/* Portal do Contador: mesmo padrão visual do Gestor Mix (cores, letra, menu lateral, topo e telas de acesso). */

:root {
    --bg: #f4f7f8;
    --panel: #ffffff;
    --line: #d7e2e6;
    --text: #002536;
    --muted: #60737b;
    --primary: #002536;
    --primary-dark: #001a26;
    --primary-soft: #e7eef1;
    --success: #059669;
    --danger: #dc2626;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --ok-soft: #d1fae5;
    --bad-soft: #fee2e2;
    --accent: #0f7c86;
    --label: #344054;
    --input-bg: #ffffff;
    --th-bg: #f6fafb;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Inter (SIL OFL, assets/fonts/Inter-LICENSE.txt), servida pelo próprio portal. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations'), url('fonts/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations'), url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
h1, h2, p { margin: 0; }

.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Botões ---------- */
.primary-button, .ghost-button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}
.primary-button, .button.primary { padding: 13px 18px; background: var(--primary); color: #fff; }
.primary-button:hover, .button.primary:hover { background: var(--primary-dark); }
.primary-button.compact { padding: 11px 18px; }
.ghost-button, .button.secondary { padding: 10px 14px; background: var(--primary-soft); color: var(--primary-dark); }
.button { min-height: 44px; padding: 11px 18px; }
.button.small { min-height: 34px; padding: 7px 12px; font-size: 13px; }

/* ---------- Estrutura: menu lateral + topo ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { display: flex; flex-direction: column; background: var(--primary); color: #fff; padding: 24px; }
.sidebar-brand { display: grid; gap: 14px; margin-bottom: 44px; }
.brand-logo { width: 188px; max-width: 100%; height: auto; }
.sidebar-brand span { color: rgba(255, 255, 255, .68); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sidebar-nav { display: grid; gap: 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; color: rgba(255, 255, 255, .78); font-weight: 700; }
.sidebar-nav a svg { flex: none; }
.sidebar-nav a.active, .sidebar-nav a:hover { background: #fff; color: var(--primary); }
.sidebar-logout { margin-top: auto; display: none; align-items: center; justify-content: space-between; gap: 12px; padding-top: 24px; color: rgba(255, 255, 255, .8); font-weight: 700; }
.sidebar-backdrop { display: none; }
.bottom-nav { display: none; }

.main-shell { min-width: 0; }
.topbar {
    height: 82px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 32px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; margin-right: auto; }
.topbar h1 { margin: 0; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-link {
    display: inline-flex; align-items: center; gap: 10px; flex: none;
    padding: 6px 6px 6px 8px; border-radius: 999px;
    background: linear-gradient(120deg, #e0580b 0%, #c2410c 60%, #a8350a 100%);
    color: #fff; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(194, 65, 12, .32);
    transition: transform .15s ease, box-shadow .15s ease;
}
.cert-link:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(194, 65, 12, .42); }
.cert-link:focus-visible { outline: 3px solid color-mix(in srgb, #ea580c 45%, transparent); outline-offset: 2px; }
.cert-icon { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.cert-icon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); animation: cert-pulso 2.4s ease-out infinite; }
@keyframes cert-pulso { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
.cert-text { display: grid; gap: 1px; line-height: 1.2; }
.cert-text strong { font-size: 13px; font-weight: 800; }
.cert-long { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .9); }
.cert-price { display: grid; justify-items: center; padding: 5px 14px; border-radius: 999px; background: #fff; color: #b93d0a; line-height: 1.1; }
.cert-price small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9a3412; }
.cert-price b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cert-go { padding: 8px 14px; border-radius: 999px; background: #fff; color: #b93d0a; font-size: 13px; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .cert-icon::after { animation: none; } .cert-link { transition: none; } }
.sidebar-certificado { display: none !important; }
.user-menu { display: flex; align-items: center; gap: 16px; color: var(--primary); font-weight: 700; }
.content { padding: 28px 32px 48px; }
.content > section { min-width: 0; }

/* ---------- Painéis, filtros e indicadores ---------- */
.panel, .metrics article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 37, 54, .06);
}
.panel { padding: 20px; margin-bottom: 18px; min-width: 0; overflow: hidden; }
.panel:has(.combo-box) { overflow: visible; position: relative; z-index: 5; }
.panel h2 { margin: 0; font-size: 18px; }

