:root {
    --bg: #f7f4fb;
    --bg-soft: #eee7f7;
    --surface: #ffffff;
    --surface-2: #f1eaf8;
    --surface-3: #fbf8ff;
    --text: #15121b;
    --muted: #71697a;
    --line: #e1d8ea;
    --accent: #9538d7;
    --accent-strong: #6d21b3;
    --accent-soft: rgba(149, 56, 215, 0.14);
    --accent-2: #31b74b;
    --accent-2-soft: rgba(49, 183, 75, 0.13);
    --accent-3: #21242f;
    --danger: #b4233a;
    --ok: #19794b;
    --sidebar: #0d0d14;
    --sidebar-soft: #1b1524;
    --shadow: 0 18px 45px rgba(24, 18, 32, 0.12);
    --shadow-soft: 0 10px 28px rgba(24, 18, 32, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 14% 4%, var(--accent-soft), transparent 34%),
        radial-gradient(circle at 88% 6%, var(--accent-2-soft), transparent 28%),
        linear-gradient(135deg, var(--bg-soft), var(--bg) 42%, #ffffff);
    color: var(--text);
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover {
    transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 26%, transparent);
    outline-offset: 2px;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 0 rgba(18, 26, 23, 0.03);
}

input:hover,
select:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(1.85rem, 3vw, 2.35rem);
    line-height: 1;
}

h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
    line-height: 1.15;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 15px 16px;
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

td {
    vertical-align: middle;
}

tr:hover td {
    background: var(--surface-3);
}

.hidden {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(320px, 440px);
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 32px;
    background:
        radial-gradient(circle at 18% 28%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 26%),
        radial-gradient(circle at 92% 80%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 28%),
        linear-gradient(135deg, #120f19 0%, #f8f4fb 42%, #ecfff0 100%);
}

.auth-hero,
.auth-panel {
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    width: min(420px, 100%);
    height: min(780px, calc(100vh - 64px));
    min-height: 610px;
    padding: 0;
    background: #090a10;
    color: #fff;
}

.auth-hero::before {
    content: none;
}

.auth-hero::after {
    content: none;
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.auth-hero h2 {
    max-width: 310px;
    margin: 18px 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 0.98;
}

.auth-hero p {
    max-width: 310px;
    color: rgba(255, 255, 255, 0.76);
}

.auth-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.auth-stats span {
    display: grid;
    gap: 4px;
    min-height: 78px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
}

.auth-stats strong {
    color: #fff;
    font-size: 1.15rem;
}

.auth-hero .hero-logo {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    filter: none;
}

.brand-line .brand-logo.small {
    width: 150px;
}

.sidebar-brand .brand-logo.small {
    width: 138px;
    padding: 4px;
    background: #fff;
}

.auth-panel {
    align-self: center;
    display: grid;
    align-content: center;
    width: 100%;
    min-height: 440px;
    background: rgba(255, 255, 255, 0.88);
    padding: clamp(24px, 5vw, 38px);
    backdrop-filter: blur(18px);
}

.auth-panel h1 {
    font-size: clamp(2rem, 4vw, 2.55rem);
}

.brand-line,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand {
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
}

.sidebar-brand > div {
    min-width: 0;
    max-width: 100%;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
        var(--accent);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 900;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
}

.brand-logo {
    display: block;
    width: 210px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.brand-logo.small {
    width: 112px;
    height: auto;
    box-shadow: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 274px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 36%),
        var(--sidebar);
    color: #fff;
}

.sidebar .eyebrow {
    margin-bottom: 4px;
}

.sidebar h2 {
    margin-bottom: 0;
    font-size: 1.25rem;
    overflow-wrap: anywhere;
}

.sidebar .muted {
    color: #a9bbb4;
}

.role-pill {
    display: inline-flex;
    margin: 18px 0 0;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.84rem;
    font-weight: 800;
}

.sidebar nav {
    display: grid;
    gap: 8px;
    margin-top: 22px;
}

.nav-link {
    position: relative;
    width: 100%;
    min-height: 46px;
    padding: 12px 12px 12px 40px;
    text-align: left;
    background: transparent;
    color: #dce8e3;
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0.72;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
    display: grid;
    gap: 12px;
}

.sidebar-footer p {
    margin: 0;
    color: #a9bbb4;
    font-size: 0.85rem;
    font-weight: 800;
}

.workspace {
    padding: clamp(18px, 3vw, 34px);
}

.topbar,
.split-heading,
.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar {
    margin-bottom: 24px;
}

.topbar h1 {
    font-size: clamp(1.9rem, 3vw, 2.25rem);
}

.tenant-picker {
    min-width: 280px;
}

.professional-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 230px;
    justify-content: flex-end;
}

.professional-brand div {
    display: grid;
    gap: 3px;
    text-align: right;
}

.professional-brand span {
    font-size: 0.76rem;
    font-weight: 800;
}

.professional-brand strong {
    line-height: 1.1;
}

.professional-brand img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.primary {
    min-height: 44px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}

.primary:hover {
    box-shadow: 0 16px 28px color-mix(in srgb, var(--accent) 30%, transparent);
}

.ghost {
    min-height: 42px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    background: transparent;
    color: inherit;
}

.sidebar .ghost {
    border-color: rgba(255, 255, 255, 0.22);
}

.danger {
    background: var(--danger);
    color: #fff;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.summary-grid.compact-grid {
    margin-bottom: 0;
}

.metric-card,
.panel,
.dialog-card,
.table-wrap,
.service-item {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 18px;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--metric-color, var(--accent));
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--metric-color, var(--accent)) 14%, transparent);
}

