: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-save-status { min-width: 58px; color: var(--muted); font-size: 10px; font-weight: 750; text-align: right; }
.description-save-status.saving { color: var(--warning); }
.description-save-status.saved { color: var(--accent); }
.description-save-status.error { color: var(--danger); }

@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; }
@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; }
.outgoing-table, .meds-table { table-layout: fixed; }
.outgoing-table th:nth-child(1) { width: 18%; }
.outgoing-table th:nth-child(2) { width: 30%; }
.outgoing-table th:nth-child(3) { width: 38%; }
.outgoing-table th:nth-child(4) { width: 14%; }
.outgoing-table td, .meds-table td { white-space: normal; }
.recipient-details { display: grid; gap: 5px; min-width: 0; }
.recipient-details strong, .recipient-details small { overflow: hidden; text-overflow: ellipsis; }
.recipient-details strong { color: var(--text); }
.recipient-details small { color: var(--muted); font-size: 10px; }
.outgoing-table .description-form { width: 100%; }
.outgoing-table .description-form input[type="text"] { min-width: 0; width: auto; flex: 1; }
.meds-table th:nth-child(1), .meds-table th:nth-child(2), .meds-table th:nth-child(5) { width: 22%; }
.meds-table th:nth-child(3) { width: 16%; }
.meds-table th:nth-child(4) { width: 18%; }
.med-normalized-review { color: var(--accent); }
.med-normalized-rejected { color: #89cf8c; }
.filter-group { width: min(100%, 500px); }
.quick-ranges { display: grid; width: 100%; gap: 4px; overflow: visible; }
.weekday-ranges, .period-ranges { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; width: 100%; }
.weekday-ranges { padding-top: 18px; }
.quick-ranges a, .quick-ranges .range-disabled { display: flex; align-items: center; justify-content: center; min-height: 30px; padding: 7px 5px; border: 0; border-radius: 2px; font-size: 9px; font-weight: 700; letter-spacing: .02em; text-align: center; text-transform: none; }
.quick-ranges a { color: var(--muted); background: #252531; text-decoration: none; }
.quick-ranges a:hover { color: #191923; background: var(--accent); }
.quick-ranges .range-disabled { color: #55555f; background: #1d1d26; cursor: not-allowed; }
.weekday-ranges a, .weekday-ranges .range-disabled { position: relative; }
.quick-ranges a.range-selected { color: #191923; background: var(--accent); }
.weekday-ranges .range-today { color: var(--accent); background: #252531; box-shadow: inset 0 0 0 1px var(--accent); }
.weekday-ranges .range-disabled.range-today { color: #777780; background: #1d1d26; }
.today-bubble { position: absolute; bottom: calc(100% + 3px); left: 50%; padding: 3px 6px; border-radius: 8px; color: #191923; background: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .05em; line-height: 1; text-transform: uppercase; transform: translateX(-50%); }
.today-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; border: 3px solid transparent; border-top-color: var(--accent); transform: translateX(-50%); }

@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; }
    .tabs { justify-content: space-between; }
    .tabs a { padding: 15px 6px; font-size: 8px; letter-spacing: .04em; }
    .quick-ranges a, .quick-ranges .range-disabled { min-height: 28px; padding: 6px 2px; font-size: 8px; }
    .page-heading h1 { font-size: 36px; }
    .date-filter { gap: 8px; }
    .metrics { gap: 12px; }
    .metric { min-height: 132px; }
    .panel-heading { padding: 20px 18px; }
}

/* Shared notes and logbook */
textarea { font: inherit; }
.shared-status {
    width: fit-content;
    margin: -10px 0 18px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--muted);
    background: var(--surface);
    font-size: 10px;
}
.shared-status.online { border-color: rgba(76, 175, 80, .32); color: #9bd49d; }
.shared-status.error { border-color: rgba(255, 102, 117, .35); color: #ff9ca6; }
.shared-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 22px; }
.shared-column { min-width: 0; overflow: hidden; border-radius: 3px; background: var(--surface); box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.shared-column-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 26px; border-bottom: 1px solid var(--border); }
.shared-column-heading .eyebrow { margin-bottom: 6px; }
.entry-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 12px; color: #191923; background: var(--accent); font-size: 9px; font-weight: 800; }
.log-heading { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 50px; padding: 5px 12px; text-align: center; }
.log-heading .eyebrow { display: none; }
.log-heading h2 { margin: 0; font-size: 14px; white-space: nowrap; }
.log-heading-brand { justify-self: start; }
.log-heading-notes { justify-self: end; }
.log-heading-accent { color: #fff; }
.log-heading-date { position: relative; display: grid; justify-items: center; padding: 0 5px 3px; color: #ff6b6b; white-space: nowrap; transform: rotate(-1deg); }
.log-heading-date::after { content: ""; position: absolute; right: 0; bottom: 0; width: 100%; height: 1px; border-radius: 50%; background: currentColor; opacity: .72; }
.log-heading-date strong { font: 700 13px/1.1 "Segoe Print", "Bradley Hand", cursive; }
.log-heading-date span { font: 700 9px/1.1 "Segoe Print", "Bradley Hand", cursive; text-transform: capitalize; }
.log-calendar { justify-self: end; width: 82px; color: #897e6d; }
.log-calendar-heading { display: grid; grid-template-columns: 14px 1fr 14px; align-items: center; margin-bottom: 3px; }
.log-calendar-title { display: block; color: #5b5144; font-size: 7px; line-height: 1.2; text-align: center; }
.log-calendar-month { width: 14px; height: 12px; padding: 0; border: 0; color: #b83932; background: transparent; font-size: 9px; font-weight: 900; line-height: 1; }
.log-calendar-month:hover { color: #7e211d; }
.log-calendar-grid { display: grid; grid-template-columns: repeat(7, 10px); justify-content: center; gap: 1px; }
.log-calendar-weekday, .log-calendar-day, .log-calendar-empty { display: grid; place-items: center; width: 10px; height: 10px; }
.log-calendar-weekday { color: #968b7b; font-size: 5px; font-weight: 800; }
.log-calendar-day { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; color: #8d8272; background: transparent; font-size: 6px; line-height: 1; }
.log-calendar-day:hover { color: #40392f; background: #e8dfd0; }
.log-calendar-day.has-entry { color: #fff; background: #b83932; font-weight: 900; }
.log-calendar-day.is-selected { box-shadow: 0 0 0 1px #b83932; }
.entry-create-form, .entry-editor form { display: grid; gap: 14px; }
.entry-create-form { padding: 22px 26px; border-bottom: 1px solid var(--border); background: #1d1d27; }
.entry-create-form label, .entry-editor label { display: grid; gap: 7px; color: #cacacf; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.entry-create-form label span, .entry-editor label span { color: #aaaab1; font-size: 8px; font-weight: 500; }
.entry-create-form input, .entry-editor input { height: 42px; padding: 0 12px; }
.entry-create-form input::placeholder, .entry-create-form textarea::placeholder { color: #777780; opacity: 1; }
.entry-create-form textarea, .entry-editor textarea {
    width: 100%;
    padding: 12px;
    resize: vertical;
    border: 1px solid #393946;
    border-radius: 2px;
    outline: 0;
    color: var(--text);
    background: #191923;
    line-height: 1.5;
}
.entry-create-form textarea:focus, .entry-editor textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 193, 7, .13); }
.entry-create-form button, .entry-editor button[type="submit"] { justify-self: start; padding: 11px 16px; border: 0; border-radius: 2px; color: #191923; background: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.entry-create-form button:hover, .entry-editor button[type="submit"]:hover { background: #ffd044; }
.entry-create-form button:disabled, .entry-editor button:disabled { cursor: wait; opacity: .55; }
.notes-import { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 26px; border-bottom: 1px solid var(--border); background: #191923; }
.notes-import > div { display: grid; min-width: 0; gap: 4px; }
.notes-import strong { color: var(--text); font-size: 11px; }
.notes-import span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.notes-import button { flex: 0 0 auto; }
.notes-import button:disabled { cursor: wait; opacity: .55; }
.entries-list { display: grid; gap: 12px; padding: 18px; }
#notes-list { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
.entries-empty { margin: 0; padding: 34px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.entry-file { display: grid; min-width: 0; justify-items: center; gap: 9px; padding: 15px 9px 10px; border: 1px solid #353440; border-radius: 3px; background: #20202a; }
.entry-file:hover { border-color: #4a4957; background: #23232e; }
.entry-file-open { display: grid; width: 100%; min-width: 0; justify-items: center; gap: 8px; padding: 0; border: 0; color: inherit; background: transparent; text-align: center; }
.entry-file-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.entry-file-icon { position: relative; display: grid; place-items: center; width: 58px; height: 72px; overflow: hidden; border: 2px solid #aaa3b0; border-radius: 2px; color: var(--accent); background: #292833; box-shadow: 0 5px 12px rgba(0, 0, 0, .2); font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.entry-file-icon::before { content: ""; position: absolute; top: -2px; right: -2px; border: 10px solid transparent; border-top-color: #aaa3b0; border-right-color: #aaa3b0; }
.entry-file-name { display: -webkit-box; width: 100%; min-height: 31px; overflow: hidden; color: var(--text); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.entry-file-date { color: var(--muted); font-size: 8px; line-height: 1.35; }
.entry-file .entry-actions { justify-content: center; }
.entry-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 2px; background: #252531; }
.entry-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.entry-card h3 { margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 15px; }
.entry-content { margin: 13px 0 14px; overflow-wrap: anywhere; color: #d0d0d5; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.entry-meta { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.entry-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.entry-action { padding: 5px 7px; border: 1px solid #444451; border-radius: 2px; color: #c5c5cb; background: transparent; font-size: 9px; }
.entry-action:hover { border-color: var(--accent); color: var(--accent); }
.entry-action.danger:hover { border-color: var(--danger); color: #ff9ca6; }
.diary-list { display: block; padding: 0; background: transparent; }
.log-notebook { overflow: hidden; background: transparent; }
.log-pad { position: relative; width: 100%; margin: 0; }
.log-flip-stage { position: relative; width: 100%; min-height: 470px; max-height: 740px; aspect-ratio: 520 / 620; overflow: clip; isolation: isolate; color: #2d2924; background: #eee7da; }
.log-sheet { position: absolute; inset: 0; }
.log-sheet { z-index: 2; }
.log-paper { position: relative; width: 100%; height: 100%; overflow: hidden; background: #f5f0e6; }
.log-paper::before { content: ""; position: absolute; top: 0; bottom: 0; left: 27px; z-index: 2; width: 1px; background: rgba(185, 81, 64, .35); pointer-events: none; }
.log-page-header { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto; align-items: flex-start; gap: 10px; min-height: 88px; padding: 10px 5px 7px 12px; }
.log-nav-controls { position: relative; width: 93px; height: 73px; }
.log-nav-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #b9ad9a; border-radius: 2px; color: #b83932; background: rgba(245, 240, 230, .84); font-size: 18px; }
.log-nav-older, .log-nav-newer, .log-theme-button, .log-editor-toggle { position: absolute; }
.log-nav-older { top: 0; left: 0; }
.log-nav-newer { top: 0; left: 39px; }
.log-theme-button { top: 39px; left: 20px; }
.log-editor-toggle { top: 39px; left: 59px; }
.log-nav-button:hover:not(:disabled) { border-color: #b83932; background: #eee5d6; }
.log-editor-toggle { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #b9ad9a; border-radius: 2px; color: #b83932; background: rgba(245, 240, 230, .88); }
.log-editor-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; pointer-events: none; }
.log-editor-menu { position: absolute; top: 3px; left: 50%; z-index: 6; width: 188px; padding: 4px; border: 1px solid #b9ad9a; border-radius: 2px; background: #f5f0e6; box-shadow: 0 8px 24px rgba(56, 43, 30, .2); transform: translateX(-50%); }
.log-marker-tools, .log-style-tools, .log-color-tools { display: flex; align-items: center; gap: 4px; }
.log-style-tools, .log-color-tools { margin-top: 3px; padding-top: 3px; border-top: 1px solid #d9cfbe; }
.log-editor-menu-label { flex: 0 0 42px; color: #897e6d; font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.log-tool-button { min-width: 27px; height: 20px; padding: 0 6px; border: 1px solid #b9ad9a; border-radius: 2px; color: #5b5144; background: rgba(245, 240, 230, .88); font-size: 10px; font-weight: 800; }
.log-subtask-button { font-size: 0; }
.log-subtask-button::before { content: "↳"; font: 800 14px/1 "DejaVu Sans Mono", sans-serif; }
.log-style-bold { font-weight: 900; }
.log-style-underline { text-decoration: underline; text-underline-offset: 2px; }
.log-style-strike { text-decoration: line-through; }
.log-color-button { width: 18px; height: 18px; padding: 0; border: 2px solid #f5f0e6; border-radius: 50%; box-shadow: 0 0 0 1px #b9ad9a; }
.log-color-button[aria-pressed="true"] { box-shadow: 0 0 0 2px #b83932; }
.log-color-black { background: #191923; }
.log-color-red { background: #b83932; }
.log-color-blue { background: #285fa8; }
.log-theme-button { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #b9ad9a; border-radius: 2px; color: #b83932; background: rgba(245, 240, 230, .88); }
.log-theme-button svg { width: 17px; height: 17px; pointer-events: none; }
.log-tool-button:hover, .log-theme-button:hover, .log-editor-toggle:hover { border-color: #b83932; color: #b83932; background: #eee5d6; }
.log-page-editor, .log-page-preview { position: relative; z-index: 1; display: block; width: calc(100% - 48px); height: calc(100% - 97px); min-height: 356px; margin: 0 18px 0 30px; padding: 6px 14px 6px 12px; overflow: auto; border: 0; color: #40392f; background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #d9cfbe 31px, #d9cfbe 32px); font: 13px/32px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.log-page-editor { outline: 0; }
.log-page-editor:empty::before { color: #a49a89; content: attr(data-placeholder); pointer-events: none; }
.log-line-indent { letter-spacing: -3px; }
.log-subtask-glyph { font: inherit; }
.log-page-editor:focus { box-shadow: inset 0 0 0 2px rgba(154, 128, 85, .18); }
.log-page-footer { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 14px 18px 16px 38px; color: #40392f; background: #f5f0e6; }
.log-save-state, .log-page-links { color: #897e6d; font-size: 8px; }
.log-page-links { display: flex; align-items: center; gap: 10px; }
.log-page-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.log-theme-dark .log-flip-stage { background: #252531; }
.log-theme-dark .log-paper, .log-theme-dark .log-page-footer { color: #f1f1f3; background: #252531; }
.log-theme-dark .log-paper::before { background: rgba(255, 102, 117, .38); }
.log-theme-dark .log-nav-button, .log-theme-dark .log-tool-button, .log-theme-dark .log-theme-button, .log-theme-dark .log-editor-toggle { border-color: #555462; color: #f1f1f3; background: #191923; }
.log-theme-dark .log-calendar-title { color: #f1f1f3; }
.log-theme-dark .log-calendar-month { color: #ff8f87; }
.log-theme-dark .log-calendar-weekday, .log-theme-dark .log-calendar-day { color: #aaaab1; }
.log-theme-dark .log-calendar-day:hover { color: #f1f1f3; background: #3a3945; }
.log-theme-dark .log-calendar-day.has-entry { color: #191923; background: var(--accent); }
.log-theme-dark .log-editor-menu { border-color: #555462; background: #252531; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.log-theme-dark .log-style-tools, .log-theme-dark .log-color-tools { border-color: #454552; }
.log-theme-dark .log-color-button { border-color: #252531; }
.log-theme-dark .log-page-editor, .log-theme-dark .log-page-preview { color: #fff; background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #454552 31px, #454552 32px); }
.log-theme-dark .log-page-editor:empty::before { color: #aaaab1; }
.log-text-black { color: #191923; }
.log-theme-dark .log-text-black { color: #fff; }
.log-text-red, .log-theme-dark .log-text-red { color: #b83932; }
.log-text-blue, .log-theme-dark .log-text-blue { color: #285fa8; }
.log-text-bold { font-weight: 800; }
.log-text-underline { text-decoration-line: underline; text-underline-offset: 2px; }
.log-text-strike { text-decoration-line: line-through; }
.log-text-underline.log-text-strike { text-decoration-line: underline line-through; }
.log-theme-dark .log-page-editor::placeholder, .log-theme-dark .log-save-state, .log-theme-dark .log-page-links { color: #aaaab1; }
.entry-editor { width: min(620px, calc(100% - 32px)); padding: 0; border: 1px solid #42424f; border-radius: 3px; color: var(--text); background: var(--surface); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }
.entry-editor::backdrop, .entry-viewer::backdrop { background: rgba(10, 10, 15, .78); backdrop-filter: blur(3px); }
.entry-editor form { padding: 25px; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 5px; }
.editor-heading .eyebrow { margin-bottom: 6px; }
.editor-close { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 28px; line-height: 1; }
.editor-close:hover { color: var(--text); }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.secondary-button { padding: 10px 14px; border: 1px solid #444451; border-radius: 2px; color: #c5c5cb; background: transparent; font-size: 10px; }
.entry-viewer { width: min(760px, calc(100% - 32px)); max-height: min(86vh, 760px); padding: 0; overflow: hidden; border: 1px solid #42424f; border-radius: 3px; color: var(--text); background: var(--surface); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }
.entry-viewer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 25px 18px; border-bottom: 1px solid var(--border); }
.entry-viewer-heading .eyebrow { margin-bottom: 6px; }
.entry-viewer-heading h2 { margin: 0; overflow-wrap: anywhere; font-size: 18px; }
.entry-viewer-content { min-height: 220px; max-height: calc(86vh - 175px); margin: 0; padding: 25px; overflow: auto; color: #e0e0e5; background: #191923; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 25px; border-top: 1px solid var(--border); }
.entry-viewer-footer .entry-meta { min-width: 0; }
[hidden] { display: none !important; }

@media (max-width: 980px) {
    .shared-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .shared-column-heading, .entry-create-form { padding-right: 18px; padding-left: 18px; }
    .notes-import { align-items: stretch; flex-direction: column; padding-right: 18px; padding-left: 18px; }
    .notes-import button { width: 100%; }
    .entries-list { padding: 12px; }
    #notes-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entry-card { padding: 15px; }
    .entry-card-heading { align-items: stretch; flex-direction: column; }
    .entry-actions { justify-content: flex-end; }
    .entry-editor form { padding: 20px; }
    .entry-viewer-heading, .entry-viewer-content, .entry-viewer-footer { padding-right: 18px; padding-left: 18px; }
    .entry-viewer-footer { align-items: stretch; flex-direction: column; }
    .entry-viewer-footer button { width: 100%; }
    .diary-list { padding: 0; }
    .log-heading { gap: 6px; padding-right: 8px; padding-left: 8px; }
    .log-heading h2 { font-size: 12px; }
    .log-heading-date strong { font-size: 11px; }
    .log-heading-date span { font-size: 8px; }
    .log-page-header { gap: 7px; padding-right: 3px; padding-left: 8px; }
    .log-nav-controls { width: 81px; height: 64px; }
    .log-nav-button { width: 30px; height: 30px; }
    .log-theme-button, .log-editor-toggle { width: 30px; height: 30px; }
    .log-nav-newer { left: 34px; }
    .log-theme-button { top: 34px; left: 17px; }
    .log-editor-toggle { top: 34px; left: 51px; }
    .log-tool-button { padding-right: 7px; padding-left: 7px; }
    .log-page-editor, .log-page-preview { width: calc(100% - 40px); min-height: 340px; margin-right: 10px; margin-left: 30px; padding-right: 10px; padding-left: 7px; }
    .log-page-footer { grid-template-columns: 1fr auto; padding-left: 34px; }
    .log-page-limit { display: none; }
}

/* Shared tasks */
.tabs a::after { opacity: 0; }
.tabs a.active::after { opacity: 1; }
.task-workspace { display: grid; gap: 18px; }
.task-overview-panel { overflow: hidden; border-radius: 3px; background: var(--surface); box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.task-overview-panel .shared-status { margin: 18px 20px 0; }
.task-overview-panel .task-summary { margin: 0 20px; box-shadow: none; }
.task-overview-panel .task-view-actions { padding: 16px 20px 20px; }
.project-overview-add { margin: 0; }
.task-create-children { display: grid; gap: 10px; }
.task-add-draft { justify-self: start; }
.task-draft-list { display: grid; gap: 8px; }
.task-draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.task-draft-row input { width: 100%; }
.task-draft-row .icon-action { width: 42px; height: 42px; }
.task-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border-radius: 3px; background: var(--border); box-shadow: 0 3px 8px rgba(15, 15, 20, .2); }
.task-summary div { display: grid; gap: 4px; padding: 17px 22px; background: var(--surface); }
.task-summary strong { color: var(--accent); font-size: 23px; }
.task-summary span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.task-view-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.task-view-actions button { min-width: 130px; }
.task-completed-filter { display: inline-flex; align-items: center; gap: 8px; color: #c5c5cb; font-size: 11px; cursor: pointer; }
.task-completed-filter input { width: 16px; height: 16px; accent-color: var(--accent); }
.project-list { display: grid; gap: 18px; }
.task-empty { border-radius: 3px; background: var(--surface); box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.project-card { overflow: hidden; border-left: 5px solid var(--accent); border-radius: 3px; background: var(--surface); box-shadow: 0 4px 14px rgba(15, 15, 20, .35); }
.project-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 24px; }
.project-card-body { min-width: 0; }
.project-title { overflow-wrap: anywhere; font-size: 21px; }
.project-description { margin: 8px 0 12px; overflow-wrap: anywhere; color: #c6c6cc; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.project-actions { padding-top: 2px; }
.project-tasks-section { padding: 18px 20px 22px; border-top: 1px solid var(--border); background: #181821; }
.project-tasks-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.project-tasks-heading strong { color: var(--accent); font-size: 12px; text-transform: uppercase; }
.project-tasks-heading span { color: var(--muted); font-size: 9px; }
.project-task-list { display: grid; gap: 12px; }
.task-card { overflow: hidden; border-left: 3px solid #777786; border-radius: 3px; background: var(--surface); box-shadow: 0 2px 7px rgba(15, 15, 20, .25); }
.task-card.completed { border-left-color: #4caf50; }
.project-card.collapsed, .task-card.collapsed { box-shadow: 0 2px 6px rgba(15, 15, 20, .24); }
.task-card-top { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: start; gap: 15px; padding: 22px 24px; }
.task-card-body { min-width: 0; }
.task-title { margin: 0; overflow-wrap: anywhere; font-size: 16px; }
.task-description { margin: 8px 0 12px; overflow-wrap: anywhere; color: #c6c6cc; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.task-card.completed .task-title { color: var(--muted); text-decoration: line-through; }
.task-actions { padding-top: 1px; }
.collapse-action { color: var(--accent); }
.entry-action.icon-action { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; }
.entry-action.icon-action:disabled { cursor: default; opacity: .65; }
.icon-action svg, .task-add-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shared-checkbox {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin: 0;
    appearance: none;
    border: 2px solid #555563;
    border-radius: 3px;
    color: #191923;
    background: #191923;
    cursor: pointer;
}
.shared-checkbox:hover { border-color: var(--accent); }
.shared-checkbox:checked { border-color: var(--accent); background: var(--accent); }
.shared-checkbox:checked::after { content: "✓"; display: grid; place-items: center; width: 100%; height: 100%; font-size: 15px; font-weight: 900; line-height: 1; }
.shared-checkbox:disabled { cursor: wait; opacity: .55; }
.task-children-section { padding: 16px 14px 18px; border-top: 1px solid var(--border); border-left: 2px solid #343440; background: #1d1d27; }
.task-children-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.task-children-heading strong { color: #d2d2d7; font-size: 10px; text-transform: uppercase; }
.task-children-heading span { color: var(--muted); font-size: 9px; }
.task-children-list { display: grid; gap: 10px; }
.task-add-button { display: grid; place-items: center; width: 38px; height: 38px; margin: 12px 0 0 auto; padding: 0; border: 1px solid #555563; border-radius: 3px; color: var(--accent); background: #23232e; cursor: pointer; }
.task-add-button:hover, .task-add-button:focus-visible { border-color: var(--accent); background: #2a2933; }
.project-actions .task-add-button, .task-actions .task-add-button { width: 30px; height: 30px; margin: 0; }
.drag-handle { width: 22px; height: 24px; padding: 0; border: 0; color: #777786; background: transparent; cursor: grab; font-size: 15px; font-weight: 900; line-height: 24px; letter-spacing: -5px; touch-action: none; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--accent); }
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: .42 !important; }
.project-card.drop-before, .task-card.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.project-card.drop-after, .task-card.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.project-list.drop-inside, .project-tasks-section.drop-inside, .task-card.drop-inside, .task-children-section.drop-inside { outline: 2px dashed var(--accent); outline-offset: 3px; }

@media (max-width: 640px) {
    .task-summary div { padding: 14px; }
    .task-summary strong { font-size: 20px; }
    .project-card-top { grid-template-columns: auto minmax(0, 1fr); padding: 18px 16px; }
    .project-actions { grid-column: 2; justify-content: flex-start; }
    .project-tasks-section { padding: 15px 12px 18px; }
    .task-card-top { grid-template-columns: auto auto minmax(0, 1fr); padding: 18px 16px; }
    .task-actions { grid-column: 3; justify-content: flex-start; }
    .task-children-section { padding: 14px 8px 16px; }
}

/* Shared files */
.files-workspace { display: grid; gap: 16px; }
.files-toolbar { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(260px, 1fr) auto; align-items: end; gap: 20px; padding: 22px 24px; border-radius: 3px; background: var(--surface); box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.files-quota { display: grid; gap: 9px; }
.files-quota-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.files-quota-label strong { color: var(--text); font-size: 12px; }
.files-quota-label span { color: var(--muted); font-size: 10px; }
.files-quota progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 0; color: var(--accent); background: #2a2933; appearance: none; }
.files-quota progress::-webkit-progress-bar { background: #2a2933; }
.files-quota progress::-webkit-progress-value { background: var(--accent); }
.files-quota progress::-moz-progress-bar { background: var(--accent); }
.files-search { display: grid; gap: 7px; color: #aaaab1; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.files-search input { height: 40px; padding: 0 12px; }
.files-toolbar-actions { display: flex; gap: 8px; }
.files-toolbar-actions button { min-height: 40px; padding: 0 15px; white-space: nowrap; }
.files-primary-button { border: 0; border-radius: 2px; color: #191923; background: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.files-primary-button:hover { background: #ffd044; }
.files-primary-button:disabled, .files-toolbar-actions button:disabled { cursor: wait; opacity: .55; }
.files-drop-zone { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 142px; padding: 24px; border: 2px dashed #57515f; border-radius: 3px; color: var(--muted); background: rgba(32, 32, 42, .58); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.files-drop-zone:hover, .files-drop-zone:focus, .files-drop-zone.dragging { border-color: var(--accent); outline: 0; color: var(--text); background: rgba(234, 216, 189, .09); }
.files-drop-zone.dragging { transform: scale(1.006); }
.files-drop-zone[aria-disabled="true"] { cursor: wait; opacity: .55; }
.drop-zone-icon { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 28px; }
.files-drop-zone div { display: grid; gap: 7px; }
.files-drop-zone strong { color: var(--text); font-size: 15px; }
.files-drop-zone div span { color: var(--muted); font-size: 10px; }
.files-breadcrumb { display: flex; align-items: center; gap: 7px; min-width: 0; overflow-x: auto; padding: 4px 1px; color: #777780; }
.files-breadcrumb button { padding: 5px 7px; border: 0; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
.files-breadcrumb button:hover, .files-breadcrumb button.active { color: var(--accent); }
.files-upload-progress { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid rgba(234, 216, 189, .3); color: var(--accent); background: rgba(234, 216, 189, .06); font-size: 11px; }
.upload-progress-heading, .upload-progress-details { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.upload-progress-heading strong { min-width: 0; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-heading span { flex: 0 0 auto; font-weight: 800; }
.files-upload-progress progress { width: 100%; height: 9px; overflow: hidden; border: 0; color: var(--accent); background: #2a2933; appearance: none; }
.files-upload-progress progress::-webkit-progress-bar { background: #2a2933; }
.files-upload-progress progress::-webkit-progress-value { background: var(--accent); }
.files-upload-progress progress::-moz-progress-bar { background: var(--accent); }
.upload-progress-details { color: var(--muted); font-size: 9px; }
.files-panel { overflow: hidden; border-radius: 3px; background: var(--surface); box-shadow: 0 3px 8px rgba(15, 15, 20, .28); }
.files-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.files-list-heading > div:first-child { display: grid; min-width: 0; gap: 5px; }
.files-list-heading strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.files-list-heading > div:first-child span { color: var(--muted); font-size: 9px; }
.files-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.files-selection-tools { display: flex; align-items: center; gap: 7px; }
.files-selection-tools[hidden] { display: none; }
.files-selection-tools strong { color: var(--accent); font-size: 10px; }
.files-selection-tools button { padding: 7px 9px; border: 1px solid #55515d; color: var(--text); background: transparent; font-size: 9px; }
.files-selection-tools button:hover { border-color: var(--accent); color: var(--accent); }
.files-view-switch { display: flex; flex: 0 0 auto; overflow: hidden; border: 1px solid #44414b; }
.files-view-switch button { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border: 0; border-right: 1px solid #44414b; color: var(--muted); background: transparent; font-size: 9px; }
.files-view-switch button:last-child { border-right: 0; }
.files-view-switch button:hover { color: var(--text); }
.files-view-switch button[aria-pressed="true"] { color: #191923; background: var(--accent); }
.files-list { display: grid; }
.files-row { position: relative; min-width: 0; background: #20202a; transition: border-color .16s, background .16s, opacity .16s; }
.files-row:hover { background: #1d1d27; }
.files-row.selected { border-color: var(--accent); background: rgba(234, 216, 189, .09); }
.files-row.dragging-file { opacity: .42; }
.files-row.file-drag-over { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -3px; background: rgba(234, 216, 189, .14); }
.file-select-checkbox { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.file-selection-spacer { width: 17px; height: 17px; }
.file-kind-icon { position: relative; display: grid; place-items: center; flex: 0 0 auto; font-weight: 900; }
.folder-icon { width: 78px; height: 54px; margin-top: 10px; border-radius: 4px; color: #3b2b0d; background: #e0ad42; box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 5px 12px rgba(0, 0, 0, .2); }
.folder-icon::before { content: ""; position: absolute; bottom: calc(100% - 4px); left: 5px; width: 31px; height: 12px; border-radius: 4px 5px 0 0; background: #e0ad42; }
.file-kind-icon.file-icon { width: 60px; height: 76px; border: 2px solid #aaa3b0; border-radius: 2px; color: var(--accent); background: #292833; font-size: 11px; letter-spacing: .05em; box-shadow: 0 5px 12px rgba(0, 0, 0, .2); }
.file-kind-icon.file-icon::before { content: ""; position: absolute; top: -2px; right: -2px; border: 11px solid transparent; border-top-color: #aaa3b0; border-right-color: #aaa3b0; }
.file-preview { position: relative; width: min(100%, 150px); height: 92px; flex: 0 0 auto; overflow: hidden; border: 1px solid #464450; border-radius: 3px; background: #111117; box-shadow: 0 5px 12px rgba(0, 0, 0, .2); }
.file-preview img, .file-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-type-badge { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; color: #191923; background: rgba(234, 216, 189, .92); font-size: 7px; font-weight: 900; letter-spacing: .04em; }
.file-details { display: grid; min-width: 0; gap: 5px; }
.file-name { width: fit-content; max-width: 100%; padding: 0; overflow: hidden; border: 0; color: var(--text); background: transparent; font-size: 12px; font-weight: 700; text-align: left; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.file-name:hover { color: var(--accent); }
.file-details small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.file-type { overflow: hidden; color: #96969f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { flex-wrap: wrap; justify-content: flex-end; }
.files-empty { margin: 0; background: transparent; }
.files-help { margin: 0; color: var(--muted); font-size: 9px; text-align: right; }

.grid-view { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; padding: 18px; }
.grid-view .files-row { display: flex; min-height: 218px; flex-direction: column; align-items: center; gap: 13px; padding: 20px 14px 14px; border: 1px solid #353440; border-radius: 3px; text-align: center; }
.grid-view .file-select-checkbox { position: absolute; top: 10px; left: 10px; z-index: 2; }
.grid-view .file-selection-spacer { display: none; }
.grid-view .file-kind-icon, .grid-view .file-preview { margin-bottom: 4px; }
.grid-view .file-details { justify-items: center; width: 100%; }
.grid-view .file-name { display: -webkit-box; width: 100%; min-height: 34px; max-width: 100%; overflow: hidden; line-height: 1.4; overflow-wrap: anywhere; text-align: center; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.grid-view .file-details small { width: 100%; line-height: 1.4; white-space: normal; }
.grid-view .file-type { display: none; }
.grid-view .file-actions { justify-content: center; margin-top: auto; }
.grid-view .files-empty { grid-column: 1 / -1; }

.list-view .files-row { display: grid; grid-template-columns: 18px 58px minmax(0, 1fr) minmax(110px, 180px) auto; align-items: center; gap: 13px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.list-view .files-row:last-child { border-bottom: 0; }
.list-view .folder-icon { width: 45px; height: 31px; margin: 4px 0 0; border-radius: 2px; }
.list-view .folder-icon::before { left: 3px; width: 18px; height: 7px; border-radius: 2px 3px 0 0; }
.list-view .file-kind-icon.file-icon { width: 31px; height: 39px; margin-left: 7px; border-width: 1px; font-size: 7px; }
.list-view .file-kind-icon.file-icon::before { top: -1px; right: -1px; border-width: 6px; }
.list-view .file-preview { width: 50px; height: 42px; }
.list-view .preview-type-badge { right: 2px; bottom: 2px; padding: 2px 3px; font-size: 5px; }

.file-dialog { width: min(92vw, 660px); max-height: 88vh; padding: 0; overflow: hidden; border: 1px solid #4d4955; border-radius: 4px; color: var(--text); background: #20202a; box-shadow: 0 22px 70px rgba(0, 0, 0, .65); }
.file-dialog::backdrop { background: rgba(7, 7, 11, .82); backdrop-filter: blur(3px); }
.file-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.file-dialog-heading h2 { margin: 2px 0 0; font-size: 17px; }
.file-dialog > .muted { margin: 0; padding: 16px 20px 10px; color: var(--muted); font-size: 11px; }
.file-move-folders { display: grid; max-height: min(56vh, 440px); padding: 8px 12px 16px; overflow-y: auto; }
.move-folder-option { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 8px 12px 8px calc(12px + var(--folder-depth) * 14px); border: 0; border-bottom: 1px solid var(--border); color: var(--text); background: transparent; text-align: left; }
.move-folder-option:hover:not(:disabled) { color: var(--accent); background: rgba(234, 216, 189, .07); }
.move-folder-option:disabled { opacity: .35; cursor: not-allowed; }
.move-folder-icon { color: #e0ad42; font-size: 20px; }
.move-folder-label { display: grid; min-width: 0; gap: 3px; }
.move-folder-label strong, .move-folder-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-folder-label strong { font-size: 11px; }
.move-folder-label small { color: var(--muted); font-size: 8px; }
.file-open-dialog { width: min(94vw, 960px); }
.file-open-content { display: grid; place-items: center; min-height: 220px; max-height: 65vh; overflow: auto; padding: 20px; background: #121219; }
.file-open-content > img, .file-open-content > video { display: block; max-width: 100%; max-height: calc(65vh - 40px); object-fit: contain; }
.file-open-content > audio { width: min(100%, 560px); }
.file-text-preview { width: 100%; min-height: 180px; margin: 0; color: #e9e7ed; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.file-preview-note { justify-self: start; margin: 12px 0 0; color: var(--muted); font-size: 9px; }
.file-open-message { display: grid; justify-items: center; gap: 18px; max-width: 480px; color: var(--muted); text-align: center; }
.file-open-message .files-primary-button { padding: 11px 14px; text-decoration: none; }
.file-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); }
.file-dialog-actions > * { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 13px; text-decoration: none; }

@media (max-width: 900px) {
    .files-toolbar { grid-template-columns: 1fr 1fr; }
    .files-toolbar-actions { grid-column: 1 / -1; }
    .list-view .files-row { grid-template-columns: 18px 58px minmax(0, 1fr) auto; }
    .list-view .file-type { display: none; }
}

@media (max-width: 640px) {
    .tabs { padding-right: 16px; }
    .files-toolbar { grid-template-columns: 1fr; padding: 18px; }
    .files-toolbar-actions { grid-column: auto; }
    .files-toolbar-actions button { flex: 1; padding-right: 9px; padding-left: 9px; }
    .files-drop-zone { min-height: 120px; flex-direction: column; gap: 12px; padding: 18px; text-align: center; }
    .drop-zone-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 23px; }
    .upload-progress-details { align-items: flex-start; flex-direction: column; gap: 5px; }
    .files-list-heading { align-items: flex-start; padding: 15px; }
    .files-heading-actions { align-items: flex-end; flex-direction: column-reverse; }
    .files-selection-tools { flex-wrap: wrap; justify-content: flex-end; }
    .files-view-switch button { padding: 8px; }
    .files-view-switch button span { display: none; }
    .grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 10px; }
    .grid-view .files-row { min-height: 210px; padding-right: 8px; padding-left: 8px; }
    .grid-view .file-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 100%; }
    .grid-view .file-actions .entry-action { width: 100%; padding-right: 3px; padding-left: 3px; }
    .list-view .files-row { grid-template-columns: 18px 45px minmax(0, 1fr); gap: 10px; padding: 14px; }
    .list-view .folder-icon { width: 39px; height: 27px; }
    .list-view .file-kind-icon.file-icon { width: 28px; height: 36px; margin-left: 5px; }
    .list-view .file-actions { grid-column: 3; justify-content: flex-start; }
    .file-dialog-heading { padding: 15px; }
    .file-open-content { min-height: 180px; padding: 12px; }
    .file-dialog-actions { padding: 12px 15px; }
    .files-help { text-align: left; line-height: 1.5; }
}

.withdrawal-form { display: grid; grid-template-columns: minmax(150px, .65fr) minmax(250px, 1.25fr) minmax(220px, 1fr) auto; align-items: end; gap: 14px; padding: 24px; }
.withdrawal-form label, .withdrawal-confirm-form label { display: grid; gap: 7px; color: #cacacf; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.withdrawal-form input, .withdrawal-confirm-form input { height: 42px; padding: 0 12px; border-radius: 2px; }
.withdrawal-form button, .danger-button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 2px; color: #191923; background: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.withdrawal-form button:hover { background: #ffd044; }
.withdrawal-help { margin: 0; padding: 0 24px 22px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.withdrawal-confirmation { position: relative; display: grid; grid-template-columns: minmax(190px, .8fr) minmax(280px, 1.3fr) minmax(220px, .8fr); align-items: center; gap: 25px; margin-top: 22px; padding: 26px; border: 1px solid rgba(255, 193, 7, .5); border-radius: 3px; background: rgba(255, 193, 7, .06); }
.withdrawal-confirmation h2 { margin-bottom: 8px; }
.withdrawal-confirmation p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.withdrawal-confirmation dl { display: grid; gap: 10px; margin: 0; }
.withdrawal-confirmation dl div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
.withdrawal-confirmation dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.withdrawal-confirmation dd { margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.withdrawal-confirm-form { display: grid; gap: 10px; }
.withdrawal-actions { display: flex; gap: 8px; }
.danger-button { width: 100%; color: #fff; background: #d95555; }
.danger-button:hover { background: #ed6767; }
.withdrawal-cancel-form { position: absolute; right: 26px; bottom: -48px; }
.withdrawal-cancel-form .secondary-button { min-height: 34px; }
.withdrawal-confirmation + .transactions-panel { margin-top: 66px; }

@media (max-width: 1000px) {
    .withdrawal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .withdrawal-form button { align-self: end; }
    .withdrawal-confirmation { grid-template-columns: 1fr 1.4fr; }
    .withdrawal-confirm-form { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: end; }
}

@media (max-width: 640px) {
    .withdrawal-form, .withdrawal-confirmation { grid-template-columns: 1fr; padding: 18px; }
    .withdrawal-confirm-form { grid-column: auto; grid-template-columns: 1fr; }
    .withdrawal-cancel-form { right: 18px; }
    .balance-metrics { grid-template-columns: 1fr; }
}

.pdf-workspace { display: grid; gap: 18px; }
.pdf-upload-panel { display: grid; grid-template-columns: minmax(280px, 1.3fr) minmax(230px, 1fr) auto; align-items: center; gap: 20px; padding: 24px; border: 1px solid var(--border); background: var(--surface); }
.pdf-upload-copy { display: flex; align-items: center; gap: 16px; }
.pdf-upload-copy h2 { margin-bottom: 5px; font-size: 20px; }
.pdf-upload-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pdf-upload-icon { display: grid; place-items: center; width: 52px; height: 66px; flex: 0 0 auto; border: 2px solid var(--accent); color: var(--accent); background: #25231f; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.pdf-file-field { display: grid; gap: 7px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pdf-file-picker { display: flex; align-items: center; min-height: 44px; overflow: hidden; border: 1px solid var(--border); color: var(--muted); background: rgba(255, 255, 255, .025); font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; cursor: pointer; }
.pdf-file-picker strong { align-self: stretch; display: flex; align-items: center; flex: 0 0 auto; padding: 0 12px; border-right: 1px solid var(--border); color: var(--text); background: var(--surface-2); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.pdf-file-picker > span { padding: 0 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-file-field:hover .pdf-file-picker { border-color: var(--accent); }
.pdf-ocr-option { grid-column: 2; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.pdf-ocr-option input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.pdf-upload-actions { grid-column: 3; grid-row: 1 / span 2; display: grid; gap: 8px; min-width: 168px; }
.pdf-upload-actions button { min-height: 44px; padding: 0 18px; }
.pdf-upload-actions button:disabled { opacity: .45; cursor: not-allowed; }
.pdf-preview-dialog { width: min(96vw, 1500px); max-height: 94vh; }
.pdf-preview-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.pdf-preview { display: block; width: 100%; height: 78vh; border: 0; background: #4b4b4b; }
.pdf-preview p { padding: 28px; color: var(--muted); text-align: center; }
.pdf-editor-panel { overflow: hidden; scroll-margin-top: 92px; border: 1px solid var(--border); background: var(--surface); }
.pdf-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.pdf-editor-heading h2 { margin-bottom: 4px; }
.pdf-editor-heading span { color: var(--muted); font-size: 10px; }
.pdf-export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pdf-export-actions button { min-height: 38px; padding: 0 13px; }
.pdf-format-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 5px; padding: 10px 24px; border-bottom: 1px solid var(--border); background: #141310; }
.pdf-format-toolbar button { min-width: 34px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--border); color: var(--text); background: var(--surface-2); font-size: 10px; }
.pdf-format-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.pdf-format-select { display: grid; gap: 3px; margin-right: 3px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pdf-format-select select { height: 32px; min-width: 138px; padding: 0 28px 0 9px; border: 1px solid var(--border); border-radius: 0; color: var(--text); background: var(--surface-2); font-size: 10px; }
.pdf-size-select select { min-width: 74px; }
.pdf-editor { min-height: 560px; margin: 24px auto; padding: 58px 64px; width: min(850px, calc(100% - 48px)); outline: 0; color: #24211d; background: #fffdf8; box-shadow: 0 10px 35px rgba(0, 0, 0, .28); font: 15px/1.65 Georgia, "Times New Roman", serif; }
.pdf-editor:focus { box-shadow: 0 10px 35px rgba(0, 0, 0, .28), 0 0 0 2px var(--accent); }
.pdf-editor h2 { margin: 1.4em 0 .55em; color: #191713; font: 700 22px/1.2 Arial, Helvetica, sans-serif; text-align: center; }
.pdf-editor h2:first-child { margin-top: 0; }
.pdf-editor p { margin: 0 0 1em; }
.pdf-editor ul, .pdf-editor ol { margin: 0 0 1em; padding-left: 26px; }
.pdf-editor-help { margin: 0; padding: 0 24px 20px; color: var(--muted); font-size: 9px; text-align: center; }
.pdf-editor.pdf-layout-editor { display: grid; justify-items: center; gap: 24px; width: 100%; min-height: 560px; margin: 0; padding: 24px; overflow: auto; color: #111; background: #17171d; box-shadow: none; }
.pdf-layout-editor .pdf-page { position: relative; flex: 0 0 auto; overflow: hidden; background: #fff; box-shadow: 0 12px 35px rgba(0, 0, 0, .42); }
.pdf-page-background { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none; }
.pdf-editor .pdf-text-block { position: absolute; z-index: 1; min-width: 8px; margin: 0; padding: 0; overflow: visible; outline: 0; border: 0; color: #111; background: transparent; font-weight: 400; line-height: 1; white-space: nowrap; }
.pdf-editor h2.pdf-text-block { margin: 0; font-weight: 700; line-height: 1; }
.pdf-text-block:hover { outline: 1px dashed rgba(23, 116, 210, .55); outline-offset: 2px; }
.pdf-text-block:focus { outline: 2px solid #1774d2; outline-offset: 2px; background: rgba(255, 255, 255, .72); }

@media (max-width: 900px) {
    .pdf-upload-panel { grid-template-columns: 1fr 1fr; }
    .pdf-upload-copy { grid-column: 1 / -1; }
    .pdf-ocr-option { grid-column: 1 / -1; grid-row: 3; }
    .pdf-upload-actions { grid-column: 1 / -1; grid-row: auto; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .pdf-upload-panel { grid-template-columns: 1fr; padding: 18px; }
    .pdf-upload-copy, .pdf-ocr-option { grid-column: auto; grid-row: auto; }
    .pdf-upload-actions { grid-column: auto; grid-template-columns: 1fr; width: 100%; }
    .pdf-editor-heading { align-items: flex-start; flex-direction: column; padding: 18px; }
    .pdf-export-actions { justify-content: flex-start; }
    .pdf-format-toolbar { padding: 10px 12px; }
    .pdf-preview-dialog { width: 98vw; max-height: 96vh; }
    .pdf-preview { height: 72vh; }
    .pdf-format-select:first-child { flex: 1 1 145px; }
    .pdf-format-select:first-child select { width: 100%; }
    .pdf-editor { min-height: 480px; width: calc(100% - 20px); margin: 10px; padding: 28px 20px; font-size: 14px; }
}

/* Grouped sidebar navigation */
.topbar { justify-content: flex-start; }
.topbar::after { display: none; }
.topbar > form { width: 100%; margin-top: auto; }
.sidebar-collapse-toggle {
    position: absolute;
    top: 118px;
    right: -14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: 1px solid #42424f;
    border-radius: 50%;
    color: var(--accent);
    background: #20202a;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
    font-size: 21px;
    line-height: 1;
}
.sidebar-collapse-toggle:hover { border-color: var(--accent); background: #292934; }
.sidebar-nav {
    display: grid;
    flex: 1 1 auto;
    align-self: stretch;
    align-content: start;
    gap: 26px;
    min-height: 0;
    margin: 46px -8px 20px 0;
    padding-right: 8px;
    overflow-y: auto;
    scrollbar-color: #555563 transparent;
    scrollbar-width: thin;
}
.nav-group { display: grid; gap: 9px; }
.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    border: 0;
    color: #777780;
    background: transparent;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .16em;
    text-align: left;
    text-transform: uppercase;
}
.nav-group-toggle:hover { color: var(--text); }
.nav-chevron { font-size: 13px; transition: transform .18s ease; }
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-links { display: none; }
.nav-links { display: grid; gap: 3px; }
.nav-links a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .05em;
    text-decoration: none;
}
.nav-links a::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 2px; background: transparent; }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-links a.active { color: #191923; background: var(--accent); }
.nav-links a.active::before { background: #191923; }

@media (min-width: 761px) {
    .dashboard-page, .topbar { transition: padding-left .2s ease, width .2s ease; }
    .dashboard-page.sidebar-collapsed { padding-left: 72px; }
    .sidebar-collapsed .topbar { width: 72px; padding: 28px 14px; }
    .sidebar-collapsed .brand div, .sidebar-collapsed .sidebar-nav, .sidebar-collapsed .topbar > form { display: none; }
    .sidebar-collapsed .brand-small { width: 44px; height: 44px; }
    .sidebar-collapsed .sidebar-collapse-toggle { top: 84px; }
}

@media (max-width: 1100px) and (min-width: 761px) {
    .sidebar-nav { margin-top: 40px; }
    .nav-links a { padding-right: 9px; padding-left: 9px; font-size: 9px; }
}

@media (max-width: 760px) {
    .dashboard-page { padding-top: 142px; }
    .topbar { justify-content: space-between; }
    .topbar > form { width: auto; margin-top: 0; }
    .sidebar-collapse-toggle { position: static; flex: 0 0 auto; width: 32px; height: 32px; font-size: 20px; }
    .sidebar-nav {
        position: absolute;
        top: 72px;
        right: 0;
        left: 0;
        display: flex;
        gap: 24px;
        height: 70px;
        margin: 0;
        padding: 10px 18px 9px;
        overflow-x: auto;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        background: rgba(32, 32, 42, .98);
        box-shadow: 0 4px 12px rgba(15, 15, 20, .28);
        scrollbar-width: thin;
    }
    .nav-group { flex: 0 0 auto; gap: 5px; }
    .nav-group.active-group { order: -1; }
    .nav-group-toggle { min-height: 12px; font-size: 7px; }
    .nav-chevron { margin-left: 12px; font-size: 11px; }
    .nav-links { display: flex; gap: 3px; }
    .nav-links a { min-height: 32px; padding: 0 10px; white-space: nowrap; }
    .nav-links a::before { display: none; }
    .dashboard-page.sidebar-collapsed { padding-top: 72px; }
    .sidebar-collapsed .sidebar-nav { display: none; }
}

@media (max-width: 640px) {
    .sidebar-nav { padding-right: 12px; padding-left: 12px; }
    .nav-links a { padding-right: 8px; padding-left: 8px; font-size: 9px; }
}

@media print {
    @page { size: auto; margin: 0; }
    html, body { min-height: 0; background: #fff !important; }
    body * { visibility: hidden !important; }
    #pdf-editor, #pdf-editor * { visibility: visible !important; }
    #pdf-editor {
        position: absolute;
        inset: 0;
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0;
        color: #000;
        background: #fff;
        box-shadow: none;
    }
    #pdf-editor h2, #pdf-editor p, #pdf-editor li { break-inside: avoid; }
    #pdf-editor.pdf-layout-editor { position: absolute; inset: 0; display: block; width: auto; min-height: 0; margin: 0; padding: 0; overflow: visible; }
    .pdf-layout-editor .pdf-page { width: var(--page-width) !important; height: var(--page-height) !important; margin: 0; break-after: page; aspect-ratio: auto !important; box-shadow: none; }
    .pdf-layout-editor .pdf-page:last-child { break-after: auto; }
    .pdf-text-block:hover, .pdf-text-block:focus { outline: 0; background: transparent; }
}
