/* =========================================================
   CLIENT PORTAL — PREMIUM GLASS UI
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --client-bg: #090909;
    --client-bg-soft: #151515;
    --client-panel: rgba(255, 255, 255, .075);
    --client-panel-strong: rgba(255, 255, 255, .11);
    --client-border: rgba(255, 255, 255, .14);
    --client-border-soft: rgba(255, 255, 255, .09);
    --client-text: #f4f4f4;
    --client-muted: rgba(255, 255, 255, .64);
    --client-muted-soft: rgba(255, 255, 255, .45);
    --client-gold: #d8b56d;
    --client-gold-light: #f0d79a;
    --client-success: #63d98c;
    --client-danger: #ff6b6b;
    --client-radius: 22px;
    --client-radius-sm: 14px;
    --client-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

html {
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--client-text);
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(
            circle at 12% 8%,
            rgba(216, 181, 109, .17),
            transparent 29%
        ),
        radial-gradient(
            circle at 92% 0%,
            rgba(255, 255, 255, .09),
            transparent 25%
        ),
        linear-gradient(
            135deg,
            var(--client-bg) 0%,
            var(--client-bg-soft) 48%,
            var(--client-bg) 100%
        );
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, .024) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .024) 1px,
            transparent 1px
        );
    background-size: 44px 44px;
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, .7),
        transparent 90%
    );
}

a {
    color: var(--client-text);
}

.container {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 36px 28px 70px;
}

.muted {
    color: var(--client-muted);
}

.small {
    font-size: 13px;
}

/* =========================================================
   NAVEGAÇÃO
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 0 32px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    background: rgba(8, 8, 8, .78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.topbar strong {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--client-text);
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topbar strong::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--client-gold);
    box-shadow: 0 0 22px rgba(216, 181, 109, .8);
}

.client-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.client-nav a {
    padding: 10px 13px;
    border-radius: 999px;
    color: var(--client-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.client-nav a:hover,
.client-nav a.active {
    color: var(--client-text);
    background: rgba(255, 255, 255, .09);
}

.client-nav a.active {
    color: var(--client-gold-light);
}

/* =========================================================
   TIPOGRAFIA
   ========================================================= */

h1,
h2,
h3 {
    margin-top: 0;
    letter-spacing: -.035em;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
}

h2 {
    margin-bottom: 16px;
    font-size: 24px;
}

h3 {
    margin-top: 26px;
    margin-bottom: 14px;
    font-size: 17px;
}

/* =========================================================
   CARDS BASE
   ========================================================= */

.client-report-card,
.client-report-details {
    border: 1px solid var(--client-border);
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .105),
            rgba(255, 255, 255, .035)
        );
    box-shadow:
        var(--client-shadow),
        inset 0 1px rgba(255, 255, 255, .07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.client-report-card {
    min-width: 0;
    padding: 28px;
    border-radius: var(--client-radius);
}

.client-report-hero {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 38px;
    border: 1px solid rgba(216, 181, 109, .36);
    border-radius: 28px;
    background:
        linear-gradient(
            135deg,
            rgba(216, 181, 109, .18),
            rgba(255, 255, 255, .055) 48%,
            rgba(0, 0, 0, .34)
        );
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .28),
        inset 0 1px rgba(255, 255, 255, .08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.client-report-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -150px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(216, 181, 109, .22);
    border-radius: 50%;
    pointer-events: none;
}

.client-eyebrow {
    position: relative;
    z-index: 1;
    margin: 0 0 14px;
    color: var(--client-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.client-user-name {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: var(--client-gold-light);
    font-weight: 700;
}

.client-hero-description {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0;
    color: var(--client-muted);
    line-height: 1.6;
}

.client-empty-card {
    margin-top: 22px;
}

/* =========================================================
   EMPRESA
   ========================================================= */

.client-company-selector {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin-top: 28px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--client-muted);
    font-size: 13px;
    font-weight: 700;
}

select,
input,
textarea {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--client-border);
    border-radius: var(--client-radius-sm);
    outline: none;
    color: var(--client-text);
    background: rgba(255, 255, 255, .08);
    font: inherit;
}

select {
    cursor: pointer;
}

select option {
    color: #fff;
    background: #111;
}

select:focus,
input:focus,
textarea:focus {
    border-color: rgba(216, 181, 109, .78);
    box-shadow: 0 0 0 4px rgba(216, 181, 109, .10);
}

/* =========================================================
   SELETOR DE RELATÓRIOS
   ========================================================= */

.client-report-selector {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(230px, 1fr)
    );
    gap: 14px;
    margin: 24px 0;
}