.alert {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--danger);
    background: var(--bad-soft);
    border: 1px solid #fecaca;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) repeat(2, minmax(140px, 1fr)) minmax(220px, 2fr) auto;
    gap: 12px;
    align-items: end;
}
label { display: grid; gap: 8px; color: var(--label); font-size: 13px; font-weight: 700; }
input, select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    background: var(--input-bg);
}
/* Campo pesquisável (cliente) */
.combo-box { position: relative; min-width: 0; }
.combo-box input { padding-right: 34px; text-overflow: ellipsis; font-weight: 600;
    background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2360737b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
.combo-list {
    position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
    width: 100%;
    max-height: 300px; overflow-y: auto;
    margin: 0; padding: 4px; list-style: none;
    background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 37, 54, .14);
}
@media (min-width: 1100px) { .combo-list { width: max(100%, 520px); } }
.combo-list li { overflow-wrap: anywhere; padding: 9px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.combo-list li.current { font-weight: 700; }
.combo-list li[aria-selected="true"] { background: var(--primary-soft); }
.combo-list .combo-empty { color: var(--muted); cursor: default; }

input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metrics article { padding: 20px; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.metrics span { color: var(--muted); font-weight: 700; font-size: 13px; }
.metrics strong { font-size: clamp(21px, 2vw, 28px); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-title > span, .section-actions > span:not(.badge) { color: var(--muted); font-size: 13px; font-weight: 500; }
.section-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
th { color: var(--primary); background: var(--th-bg); font-weight: 700; }
td { font-variant-numeric: tabular-nums; }
.total-row td { font-weight: 700; background: var(--th-bg); border-top: 2px solid var(--line); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; max-width: 340px; word-break: break-all; }
.empty { color: var(--muted); text-align: center; padding: 22px; }
.link { color: var(--accent); font-weight: 700; }
.link:hover { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { color: var(--success); background: var(--ok-soft); }
.badge.danger { color: var(--danger); background: var(--bad-soft); }
.badge.neutral { color: var(--muted); background: var(--primary-soft); }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding-top: 14px; }
.pagination a {
    min-width: 36px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    color: var(--primary);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}
.pagination a.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.pagination a.disabled { pointer-events: none; color: var(--muted); opacity: .6; }
.pagination-gap { min-height: 34px; display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }

/* ---------- Sequência e avisos ---------- */
.sequence-note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.sequence-help { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line));
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    background: var(--warn-soft);
}
.notice strong { display: block; margin-bottom: 2px; }
.notice span { color: var(--muted); font-size: 13px; }
.notice.quiet { padding: 10px 16px; border-color: var(--line); border-left-color: var(--success); background: var(--panel); }

/* ---------- Carregando ---------- */
.loading-overlay { position: fixed; inset: 0; z-index: 9999; display: none; place-items: center; background: rgba(0, 20, 30, .45); }
.loading-overlay.show { display: grid; }
.loading-box {
    display: grid;
    justify-items: center;
    gap: 12px;
    min-width: 230px;
    padding: 24px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 37, 54, .22);
}
.spinner { width: 34px; height: 34px; border: 4px solid var(--primary-soft); border-top-color: var(--accent); border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { max-width: calc(100vw - 32px); text-align: center; }
.loading-detail { color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.loading-detail[hidden], .loading-bar[hidden], .loading-close[hidden], .toast[hidden] { display: none; }
.loading-bar { width: 240px; max-width: 100%; height: 8px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .4s ease; }
.loading-close { margin-top: 4px; }

.toast {
    position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 10000;
    transform: translateX(-50%); max-width: calc(100vw - 32px);
    padding: 12px 18px; border-radius: 10px;
    background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 37, 54, .25);
}
@media (max-width: 760px) { .toast { bottom: calc(88px + var(--safe-bottom)); } }
@media (prefers-color-scheme: dark) { .toast { background: var(--accent); color: #062228; } }

/* ---------- Telas menores ---------- */
@media (max-width: 1399px) {
    .cert-text { display: none; }
    .cert-link { gap: 8px; }
}
@media (max-width: 1100px) {
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-logout { display: flex; }
    .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 20, 30, .45); z-index: 25; }

    .topbar { height: auto; min-height: 64px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top, 0px)); gap: 10px; position: sticky; top: 0; z-index: 5; }
    .topbar h1 { font-size: 20px; }
    .topbar-action { padding: 10px 12px; }
    .topbar-action span { display: none; }
    .user-menu { display: none; }
    .cert-link { padding: 4px 4px 4px 5px; gap: 6px; box-shadow: 0 4px 12px rgba(194, 65, 12, .3); }
    .cert-icon { width: 28px; height: 28px; }
    .cert-icon svg { width: 15px; height: 15px; }
    .cert-price { padding: 3px 10px; }
    .cert-price small { font-size: 9px; }
    .cert-price b { font-size: 13px; }
    .sidebar-nav a.sidebar-certificado {
        display: flex !important; margin-top: 8px;
        background: linear-gradient(120deg, #e0580b, #b93d0a); color: #fff;
    }
    .sidebar-certificado span { display: grid; gap: 2px; }
    .sidebar-certificado small { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .9); }
    .content { padding: 18px 16px calc(88px + var(--safe-bottom)); }
    .panel { padding: 16px; }
    .filters, .metrics { grid-template-columns: 1fr; }
    .section-title { align-items: flex-start; flex-direction: column; }

    .bottom-nav {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
        background: var(--panel); border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + var(--safe-bottom));
        box-shadow: 0 -6px 20px rgba(0, 37, 54, .06);
    }
    .bottom-nav a, .bottom-nav button {
        display: grid; justify-items: center; gap: 2px; padding: 6px 0;
        background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer;
    }
    .bottom-nav svg { width: 22px; height: 22px; }
    .bottom-nav .active { color: var(--accent); }
    .bottom-nav a:focus-visible, .bottom-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
}

