:root {
    color-scheme: dark;
    --bg: #080b10;
    --surface: #10151d;
    --surface-2: #161c26;
    --border: #242d3a;
    --text: #f4f7fb;
    --muted: #8f9cad;
    --accent: #75f5b5;
    --accent-dark: #19b66f;
    --danger: #ff6b7a;
    --warning: #ffc766;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }

.login-page {
    background:
        radial-gradient(circle at 15% 20%, rgba(32, 195, 120, .16), transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(68, 104, 255, .13), transparent 35%),
        var(--bg);
}
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 42px; border: 1px solid var(--border); border-radius: 24px; background: rgba(16, 21, 29, .94); box-shadow: 0 24px 80px rgba(0, 0, 0, .42); }
.brand-mark, .brand-small { display: grid; place-items: center; color: #07140e; background: linear-gradient(135deg, var(--accent), #45d9ff); font-weight: 900; letter-spacing: -.06em; }
.brand-mark { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 28px; font-size: 22px; }
.brand-small { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.025em; }
.muted { color: var(--muted); line-height: 1.6; }
.login-form { display: grid; gap: 10px; margin-top: 30px; }
.login-form label, .date-filter label { color: #c8d0dc; font-size: 13px; font-weight: 700; }
input { width: 100%; border: 1px solid var(--border); border-radius: 11px; outline: 0; color: var(--text); background: #0b1017; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(25, 182, 111, .15); }
.login-form input { height: 48px; padding: 0 14px; margin-bottom: 7px; }
.login-form button, .date-filter button { border: 0; border-radius: 11px; color: #06120d; background: var(--accent); font-weight: 850; }
.login-form button { height: 50px; margin-top: 8px; }
.login-form button:hover, .date-filter button:hover { background: #9affcb; }
.security-note { margin: 20px 0 0; color: #647183; font-size: 12px; text-align: center; }
.alert { padding: 13px 15px; border-radius: 11px; font-size: 14px; }
.alert.error { border: 1px solid rgba(255, 107, 122, .28); color: #ffadb6; background: rgba(255, 107, 122, .09); }
.login-card .alert { margin-top: 20px; }

.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100% - 1240px) / 2)); border-bottom: 1px solid var(--border); background: rgba(8, 11, 16, .88); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand div { display: grid; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.logout { padding: 9px 15px; border: 1px solid var(--border); border-radius: 9px; color: #cbd3df; background: transparent; font-weight: 700; }
.logout:hover { border-color: #455166; background: var(--surface); }
.dashboard-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 70px; }
.tabs { display: flex; gap: 4px; width: fit-content; max-width: 100%; margin-bottom: 34px; padding: 4px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tabs a { white-space: nowrap; }
.tabs a { padding: 9px 15px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 750; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: #06120d; background: var(--accent); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.page-heading .muted { margin-bottom: 0; }
.filter-group { display: grid; justify-items: end; gap: 8px; }
.date-filter { display: flex; align-items: flex-end; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.date-filter label { display: grid; gap: 6px; }
.date-filter input { min-width: 142px; height: 40px; padding: 0 10px; color-scheme: dark; }
.date-filter button { height: 40px; padding: 0 18px; }
.date-filter.single-date input { min-width: 170px; }
.quick-ranges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.quick-ranges a { padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 750; text-decoration: none; }
.quick-ranges a:hover { border-color: var(--accent-dark); color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.metric { min-height: 138px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.metric.primary { border-color: rgba(117, 245, 181, .3); background: linear-gradient(145deg, rgba(32, 134, 87, .22), var(--surface) 70%); }
.metric.warning { border-color: rgba(255, 199, 102, .35); }
.metric span, .metric small { color: var(--muted); font-size: 12px; }
.metric strong { margin: 15px 0; font-size: clamp(23px, 2.5vw, 31px); letter-spacing: -.035em; }
.metric strong.period { font-size: 18px; }
.panel { margin-top: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.panel-heading .eyebrow { margin-bottom: 5px; }
.updated { color: var(--muted); font-size: 12px; }
.site-list { padding: 4px 24px 10px; }
.site-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) 2fr 70px 130px; align-items: center; gap: 24px; padding: 17px 0; border-bottom: 1px solid rgba(36, 45, 58, .75); }
.site-row:last-child { border-bottom: 0; }
.site-row.exception { opacity: .85; }
.site-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-identity div { display: grid; gap: 4px; min-width: 0; }
.site-identity strong, .site-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-identity small, .site-count small, .site-value small { color: var(--muted); font-size: 11px; }
.site-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #6687ff; box-shadow: 0 0 13px currentColor; }
.site-progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 6px; color: var(--accent); background: #222b37; appearance: none; }
.site-progress::-webkit-progress-bar { border-radius: 6px; background: #222b37; }
.site-progress::-webkit-progress-value { border-radius: 6px; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); }
.site-progress::-moz-progress-bar { border-radius: 6px; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); }
.site-count, .site-value { display: grid; gap: 3px; }
.site-value { text-align: right; }
.key-ramtrx { color: #ffb66e !important; }
.key-unidentified, .key-ambiguous { color: var(--danger) !important; }
.site-dot.key-ramtrx { background: #ffb66e; }
.site-dot.key-unidentified, .site-dot.key-ambiguous { background: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 18px; color: var(--muted); background: #0d1219; font-size: 10px; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
td { padding: 14px 18px; border-top: 1px solid rgba(36, 45, 58, .65); color: #c7d0dc; white-space: nowrap; }
.right { text-align: right; }
.value { color: var(--text); font-weight: 800; }
.mono { color: #8fa0b6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.status { display: inline-flex; padding: 5px 8px; border: 1px solid currentColor; border-radius: 7px; color: #75b2ff; font-size: 11px; font-weight: 750; }
.empty { padding: 38px; color: var(--muted); text-align: center; }
.table-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; text-align: right; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--border); background: #0d1219; }
.page-size-form, .page-size-form label, .page-navigation { display: flex; align-items: center; gap: 8px; }
.page-size-form label, .page-navigation { color: var(--muted); font-size: 12px; font-weight: 700; }
.page-size-form select { height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
.page-size-form button, .page-navigation a { padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); font-size: 12px; font-weight: 750; text-decoration: none; }
.page-size-form button:hover, .page-navigation a:hover { border-color: var(--accent-dark); color: var(--accent); }
.alert.warning { border: 1px solid rgba(255, 199, 102, .3); color: #ffe0a3; background: rgba(255, 199, 102, .09); }
.alert.info { margin: 18px 0; border: 1px solid rgba(117, 178, 255, .3); color: #b9d7ff; background: rgba(117, 178, 255, .09); }
.alert.success { margin: 18px 0; border: 1px solid rgba(117, 245, 181, .3); color: var(--accent); background: rgba(117, 245, 181, .09); }
.inline-link { margin-left: 6px; color: inherit; font-weight: 800; }
.processing-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 26px; border: 1px solid rgba(117, 245, 181, .25); border-radius: 18px; background: var(--surface); }
.processing-card h2 { margin-bottom: 7px; }
.processing-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.processing-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--accent); background: rgba(117, 245, 181, .1); font-size: 24px; }
.refresh-button { padding: 11px 16px; border-radius: 10px; color: #06120d; background: var(--accent); font-size: 13px; font-weight: 800; text-decoration: none; }
.site-identity.compact { min-width: 210px; }
.discount-summary-table tfoot th { border-top: 2px solid var(--border); color: var(--text); font-size: 12px; letter-spacing: 0; text-transform: none; }
.deduction { color: #ff9ba6 !important; font-weight: 750; }
.credit { color: var(--accent) !important; font-weight: 750; }
.pending { color: var(--warning); font-weight: 750; }
.med-status-rejeitada, .med-status-cancelada_efi, .med-status-cancelada_psp_externo { color: var(--accent); }
.med-status-aceita { color: var(--danger); }
.med-status-aberta, .med-status-em_defesa { color: var(--warning); }
.outgoing-status-realizado { color: var(--accent); }
.outgoing-status-em_processamento { color: var(--warning); }
.outgoing-status-nao_realizado { color: var(--danger); }
.outgoing-table .recipient-name { max-width: 240px; overflow: hidden; color: var(--text); font-weight: 700; text-overflow: ellipsis; }
.description-form { display: flex; align-items: center; gap: 7px; }
.description-form input[type="text"] { width: 220px; height: 36px; padding: 0 10px; }
.description-form button { height: 36px; padding: 0 11px; border: 1px solid var(--accent-dark); border-radius: 9px; color: #06120d; background: var(--accent); font-size: 12px; font-weight: 800; }
.description-form button:hover { background: #9affcb; }

@media (max-width: 900px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .filter-group { justify-items: start; }
    .quick-ranges { justify-content: flex-start; }
    .date-filter { align-self: flex-start; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-row { grid-template-columns: minmax(180px, 1.5fr) 1fr 60px 120px; gap: 14px; }
}

@media (max-width: 640px) {
    .login-card { padding: 30px 24px; }
    .topbar { padding: 0 18px; }
    .dashboard-shell { width: min(100% - 28px, 1240px); padding-top: 30px; }
    .date-filter { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .date-filter input { min-width: 0; }
    .date-filter button { grid-column: 1 / -1; }
    .date-filter.single-date { grid-template-columns: 1fr; }
    .date-filter.single-date button { grid-column: auto; }
    .metrics { grid-template-columns: 1fr; }
    .metric { min-height: 120px; }
    .panel-heading { align-items: flex-start; gap: 12px; padding: 18px; }
    .updated { text-align: right; }
    .site-list { padding: 3px 18px 8px; }
    .site-row { grid-template-columns: 1fr auto; gap: 10px; }
    .site-progress { grid-column: 1 / -1; grid-row: 2; }
    .site-count { display: none; }
    .site-value { grid-column: 2; grid-row: 1; }
    .processing-card { grid-template-columns: auto 1fr; }
    .refresh-button { grid-column: 1 / -1; text-align: center; }
    .table-pagination { align-items: stretch; flex-direction: column; }
    .page-navigation { justify-content: space-between; }
    th, td { padding-left: 14px; padding-right: 14px; }
}

/* Zusee-inspired editorial theme */
:root {
    color-scheme: dark;
    --bg: #12110f;
    --surface: #181714;
    --surface-2: #201e1a;
    --border: #3c3831;
    --text: #eee1cf;
    --muted: #a49b8f;
    --accent: #ead8bd;
    --accent-dark: #cdb99b;
    --danger: #ff725e;
    --warning: #e9a76f;
    font-family: Arial, Helvetica, sans-serif;
}

html { background: var(--bg); }
html { scrollbar-color: #6c655c var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border: 2px solid var(--bg); background: #6c655c; }
body {
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(234, 216, 189, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(234, 216, 189, .045) 1px, transparent 1px);
    background-size: 80px 80px;
}
body::before {
    content: "GRUPO TRX  •  CONTROLE FINANCEIRO";
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: -1;
    color: rgba(234, 216, 189, .18);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .32em;
    writing-mode: vertical-rl;
}

.login-page {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 82% 18%, rgba(255, 114, 94, .18), transparent 24%),
        linear-gradient(rgba(234, 216, 189, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(234, 216, 189, .055) 1px, transparent 1px);
    background-size: auto, 80px 80px, 80px 80px;
}
.login-shell { min-height: 100vh; padding: 32px; }
.login-card {
    position: relative;
    width: min(520px, 100%);
    padding: 56px;
    border: 1px solid var(--accent);
    border-radius: 0;
    background: rgba(18, 17, 15, .96);
    box-shadow: 22px 22px 0 rgba(234, 216, 189, .08);
}
.login-card::after {
    content: "CONTROLE • AUDITORIA • RESULTADOS";
    position: absolute;
    top: -42px;
    right: -42px;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border: 1px dashed var(--accent);
    border-radius: 50%;
    color: var(--accent);
    background: var(--bg);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: center;
}
.brand-mark, .brand-small {
    border: 1px solid var(--accent);
    border-radius: 0;
    color: var(--bg);
    background: var(--accent);
    box-shadow: none;
    letter-spacing: -.08em;
}
.brand-mark { width: 72px; height: 72px; margin-bottom: 38px; border-radius: 50%; font-size: 21px; }
.brand-small { width: 40px; height: 40px; font-size: 13px; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .24em; }
h1 { font-size: clamp(38px, 5vw, 68px); font-weight: 750; line-height: .98; letter-spacing: -.055em; }
h2 { font-size: 24px; font-weight: 700; letter-spacing: -.035em; }
.muted { color: var(--muted); }
.login-card h1 { max-width: 400px; margin-bottom: 18px; }
.login-form { gap: 11px; margin-top: 36px; }
.login-form label, .date-filter label { color: var(--accent); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
input {
    border-color: var(--border);
    border-radius: 0;
    color: var(--text);
    background: rgba(255, 255, 255, .025);
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.login-form input { height: 52px; }
.login-form button, .date-filter button {
    border: 1px solid var(--accent);
    border-radius: 0;
    color: var(--bg);
    background: var(--accent);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.login-form button:hover, .date-filter button:hover { color: var(--accent); background: transparent; }
.security-note { color: #776f65; letter-spacing: .06em; text-transform: uppercase; }

.topbar {
    height: 82px;
    padding: 0 max(24px, calc((100% - 1360px) / 2));
    border-color: var(--border);
    background: rgba(18, 17, 15, .94);
    backdrop-filter: blur(18px);
}
.brand { gap: 14px; }
.brand strong { color: var(--accent); font-size: 16px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; }
.logout {
    padding: 11px 22px;
    border-color: var(--accent);
    border-radius: 0;
    color: var(--accent);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.logout:hover { color: var(--bg); background: var(--accent); }
.dashboard-shell { width: min(1360px, calc(100% - 64px)); padding: 32px 0 90px; }
.tabs {
    justify-content: center;
    width: 100%;
    margin-bottom: 58px;
    padding: 0;
    overflow-x: auto;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    position: relative;
    padding: 18px 22px;
    border-radius: 0;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.tabs a::after { content: ""; position: absolute; right: 50%; bottom: -1px; left: 50%; height: 2px; background: var(--accent); transition: right .2s, left .2s; }
.tabs a:hover { color: var(--accent); }
.tabs a.active { color: var(--accent); background: transparent; }
.tabs a.active::after { right: 12px; left: 12px; }

.page-heading { align-items: flex-start; margin-bottom: 44px; }
.page-heading > div:first-child { max-width: 660px; }
.page-heading h1 { margin-top: 15px; }
.page-heading .muted { max-width: 620px; }
.filter-group { gap: 12px; }
.date-filter { padding: 12px; border-color: var(--border); border-radius: 0; background: rgba(24, 23, 20, .9); }
.date-filter label { gap: 8px; }
.date-filter input { height: 42px; color-scheme: dark; }
.date-filter button { height: 42px; padding: 0 22px; font-size: 10px; }
.quick-ranges { gap: 0; border: 1px solid var(--border); }
.quick-ranges a { padding: 7px 11px; border: 0; border-right: 1px solid var(--border); border-radius: 0; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.quick-ranges a:last-child { border-right: 0; }
.quick-ranges a:hover { color: var(--bg); background: var(--accent); }

.metrics { gap: 1px; margin: 28px 0; border: 1px solid var(--border); background: var(--border); }
.metric {
    position: relative;
    min-height: 170px;
    padding: 26px;
    border: 0;
    border-radius: 0;
    background: var(--surface);
}
.metric::before { content: "+"; position: absolute; top: 11px; right: 14px; color: #6f685e; font-size: 14px; }
.metric.primary { border: 0; color: var(--bg); background: var(--accent); }
.metric.primary::before, .metric.primary span, .metric.primary small { color: #423a30; }
.metric.warning { box-shadow: inset 0 3px 0 var(--warning); }
.metric span, .metric small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { margin: 23px 0; font-size: clamp(25px, 2.8vw, 38px); font-weight: 700; }
.metric strong.period { font-size: 19px; }

.panel { margin-top: 28px; border-color: var(--border); border-radius: 0; background: rgba(24, 23, 20, .94); box-shadow: 12px 12px 0 rgba(234, 216, 189, .025); }
.panel-heading { padding: 27px 28px; border-color: var(--border); }
.updated { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.site-list { padding: 7px 28px 13px; }
.site-row { padding: 20px 0; border-color: var(--border); }
.site-identity small, .site-count small, .site-value small { color: #b8ad9d; letter-spacing: .07em; text-transform: uppercase; }
.site-dot { border-radius: 0; background: var(--accent); box-shadow: none; transform: rotate(45deg); }
.site-progress, .site-progress::-webkit-progress-bar { border-radius: 0; background: #2e2b26; }
.site-progress::-webkit-progress-value { border-radius: 0; background: var(--accent); }
.site-progress::-moz-progress-bar { border-radius: 0; background: var(--accent); }

table { font-size: 12px; }
th { padding: 15px 18px; color: var(--accent); background: #0e0d0c; font-size: 9px; letter-spacing: .15em; }
td { padding: 16px 18px; border-color: rgba(60, 56, 49, .7); color: #c9bca9; }
tbody tr { transition: background .16s; }
tbody tr:hover { background: rgba(234, 216, 189, .035); }
.value { color: var(--text); }
.mono { color: #9c9284; }
.status { padding: 6px 9px; border-radius: 0; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.empty { color: var(--muted); }
.table-note, .table-pagination { border-color: var(--border); background: #0e0d0c; }
.page-size-form label, .page-navigation { color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.page-size-form select, .page-size-form button, .page-navigation a {
    border-color: var(--border);
    border-radius: 0;
    color: var(--accent);
    background: var(--surface);
}
.page-size-form button:hover, .page-navigation a:hover { border-color: var(--accent); color: var(--bg); background: var(--accent); }

.alert { border-radius: 0; }
.alert.warning { border-color: rgba(233, 167, 111, .55); color: #efc39e; background: rgba(233, 167, 111, .08); }
.alert.info { border-color: rgba(234, 216, 189, .35); color: var(--accent); background: rgba(234, 216, 189, .06); }
.alert.success { border-color: rgba(139, 204, 167, .5); color: #a5d8b8; background: rgba(139, 204, 167, .07); }
.alert.error { border-color: rgba(255, 114, 94, .48); color: #ff9a8b; background: rgba(255, 114, 94, .08); }
.processing-card { border-color: var(--border); border-radius: 0; background: var(--surface); }
.processing-icon { border: 1px dashed var(--accent); color: var(--accent); background: transparent; }
.refresh-button { border: 1px solid var(--accent); border-radius: 0; color: var(--bg); background: var(--accent); }
.deduction { color: #ff8c7a !important; }
.credit { color: #a5d8b8 !important; }
.description-form input[type="text"] { border-radius: 0; }
.description-form button { border-color: var(--accent); border-radius: 0; color: var(--bg); background: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.description-form button:hover { color: var(--accent); background: transparent; }

@media (max-width: 900px) {
    .dashboard-shell { width: min(100% - 36px, 1360px); }
    .tabs { justify-content: flex-start; margin-bottom: 40px; }
    .page-heading { gap: 28px; }
}

@media (max-width: 640px) {
    body { background-size: 48px 48px; }
    body::before { display: none; }
    .login-shell { padding: 22px; }
    .login-card { width: calc(100vw - 44px); max-width: none; padding: 40px 26px; box-shadow: 10px 10px 0 rgba(234, 216, 189, .08); }
    .login-card::after { top: -28px; right: -8px; width: 64px; height: 64px; font-size: 6px; }
    .topbar { height: 72px; }
    .dashboard-shell { width: min(100% - 24px, 1360px); padding-top: 20px; }
    .tabs a { padding: 15px 14px; font-size: 9px; }
    .page-heading { margin-bottom: 30px; }
    .page-heading h1 { font-size: 42px; }
    .date-filter { gap: 8px; }
    .quick-ranges { max-width: 100%; overflow-x: auto; }
    .quick-ranges a { flex: 0 0 auto; }
    .metrics { gap: 1px; }
    .metric { min-height: 140px; }
    .panel { box-shadow: none; }
    .panel-heading { padding: 22px 18px; }
}

/* Arter-inspired portfolio dashboard theme */
:root {
    --bg: #191923;
    --surface: #20202a;
    --surface-2: #252531;
    --border: #30303d;
    --text: #fafafc;
    --muted: #8c8c8e;
    --accent: #ffc107;
    --accent-dark: #d9a400;
    --danger: #ff6675;
    --warning: #ffc107;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

html { background: var(--bg); scrollbar-color: #4d4d5b var(--bg); }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border-color: var(--bg); background: #4d4d5b; }
body {
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 78% -10%, rgba(255, 193, 7, .07), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, .018) 25%, transparent 25%);
    background-size: auto, 28px 28px;
}
body::before { display: none; }

.login-page {
    background-color: #191923;
    background-image:
        radial-gradient(circle at 18% 18%, rgba(255, 193, 7, .11), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(82, 82, 106, .2), transparent 30%);
}
.login-shell { padding: 28px; }
.login-card {
    width: min(460px, 100%);
    padding: 50px;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: #20202a;
    box-shadow: 0 3px 8px rgba(15, 15, 20, .3), 0 20px 50px rgba(15, 15, 20, .48);
}
.login-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; background: var(--accent); }
.login-card::after { display: none; }
.brand-mark, .brand-small {
    border: 0;
    border-radius: 50%;
    color: #191923;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(255, 193, 7, .08);
    letter-spacing: -.06em;
}
.brand-mark { position: relative; width: 78px; height: 78px; margin: 0 auto 32px; border-radius: 50%; font-size: 21px; }
.brand-mark::after { content: ""; position: absolute; right: 4px; bottom: 6px; width: 12px; height: 12px; border: 3px solid var(--surface); border-radius: 50%; background: #4caf50; }
.brand-small { width: 82px; height: 82px; font-size: 20px; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .16em; }
h1 { font-size: clamp(34px, 4vw, 54px); font-weight: 800; line-height: 1.08; letter-spacing: -.035em; }
h2 { font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.login-card .eyebrow, .login-card h1, .login-card > .muted { text-align: center; }
.login-card h1 { margin-bottom: 14px; }
.login-form { margin-top: 32px; }
.login-form label, .date-filter label { color: #cacacf; font-size: 10px; letter-spacing: .08em; }
input { border-color: #393946; border-radius: 2px; color: var(--text); background: #191923; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 193, 7, .13); }
.login-form input { height: 49px; }
.login-form button, .date-filter button {
    border: 0;
    border-radius: 2px;
    color: #191923;
    background: var(--accent);
    box-shadow: 0 2px 5px rgba(15, 15, 20, .25);
    font-size: 11px;
    letter-spacing: .08em;
}
.login-form button:hover, .date-filter button:hover { color: #191923; background: #ffd044; transform: translateY(-1px); }
.security-note { color: #6f6f75; letter-spacing: .04em; }

.dashboard-page { padding-left: 250px; }
.topbar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: 250px;
    height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 28px 30px;
    border: 0;
    background: #20202a;
    box-shadow: 4px 0 24px rgba(15, 15, 20, .35);
    backdrop-filter: none;
}
.topbar::after { content: "EFI  •  PIX  •  AUDITORIA"; position: absolute; top: 190px; right: 28px; left: 28px; padding: 22px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: #6f6f75; font-size: 8px; font-weight: 700; letter-spacing: .14em; text-align: center; }
.brand { flex-direction: column; gap: 17px; text-align: center; }
.brand div { gap: 4px; }
.brand strong { color: var(--text); font-size: 18px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .11em; }
.logout {
    width: 100%;
    padding: 12px 18px;
    border: 0;
    border-radius: 2px;
    color: #191923;
    background: var(--accent);
    box-shadow: 0 2px 5px rgba(15, 15, 20, .25);
    font-size: 10px;
    letter-spacing: .11em;
}
.logout:hover { color: #191923; background: #ffd044; }
.dashboard-shell { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 80px; }
.tabs {
    position: sticky;
    top: 0;
    z-index: 9;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 28px;
    padding: 0 18px;
    border: 0;
    border-radius: 0 0 3px 3px;
    background: rgba(32, 32, 42, .96);
    box-shadow: 0 3px 10px rgba(15, 15, 20, .25);
    backdrop-filter: blur(12px);
}
.tabs a { padding: 19px 17px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.tabs a::after { right: 50%; bottom: 0; left: 50%; height: 2px; background: var(--accent); }
.tabs a:hover, .tabs a.active { color: var(--text); }
.tabs a.active::after { right: 15px; left: 15px; }

.page-heading {
    position: relative;
    align-items: center;
    gap: 30px;
    margin-bottom: 26px;
    padding: 34px;
    overflow: hidden;
    border-radius: 3px;
    background: linear-gradient(110deg, #252531 0%, #20202a 72%);
    box-shadow: 0 3px 8px rgba(15, 15, 20, .28);
}
.page-heading::after { content: ""; position: absolute; top: -75px; right: -55px; width: 190px; height: 190px; border: 34px solid rgba(255, 193, 7, .075); border-radius: 50%; }
.page-heading > * { position: relative; z-index: 1; }
.page-heading > div:first-child { max-width: 570px; }
.page-heading h1 { margin: 10px 0 12px; }
.filter-group { gap: 10px; }
.date-filter { padding: 10px; border: 0; border-radius: 2px; background: #191923; box-shadow: inset 0 0 0 1px #33333f; }
.date-filter label { gap: 7px; }
.date-filter input { height: 40px; }
.date-filter button { height: 40px; }
.quick-ranges { gap: 3px; border: 0; }
.quick-ranges a { padding: 7px 10px; border: 0; border-radius: 2px; color: var(--muted); background: #252531; font-size: 9px; letter-spacing: .04em; }
.quick-ranges a:hover { color: #191923; background: var(--accent); }

.metrics { gap: 16px; margin: 24px 0; border: 0; background: transparent; }
.metric {
    min-height: 158px;
    padding: 24px;
    border: 0;
    border-radius: 3px;
    background: #20202a;
    box-shadow: 0 3px 8px rgba(15, 15, 20, .28);
}
.metric::before { content: ""; top: auto; right: 24px; bottom: 21px; width: 28px; height: 3px; border-radius: 3px; background: var(--accent); }
.metric.primary { color: var(--text); background: #20202a; box-shadow: inset 0 3px 0 var(--accent), 0 3px 8px rgba(15, 15, 20, .28); }
.metric.primary::before { color: transparent; }
.metric.primary span, .metric.primary small, .metric span, .metric small { color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.metric.warning { box-shadow: inset 0 3px 0 var(--warning), 0 3px 8px rgba(15, 15, 20, .28); }
.metric strong { margin: 20px 0; color: var(--accent); font-size: clamp(25px, 2.5vw, 35px); font-weight: 800; }
.metric strong.period { color: var(--text); font-size: 17px; }

.panel { margin-top: 22px; border: 0; border-radius: 3px; background: #20202a; box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.panel-heading { padding: 24px 26px; border-color: var(--border); }
.updated { color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.site-list { padding: 5px 26px 12px; }
.site-row { padding: 18px 0; border-color: var(--border); }
.site-identity small, .site-count small, .site-value small { color: var(--muted); letter-spacing: .03em; }
.site-dot { border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 193, 7, .11); transform: none; }
.site-progress, .site-progress::-webkit-progress-bar { height: 5px; border-radius: 5px; background: #363642; }
.site-progress::-webkit-progress-value { border-radius: 5px; background: var(--accent); }
.site-progress::-moz-progress-bar { border-radius: 5px; background: var(--accent); }

table { font-size: 12px; }
th { padding: 14px 18px; color: #bdbdc4; background: #191923; font-size: 9px; letter-spacing: .08em; }
td { padding: 15px 18px; border-color: var(--border); color: #b7b7bd; }
tbody tr:hover { background: rgba(255, 193, 7, .025); }
.value { color: var(--text); }
.mono { color: #85858b; }
.status { border-radius: 12px; font-size: 9px; letter-spacing: .03em; }
.table-note, .table-pagination { border-color: var(--border); background: #191923; }
.page-size-form label, .page-navigation { color: var(--muted); font-size: 10px; letter-spacing: .03em; }
.page-size-form select, .page-size-form button, .page-navigation a { border-color: #3a3a47; border-radius: 2px; color: #c9c9ce; background: #252531; }
.page-size-form button:hover, .page-navigation a:hover { border-color: var(--accent); color: #191923; background: var(--accent); }

.alert { border-radius: 3px; }
.alert.warning { border-color: rgba(255, 193, 7, .32); color: #f5d66d; background: rgba(255, 193, 7, .07); }
.alert.info { border-color: rgba(101, 156, 255, .3); color: #a9c7ff; background: rgba(101, 156, 255, .07); }
.alert.success { border-color: rgba(76, 175, 80, .32); color: #9bd49d; background: rgba(76, 175, 80, .07); }
.alert.error { border-color: rgba(255, 102, 117, .35); color: #ff9ca6; background: rgba(255, 102, 117, .07); }
.processing-card { border: 0; border-radius: 3px; background: var(--surface); box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.processing-icon { border: 2px solid var(--accent); color: var(--accent); background: transparent; }
.refresh-button { border: 0; border-radius: 2px; color: #191923; background: var(--accent); }
.credit { color: #89cf8c !important; }
.deduction { color: #ff8994 !important; }
.description-form input[type="text"] { border-radius: 2px; }
.description-form button { border: 0; border-radius: 2px; color: #191923; background: var(--accent); }
.description-form button:hover { color: #191923; background: #ffd044; }

@media (max-width: 1100px) {
    .dashboard-page { padding-left: 210px; }
    .topbar { width: 210px; padding-right: 22px; padding-left: 22px; }
    .topbar::after { right: 22px; left: 22px; }
    .dashboard-shell { width: min(100% - 36px, 1240px); }
    .page-heading { align-items: stretch; flex-direction: column; }
    .filter-group { justify-items: start; }
}

@media (max-width: 760px) {
    .dashboard-page { padding: 72px 0 0; }
    .topbar {
        right: 0;
        bottom: auto;
        width: 100%;
        height: 72px;
        flex-direction: row;
        padding: 0 18px;
        box-shadow: 0 4px 18px rgba(15, 15, 20, .35);
    }
    .topbar::after { display: none; }
    .brand { flex-direction: row; gap: 11px; text-align: left; }
    .brand-small { width: 42px; height: 42px; font-size: 13px; }
    .brand strong { font-size: 15px; }
    .logout { width: auto; padding: 10px 16px; }
    .dashboard-shell { width: min(100% - 24px, 1240px); padding-top: 12px; }
    .tabs { top: 72px; margin-bottom: 20px; padding: 0 4px; }
    .tabs a { padding: 15px 11px; font-size: 9px; }
    .page-heading { padding: 24px 20px; }
}

@media (max-width: 640px) {
    body { background-size: auto, 22px 22px; }
    .login-shell { padding: 20px; }
    .login-card { width: calc(100vw - 40px); max-width: none; padding: 42px 24px 34px; box-shadow: 0 12px 32px rgba(15, 15, 20, .45); }
    .login-card::after { display: none; }
    .page-heading h1 { font-size: 36px; }
    .date-filter { gap: 8px; }
    .metrics { gap: 12px; }
    .metric { min-height: 132px; }
    .panel-heading { padding: 20px 18px; }
}
