.super-admin, .admin-compact {
    --sa-navy: #11283d;
    --sa-teal: #176776;
    --sa-text: #1c3549;
    --sa-muted: #4f6474;
    --sa-line: #d8e3eb;
    --sa-canvas: #f3f7fa;
    color: var(--sa-text);
    font: 15px/1.5 Inter, system-ui, sans-serif;
}
.super-admin {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    align-items: start;
    min-height: min(850px, 86vh);
    border: 1px solid var(--sa-line);
    border-radius: 14px;
    background: var(--sa-canvas);
}
.super-admin.sa-collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.sa-nav {
    position: sticky;
    top: 12px;
    max-height: calc(100dvh - 24px);
    min-height: min(850px, 86vh);
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    border-radius: 13px 0 0 13px;
    background: var(--sa-navy);
    color: #dce8f2;
}
.sa-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 2px 4px 14px; border-bottom: 1px solid #365064; }
.sa-brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: .035em; white-space: nowrap; }
.sa-brand small { display: block; color: #a9c6d9; font-size: 12px; }
.sa-brand-icon { display: grid; flex: 0 0 36px; height: 36px; place-items: center; border-radius: 9px; background: #1d6878; color: #fff; }
.sa-nav-toggle { margin-left: auto; padding: 6px; border-radius: 6px; color: #dce8f2; }
.sa-nav-toggle:hover, .sa-exit:hover, .sa-nav-items button:hover { background: #22465b; }
.sa-nav-items { display: grid; gap: 2px; overflow-y: auto; }
.sa-nav-items button, .sa-exit {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 35px;
    padding: 7px 10px;
    border-radius: 7px;
    text-align: left;
    font-size: 14px;
    font-weight: 650;
}
.sa-nav-items button i, .sa-exit i { flex: 0 0 17px; text-align: center; color: #a4cee1; }
.sa-nav-items button[aria-current] { background: #1d6574; color: white; }
.sa-nav-items button[aria-current] i { color: white; }
.sa-exit { margin-top: auto; }
.sa-collapsed .sa-nav { align-items: stretch; }
.sa-collapsed .sa-brand { flex-direction: column; padding: 0 0 8px; }
.sa-collapsed .sa-brand > div, .sa-collapsed .sa-nav-items span, .sa-collapsed .sa-exit span { display: none; }
.sa-collapsed .sa-brand-icon { width: 34px; flex-basis: 34px; }
.sa-collapsed .sa-nav-toggle { margin: 0; }
.sa-collapsed .sa-nav-items button, .sa-collapsed .sa-exit { justify-content: center; }
.sa-main, .sa-content { min-width: 0; }
.sa-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--sa-line);
    border-radius: 0 13px 0 0;
    background: #fff;
}
.sa-search { display: flex; flex: 1 1 250px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--sa-line); border-radius: 8px; background: #f9fcfd; color: var(--sa-muted); }
.sa-search input { width: 100%; min-width: 0; padding: 8px 0; background: none; font: inherit; }
.sa-content { display: grid; gap: 14px; padding: 18px; }
.sa-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.sa-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 28px); font-weight: 780; letter-spacing: -.025em; overflow-wrap: anywhere; }
.sa-heading .sa-back { justify-self: end; min-width: 76px; }
.sa-firm-meta { display: flex; flex-wrap: wrap; gap: 6px 15px; color: var(--sa-muted); overflow-wrap: anywhere; }
.sa-panel { min-width: 0; padding: 14px; border: 1px solid var(--sa-line); border-radius: 11px; background: #fff; }
.sa-panel h2 { margin: 0 0 9px; color: var(--sa-navy); font-size: 18px; font-weight: 760; }
.sa-panel .sa-table-wrap + h2 { margin-top: 16px; }
.sa-panel .sa-values { margin-top: 12px; }
.sa-panel p + button, .sa-panel p + .sa-row { margin-top: 10px; }
.sa-muted { color: var(--sa-muted); font-size: 14px; }
.sa-state { padding: 12px; border-radius: 8px; border: 1px solid #cee0eb; background: #edf5fa; }
.super-admin.sa-state { display: block; min-height: 0; }
.sa-error { border-color: #e5b8b8; background: #fff2f1; color: #9b2828; }
.sa-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sa-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 6px 11px;
    border: 1px solid #c5d6df;
    border-radius: 8px;
    background: #fff;
    color: var(--sa-text);
    font-weight: 700;
}
.sa-button:hover { background: #eaf3f7; }
.sa-primary { border-color: var(--sa-teal); background: var(--sa-teal); color: #fff; }
.sa-primary:hover { background: #115563; }
.sa-danger { border-color: #e3b2b2; color: #a32828; }
.super-admin button:disabled { cursor: not-allowed; opacity: .55; }
.super-admin :is(button, input, select, summary):focus-visible { outline: 2px solid #24869b; outline-offset: 2px; }
.sa-link { color: #155d76; font-weight: 750; text-align: left; }
.sa-link:hover { text-decoration: underline; }
.sa-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(140px, calc((100% - 50px) / 6))), 1fr)); gap: 10px; }
.sa-overview-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.sa-metric {
    display: grid;
    grid-template-columns: 29px 1fr;
    align-items: start;
    gap: 2px 8px;
    min-width: 0;
    min-height: 88px;
    padding: 9px 10px;
    border: 1px solid var(--sa-line);
    border-radius: 9px;
    background: #fff;
    text-align: left;
}
button.sa-metric:hover { border-color: #95bac7; background: #f9fcfd; }
.sa-metric i { grid-row: span 2; display: grid; height: 29px; place-items: center; border-radius: 7px; background: #e7f2f5; color: #176776; }
.sa-metric span { color: var(--sa-muted); font-size: 14px; line-height: 1.25; font-weight: 650; }
.sa-metric strong { color: var(--sa-navy); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sa-overview-metrics .sa-metric { grid-template-columns: 24px minmax(0, 1fr); align-content: start; min-height: 78px; gap: 4px 7px; }
.sa-overview-metrics .sa-metric i { height: 24px; font-size: 12px; }
.sa-overview-metrics .sa-metric span { overflow-wrap: anywhere; font-size: 13px; }
.sa-overview-metrics .sa-metric strong { font-size: 24px; }
.sa-overview-metrics .sa-account-metric { grid-template-columns: minmax(0, 1fr); }
.sa-overview-metrics .sa-account-metric:nth-child(1) { background: #eaf3fc; border-color: #cbdff1; }
.sa-overview-metrics .sa-account-metric:nth-child(2) { background: #edf5eb; border-color: #d3e4d0; }
.sa-overview-metrics .sa-account-metric:nth-child(3) { background: #f2edf8; border-color: #ded2eb; }
.sa-overview-metrics .sa-account-metric:nth-child(4) { background: #fbf1e5; border-color: #ecd9c2; }
.sa-overview-metrics .sa-account-metric:nth-child(5) { background: #e7f4f2; border-color: #cbe3df; }
.sa-overview-metrics .sa-account-metric:nth-child(6) { background: #f9edef; border-color: #eed3da; }
.sa-overview-metrics button.sa-metric { cursor: pointer; transition: box-shadow 140ms ease, border-color 140ms ease; }
.sa-overview-metrics button.sa-metric:hover { box-shadow: 0 2px 7px rgb(18 53 73 / 13%); }
.sa-stat-help { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sa-line); }
.sa-stat-help summary { width: fit-content; color: var(--sa-teal); cursor: pointer; font-weight: 700; }
.sa-stat-help > div { display: grid; gap: 8px; margin-top: 9px; }
.sa-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sa-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(165px, calc((100% - 16px) / 3))), 1fr)); gap: 8px; }
.sa-values > div { padding: 10px; border: 1px solid var(--sa-line); border-radius: 8px; background: #f9fcfd; overflow-wrap: anywhere; }
.sa-values dt { color: var(--sa-muted); font-size: 13px; }
.sa-values dd { margin: 3px 0 0; font-weight: 750; }
.sa-copy { margin-inline-start: 5px; color: #155d76; font-size: 12px; text-decoration: underline; }
.sa-bars { display: grid; gap: 9px; }
.sa-bars .sa-row { justify-content: space-between; }
.sa-bar { height: 7px; margin-top: 3px; border-radius: 8px; background: #e7eff3; overflow: hidden; }
.sa-bar span { display: block; height: 100%; border-radius: inherit; background: var(--sa-teal); }
.sa-form { display: grid; justify-items: start; gap: 11px; min-width: 0; width: min(100%, 560px); }
.sa-panel > .sa-form { margin-block: 12px; }
.sa-form > .sa-label, .sa-form > .sa-state { width: 100%; min-width: 0; overflow-wrap: anywhere; }
.sa-form fieldset { margin: 0; padding: 0; border: 0; }
.sa-module-status > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--sa-line); }
.sa-module-status dt { font-weight: 700; }
.sa-module-status dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.sa-row, .sa-table-tools, .sa-form-row, .sa-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sa-form-row { align-items: flex-end; margin-top: 9px; }
.sa-label { display: grid; gap: 4px; min-width: 0; max-width: 100%; color: var(--sa-muted); font-size: 13px; font-weight: 700; }
.sa-label :is(input, select, textarea) {
    min-width: 0;
    min-height: 40px;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid #c5d6df;
    border-radius: 7px;
    background: #fff;
    color: var(--sa-text);
    font-size: 14px;
}
.sa-form-row input[type="number"] { width: 104px; }
.sa-form-row + .sa-muted, .sa-label + .sa-row { margin-top: 10px; }
.sa-table-tools { justify-content: flex-end; margin-bottom: 10px; }
.sa-table-tools h2, .sa-pagination span { margin: 0 auto 0 0; }
.sa-table-wrap { overflow-x: auto; border: 1px solid var(--sa-line); border-radius: 8px; }
.sa-table { width: 100%; border-collapse: collapse; color: var(--sa-text); font-size: 13px; }
.sa-table th, .sa-table td { padding: 8px 9px; border-bottom: 1px solid var(--sa-line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.sa-table th { background: #edf3f7; color: #3e596d; font-weight: 750; }
.sa-table tr:last-child td { border: 0; }
.sa-table tbody tr:hover { background: #f7fbfd; }
.sa-table small { display: block; color: var(--sa-muted); font-size: 12px; overflow-wrap: anywhere; }
.sa-company-name { margin-right: 5px; overflow-wrap: anywhere; }
.sa-detail-link { min-height: 34px; padding: 4px 7px; }
.sa-table td:last-child .sa-link { white-space: nowrap; }
.sa-company-table th, .sa-company-table td { padding-inline: 7px; }
.sa-company-table td:nth-child(8) { font-size: 12px; }
.sa-last-use time { white-space: nowrap; }
.sa-firm-meta .sa-last-use small { font-size: inherit; }
.sa-pagination { margin-top: 10px; color: var(--sa-muted); font-size: 12px; }
.sa-tabs { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--sa-line); border-radius: 8px; background: #fff; }
.sa-tabs button { padding: 6px 10px; border-radius: 5px; color: var(--sa-muted); font-weight: 700; }
.sa-tabs button[aria-current] { background: #deedf1; color: #125b6a; }
.sa-feed { display: grid; gap: 8px; margin-top: 10px; }
.sa-feed article { padding: 10px; border: 1px solid var(--sa-line); border-radius: 8px; overflow-wrap: anywhere; }
.sa-feed details { margin-top: 8px; }
.sa-feed pre { overflow-x: auto; }
.sa-event-heading { justify-content: space-between; }
.sa-event-heading time { color: var(--sa-muted); font-size: 12px; }
.sa-bulk { margin-top: 10px; }
.sa-bulk ul { max-height: 180px; margin-bottom: 10px; padding: 8px 18px; overflow: auto; list-style: disc; background: var(--sa-canvas); }
.sa-bulk li { overflow-wrap: anywhere; }

.admin-compact { display: grid; gap: 9px; padding: 6px; margin: 0 auto; width: min(100%, 680px); }
.admin-compact .ac-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cddce4;
    border-radius: 9px;
    background: #fff;
    color: #203d52;
    text-align: left;
}
.admin-compact .ac-row strong, .admin-compact .ac-row small { display: block; overflow-wrap: anywhere; }
.admin-compact .ac-row small { color: #476276; font-size: 11px; }
.admin-compact .ac-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.admin-compact .ac-list { display: grid; gap: 6px; margin-top: 10px; }
.admin-compact .ac-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 7px; }
.admin-compact .ac-metrics button { min-width: 0; min-height: 48px; overflow-wrap: anywhere; }
.admin-compact .ac-metrics button > div:has(> i) { display: none; }
.admin-compact .ac-metric { color: #203d52; }
.admin-compact .ac-metric small { color: #476276; }
.admin-compact .ac-header { background: #163b51; color: #fff; }
.admin-compact .ac-header button { color: #203d52; }
.admin-compact [data-android-action="primary"].ac-row { background: #fff !important; color: #203d52 !important; }
.ac-detail { background: var(--sa-canvas); min-width: 0; border-radius: 12px; }
.ac-detail-header { position: sticky; top: 0; z-index: 2; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--sa-line); }
.ac-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.ac-controls input[type="number"] { width: 78px; }
.ac-controls + .ac-controls { margin-top: 10px; }
.ac-button { padding: 6px 9px; min-height: 38px; border: 1px solid var(--sa-line); border-radius: 7px; background: #fff; color: #23495e; font-size: 13px; font-weight: 750; }
.ac-section { background: #fff; border: 1px solid var(--sa-line); border-radius: 10px; }
.ac-section summary { cursor: pointer; font-weight: 750; padding: 11px; }
.ac-section > section { margin: 7px; }
.ac-detail-metrics, .ac-plan-dates { display: grid; gap: 6px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ac-detail-metrics > div, .ac-plan-dates > div { border-radius: 8px; border: 1px solid var(--sa-line); background: #fff; padding: 7px; }
.ac-detail-metrics strong { display: block; font-size: 19px; line-height: 1.2; }
.ac-detail-metrics small, .ac-plan-dates small { color: var(--sa-muted); font-size: 11px; font-weight: 650; }
.ac-plan-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: 8px; }
.ac-plan-dates strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.ac-plan { background: #fff; border: 1px solid var(--sa-line); border-radius: 11px; padding: 10px; }
.ac-plan h4 { color: var(--sa-navy); font-size: 16px; font-weight: 760; }
.ac-plan-actions { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.ac-primary { background: #176776; border-color: #176776; color: white; }
.ac-danger { background: #fff4f1; border-color: #eac9bb; color: #913923; }
.ac-extra { padding: 0 8px 8px; }
.admin-compact :is(button, summary):focus-visible { outline: 2px solid #24869b; outline-offset: 2px; }
.sa-documents { min-width: 0; }
.sa-document-rows { display: grid; gap: 6px; margin-block: 9px; }
.sa-document-rows article {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center; gap: 8px; border: 1px solid var(--sa-line); border-radius: 8px; padding: 8px;
    overflow-wrap: anywhere;
}
.sa-document-rows small { color: var(--sa-muted); }
.sa-doc-preview { display: grid; gap: 8px; min-width: 0; padding: 10px; background: #edf3f7; border-radius: 8px; }
.sa-doc-preview:fullscreen { align-content: start; width: 100%; height: 100%; }
.sa-doc-canvas { overflow: auto; max-height: 68vh; background: #dce7ef; padding: 8px; }
.sa-doc-preview:fullscreen .sa-doc-canvas { max-height: calc(100dvh - 105px); }
.sa-doc-canvas canvas { display: block; max-width: none; margin-inline: auto; background: #fff; }
.sa-doc-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(1120px, calc(100% - 32px));
    max-width: none;
    max-height: min(86dvh, 900px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #b9cbd7;
    border-radius: 12px;
    color: #17334a;
    background: #edf3f7;
    box-shadow: 0 16px 48px #112d4560;
}
.sa-doc-modal::backdrop { background: #102b42a3; }
.sa-doc-modal .sa-doc-preview { display: flex; flex-direction: column; height: min(86dvh, 900px); padding: 14px; }
.sa-doc-modal .sa-doc-preview:fullscreen { height: 100%; border-radius: 0; }
.sa-doc-modal .sa-doc-preview-header { justify-content: space-between; }
.sa-doc-modal .sa-doc-close { min-width: 34px; font-size: 20px; line-height: 18px; }
.sa-doc-modal .sa-doc-canvas, .sa-doc-legacy { flex: 1; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; }
.sa-doc-legacy dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 14px; margin-top: 12px; }
.sa-doc-legacy dt { font-weight: 700; }
.sa-doc-legacy dd { margin: 0; overflow-wrap: anywhere; }
.admin-compact .sa-document-rows article { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-compact .sa-documents :is(.sa-row, .sa-tabs) { flex-wrap: wrap; }
.admin-compact .sa-documents .sa-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-compact .ac-metric small { font-size: 11px; line-height: 1.35; }
.ac-account { display: grid; gap: 7px; padding-block: 6px; }
.ac-account .sa-copy { min-height: 28px; padding: 2px 7px; font-size: 11px; }
@media (max-width: 600px) {
    .sa-document-rows article { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
    .super-admin { grid-template-columns: 184px minmax(0, 1fr); }
    .sa-toolbar, .sa-content { padding: 11px; }
    .sa-table th, .sa-table td { padding: 7px; }
}
@media (max-width: 940px) {
    .sa-overview-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .sa-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .super-admin, .super-admin.sa-collapsed { grid-template-columns: minmax(0, 1fr); }
    .sa-nav { position: static; min-height: 0; max-height: none; border-radius: 13px 13px 0 0; }
    .sa-brand, .sa-collapsed .sa-brand { flex-direction: row; margin-bottom: 5px; padding-bottom: 6px; }
    .sa-collapsed .sa-brand > div { display: block; }
    .sa-nav-toggle, .sa-collapsed .sa-nav-toggle { margin-left: auto; }
    .sa-nav-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sa-collapsed .sa-nav-items { display: none; }
    .sa-exit { margin: 3px 0 0; }
    .sa-toolbar { border-radius: 0; }
    .sa-split { grid-template-columns: minmax(0, 1fr); }
}