/* ---------- Tela de acesso ---------- */
.auth-body { min-height: 100vh; min-height: 100dvh; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }

.auth-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
    padding: 48px clamp(32px, 5vw, 72px);
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(76, 194, 204, .18), transparent 60%),
        radial-gradient(90% 70% at 0% 100%, rgba(15, 124, 134, .22), transparent 60%),
        #002536;
    color: #e6f1f4;
}
.auth-logo { width: 168px; height: auto; }
.auth-pitch { max-width: 30rem; }
.auth-kicker { margin: 0 0 14px; color: #4cc2cc; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-headline { margin: 0 0 14px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; font-weight: 700; text-wrap: balance; color: #fff; }
.auth-sub { margin: 0; font-size: 17px; line-height: 1.55; color: rgba(230, 241, 244, .78); max-width: 26rem; }
.auth-illustration { width: min(100%, 420px); height: auto; color: #fff; }

.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-title { margin: 0 0 6px; font-size: 30px; line-height: 1.15; font-weight: 700; }
.auth-lead { margin: 0 0 28px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.auth-footer { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; }

.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 8px; }
.auth-field label { color: var(--text); font-size: 14px; }
.auth-field input {
    height: 50px; padding: 0 14px; font-size: 16px;
    border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel);
    transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.auth-password { position: relative; }
.auth-password input { padding-right: 52px; }
.auth-eye {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 40px; height: 40px; display: grid; place-items: center;
    border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.auth-eye span { display: grid; }
.auth-eye svg { width: 20px; height: 20px; }
.auth-eye .icon-hide, .auth-eye.showing .icon-show { display: none; }
.auth-eye.showing .icon-hide { display: grid; }
.auth-eye[aria-pressed="true"] { color: var(--accent); }
.auth-eye:focus-visible { outline: 2px solid var(--accent); }

.auth-submit {
    height: 52px; margin-top: 6px; border: 0; border-radius: 10px; cursor: pointer;
    background: #002536; color: #fff; font-size: 16px; font-weight: 700;
    transition: background .15s, transform .05s;
}
.auth-submit:hover { background: #0b3748; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.auth-submit[disabled] { opacity: .7; cursor: progress; }

.auth-alert { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1.45; border: 1px solid transparent; }
.auth-alert.erro { background: var(--bad-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-brand { padding: max(28px, env(safe-area-inset-top, 0px)) 24px 64px; gap: 18px; }
    .auth-logo { width: 132px; }
    .auth-headline { font-size: 26px; margin-bottom: 8px; }
    .auth-sub { font-size: 15px; }
    .auth-kicker, .auth-illustration { display: none; }
    .auth-panel {
        justify-content: flex-start; gap: 20px; margin-top: -32px;
        padding: 32px 20px max(24px, env(safe-area-inset-bottom, 0px));
        background: var(--bg); border-radius: 24px 24px 0 0; position: relative;
    }
}

/* ---------- Modo escuro (segue o tema do aparelho) ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0b1418;
        --panel: #111e24;
        --line: #24404b;
        --text: #e3eef2;
        --muted: #8fa8b2;
        --primary: #0e3a4f;
        --primary-dark: #0a2c3d;
        --primary-soft: #18313b;
        --success: #3cc791;
        --danger: #f07a6f;
        --warn: #e2a84b;
        --warn-soft: #3a2c12;
        --ok-soft: #12352a;
        --bad-soft: #3d1c19;
        --accent: #4cc2cc;
        --label: #8fa8b2;
        --input-bg: #0e1a1f;
        --th-bg: #152730;
    }

    .panel, .metrics article { box-shadow: none; }
    th { color: var(--text); }
    .ghost-button, .button.secondary, .user-menu { color: var(--text); }
    .sidebar { background: #08232f; }
    .sidebar-nav a.active, .sidebar-nav a:hover { background: var(--primary-soft); color: #fff; }
    .primary-button, .button.primary, .auth-submit { background: var(--accent); color: #062228; }
    .primary-button:hover, .button.primary:hover, .auth-submit:hover { background: #6fd3db; }
    .pagination a { color: var(--accent); }
    .pagination a.active { background: var(--accent); border-color: var(--accent); color: #062228; }
    .alert { border-color: #5c2a25; }
    .auth-field input { background: var(--input-bg); }
}

/* ---------- Administração (admin.php) ---------- */
.admin-back { margin: 0 0 14px; font-size: 14px; }
.admin-search { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; max-width: 560px; }
.admin-search input { flex: 1; }
.admin-table td.num, .admin-table th.num { text-align: right; }
.admin-table td.acao { text-align: right; white-space: nowrap; }
.admin-table tr.inativo td { color: var(--muted); }
.admin-table .badge + .badge { margin-left: 6px; }
.badge.admin { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

.admin-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-switches { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-hint { flex-basis: 100%; color: var(--muted); font-size: 13px; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
label.check input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
label.check span { display: grid; gap: 2px; }
label.check strong { color: var(--text); font-size: 14px; }
label.check small { color: var(--muted); font-size: 12px; font-weight: 500; }
label.check.inline { align-items: center; white-space: nowrap; }
label.check input:disabled + span { opacity: .7; }

.client-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.client-tools input[type="search"] { flex: 1 1 260px; width: auto; }
.client-list { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.client-list li + li { border-top: 1px solid var(--line); }
.client-list li[hidden] { display: none; }
.client-list label { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; font-weight: 500; font-size: 14px; color: var(--text); cursor: pointer; }
.client-list label:hover { background: var(--th-bg); }
.client-list input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.client-list label:has(input:checked) { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.client-name { min-width: 0; overflow-wrap: anywhere; }
.client-name small { display: block; color: var(--muted); font-size: 12px; }
.client-cnpj { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.client-list .empty { padding: 18px; }

.save-bar {
    position: sticky; bottom: 0; z-index: 4;
    display: flex; justify-content: flex-end; gap: 12px;
    margin: 0 -32px -48px; padding: 14px 32px;
    background: var(--panel); border-top: 1px solid var(--line);
}

@media (max-width: 1100px) { .admin-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .admin-fields { grid-template-columns: 1fr; }
    .admin-search { max-width: none; }
    .client-list { max-height: none; }
    .client-list label { grid-template-columns: 18px minmax(0, 1fr); }
    .client-cnpj { grid-column: 2; margin-top: -8px; }
    .save-bar { bottom: calc(62px + var(--safe-bottom)); margin: 0 -16px; padding: 12px 16px; }
    .save-bar > * { flex: 1; justify-content: center; }
}