.client-report-selector-card {
    display: block;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--client-border-soft);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, .045);
    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease;
}

.client-report-selector-card:hover,
.client-report-selector-card.active {
    transform: translateY(-2px);
    border-color: rgba(216, 181, 109, .72);
    background: rgba(216, 181, 109, .13);
}

.client-report-selector-card strong {
    display: block;
    margin-bottom: 8px;
    overflow-wrap: break-word;
}

.client-report-selector-card span {
    color: var(--client-muted);
    font-size: 13px;
}

/* =========================================================
   LAYOUT PRINCIPAL DO RELATÓRIO
   ========================================================= */

.client-report-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(520px, 1fr);
    gap: 24px;
    width: 100%;
    min-width: 0;
    align-items: start;
}

.client-report-content,
.client-report-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    width: 100%;
}

.report-intro-card {
    min-height: 190px;
}

.client-report-period {
    margin: 0;
    color: var(--client-muted);
    font-size: 14px;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.metrics-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    min-width: 0;
    margin-bottom: 24px;
}

.report-kpi {
    min-width: 0;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(216, 181, 109, .34);
    border-radius: 18px;
    background: rgba(216, 181, 109, .09);
}

.report-kpi strong {
    display: block;
    min-width: 0;
    margin-bottom: 4px;
    overflow-wrap: normal;
    word-break: normal;
    color: var(--client-gold-light);
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.1;
}

.report-kpi-unit {
    display: block;
    margin-bottom: 10px;
    color: var(--client-gold-light);
    font-size: 13px;
    font-weight: 700;
}

.report-kpi small {
    display: block;
    min-width: 0;
    color: var(--client-muted);
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.report-metric-chart {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.report-metric-row {
    display: grid;
    grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
    gap: 9px 14px;
    min-width: 0;
    align-items: center;
}

.report-metric-heading {
    min-width: 0;
    color: var(--client-text);
    font-weight: 700;
    overflow-wrap: break-word;
}

.report-metric-track {
    width: 100%;
    height: 13px;
    min-width: 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .11);
}

.report-metric-bar {
    height: 100%;
    min-width: 8px;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        #a8782d,
        #f0c873
    );
    box-shadow: 0 0 18px rgba(216, 181, 109, .35);
}

.report-metric-value {
    grid-column: 2;
    min-width: 0;
    margin-top: -3px;
    color: var(--client-muted);
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: break-word;
}

/* =========================================================
   BLOCOS EXPANSÍVEIS
   ========================================================= */

.client-report-details {
    overflow: hidden;
    border-radius: 18px;
}

.client-report-details summary {
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
}

.client-report-details summary::-webkit-details-marker {
    display: none;
}

.client-report-details summary::after {
    content: "+";
    float: right;
    color: var(--client-gold);
    font-size: 20px;
    line-height: 1;
}

.client-report-details[open] summary::after {
    content: "−";
}

.client-details-content {
    padding: 0 20px 22px;
    color: rgba(255, 255, 255, .82);
    line-height: 1.7;
    overflow-wrap: break-word;
}

/* =========================================================
   LISTAS E TABELAS
   ========================================================= */

