:root {
    --sidebar-width: 232px; --ink: #1b2739; --muted: #566575; --line: #dbe1e7;
    --navy-900: #182d49; --navy-800: #243d60; --navy-700: #2c4871; --navy-500: #385ba0;
    --accent: #2d5293; --night: #18283e; --paper: #f4f5f7;
    --font: Inter, "Segoe UI", Arial, sans-serif;
}
body { font-family: var(--font); color: var(--ink); }
.app-sidebar { background: var(--night); color: white; border: 0; padding: 17px 12px 12px; overflow-y: auto; scrollbar-width: thin; }
.sidebar-brand { padding: 4px 3px 17px; border-bottom: 1px solid #39485c; gap: 9px; }
.sidebar-brand img { width: 37px; height: 37px; object-fit: contain; background: white; padding: 2px; border-radius: 9px; }
.sidebar-brand strong { color: white; font-size: 18px; }
.sidebar-brand small { color: #c5ced8; font-size: 10.5px; }
.sidebar-section { padding: 16px 9px 5px; font: 650 10px/1.4 var(--font); text-transform: uppercase; letter-spacing: .11em; color: #acb9cb; }
.sidebar-nav { flex: none; }
.sidebar-nav li { margin-bottom: 1px; }
.sidebar-nav a { color: #e0e6ee; border-radius: 6px; padding: 8px 11px; gap: 10px; line-height: 1.4; font-size: 13px; }
.sidebar-nav a i { color: #a4b6cd; font-size: 13px; }
.sidebar-nav a:hover,.sidebar-nav a:hover i { background: #243850; color: white; }
.sidebar-nav a.active,.sidebar-nav a.active:hover { background: #334c69; color: white; box-shadow: inset 3px 0 #f0bd68; }
.sidebar-nav a.active i { color: #f6cf8d; }
.sidebar-footer { margin-top: auto; padding: 12px 6px 0; border-color: #39485c; }
.sidebar-user strong,.btn-logout { color: white; }
.sidebar-user small { color: #c9d2df; }
.btn-logout { background: transparent; border-color: #607086; }
.sidebar-user .avatar,.topbar-avatar { color: #283c56; background: #e6d2b0; }
.topbar { padding-block: 10px; min-height: 56px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-search { max-width: 420px; }
.topbar-search input { background: #f6f7f9; border: 1px solid #dce2e8; border-radius: 7px; }
.app-main { background: var(--paper); }
.app-content { padding-top: 26px; max-width: 1540px; }
.page-head { align-items: center; margin-bottom: 16px; gap: 12px; }
.page-head h1 { font-size: clamp(27px,2.65vw,38px); font-weight: 680; color: #1a2b42; letter-spacing: -.045em; }
.page-head p { max-width: 72ch; line-height: 1.52; color: var(--muted); }
.page-head .actions { gap: 6px; flex-wrap: wrap; }
.desk-tabs,.section-tabs { display: flex; gap: 5px; align-items: stretch; overflow-x: auto; scrollbar-width: thin; }
.desk-tabs { margin: 0 0 18px; border-bottom: 1px solid #cdd5df; }
.desk-tabs a { display: inline-flex; align-items: center; font-size: 13px; padding: 10px 12px; border-bottom: 3px solid transparent; color: #46586e; white-space: nowrap; text-decoration: none; font-weight: 600; }
.desk-tabs a:hover,.desk-tabs a[aria-current] { color: #233f76; background: #e9edf3; }
.desk-tabs a[aria-current] { border-bottom-color: #355da1; }
.section-tabs { padding: 5px; margin: 0 0 16px; border: 1px solid var(--line); background: white; border-radius: 10px; }
.section-tabs button { background: transparent; border: 0; color: #4a586c; border-radius: 6px; font-size: 13px; font-weight: 600; padding: 8px 12px; white-space: nowrap; }
.section-tabs button[aria-selected=true] { background: #283f60; color: white; }
.card,.kpi-card,.settings-group { border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 1px 2px #182a3f09; }
.card-header { background: white; padding-block: 14px; border-color: #e5e9ee; }
.card-header h2,.settings-group h2 { color: #24344a; font-weight: 660; }
.btn { border-radius: 6px; font-weight: 600; }
.btn-primary,.btn-login { color: white; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover,.btn-primary:active,.btn-login:hover { background: #223e72; border-color: #223e72; color: white; }
.btn-outline-primary { color: #28477e; border-color: #b9c6da; }
.btn-outline-primary:hover { background: #e9eef6; color: #214078; }
.setup-banner { position: relative; background: #233953; border-left: 5px solid #e1b674; border-radius: 8px; padding: clamp(18px,2vw,30px); }
.setup-banner small { color: #efcf9a; }
.setup-banner p { color: #dce5f1; }
.setup-banner a { color: #233b5c; }
.kpi-grid { gap: 12px; }
.kpi-card { align-items: flex-start; flex-direction: row-reverse; justify-content: space-between; }
.kpi-icon { width: 34px; height: 34px; font-size: 15px; background: #edf1f7; color: #3e5880; border-radius: 7px; }
.kpi-navy { background: #253e5c; color: white; }
.kpi-label { font-size: 11px; }
.kpi-value { font-weight: 680; }
.pay-track { border: 0; background: transparent; padding: 0; }
.pay-track .current span,.pay-track .done span { background: #365b8b; }
.settings-grid[data-enhanced] { display: block; }
.settings-group { padding: 0 20px 5px; }
.settings-link { padding: 15px 5px; }
.settings-link:hover { background: #f0f3f7; }
.settings-link strong { color: #253c5c; }
.form-control,.form-select { min-height: 38px; border-radius: 6px; border-color: #bdc8d5; }
.form-control:focus,.form-select:focus { border-color: #5874a3; box-shadow: 0 0 0 3px #325d9820; }
.table-responsive { overscroll-behavior-x: contain; }
.table thead th,table.dataTable thead th { background: #f0f3f7; color: #3f5066; font-size: 11px; font-weight: 700; letter-spacing: .035em; }
table.dataTable { width: 100% !important; border-collapse: collapse; }
.table tbody td { border-color: #e7ebef; vertical-align: middle; }
.table tbody tr:hover td { background-color: #f6f8fb; }
div.dt-container div.dt-layout-row:not(.dt-layout-table) { padding: 8px 14px; margin: 0; color: #4a596b; font-size: 13px; }
div.dt-container .dt-search input,div.dt-container .dt-length select { background: white; border: 1px solid #bdc8d5; border-radius: 5px; padding: 6px 8px; }
div.dt-container .dt-paging button.dt-paging-button.current { background: #e8eef7; color: #24477f !important; border: 1px solid #c0cfe2; border-radius: 5px; }
.grid-status { margin: 8px 14px; color: #4d5f73; font-size: 13px; }
.grid-status button { border: 0; background: transparent; color: #294b84; text-decoration: underline; }
#desk-editor { padding: 0; border: 1px solid #c4ceda; border-radius: 12px; width: min(850px,94vw); max-height: 88dvh; color: var(--ink); background: #f7f8fa; box-shadow: 0 18px 68px #0d1e333a; }
#desk-editor[open] { display: flex; flex-direction: column; overflow: hidden; }
#desk-editor::backdrop { background: #101e32a3; }
.editor-head { flex: none; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); }
.editor-head h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.editor-head button { font-size: 23px; border: 0; line-height: 1; background: #eef1f5; border-radius: 6px; height: 36px; width: 36px; color: #26364b; }
.editor-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
.editor-body [data-section-tabs] .card-header:has(h2) { display: none; }
.editor-body .card { margin-bottom: 12px; }
.editor-body .alert { white-space: pre-line; }
[hidden] { display: none !important; }
a:focus-visible,button:focus-visible,summary:focus-visible { outline: 3px solid #5583bb; outline-offset: 2px; }
.login-aside { background: #1b304c; border-top: 0; border-left: 9px solid #dcb576; }
.login-main { background: #f5f6f8; }
@media(max-width:760px) {
    .page-head { align-items: flex-start; flex-direction: column; }
    .app-content { padding: 18px 12px 34px; }
    .desk-tabs { margin-bottom: 14px; }
    .desk-tabs a,.section-tabs button { padding: 9px; }
    .editor-body { padding: 12px; }
    #desk-editor { width: calc(100vw - 12px); max-width: none; max-height: 94dvh; }
    .kpi-icon { display: none; }
    .table-responsive { max-width: 100%; }
    .sidebar-section { padding-top: 11px; }
}
@media print {
    .desk-tabs,.section-tabs,#desk-editor,.dt-layout-row:not(.dt-layout-table),.grid-status { display: none !important; }
    .app-main { background: white; }
}
.terminal-diagnosis { margin:12px 0; background:#f3f6fa; border-left:3px solid #406499; padding:16px; }
.terminal-diagnosis h3 {font-size:18px}.terminal-diagnosis h4{font-size:14px}.terminal-diagnosis li{font-size:13px;margin:6px 0}