.metric-card span {
    position: relative;
    display: block;
    font-weight: 800;
}

.metric-card strong {
    position: relative;
    display: block;
    margin-top: 10px;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    line-height: 1;
}

.metric-card small {
    position: relative;
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-weight: 800;
}

.metric-card:nth-child(2) {
    --metric-color: var(--accent-3);
}

.metric-card:nth-child(3) {
    --metric-color: var(--accent-2);
}

.metric-card:nth-child(4) {
    --metric-color: var(--accent);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
    gap: 18px;
}

.panel {
    padding: clamp(18px, 3vw, 24px);
}

.panel.compact {
    margin-top: 16px;
}

.panel-title {
    margin-bottom: 18px;
}

#miniChart {
    display: block;
    width: 100%;
    height: 260px;
}

.panel-section {
    display: grid;
    gap: 18px;
}

.table-wrap {
    overflow-x: auto;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.table-toolbar h2 {
    margin-bottom: 4px;
}

.schedule-filter {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
    gap: 10px;
    align-items: end;
}

.tag,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 900;
}

.status.cancelado {
    background: #ffe8ed;
    color: var(--danger);
}

.status.concluido {
    background: #e5f5ee;
    color: var(--ok);
}

.status.agendado {
    background: #e7f1ff;
    color: var(--accent-3);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
    grid-column: span 2;
}

.form-message {
    min-height: 22px;
    margin: 0;
    color: var(--danger);
    font-weight: 800;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
    align-items: end;
}

.inline-form button {
    min-height: 44px;
    padding: 12px;
    background: var(--accent);
    color: #fff;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.portfolio-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.portfolio-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--surface-2);
}

.portfolio-card div {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.portfolio-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.moderation-list {
    display: grid;
    gap: 12px;
}

.moderation-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.moderation-card img {
    width: 88px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--surface-2);
}

.moderation-card p {
    margin-bottom: 6px;
}

.moderation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.location-tools {
    display: grid;
    grid-template-columns: auto auto minmax(220px, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-3);
}

.location-tools p {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
}

.image-tools,
.logo-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
    gap: 10px;
}

.image-tools input[type="file"],
.logo-tools input[type="file"] {
    min-height: 46px;
    padding: 9px;
}

.service-item {
    padding: 17px;
}

.service-item strong {
    display: block;
    margin-bottom: 6px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions button {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
}

.clean-list,
.pill-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.clean-list li {
    position: relative;
    padding: 13px 13px 13px 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--muted);
    font-weight: 700;
}