.client-report-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.client-report-list li {
    padding: 13px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.client-report-list li:last-child {
    border-bottom: 0;
}

.client-report-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.client-report-table-wrap table {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.client-report-table-wrap th,
.client-report-table-wrap td {
    padding: 12px;
    text-align: left;
}

.client-report-table-wrap th {
    color: var(--client-muted-soft);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.client-report-table-wrap tbody tr {
    background: rgba(255, 255, 255, .06);
}

.client-report-table-wrap tbody td {
    color: var(--client-muted);
}

.client-report-table-wrap tbody td:first-child {
    border-radius: 12px 0 0 12px;
}

.client-report-table-wrap tbody td:last-child {
    border-radius: 0 12px 12px 0;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 1120px) {
    .client-report-layout {
        grid-template-columns: minmax(0, 1fr) minmax(430px, .85fr);
    }
}

@media (max-width: 920px) {
    .client-report-layout {
        grid-template-columns: 1fr;
    }

    .client-report-sidebar {
        order: -1;
    }

    .report-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding: 18px;
    }

    .client-nav {
        justify-content: flex-start;
    }

    .container {
        padding: 22px 16px 50px;
    }

    .client-report-hero,
    .client-report-card {
        padding: 22px;
        border-radius: 20px;
    }

    .client-report-selector {
        grid-template-columns: 1fr;
    }

    .report-kpi-grid {
        grid-template-columns: 1fr;
    }

    .report-metric-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .report-metric-value {
        grid-column: 1;
        margin-top: 0;
    }
}


/* =========================================================
   CLIENT PORTAL — DASHBOARD PREMIUM
   ========================================================= */

.client-dashboard-page {
    max-width: 1180px;
}

/* Hero principal */

.client-dashboard-page .page-head {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 250px;
    margin-bottom: 18px;
    padding: 38px 42px;
    overflow: hidden;
    border: 1px solid rgba(216, 181, 109, .34);
    border-radius: 28px;
    background:
        linear-gradient(
            135deg,
            rgba(216, 181, 109, .18),
            rgba(255, 255, 255, .055) 48%,
            rgba(0, 0, 0, .30)
        );
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .30),
        inset 0 1px rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.client-dashboard-page .page-head::before {
    content: "";
    position: absolute;
    top: -150px;
    right: -80px;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(216, 181, 109, .24);
    border-radius: 50%;
    pointer-events: none;
}

.client-dashboard-page .page-head::after {
    content: "";
    position: absolute;
    right: 90px;
    bottom: -170px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 50%;
    pointer-events: none;
}

.client-dashboard-page .page-head > div {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.client-dashboard-page .page-head h1 {
    margin: 0 0 14px;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: .95;
    letter-spacing: -.06em;
}

.client-dashboard-page .page-head .muted {
    max-width: 660px;
    margin: 0;
    color: var(--client-muted);
    font-size: 16px;
    line-height: 1.6;
}

/* Seletor da empresa */

.client-dashboard-company-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
    gap: 28px;
    align-items: center;
    min-height: 130px;
    margin-bottom: 18px;
    border-color: rgba(216, 181, 109, .28);
    background:
        linear-gradient(
            110deg,
            rgba(216, 181, 109, .12),
            rgba(255, 255, 255, .055)
        );
}

.client-dashboard-company-picker h2 {
    margin: 0;
    color: var(--client-gold-light);
    font-size: 24px;
}

.client-dashboard-company-picker form {
    min-width: 0;
}

.client-dashboard-company-picker label {
    margin-bottom: 8px;
}

.client-dashboard-company-picker select {
    margin: 0;
}

/* Empresa selecionada */

.client-dashboard-company-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    min-height: 112px;
    margin-bottom: 24px;
    padding: 24px 28px;
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .055);
}

.client-dashboard-company-summary h2 {
    margin: 0;
    color: var(--client-text);
    font-size: 28px;
}

.client-dashboard-company-summary .client-eyebrow {
    margin-bottom: 7px;
}

.client-company-role {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    text-align: right;
}

.client-company-role span {
    color: var(--client-muted);
    font-size: 13px;
}

.client-company-role strong {
    display: inline-flex;
    padding: 8px 13px;
    border: 1px solid rgba(216, 181, 109, .30);
    border-radius: 999px;
    color: var(--client-gold-light);
    background: rgba(216, 181, 109, .12);
    font-size: 13px;
}

/* Área principal */

.client-dashboard-overview {
    padding: 30px;
}

.client-dashboard-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 22px;
}

.client-dashboard-section-heading h2 {
    margin: 0;
    font-size: 30px;
}

.client-dashboard-section-heading .client-eyebrow {
    margin-bottom: 8px;
}

/* Cards principais */

.client-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.client-dashboard-module {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 310px;
    flex-direction: column;
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .105),
            rgba(255, 255, 255, .035)
        );
    box-shadow:
        0 18px 42px rgba(0, 0, 0, .22),
        inset 0 1px rgba(255, 255, 255, .06);
    transition:
        transform .2s ease,
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.client-dashboard-module::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(216, 181, 109, .18);
    border-radius: 50%;
    pointer-events: none;
}

.client-dashboard-module:hover {
    transform: translateY(-5px);
    border-color: rgba(216, 181, 109, .50);
    background:
        linear-gradient(
            145deg,
            rgba(216, 181, 109, .15),
            rgba(255, 255, 255, .055)
        );
    box-shadow:
        0 24px 52px rgba(0, 0, 0, .30),
        0 0 0 1px rgba(216, 181, 109, .08);
}