.clean-list li::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 17px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.pill-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.pill {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.weekday-box {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.weekday-box label,
.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weekday-box input,
.check-line input {
    width: auto;
}

dialog {
    width: min(720px, calc(100vw - 28px));
    border: 0;
    padding: 0;
    background: transparent;
}

dialog::backdrop {
    background: rgba(18, 23, 21, 0.55);
    backdrop-filter: blur(4px);
}

.dialog-card {
    padding: 22px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: 340px;
    padding: 13px 16px;
    border-radius: 8px;
    background: var(--sidebar);
    color: #fff;
    box-shadow: var(--shadow);
    z-index: 5;
}

.theme-masculino {
    --bg: #f3f5f2;
    --bg-soft: #e8eee9;
    --surface-2: #e8eee8;
    --surface-3: #f8faf7;
    --text: #111514;
    --accent: #2d7a52;
    --accent-strong: #205b3d;
    --accent-soft: rgba(45, 122, 82, 0.14);
    --accent-2: #b4233a;
    --accent-2-soft: rgba(180, 35, 58, 0.14);
    --accent-3: #364fc7;
    --sidebar: #131817;
    --sidebar-soft: #202826;
}

.theme-masculino .sidebar {
    background:
        linear-gradient(90deg, rgba(180, 35, 58, 0.28) 0 8px, transparent 8px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 36%),
        var(--sidebar);
}

.theme-feminino {
    --bg: #fbf7f9;
    --bg-soft: #f8edf2;
    --surface-2: #f5eef3;
    --surface-3: #fffbfd;
    --text: #241820;
    --accent: #c44770;
    --accent-strong: #963756;
    --accent-soft: rgba(196, 71, 112, 0.15);
    --accent-2: #188b73;
    --accent-2-soft: rgba(24, 139, 115, 0.13);
    --accent-3: #5b66d6;
    --sidebar: #241720;
    --sidebar-soft: #33222d;
}

.theme-feminino .sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 34%),
        linear-gradient(135deg, #2d1b28, var(--sidebar));
}

.theme-neutro {
    --bg: #f7f4fb;
    --bg-soft: #eee7f7;
    --surface-2: #f1eaf8;
    --surface-3: #fbf8ff;
    --text: #15121b;
    --accent: #9538d7;
    --accent-strong: #6d21b3;
    --accent-soft: rgba(149, 56, 215, 0.14);
    --accent-2: #31b74b;
    --accent-2-soft: rgba(49, 183, 75, 0.13);
    --accent-3: #21242f;
    --sidebar: #0d0d14;
    --sidebar-soft: #1b1524;
}

@media (max-width: 1080px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .auth-hero {
        height: auto;
        min-height: 0;
        aspect-ratio: 9 / 16;
    }

    .auth-panel {
        min-height: auto;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        gap: 18px;
    }

    .sidebar nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .sidebar-footer {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .workspace {
        padding: 18px;
    }

    .topbar,
    .split-heading,
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .summary-grid,
    .form-grid.wide,
    .inline-form,
    .schedule-filter,
    .location-tools,
    .image-tools,
    .logo-tools {
        grid-template-columns: 1fr;
    }

    .professional-brand {
        justify-content: space-between;
    }

    .professional-brand div {
        text-align: left;
    }

    .moderation-card {
        grid-template-columns: 1fr;
    }

    .moderation-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 2;
    }

    .span-2 {
        grid-column: span 1;
    }

    #miniChart {
        height: 230px;
    }
}

@media (max-width: 560px) {
    h1 {
        font-size: 2rem;
    }

    .auth-shell {
        padding: 12px;
    }

    .auth-hero {
        display: none;
    }

    .auth-panel,
    .panel,
    .metric-card {
        padding: 18px;
    }

    .summary-grid {
        gap: 12px;
    }

    .sidebar {
        padding: 18px;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
    }

    .sidebar-footer {
        grid-template-columns: 1fr;
    }

    .topbar {
        margin-bottom: 18px;
    }

    .actions button,
    .schedule-filter .ghost {
        width: 100%;
    }

    .auth-stats {
        grid-template-columns: 1fr;
    }
}