.client-module-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 28px;
    border: 1px solid rgba(216, 181, 109, .42);
    border-radius: 50%;
    color: var(--client-gold-light);
    background: rgba(216, 181, 109, .12);
    font-size: 15px;
    font-weight: 900;
}

.client-dashboard-module h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    color: var(--client-text);
    font-size: 24px;
    letter-spacing: -.04em;
}

.client-dashboard-module > .muted {
    position: relative;
    z-index: 1;
    min-height: 74px;
    margin: 0 0 22px;
    color: var(--client-muted);
    line-height: 1.55;
}

.client-module-count {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-top: auto;
    margin-bottom: 20px;
}

.client-module-count strong {
    color: var(--client-gold-light);
    font-size: 38px;
    line-height: 1;
}

.client-module-count span {
    color: var(--client-muted);
    font-size: 13px;
}

.client-dashboard-module .button {
    position: relative;
    z-index: 2;
    align-self: flex-start;
}

/* Cartão da conta */

.client-account-module {
    grid-column: 1 / -1;
    min-height: 130px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    border-color: rgba(99, 217, 140, .24);
}

.client-account-module .client-module-icon {
    margin: 0;
    border-color: rgba(99, 217, 140, .38);
    color: var(--client-success);
    background: rgba(99, 217, 140, .12);
}

.client-account-module h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.client-account-module p {
    margin: 0;
}

.client-account-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 9px 14px;
    border: 1px solid rgba(99, 217, 140, .28);
    border-radius: 999px;
    color: var(--client-success);
    background: rgba(99, 217, 140, .12);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.client-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--client-success);
    box-shadow: 0 0 12px rgba(99, 217, 140, .75);
}

/* Estado sem empresas */

.client-dashboard-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsivo */

@media (max-width: 1050px) {
    .client-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-account-module {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .client-dashboard-page .page-head {
        min-height: 220px;
        padding: 30px;
    }

    .client-dashboard-company-picker {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .client-dashboard-company-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-company-role {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .client-dashboard-page .page-head {
        min-height: auto;
        padding: 26px 22px;
    }

    .client-dashboard-page .page-head h1 {
        font-size: 2.7rem;
    }

    .client-dashboard-company-picker,
    .client-dashboard-company-summary,
    .client-dashboard-overview {
        padding: 22px;
    }

    .client-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .client-account-module {
        grid-column: auto;
        min-height: 180px;
        align-items: flex-start;
        flex-direction: column;
    }

    .client-account-module .client-module-icon {
        margin-bottom: 18px;
    }

    .client-account-status {
        margin-left: 0;
    }

    .client-dashboard-module {
        min-height: 270px;
    }
}


/* =========================================================
   CLIENT PORTAL — DOCUMENTS
   ========================================================= */

.client-documents-page {
    max-width: 1180px;
}

.client-documents-page .page-head {
    margin-bottom: 24px;
}

.client-documents-page .page-head h1 {
    max-width: 760px;
    margin-bottom: 12px;
    font-size: clamp(2.3rem, 5vw, 4.6rem);
    line-height: .96;
    letter-spacing: -.06em;
}

.client-documents-page .page-head .muted {
    max-width: 700px;
    font-size: 16px;
    line-height: 1.6;
}

/* Seletor da empresa */

.client-documents-page > .card:first-of-type {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    border-color: rgba(216, 181, 109, .32);
    background:
        linear-gradient(
            135deg,
            rgba(216, 181, 109, .15),
            rgba(255, 255, 255, .055) 52%,
            rgba(0, 0, 0, .28)
        );
}

.client-documents-page > .card:first-of-type::after {
    content: "";
    position: absolute;
    right: -100px;
    bottom: -130px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(216, 181, 109, .22);
    border-radius: 50%;
    pointer-events: none;
}

.client-documents-page > .card:first-of-type h2,
.client-documents-page > .card:first-of-type form {
    position: relative;
    z-index: 1;
}

.client-documents-page > .card:first-of-type h2 {
    margin-bottom: 18px;
    color: var(--client-gold-light);
}

.client-documents-page > .card:first-of-type select {
    max-width: 460px;
    margin-bottom: 0;
}

/* Área dos documentos */

.client-documents-page > .card:nth-of-type(2) {
    padding: 30px;
}

.client-documents-page > .card:nth-of-type(2) h2 {
    margin-bottom: 24px;
    color: var(--client-text);
}

/* Tabela */

.client-documents-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.client-documents-table-wrap table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.client-documents-table-wrap th {
    padding: 10px 14px;
    color: var(--client-muted-soft);
    font-size: 11px;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.client-documents-table-wrap td {
    padding: 17px 14px;
    color: var(--client-muted);
    vertical-align: middle;
}

.client-documents-table-wrap tbody tr {
    background:
        linear-gradient(
            105deg,
            rgba(255, 255, 255, .075),
            rgba(255, 255, 255, .035)
        );
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.client-documents-table-wrap tbody tr:hover {
    transform: translateY(-2px);
    background:
        linear-gradient(
            105deg,
            rgba(216, 181, 109, .14),
            rgba(255, 255, 255, .055)
        );
}

.client-documents-table-wrap tbody td:first-child {
    border-radius: 15px 0 0 15px;
}

.client-documents-table-wrap tbody td:last-child {
    border-radius: 0 15px 15px 0;
}

/* Data */

.client-documents-table-wrap tbody td:first-child {
    color: var(--client-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* Origem e tipo */

.client-documents-table-wrap tbody td:nth-child(2),
.client-documents-table-wrap tbody td:nth-child(3) {
    color: var(--client-gold-light);
    font-size: 12px;
    font-weight: 700;
}

/* Título */

.client-documents-table-wrap tbody td:nth-child(4) {
    min-width: 220px;
    color: var(--client-text);
}

.client-documents-table-wrap tbody td:nth-child(4) strong {
    display: block;
    margin-bottom: 5px;
    color: var(--client-text);
    font-size: 15px;
}

.client-documents-table-wrap tbody td:nth-child(4) .small {
    display: block;
    max-width: 320px;
    line-height: 1.45;
}

/* Valor */

.client-documents-table-wrap tbody td:nth-child(5) {
    color: var(--client-gold-light);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

/* Botão de download */

.client-documents-table-wrap tbody td:last-child {
    text-align: right;
    white-space: nowrap;
}

.client-documents-table-wrap .button {
    min-height: 36px;
    padding: 9px 14px;
    font-size: 12px;
}

/* Estado vazio */

.client-documents-page .muted {
    line-height: 1.6;
}

/* Responsivo */

@media (max-width: 700px) {
    .client-documents-page .page-head h1 {
        font-size: 2.7rem;
    }

    .client-documents-page > .card:nth-of-type(2) {
        padding: 22px;
    }

    .client-documents-table-wrap table {
        min-width: 700px;
    }
}


/* =========================================================
   CLIENT PORTAL — LOGIN
   ========================================================= */

.client-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
}

.client-login-card {
    width: min(100%, 460px);
    padding: 34px;
}

.client-login-logo {
    margin-bottom: 28px;
    text-align: center;
}

.client-login-logo img {
    display: inline-block;
    width: 230px;
    max-width: 100%;
    height: auto;
}

.client-login-card h1 {
    margin-bottom: 10px;
    text-align: center;
}

.client-login-card > .muted {
    margin-bottom: 26px;
    text-align: center;
}

.client-login-card .danger {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 107, 107, .30);
    border-radius: 12px;
    background: rgba(255, 107, 107, .10);
}

.client-login-card form button {
    width: 100%;
    margin-top: 4px;
}

.client-forgot-link {
    display: block;
    margin-top: 20px;
    color: var(--client-gold-light);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.client-forgot-link:hover {
    color: var(--client-text);
    text-decoration: underline;
}

@media (max-width: 520px) {
    .client-login-card {
        padding: 24px 20px;
    }
}


/* =========================================================
   CLIENT PORTAL — BOTÕES COBRE
   ========================================================= */

.client-login-card form button,
.client-login-card button[type="submit"],
.client-dashboard-page .button,
.client-dashboard-page button,
.client-documents-page .button,
.client-reports-page .button,
.client-reports-page button,
.client-auth-card button {
    appearance: none !important;
    -webkit-appearance: none !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    min-height: 42px !important;
    width: auto !important;
    padding: 12px 20px !important;

    border: 1px solid rgba(255, 220, 145, .55) !important;
    border-radius: 999px !important;

    color: #17120b !important;
    background:
        linear-gradient(
            135deg,
            #f4d995 0%,
            #e4bd6e 48%,
            #bd8435 100%
        ) !important;

    box-shadow:
        0 10px 24px rgba(216, 181, 109, .20),
        inset 0 1px rgba(255, 255, 255, .42) !important;

    font: inherit !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        filter .18s ease !important;
}

.client-login-card form button {
    width: 100% !important;
    margin-top: 5px !important;
}

.client-login-card form button:hover,
.client-dashboard-page .button:hover,
.client-dashboard-page button:hover,
.client-documents-page .button:hover,
.client-reports-page .button:hover,
.client-reports-page button:hover,
.client-auth-card button:hover {
    color: #17120b !important;
    background:
        linear-gradient(
            135deg,
            #ffe7a8 0%,
            #efc97c 48%,
            #ca9340 100%
        ) !important;

    box-shadow:
        0 14px 32px rgba(216, 181, 109, .34),
        inset 0 1px rgba(255, 255, 255, .52) !important;

    transform: translateY(-2px) !important;
    filter: brightness(1.04) !important;
}

.client-login-card form button:focus-visible,
.client-dashboard-page .button:focus-visible,
.client-dashboard-page button:focus-visible,
.client-documents-page .button:focus-visible,
.client-reports-page .button:focus-visible,
.client-reports-page button:focus-visible {
    outline: none !important;
    box-shadow:
        0 0 0 4px rgba(216, 181, 109, .18),
        0 12px 30px rgba(216, 181, 109, .25) !important;
}

/* Botões de download e navegação interna */

.client-documents-page .button.secondary,
.client-dashboard-page .button.secondary,
.client-reports-page .button.secondary {
    color: #17120b !important;
    background:
        linear-gradient(
            135deg,
            #f4d995 0%,
            #e4bd6e 48%,
            #bd8435 100%
        ) !important;
    border-color: rgba(255, 220, 145, .55) !important;
    box-shadow:
        0 10px 24px rgba(216, 181, 109, .20),
        inset 0 1px rgba(255, 255, 255, .42) !important;
}

/* Link recuperar acesso continua discreto */

.client-forgot-link {
    color: var(--client-gold-light) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}



.client-reports-page {
    width: min(84vw, 1500px);
    max-width: 1500px;
    margin: 0 auto;
}

.client-reports-browser {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.client-reports-list-panel,
.client-report-selected {
    min-width: 0;
}

.client-reports-list-panel {
    position: sticky;
    top: 98px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.10),
            rgba(255,255,255,.035)
        );
    box-shadow:
        0 20px 50px rgba(0,0,0,.25),
        inset 0 1px rgba(255,255,255,.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.client-reports-list-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.client-reports-list-header h2 {
    margin: 0;
    font-size: 21px;
}

.client-report-count,
.metrics-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(216,181,109,.38);
    border-radius: 50%;
    color: #f0d79a;
    background: rgba(216,181,109,.12);
    font-size: 13px;
    font-weight: 800;
}

.client-reports-list-panel input[type="search"] {
    margin-bottom: 16px;
}

#client-reports-list {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.client-report-list-item {
    display: block;
    padding: 15px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 16px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255,255,255,.045);
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.client-report-list-item:hover,
.client-report-list-item.active {
    transform: translateY(-2px);
    border-color: rgba(216,181,109,.72);
    background: rgba(216,181,109,.14);
}

.client-report-list-item strong {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
}

.client-report-list-item span {
    color: var(--text-soft);
    font-size: 12px;
}

.metrics-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.metrics-card-heading h2 {
    margin-bottom: 0;
}

.report-primary-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-kpi {
    min-width: 0;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(216,181,109,.32);
    border-radius: 18px;
    background: rgba(216,181,109,.09);
}

.report-kpi-primary {
    min-height: 145px;
    border-color: rgba(216,181,109,.55);
    background:
        linear-gradient(
            145deg,
            rgba(216,181,109,.20),
            rgba(216,181,109,.07)
        );
    box-shadow: inset 0 1px rgba(255,255,255,.08);
}

.report-kpi-secondary {
    min-height: 130px;
    background: rgba(216,181,109,.07);
}

.report-kpi strong {
    display: block;
    overflow-wrap: anywhere;
    color: #f0c873;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.05;
}

.report-kpi-unit {
    display: block;
    margin-top: 5px;
    color: #f0d79a;
    font-size: .78rem;
    font-weight: 800;
}

.report-kpi small {
    display: block;
    margin-top: 14px;
    color: var(--text-soft);
    font-size: .78rem;
    line-height: 1.3;
}

.report-kpi em {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: .72rem;
    font-style: normal;
}

.metrics-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px;
    color: var(--text-muted);
}

.metrics-divider span {
    height: 1px;
    flex: 1;
    background: rgba(255,255,255,.13);
}

.metrics-divider small {
    color: #d8b56d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.extra-metrics-details {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.04);
}

.extra-metrics-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
}

.extra-metrics-details summary::-webkit-details-marker {
    display: none;
}

.extra-metrics-details summary b {
    color: #d8b56d;
    font-size: 21px;
    font-weight: 400;
}

.extra-metrics-details[open] summary b {
    font-size: 0;
}

.extra-metrics-details[open] summary b::after {
    content: "−";
    font-size: 21px;
}

.extra-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 14px 14px;
}

@media (max-width: 1100px) {
    .client-reports-page {
        width: min(92vw, 1000px);
    }

    .client-reports-browser {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .report-primary-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 850px) {
    .client-reports-browser {
        grid-template-columns: 1fr;
    }

    .client-reports-list-panel {
        position: static;
    }

    #client-reports-list {
        max-height: 340px;
    }
}

@media (max-width: 600px) {
    .client-reports-page {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .extra-metrics-grid {
        grid-template-columns: 1fr;
    }

    .report-kpi-primary,
    .report-kpi-secondary {
        min-height: auto;
    }
}




.client-documents-page {
    width: min(84vw, 1500px);
    max-width: 1500px;
    margin: 0 auto;
}

.client-documents-hero {
    margin-bottom: 28px;
}

.client-documents-hero h1 {
    max-width: 760px;
    margin-bottom: 12px;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: .98;
}

.client-documents-toolbar,
.client-document-filters,
.client-documents-card {
    padding: 24px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.10),
            rgba(255,255,255,.035)
        );
    box-shadow:
        0 20px 55px rgba(0,0,0,.22),
        inset 0 1px rgba(255,255,255,.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.client-documents-toolbar {
    margin-bottom: 18px;
}

.client-documents-toolbar form {
    max-width: 520px;
}

.client-documents-toolbar select {
    margin-bottom: 0;
}

.client-document-filters {
    margin-bottom: 18px;
}

.client-document-filters-head,
.client-documents-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.client-document-filters-head h2,
.client-documents-heading h2 {
    margin: 0;
}

.documents-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 16px;
}

.documents-filter-grid input,
.documents-filter-grid select {
    margin-bottom: 15px;
}

.documents-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.documents-result-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(216,181,109,.30);
    border-radius: 999px;
    color: #f0d79a;
    background: rgba(216,181,109,.10);
    font-size: 12px;
    font-weight: 800;
}

.client-documents-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.client-documents-table-wrap table {
    min-width: 900px;
}

.client-documents-table-wrap td {
    vertical-align: middle;
}

.client-documents-table-wrap td strong {
    display: block;
    color: var(--text);
}

.client-documents-table-wrap td .small {
    display: block;
    margin-top: 5px;
    line-height: 1.4;
}

.client-documents-table-wrap .button {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .client-documents-page {
        width: min(92vw, 900px);
    }

    .documents-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .client-documents-page {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .client-documents-toolbar,
    .client-document-filters,
    .client-documents-card {
        padding: 18px;
        border-radius: 18px;
    }

    .documents-filter-grid {
        grid-template-columns: 1fr;
    }

    .client-document-filters-head,
    .client-documents-heading {
        flex-direction: column;
    }
}


.client-document-filters .documents-filter-actions button[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 12px 20px !important;
    border: 0 !important;
    border-radius: 999px !important;
    color: #17120b !important;
    background:
        linear-gradient(
            135deg,
            #f1d28a 0%,
            #dfb765 48%,
            #b77d2e 100%
        ) !important;
    box-shadow:
        0 12px 28px rgba(216,181,109,.22) !important;
    font: inherit !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        filter .18s ease !important;
}

.client-document-filters .documents-filter-actions button[type="submit"]:hover {
    transform: translateY(-1px) !important;
    box-shadow:
        0 16px 34px rgba(216,181,109,.30) !important;
    filter: brightness(1.05) !important;
}

.client-document-filters .documents-filter-actions button[type="submit"]:focus {
    outline: none !important;
    box-shadow:
        0 0 0 4px rgba(216,181,109,.16),
        0 12px 28px rgba(216,181,109,.22) !important;
}