:root{--accent:#1d4ed8;--bg:#f3f6fb;--surface:#fff;--surface-2:#f8fafc;--text:#172033;--muted:#657086;--line:#e3e9f2;--sidebar:#0f172a;--sidebar-text:#cbd5e1;--shadow:0 12px 30px rgba(15,23,42,.08);--danger:#b91c1c;--success:#166534;--warning:#a16207}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}.app-shell{min-height:100vh;display:grid;grid-template-columns:255px 1fr}.sidebar{background:var(--sidebar);color:var(--sidebar-text);padding:22px 16px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;gap:12px;align-items:center;padding:4px 8px 24px}.brand-mark{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--accent);color:white;font-size:12px;font-weight:800;letter-spacing:.05em}.brand strong{display:block;color:white;font-size:15px}.brand span{display:block;color:#94a3b8;font-size:11px;margin-top:3px}nav{display:grid;gap:6px}nav button{border:0;background:transparent;color:var(--sidebar-text);text-align:left;padding:11px 13px;border-radius:10px;font-weight:650}nav button:hover,nav button.active{background:rgba(255,255,255,.1);color:white}.sidebar-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.1);padding:15px 8px 0;font-size:11px;color:#94a3b8}.main{min-width:0;padding:24px 30px 50px}.national-header{min-height:92px;background:linear-gradient(135deg,var(--surface),var(--surface-2));border:1px solid var(--line);border-radius:18px;padding:13px 18px;display:flex;align-items:center;justify-content:space-between;gap:20px;box-shadow:var(--shadow);margin-bottom:18px}.national-brand{display:flex;align-items:center;min-width:0;gap:16px}.national-emblem{width:68px;height:68px;object-fit:contain;flex:0 0 auto}.national-title-wrap{min-width:0}.national-title{font-size:23px;font-weight:850;line-height:1.12;letter-spacing:-.02em}.national-subtitle{margin-top:5px;color:var(--muted);font-size:13px}.national-flag{width:58px;height:72px;object-fit:contain;flex:0 0 auto}.page-header{display:flex;justify-content:space-between;gap:20px;align-items:center;margin:0 0 22px}.page-header h1{margin:0;font-size:28px;letter-spacing:-.03em}.page-header p{margin:5px 0 0;color:var(--muted);font-size:13px}.header-actions,.actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.btn{border:1px solid var(--line);border-radius:10px;padding:9px 13px;background:var(--surface);color:var(--text);font-weight:700}.btn:hover{filter:brightness(.98)}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.danger{background:#fff1f2;border-color:#fecdd3;color:#be123c}.btn.ghost{background:transparent}.btn.small{padding:6px 9px;font-size:12px}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-bottom:20px}.card,.panel{background:var(--surface);border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow)}.card{padding:17px}.card .k{font-size:12px;color:var(--muted);font-weight:700}.card .v{font-size:28px;font-weight:850;margin-top:7px;letter-spacing:-.03em}.card .hint{font-size:11px;color:var(--muted);margin-top:4px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:22px 0 10px}.section-title h2{margin:0;font-size:16px}.section-title p{margin:2px 0 0;color:var(--muted);font-size:12px}.panel{padding:17px;margin-bottom:16px}.panel h3{margin:0 0 12px;font-size:15px}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}.toolbar .grow{flex:1;min-width:220px}.field{display:grid;gap:6px}.field label{font-size:12px;font-weight:750;color:var(--muted)}.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);border-radius:9px;padding:9px 10px;background:var(--surface);color:var(--text);outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.field textarea{resize:vertical;min-height:84px}.field.hidden{display:none}.full{grid-column:1/-1}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}.table{width:100%;border-collapse:collapse;min-width:760px}.table th,.table td{padding:10px 11px;border-bottom:1px solid var(--line);text-align:left;font-size:12px;vertical-align:middle}.table th{background:var(--surface-2);color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em;position:sticky;top:0}.table tr:last-child td{border-bottom:0}.table tr:hover td{background:color-mix(in srgb,var(--accent) 3%,var(--surface))}.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#eef2f7;color:#475569;font-weight:800;font-size:11px;white-space:nowrap}.badge-active{background:#dcfce7;color:#166534}.badge-hold{background:#fee2e2;color:#b91c1c}.badge-inactive{background:#e2e8f0;color:#475569}.muted{color:var(--muted)}.empty{padding:34px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:12px}.stat-line{display:grid;grid-template-columns:minmax(110px,160px) 1fr 52px;align-items:center;gap:10px;margin:10px 0;font-size:12px}.bar{height:9px;background:#edf1f6;border-radius:999px;overflow:hidden}.bar i{height:100%;display:block;background:var(--accent);border-radius:inherit}.tabs{display:flex;gap:6px;padding:5px;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;width:max-content;max-width:100%;overflow:auto;margin-bottom:14px}.tabs button{border:0;background:transparent;color:var(--muted);padding:8px 11px;border-radius:8px;font-weight:750;white-space:nowrap}.tabs button.active{background:var(--surface);color:var(--text);box-shadow:0 2px 8px rgba(15,23,42,.06)}.list-editor{display:grid;gap:8px}.list-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}.list-row.three{grid-template-columns:1fr 180px auto}.list-row input,.list-row select{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--surface);color:var(--text)}.note{font-size:12px;color:var(--muted);line-height:1.55}.callout{padding:12px 13px;border-radius:10px;background:color-mix(in srgb,var(--accent) 7%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 18%,var(--line));font-size:12px;line-height:1.55}.danger-zone{border-color:#fecdd3;background:#fffafb}.modal{position:fixed;inset:0;background:rgba(15,23,42,.55);display:none;align-items:center;justify-content:center;padding:22px;z-index:50}.modal.open{display:flex}.modal-card{width:min(850px,100%);max-height:92vh;overflow:auto;background:var(--surface);border-radius:17px;box-shadow:0 30px 80px rgba(0,0,0,.25)}.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:18px 20px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface);z-index:2}.modal-head h2{margin:0;font-size:18px}.modal-head p{margin:5px 0 0;color:var(--muted);font-size:12px}.icon-btn{border:0;background:var(--surface-2);color:var(--text);border-radius:9px;width:34px;height:34px;font-size:22px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;padding:20px}.form-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:9px;padding-top:5px}.toast{position:fixed;right:20px;bottom:20px;background:#111827;color:white;padding:10px 14px;border-radius:9px;font-size:12px;box-shadow:var(--shadow);opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s;z-index:100}.toast.show{opacity:1;transform:none}.split-note{display:flex;justify-content:space-between;align-items:center;gap:12px}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.pill-count{display:inline-flex;align-items:center;justify-content:center;min-width:24px;padding:2px 7px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);font-size:11px;font-weight:800}.help{font-size:11px;color:var(--muted);margin-top:2px}
body.dark{--bg:#0b1120;--surface:#111827;--surface-2:#172033;--text:#e5e7eb;--muted:#94a3b8;--line:#263247;--sidebar:#080d17;--shadow:0 12px 30px rgba(0,0,0,.18)}body.dark .badge-active{background:#12351f;color:#86efac}body.dark .badge-hold{background:#451a1a;color:#fca5a5}body.dark .badge-inactive{background:#273244;color:#cbd5e1}body.dark .danger-zone{background:#201216;border-color:#55202a}body.dark .btn.danger{background:#2a151a;border-color:#5b2330;color:#fda4af}
@media(max-width:960px){.app-shell{grid-template-columns:1fr}.sidebar{height:auto;position:static;padding:12px}.brand{padding-bottom:12px}.sidebar nav{display:flex;overflow:auto}.sidebar nav button{white-space:nowrap}.sidebar-footer{display:none}.main{padding:18px}.grid-3{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.main{padding:12px}.national-header{padding:10px 12px;min-height:78px}.national-emblem{width:54px;height:54px}.national-flag{width:44px;height:58px}.national-title{font-size:17px}.national-subtitle{font-size:11px}.page-header{align-items:flex-start;flex-direction:column}.header-actions{width:100%}.header-actions .btn{flex:1}.form-grid,.grid-2,.grid-3{grid-template-columns:1fr}.field,.full{grid-column:1}.modal{padding:8px}.modal-card{max-height:97vh}.list-row.three{grid-template-columns:1fr}.stat-line{grid-template-columns:100px 1fr 38px}}
.table input,.table select{width:100%;min-width:120px;border:1px solid var(--line);border-radius:8px;padding:7px 8px;background:var(--surface);color:var(--text)}
/* V4 visual alignment with V2 */
:root{
  --accent:#1d4ed8;
  --bg:#f4f7fb;
  --surface:#fff;
  --surface-2:#f4f7fb;
  --text:#172033;
  --muted:#6b7587;
  --line:#e4e9f1;
  --sidebar:#101828;
  --sidebar-text:#cbd5e1;
  --shadow:0 8px 30px rgba(23,32,51,.07);
  --danger:#b42318;
  --success:#166534;
  --warning:#a16207;
}
html,body{font:14px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
.app-shell{grid-template-columns:250px 1fr}
.sidebar{background:#101828;padding:24px 16px}
.brand{padding:4px 8px 26px}
.brand-mark{border-radius:12px;background:#2563eb}
.brand strong{font-size:14px}
.brand span{color:#98a2b3;font-size:11px;margin-top:2px}
nav button{padding:11px 13px;border-radius:9px;font-weight:400}
nav button:hover,nav button.active{background:#1d2939;color:#fff}
.sidebar-footer{color:#98a2b3;font-size:12px}
.main{padding:24px 30px 50px;background:var(--bg)}
.national-header{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:12px 18px;min-height:84px;margin-bottom:18px}
.national-emblem{width:62px;height:62px}
.national-title{font-size:23px;font-weight:800;line-height:1.15;letter-spacing:0}
.national-subtitle{font-size:13px;margin-top:3px;color:var(--muted)}
.national-flag{width:46px;height:58px}
.page-header{margin:0 0 20px}
.page-header h1{font-size:23px;letter-spacing:0}
.page-header p{margin:3px 0 0;color:var(--muted);font-size:14px}
.btn{border-radius:9px;padding:9px 13px;border:1px solid var(--line);background:var(--surface);color:var(--text);font-weight:400}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.danger{color:var(--danger);background:var(--surface);border-color:var(--line)}
.cards{gap:15px;margin-bottom:20px}
.card,.panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}
.card{padding:18px}.card .k{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em;font-weight:400}.card .v{font-size:28px;margin-top:7px;font-weight:700;letter-spacing:0}
.panel{padding:20px;margin-bottom:18px}.panel h3{font-size:16px}
.section-title h2{font-size:16px}
/* Search bar and filter dropdowns match V2 */
.toolbar{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.toolbar input,.toolbar select{
  font:inherit;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:8px;
  padding:9px 10px;
  min-width:150px;
  outline:none;
  box-shadow:none;
}
.toolbar input:focus,.toolbar select:focus{border-color:var(--line);box-shadow:none}
.toolbar .grow{flex:1;min-width:220px}
.field label{font-size:12px;font-weight:400;color:var(--muted)}
.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:8px;padding:9px 10px;background:var(--surface);color:var(--text)}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);box-shadow:none}
.table-wrap{border:1px solid var(--line);border-radius:10px}
.table th,.table td{padding:11px 12px}.table th{font-size:11px;background:var(--bg);color:var(--muted);font-weight:600}
.tabs{padding:0;background:transparent;border:0;border-radius:0;gap:8px}.tabs button{border:1px solid var(--line);background:var(--surface);color:var(--text);padding:9px 13px;border-radius:9px;font-weight:400}.tabs button.active{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:none}
.modal-card{border-radius:16px}.modal-head h2{font-size:18px}.form-grid{gap:14px}
body.dark{--bg:#0f172a;--surface:#172033;--surface-2:#0f172a;--text:#eef2ff;--muted:#a7b0c0;--line:#2a3549;--sidebar:#101828;--shadow:none}
@media(max-width:680px){.national-header{min-height:72px;padding:9px 12px}.national-emblem{width:50px;height:50px}.national-flag{width:36px;height:46px}.national-title{font-size:17px}.national-subtitle{font-size:11px}.main{padding:12px}}
/* Keep editable/customization dropdowns on the same V2 control language */
.list-row input,.list-row select,.table input,.table select{
  font:inherit;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:9px 10px;box-shadow:none;
}


/* V5: Operators page typography aligned with V2 */
.operators-database .table td{
  font-size:14px;
  font-family:inherit;
}
.operators-database .table th{
  font-size:11px;
  letter-spacing:0;
  font-weight:700;
}
.operators-database .mono{font-family:inherit}
.theme-choice{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.theme-icon{display:inline-grid;place-items:center;width:18px;height:18px;font-size:16px;line-height:1}

/* V6: V2 typography applied consistently across the entire project */
html,body{
  font:14px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
body,button,input,select,textarea,table,.btn,.badge,.tabs button,.sidebar,nav button,
.national-header,.page-header,.card,.panel,.field,.table,.modal,.toast,.note,.callout{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
button,input,select,textarea,.btn,.tabs button,nav button{font-size:14px;line-height:1.45}
.page-header h1,h1{font-size:23px;line-height:1.25;font-weight:700;letter-spacing:0}
.section-title h2,.panel h2,h2{font-size:16px;line-height:1.35;font-weight:700;letter-spacing:0}
.panel h3,h3{font-size:16px;line-height:1.35;font-weight:700;letter-spacing:0}
.field label{font-size:12px;font-weight:400;line-height:1.45}
.table th{font-size:11px;font-weight:600;letter-spacing:0;text-transform:uppercase}
.table td{font-size:14px;line-height:1.45}
.badge{font-size:12px;line-height:1.3;font-weight:400}
.btn{font-weight:400}
nav button{font-weight:400}
.tabs button{font-weight:400}
.brand strong{font-size:14px;font-weight:700}
.brand span{font-size:11px}
.card .k{font-size:12px;font-weight:400}.card .v{font-size:28px;font-weight:700}
.note{font-size:13px;line-height:1.45}.callout{font-size:13px;line-height:1.45}
.help{font-size:12px}.mono{font-family:inherit}
.national-title{font-size:23px;font-weight:700;letter-spacing:0}.national-subtitle{font-size:13px}

/* V6 dashboard project bar graph */
.project-chart{display:grid;gap:11px}
.chart-row{display:grid;grid-template-columns:minmax(120px,170px) 1fr 42px;gap:10px;align-items:center;font-size:14px}
.chart-row>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chart-track{height:11px;background:var(--bg);border-radius:999px;overflow:hidden}
.chart-track i{display:block;height:100%;background:var(--accent);border-radius:999px;min-width:0}
.chart-row strong{text-align:right;font-weight:700}
.table-summary{padding:9px 2px 0;color:var(--muted);font-size:12px}

/* V6 settings page */
.settings-form{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.setting-toggle{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:11px 0;border-top:1px solid var(--line);cursor:pointer}
.setting-toggle:first-of-type{margin-top:12px}
.setting-toggle span{display:grid;gap:2px}
.setting-toggle strong{font-size:14px;font-weight:600}
.setting-toggle small{font-size:12px;color:var(--muted);line-height:1.4}
.setting-toggle input{width:18px;height:18px;accent-color:var(--accent);flex:0 0 auto}
.settings-info{display:grid;gap:4px;margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.settings-info strong{font-size:14px}.settings-info span{font-size:12px;color:var(--muted);line-height:1.45}

@media(max-width:680px){
  .settings-form{grid-template-columns:1fr}
  .chart-row{grid-template-columns:105px 1fr 34px;font-size:12px}
}

/* V10: sidebar logo, icons, collapse state, theme controls and reset undo */
.app-shell{transition:grid-template-columns .2s ease}
.brand{gap:10px;min-width:0;align-items:center}
.brand-logo-shell{width:108px;min-width:108px;height:38px;border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center;padding:4px 7px;overflow:hidden}
.brand-logo{display:block;width:100%;height:100%;object-fit:contain}
.brand-copy{min-width:0;overflow:hidden}
.brand-copy strong,.brand-copy span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
nav button,.sidebar-toggle{display:flex;align-items:center;gap:10px;width:100%}
.nav-icon{width:18px;height:18px;display:inline-grid;place-items:center;flex:0 0 18px}
.nav-icon svg{width:18px;height:18px;display:block;fill:currentColor}
.nav-label{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-bottom{margin-top:auto}
.sidebar-toggle{border:0;background:transparent;color:var(--sidebar-text);text-align:left;padding:10px 13px;border-radius:9px;font:inherit;margin-bottom:8px}
.sidebar-toggle:hover{background:#1d2939;color:#fff}
.sidebar-toggle-icon{transition:transform .2s ease}
.app-shell.sidebar-collapsed{grid-template-columns:76px 1fr}
.app-shell.sidebar-collapsed .sidebar{padding-left:12px;padding-right:12px}
.app-shell.sidebar-collapsed .brand{justify-content:center;padding-left:0;padding-right:0}
.app-shell.sidebar-collapsed .brand-logo-shell{width:48px;min-width:48px;height:32px;padding:3px}
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .sidebar .nav-label,
.app-shell.sidebar-collapsed .sidebar-footer{display:none}
.app-shell.sidebar-collapsed nav button,
.app-shell.sidebar-collapsed .sidebar-toggle{justify-content:center;padding-left:10px;padding-right:10px}
.app-shell.sidebar-collapsed .sidebar-toggle-icon{transform:rotate(180deg)}
.sidebar-footer{margin-top:0}
.theme-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:12px}
.theme-mode-btn{display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line);border-radius:9px;padding:10px 9px;background:var(--surface);color:var(--text);font:inherit}
.theme-mode-btn:hover{border-color:var(--accent)}
.theme-mode-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}
.theme-mode-btn .theme-icon{font-size:16px;line-height:1}
.reset-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.reset-choice{border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--surface-2)}
.reset-choice h4{margin:0 0 5px;font-size:14px}
.reset-choice p{margin:0 0 12px;color:var(--muted);font-size:12px;line-height:1.45}
.undo-toast{position:fixed;right:20px;bottom:20px;z-index:130;display:flex;align-items:center;gap:10px;background:#111827;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:10px;padding:11px 12px;box-shadow:0 18px 45px rgba(0,0,0,.28);opacity:0;transform:translateY(12px);pointer-events:none;transition:.18s ease;font-size:13px}
.undo-toast.show{opacity:1;transform:none;pointer-events:auto}
.undo-toast button{border:0;border-radius:7px;padding:6px 9px;background:#fff;color:#111827;font:inherit;font-weight:700}
.undo-countdown{font-variant-numeric:tabular-nums;color:#cbd5e1;min-width:22px;text-align:right}
body.dark .brand-logo-shell{background:#fff}
body.dark .undo-toast{background:#020617}

@media(max-width:960px){
  .app-shell.sidebar-collapsed{grid-template-columns:1fr}
  .app-shell.sidebar-collapsed .sidebar{padding:12px}
  .app-shell.sidebar-collapsed .brand{justify-content:flex-start}
  .app-shell.sidebar-collapsed .brand-logo-shell{width:108px;min-width:108px;height:38px;padding:4px 7px}
  .app-shell.sidebar-collapsed .brand-copy{display:block}
  .app-shell.sidebar-collapsed .sidebar .nav-label{display:inline}
  .app-shell.sidebar-collapsed nav button{justify-content:flex-start}
  .sidebar-toggle{display:none}
  .sidebar-bottom{display:none}
}
@media(max-width:680px){
  .theme-mode-grid,.reset-choice-grid{grid-template-columns:1fr}
  .undo-toast{left:12px;right:12px;bottom:12px;justify-content:space-between}
}

/* V11 sidebar refinements */
.brand-copy{display:none!important}
.brand-logo-shell{background:transparent!important}
body.dark .brand-logo-shell{background:transparent!important}
@media(min-width:961px){
  .sidebar #nav{margin-top:20px}
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{position:relative;overflow:visible}
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    content:attr(data-tooltip);position:absolute;left:calc(100% + 12px);top:50%;
    transform:translateY(-50%);z-index:200;white-space:nowrap;pointer-events:none;
    padding:7px 9px;border-radius:7px;background:#101828;color:#fff;
    border:1px solid rgba(255,255,255,.12);box-shadow:0 8px 24px rgba(0,0,0,.22);
    font-size:12px;font-weight:650;line-height:1;opacity:0;visibility:hidden;
    transition:opacity .12s ease,visibility .12s ease
  }
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]:hover::after,
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]:focus-visible::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]:hover::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]:focus-visible::after{opacity:1;visibility:visible}
}

/* V12 sidebar wordmark, alignment and theme-aware surface */
.brand{
  min-height:92px;
  padding:0 8px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  overflow:hidden;
}
.brand-wordmark{min-width:0;display:block;line-height:1.15}
.brand-title{
  display:block;
  color:#fff;
  font-size:21px;
  line-height:1.05;
  font-weight:850;
  letter-spacing:.015em;
  white-space:nowrap;
}
.brand-subtitle{
  display:block;
  margin-top:6px;
  color:#98a2b3;
  font-size:10.5px;
  line-height:1.25;
  font-weight:500;
  letter-spacing:.01em;
  white-space:nowrap;
}
.sidebar #nav{margin-top:18px}

/* Light theme sidebar */
body:not(.dark){--sidebar:#fff;--sidebar-text:#475467}
body:not(.dark) .sidebar{
  background:#fff;
  color:#475467;
  border-right:1px solid var(--line);
}
body:not(.dark) .brand-title{color:#101828}
body:not(.dark) .brand-subtitle{color:#667085}
body:not(.dark) .sidebar nav button,
body:not(.dark) .sidebar-toggle{color:#475467}
body:not(.dark) .sidebar nav button:hover,
body:not(.dark) .sidebar nav button.active,
body:not(.dark) .sidebar-toggle:hover{background:#f2f4f7;color:#101828}
body:not(.dark) .sidebar-footer{border-top-color:#e4e7ec;color:#667085}
body:not(.dark) .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
body:not(.dark) .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
  background:#fff;color:#101828;border-color:#e4e7ec;box-shadow:0 8px 24px rgba(16,24,40,.14)
}

/* Dark theme sidebar */
body.dark .sidebar{background:#101828;color:#cbd5e1;border-right:0}
body.dark .brand-title{color:#fff}
body.dark .brand-subtitle{color:#98a2b3}

/* Collapsed wordmark: keep DONIDCR, hide only its subtitle. */
.app-shell.sidebar-collapsed .brand{justify-content:center;padding-left:0;padding-right:0}
.app-shell.sidebar-collapsed .brand-wordmark{width:100%;text-align:center}
.app-shell.sidebar-collapsed .brand-title{font-size:10.5px;letter-spacing:0;font-weight:850}
.app-shell.sidebar-collapsed .brand-subtitle{display:none}

@media(max-width:960px){
  .brand{min-height:auto;padding:4px 8px 18px}
  .sidebar #nav{margin-top:0}
  .app-shell.sidebar-collapsed .brand{justify-content:flex-start;padding:4px 8px 18px}
  .app-shell.sidebar-collapsed .brand-wordmark{text-align:left}
  .app-shell.sidebar-collapsed .brand-title{font-size:21px;letter-spacing:.015em}
  .app-shell.sidebar-collapsed .brand-subtitle{display:block}
}


/* V13: theme click fix support + larger, vertically centered sidebar wordmark */
.brand{
  height:92px;
  min-height:92px;
  display:flex;
  align-items:center;
}
.brand-wordmark{
  min-height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
}
.brand-title{
  font-size:28px;
  line-height:1;
  font-weight:850;
  letter-spacing:.01em;
}
.brand-subtitle{
  margin-top:7px;
  font-size:11px;
  line-height:1.2;
}
.app-shell.sidebar-collapsed .brand-wordmark{
  min-height:100%;
  align-items:center;
  justify-content:center;
}
.app-shell.sidebar-collapsed .brand-title{
  font-size:11.5px;
  line-height:1;
  letter-spacing:0;
}
@media(max-width:960px){
  .brand{height:auto;min-height:auto}
  .brand-wordmark{min-height:0;align-items:flex-start}
  .brand-title{font-size:24px}
  .app-shell.sidebar-collapsed .brand-wordmark{min-height:0;align-items:flex-start}
  .app-shell.sidebar-collapsed .brand-title{font-size:24px;letter-spacing:.01em}
}

/* V14: full responsive layout, safer collapsed wordmark, and Version History */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-x:hidden}
.app-shell{grid-template-columns:280px minmax(0,1fr)}
.main,#content,.panel,.card,.settings-page{min-width:0}
.sidebar{min-width:0;overflow:visible}
.brand{height:104px;min-height:104px;padding:0 8px}
.brand-wordmark{width:100%;overflow:visible}
.brand-title{font-size:36px;line-height:.98;letter-spacing:.005em;overflow:visible;text-overflow:clip}
.brand-subtitle{font-size:11.5px;margin-top:8px}
.app-shell.sidebar-collapsed{grid-template-columns:112px minmax(0,1fr)}
.app-shell.sidebar-collapsed .sidebar{padding-left:12px;padding-right:12px}
.app-shell.sidebar-collapsed .brand{width:100%;padding:0;overflow:visible}
.app-shell.sidebar-collapsed .brand-wordmark{width:100%;min-width:0;overflow:visible;align-items:center;text-align:center}
.app-shell.sidebar-collapsed .brand-title{display:block;width:100%;font-size:15.5px;line-height:1;letter-spacing:.015em;white-space:nowrap;overflow:visible;text-overflow:clip;text-align:center}
.app-shell.sidebar-collapsed .brand-subtitle{display:none}
.btn:disabled{opacity:.5;cursor:not-allowed;filter:none}
.table-wrap{max-width:100%;-webkit-overflow-scrolling:touch}
.table th,.table td{white-space:nowrap}
.toolbar>*{max-width:100%}

.version-history-panel{overflow:hidden}
.version-history-head{margin-top:0}
.version-history-layout{display:grid;grid-template-columns:minmax(240px,300px) minmax(0,1fr);gap:16px;align-items:start}
.version-list{display:grid;gap:8px;max-height:480px;overflow:auto;padding-right:3px}
.version-item{width:100%;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:10px;padding:11px 12px;text-align:left;display:grid;gap:7px}
.version-item:hover{border-color:color-mix(in srgb,var(--accent) 55%,var(--line))}
.version-item.active{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent)}
.version-item span:first-child{display:grid;gap:3px;min-width:0}
.version-item strong{font-size:12px;line-height:1.3}
.version-item small{font-size:11px;color:var(--muted);line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.version-meta{font-size:10.5px;color:var(--muted);font-weight:700}
.version-preview{min-width:0}
.version-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}
.version-preview-head h3{margin:0 0 3px}
.version-preview-head .note{margin:0}
.history-table-wrap{max-height:420px}
.history-state{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:10.5px;font-weight:800}
.history-state.present{background:#dcfce7;color:#166534}
.history-state.missing{background:#fee2e2;color:#b91c1c}
body.dark .history-state.present{background:#12351f;color:#86efac}
body.dark .history-state.missing{background:#451a1a;color:#fca5a5}

@media(max-width:1280px){
  .app-shell{grid-template-columns:250px minmax(0,1fr)}
  .app-shell.sidebar-collapsed{grid-template-columns:108px minmax(0,1fr)}
  .main{padding-left:22px;padding-right:22px}
  .brand-title{font-size:32px}
}

@media(max-width:1024px){
  .app-shell,.app-shell.sidebar-collapsed{display:block}
  .sidebar,.app-shell.sidebar-collapsed .sidebar{position:sticky;top:0;z-index:45;height:auto;width:100%;padding:9px 14px 10px;border-right:0;border-bottom:1px solid var(--line)}
  .brand,.app-shell.sidebar-collapsed .brand{height:auto;min-height:52px;padding:2px 6px 8px;justify-content:flex-start;overflow:visible}
  .brand-wordmark,.app-shell.sidebar-collapsed .brand-wordmark{min-height:0;width:auto;align-items:flex-start;text-align:left;overflow:visible}
  .brand-title,.app-shell.sidebar-collapsed .brand-title{width:auto;font-size:27px;letter-spacing:.006em;text-align:left;overflow:visible}
  .brand-subtitle,.app-shell.sidebar-collapsed .brand-subtitle{display:block;font-size:10px;margin-top:4px}
  .sidebar #nav,.app-shell.sidebar-collapsed .sidebar #nav{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;margin:0;padding:2px 0 3px}
  .sidebar nav button,.app-shell.sidebar-collapsed .sidebar nav button{width:auto;flex:0 0 auto;justify-content:flex-start;padding:9px 11px;white-space:nowrap}
  .sidebar .nav-label,.app-shell.sidebar-collapsed .sidebar .nav-label{display:inline;overflow:visible;text-overflow:clip}
  .sidebar-bottom{display:none!important}
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{content:none!important;display:none!important}
  .main{padding:18px 18px 40px}
  .national-header{min-height:84px;padding:11px 14px;border-radius:14px}
  .national-emblem{width:58px;height:58px}
  .national-flag{width:44px;height:56px}
  .national-title{font-size:clamp(18px,2.4vw,22px)}
  .page-header h1{font-size:26px}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .version-history-layout{grid-template-columns:1fr}
  .version-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:280px}
}

@media(max-width:768px){
  .main{padding:12px 12px 34px}
  .national-header{min-height:74px;gap:10px;padding:9px 11px;margin-bottom:14px}
  .national-brand{gap:10px}
  .national-emblem{width:48px;height:48px}
  .national-flag{width:34px;height:46px}
  .national-title{font-size:clamp(16px,4.2vw,20px);line-height:1.08}
  .national-subtitle{font-size:10.5px;margin-top:3px}
  .page-header{margin-bottom:16px;gap:12px}
  .page-header h1{font-size:24px}
  .page-header p{font-size:12px}
  .grid-2,.grid-3{grid-template-columns:1fr}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .card{padding:14px}
  .card .v{font-size:24px}
  .panel{padding:14px}
  .toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .toolbar .grow{grid-column:1/-1;min-width:0;width:100%}
  .toolbar input,.toolbar select,.toolbar button{width:100%;min-width:0}
  .operators-database .toolbar #resetOperatorFilters{grid-column:1/-1}
  .table{min-width:720px}
  .table th,.table td{padding:9px 10px}
  .form-grid{grid-template-columns:1fr;padding:15px;gap:11px}
  .field,.full,.form-actions{grid-column:1}
  .form-actions{display:grid;grid-template-columns:1fr 1fr}
  .form-actions .btn{min-height:42px}
  .modal{padding:6px;align-items:flex-end}
  .modal-card{width:100%;max-height:95dvh;border-radius:16px 16px 8px 8px}
  .modal-head{padding:15px 16px}
  .section-title{align-items:flex-start}
  .list-row.three{grid-template-columns:1fr}
  .theme-mode-grid,.reset-choice-grid{grid-template-columns:1fr}
  .version-list{grid-template-columns:1fr;max-height:240px}
  .version-preview-head{flex-direction:column}
  .version-preview-head .btn{width:100%}
  .tabs{width:100%}
  .tabs button{flex:1;text-align:center}
}

@media(max-width:520px){
  .sidebar,.app-shell.sidebar-collapsed .sidebar{padding-left:10px;padding-right:10px}
  .brand-title,.app-shell.sidebar-collapsed .brand-title{font-size:24px}
  .brand-subtitle,.app-shell.sidebar-collapsed .brand-subtitle{font-size:9.5px}
  .sidebar nav button,.app-shell.sidebar-collapsed .sidebar nav button{padding:8px 9px}
  .nav-icon{width:17px;height:17px;flex-basis:17px}
  .nav-icon svg{width:17px;height:17px}
  .national-header{border-radius:12px}
  .national-emblem{width:42px;height:42px}
  .national-flag{width:29px;height:39px}
  .national-title{font-size:15.5px}
  .national-subtitle{font-size:9.5px}
  .page-header{flex-direction:column;align-items:stretch}
  .header-actions{width:100%}
  .header-actions .btn{width:100%;min-height:42px}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .toolbar{grid-template-columns:1fr}
  .toolbar .grow,.operators-database .toolbar #resetOperatorFilters{grid-column:1}
  .btn{min-height:40px}
  .btn.small{min-height:34px}
  .section-title{flex-direction:column}
  .split-note{align-items:flex-start;flex-direction:column}
  .stat-line{grid-template-columns:minmax(78px,105px) 1fr 32px;gap:7px}
  .form-actions{grid-template-columns:1fr}
  .list-row{grid-template-columns:minmax(0,1fr) auto}
  .toast{left:10px;right:10px;bottom:10px;text-align:center}
  .undo-toast{left:10px;right:10px;bottom:10px}
  .version-history-head .btn{width:100%}
}

@media(max-width:390px){
  .cards{grid-template-columns:1fr}
  .national-title-wrap{min-width:0}
  .national-title,.national-subtitle{overflow-wrap:anywhere}
  .national-emblem{width:38px;height:38px}
  .national-flag{width:26px;height:35px}
  .panel,.card{border-radius:12px}
}

/* V14 wordmark specificity guard against legacy .brand strong/span rules */
.brand .brand-title{font-size:36px;line-height:.98;font-weight:850;letter-spacing:.005em}
.brand .brand-subtitle{font-size:11.5px;line-height:1.2;margin-top:8px}
.app-shell.sidebar-collapsed .brand .brand-title{font-size:15.5px;line-height:1;letter-spacing:.015em}
@media(max-width:1280px){.brand .brand-title{font-size:32px}}
@media(max-width:1024px){
  .brand .brand-title,.app-shell.sidebar-collapsed .brand .brand-title{font-size:27px;letter-spacing:.006em}
  .brand .brand-subtitle,.app-shell.sidebar-collapsed .brand .brand-subtitle{font-size:10px;margin-top:4px}
}
@media(max-width:520px){
  .brand .brand-title,.app-shell.sidebar-collapsed .brand .brand-title{font-size:24px}
  .brand .brand-subtitle,.app-shell.sidebar-collapsed .brand .brand-subtitle{font-size:9.5px}
}


/* V15: fluid desktop sidebar + blank brand area + fixed responsive government header/nav */
@media(min-width:1025px){
  .app-shell,
  .app-shell.sidebar-collapsed{
    display:flex;
    min-height:100vh;
    grid-template-columns:none;
    transition:none;
  }
  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    width:280px;
    flex:0 0 280px;
    padding:22px 16px;
    overflow:visible;
    transition:
      width .30s cubic-bezier(.22,1,.36,1),
      flex-basis .30s cubic-bezier(.22,1,.36,1),
      padding-left .30s cubic-bezier(.22,1,.36,1),
      padding-right .30s cubic-bezier(.22,1,.36,1),
      background-color .20s ease,
      border-color .20s ease;
    will-change:width,flex-basis,padding-left,padding-right;
  }
  .main{flex:1 1 auto;width:auto;min-width:0}
  .app-shell.sidebar-collapsed .sidebar{
    width:82px;
    flex-basis:82px;
    padding-left:11px;
    padding-right:11px;
  }
  /* Keep the former brand footprint blank, as requested. */
  .brand,
  .app-shell.sidebar-collapsed .brand{
    display:block;
    height:104px;
    min-height:104px;
    padding:0;
    margin:0;
    overflow:hidden;
  }
  .brand-wordmark,.brand-title,.brand-subtitle{display:none!important}

  .sidebar #nav{margin-top:18px}
  .sidebar nav button,
  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    justify-content:flex-start!important;
    overflow:visible;
    transition:
      padding .30s cubic-bezier(.22,1,.36,1),
      gap .30s cubic-bezier(.22,1,.36,1),
      background-color .15s ease,
      color .15s ease;
  }
  .sidebar nav button,.sidebar-toggle{gap:10px}
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    gap:0;
    padding-left:21px;
    padding-right:21px;
  }
  .sidebar .nav-label,
  .sidebar-toggle .nav-label,
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    display:inline-block!important;
    max-width:190px;
    opacity:1;
    transform:translateX(0);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:clip;
    transition:
      max-width .30s cubic-bezier(.22,1,.36,1),
      opacity .15s ease .08s,
      transform .30s cubic-bezier(.22,1,.36,1);
  }
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    max-width:0;
    opacity:0;
    transform:translateX(-5px);
    transition:
      max-width .30s cubic-bezier(.22,1,.36,1),
      opacity .10s ease,
      transform .30s cubic-bezier(.22,1,.36,1);
    pointer-events:none;
  }
  .nav-icon,.sidebar-toggle-icon{transition:transform .30s cubic-bezier(.22,1,.36,1)}
  .app-shell.sidebar-collapsed .sidebar-toggle-icon{transform:rotate(180deg)}
  .sidebar-footer{transition:opacity .16s ease,max-height .28s ease,padding .28s ease,border-color .2s ease}
  .app-shell.sidebar-collapsed .sidebar-footer{
    display:block!important;
    opacity:0;
    max-height:0;
    padding-top:0;
    border-top-color:transparent;
    overflow:hidden;
    pointer-events:none;
  }
}

/* Responsive navigation: fixed government header, dedicated horizontal menu directly below it. */
@media(max-width:1024px){
  :root{--responsive-header-h:84px;--responsive-nav-h:56px}
  .app-shell,.app-shell.sidebar-collapsed{display:block;min-height:100vh}
  .national-header{
    position:fixed;
    inset:0 0 auto 0;
    z-index:70;
    width:100%;
    height:var(--responsive-header-h);
    min-height:var(--responsive-header-h);
    margin:0;
    border-radius:0;
    border-left:0;
    border-right:0;
    border-top:0;
    padding:10px 16px;
    box-shadow:0 5px 18px rgba(15,23,42,.10);
  }
  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    position:fixed;
    top:var(--responsive-header-h);
    left:0;
    right:0;
    z-index:65;
    width:100%;
    height:var(--responsive-nav-h);
    min-height:var(--responsive-nav-h);
    padding:7px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow:hidden;
    box-shadow:0 5px 14px rgba(15,23,42,.05);
  }
  .sidebar .brand,
  .app-shell.sidebar-collapsed .sidebar .brand{display:none!important}
  .sidebar #nav,
  .app-shell.sidebar-collapsed .sidebar #nav{
    display:flex;
    align-items:center;
    gap:6px;
    width:100%;
    height:100%;
    margin:0;
    padding:0 1px 2px;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
  }
  .sidebar #nav::-webkit-scrollbar{display:none}
  .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar nav button{
    width:auto;
    min-height:40px;
    flex:0 0 auto;
    justify-content:flex-start!important;
    gap:8px;
    padding:8px 11px;
    white-space:nowrap;
    border-radius:9px;
  }
  .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar .nav-label{
    display:inline!important;
    max-width:none!important;
    opacity:1!important;
    transform:none!important;
    overflow:visible;
  }
  .sidebar-bottom{display:none!important}
  .main{
    padding-top:calc(var(--responsive-header-h) + var(--responsive-nav-h) + 18px)!important;
  }
  /* Header is fixed, so its in-document box must not reserve extra space. */
  .main>.national-header{margin:0}
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{content:none!important;display:none!important}
}

@media(max-width:768px){
  :root{--responsive-header-h:76px;--responsive-nav-h:54px}
  .national-header{padding:8px 11px}
  .main{padding-top:calc(var(--responsive-header-h) + var(--responsive-nav-h) + 14px)!important}
}

@media(max-width:520px){
  :root{--responsive-header-h:72px;--responsive-nav-h:52px}
  .national-header{padding:7px 9px}
  .sidebar,.app-shell.sidebar-collapsed .sidebar{padding:6px 8px}
  .sidebar nav button,.app-shell.sidebar-collapsed .sidebar nav button{min-height:38px;padding:7px 9px}
  .main{padding-top:calc(var(--responsive-header-h) + var(--responsive-nav-h) + 12px)!important}
}

@media(prefers-reduced-motion:reduce){
  .sidebar,.app-shell,.nav-label,.nav-icon,.sidebar-toggle,.sidebar-footer{transition:none!important}
}

/* V16: anchored sidebar toggle, polished desktop animation, viewport-safe responsive selects */
select{min-width:0;max-width:100%}

@media(min-width:1025px){
  .app-shell,
  .app-shell.sidebar-collapsed{
    display:grid!important;
    min-height:100vh;
    grid-template-columns:280px minmax(0,1fr);
    transition:grid-template-columns .38s cubic-bezier(.22,1,.36,1);
    will-change:grid-template-columns;
  }
  .app-shell.sidebar-collapsed{grid-template-columns:82px minmax(0,1fr)}

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    width:auto!important;
    min-width:0;
    flex:none!important;
    padding:22px 16px!important;
    position:sticky;
    top:0;
    height:100vh;
    overflow:visible;
    transition:background-color .2s ease,border-color .2s ease!important;
    will-change:auto;
  }
  .main{
    width:auto!important;
    min-width:0;
    transform:translateZ(0);
  }

  .sidebar nav button,
  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    display:grid!important;
    grid-template-columns:20px minmax(0,1fr);
    align-items:center;
    justify-content:stretch!important;
    column-gap:10px!important;
    width:100%;
    padding:11px 13px!important;
    overflow:visible;
    transition:
      grid-template-columns .34s cubic-bezier(.22,1,.36,1),
      background-color .15s ease,
      color .15s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    grid-template-columns:20px 0fr;
  }
  .sidebar .nav-icon,
  .sidebar-toggle .nav-icon{
    width:20px;
    min-width:20px;
    height:20px;
    margin:0;
    justify-self:start;
    transform-origin:center;
  }
  .sidebar .nav-label,
  .sidebar-toggle .nav-label,
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    display:block!important;
    min-width:0!important;
    max-width:none!important;
    width:auto!important;
    overflow:hidden!important;
    white-space:nowrap;
    text-overflow:clip;
    opacity:1;
    transform:translateX(0);
    pointer-events:auto;
    transition:opacity .16s ease .10s,transform .34s cubic-bezier(.22,1,.36,1)!important;
  }
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    opacity:0;
    transform:translateX(-4px);
    pointer-events:none;
    transition:opacity .10s ease,transform .28s cubic-bezier(.22,1,.36,1)!important;
  }

  /* The toggle occupies one fixed anchor point in both sidebar states. */
  .sidebar-bottom,
  .app-shell.sidebar-collapsed .sidebar-bottom{
    display:block!important;
    position:absolute;
    left:16px;
    right:16px;
    bottom:16px;
    height:88px;
    margin:0!important;
  }
  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    position:absolute!important;
    left:0;
    right:0;
    top:0;
    height:42px;
    margin:0!important;
  }
  .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer{
    display:block!important;
    position:absolute;
    left:8px;
    right:8px;
    bottom:0;
    max-height:30px;
    padding:8px 0 0;
    margin:0;
    overflow:hidden;
    white-space:nowrap;
    transition:opacity .15s ease,border-color .2s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar-footer{
    opacity:0;
    max-height:30px;
    padding-top:8px;
    border-top-color:transparent;
    pointer-events:none;
  }
  .sidebar-toggle-icon{transition:transform .34s cubic-bezier(.22,1,.36,1)!important}
  .app-shell.sidebar-collapsed .sidebar-toggle-icon{transform:rotate(180deg)}
}

/* Keep native controls constrained even before the responsive chooser opens. */
@media(max-width:1024px){
  select,
  .field select,
  .toolbar select,
  .list-row select,
  .table select,
  .settings-form select{
    inline-size:100%;
    width:100%;
    min-inline-size:0!important;
    min-width:0!important;
    max-inline-size:100%!important;
    max-width:100%!important;
    text-overflow:ellipsis;
  }
  select option{
    max-width:100vw;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .field,.toolbar,.list-row,.settings-form,.panel,.modal-card,.form-grid{min-width:0}
}

/* Responsive select sheet prevents long dropdown choices from escaping the viewport. */
.responsive-select-overlay{
  position:fixed;
  inset:0;
  z-index:400;
  display:none;
  align-items:flex-end;
  justify-content:center;
  padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  background:rgba(15,23,42,.48);
  backdrop-filter:blur(2px);
}
.responsive-select-overlay.open{display:flex}
.responsive-select-sheet{
  width:min(560px,100%);
  max-width:calc(100vw - 20px);
  max-height:min(72dvh,620px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
}
.responsive-select-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 15px;
  border-bottom:1px solid var(--line);
  flex:0 0 auto;
}
.responsive-select-head strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
}
.responsive-select-close{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:0;
  border-radius:9px;
  background:var(--surface-2);
  color:var(--text);
  font:inherit;
  font-size:20px;
  line-height:1;
}
.responsive-select-list{
  min-width:0;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:7px;
}
.responsive-select-option{
  width:100%;
  min-width:0;
  border:0;
  border-radius:9px;
  padding:11px 12px;
  background:transparent;
  color:var(--text);
  text-align:left;
  font:inherit;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.responsive-select-option:hover,
.responsive-select-option:focus-visible{background:var(--surface-2);outline:none}
.responsive-select-option.selected{background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--accent);font-weight:700}
body.responsive-select-open{overflow:hidden}
@media(min-width:1025px){.responsive-select-overlay{display:none!important}}

@media(prefers-reduced-motion:reduce){
  .app-shell,.sidebar nav button,.sidebar-toggle,.sidebar .nav-label,.sidebar-footer,.sidebar-toggle-icon{transition:none!important}
}


/* V17: V13 desktop sidebar footprint + collapsed hover labels + access gate */
@media(min-width:1025px){
  .app-shell,.app-shell.sidebar-collapsed{grid-template-columns:255px minmax(0,1fr)!important}
  .app-shell.sidebar-collapsed{grid-template-columns:76px minmax(0,1fr)!important}
  .sidebar,.app-shell.sidebar-collapsed .sidebar{padding:24px 16px!important}
  .app-shell.sidebar-collapsed .sidebar{padding-left:12px!important;padding-right:12px!important}
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{padding-left:16px!important;padding-right:16px!important;position:relative!important;overflow:visible!important}
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    content:attr(data-tooltip)!important;display:block!important;position:absolute!important;
    left:calc(100% + 10px)!important;top:50%!important;transform:translateY(-50%) translateX(-3px)!important;
    z-index:500!important;width:max-content!important;max-width:240px!important;white-space:nowrap!important;pointer-events:none!important;
    padding:7px 9px!important;border-radius:7px!important;background:#101828!important;color:#fff!important;
    border:1px solid rgba(255,255,255,.12)!important;box-shadow:0 8px 24px rgba(0,0,0,.22)!important;
    font-size:12px!important;font-weight:650!important;line-height:1!important;opacity:0!important;visibility:hidden!important;
    transition:opacity .14s ease,visibility .14s ease,transform .14s ease!important
  }
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]:hover::after,
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]:focus-visible::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]:hover::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]:focus-visible::after{
    opacity:1!important;visibility:visible!important;transform:translateY(-50%) translateX(0)!important
  }
  body:not(.dark) .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  body:not(.dark) .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    background:#fff!important;color:#101828!important;border-color:#e4e7ec!important;box-shadow:0 8px 24px rgba(16,24,40,.14)!important
  }
}

body.access-pending{overflow:hidden}
body.access-pending .app-shell{visibility:hidden;pointer-events:none}
.access-gate{display:none;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;padding:24px;background:var(--bg);color:var(--text);overflow:auto}
body.access-pending .access-gate{display:flex}
.access-card{width:min(430px,100%);background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:28px;box-shadow:0 28px 80px rgba(15,23,42,.22);text-align:left}
.access-emblem{display:block;width:72px;height:72px;object-fit:contain;margin:0 auto 12px}
.access-kicker{text-align:center;color:var(--muted);font-size:12px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.access-card h1{margin:8px 0 7px;text-align:center;font-size:25px;letter-spacing:-.025em}
.access-card>p#accessMessage{margin:0 0 20px;text-align:center;color:var(--muted);font-size:13px;line-height:1.5}
.access-field{margin-bottom:13px}.access-field input{font-size:16px}
.access-show{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;margin:2px 0 12px;user-select:none}.access-show input{width:16px;height:16px}
.access-error{min-height:18px;color:#dc2626;font-size:12px;margin:0 0 8px}.access-submit{width:100%;min-height:43px}
.access-note{margin:16px 0 0!important;text-align:center;color:var(--muted);font-size:11px;line-height:1.45}
body.dark .access-card{box-shadow:0 28px 80px rgba(0,0,0,.38)}
.access-settings-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}
@media(max-width:520px){.access-gate{padding:14px}.access-card{padding:22px 18px;border-radius:16px}.access-emblem{width:60px;height:60px}.access-card h1{font-size:22px}.access-settings-actions .btn{width:100%}}

/* V18: polished collapsed-sidebar icon spacing + viewport-level hover tooltip */
@media(min-width:1025px){
  /* Keep a comfortable gutter between every collapsed control and the sidebar edge. */
  .app-shell.sidebar-collapsed .sidebar{
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .app-shell.sidebar-collapsed .sidebar #nav{
    width:100%;
    padding-left:0!important;
    padding-right:0!important;
  }
  .app-shell.sidebar-collapsed .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:42px;
    padding:0!important;
    gap:0!important;
    border-radius:10px;
    overflow:visible!important;
  }
  .app-shell.sidebar-collapsed .sidebar .nav-icon,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-icon{
    width:20px!important;
    min-width:20px!important;
    height:20px!important;
    flex:0 0 20px!important;
    margin:0!important;
    justify-self:auto!important;
  }
  .app-shell.sidebar-collapsed .sidebar .nav-icon svg,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-icon svg{
    width:20px!important;
    height:20px!important;
  }
  /* The real tooltip is rendered at body level so it cannot be clipped by sidebar/nav geometry. */
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    content:none!important;
    display:none!important;
  }
}
.sidebar-hover-tooltip{
  position:fixed;
  z-index:1500;
  left:0;
  top:0;
  max-width:min(260px,calc(100vw - 24px));
  padding:8px 10px;
  border-radius:8px;
  background:#101828;
  color:#fff;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 10px 28px rgba(0,0,0,.24);
  font-size:12px;
  font-weight:650;
  line-height:1.2;
  white-space:nowrap;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transform:translateX(-4px);
  transition:opacity .14s ease,transform .14s ease,visibility .14s ease;
}
.sidebar-hover-tooltip.visible{
  opacity:1;
  visibility:visible;
  transform:translateX(0);
}
body:not(.dark) .sidebar-hover-tooltip{
  background:#fff;
  color:#101828;
  border-color:#e4e7ec;
  box-shadow:0 10px 28px rgba(16,24,40,.16);
}
@media(max-width:1024px){.sidebar-hover-tooltip{display:none!important}}


/* V19: exact V13 sidebar restoration. V13 is the single source of truth. */
/* Disable post-V13 viewport tooltip implementation; V13 uses the sidebar pseudo-tooltip. */
.sidebar-hover-tooltip{display:none!important}

/* Exact V13 desktop sidebar (V13 switches to responsive mode only at 960px). */
@media(min-width:961px){
  .app-shell{
    min-height:100vh!important;
    display:grid!important;
    grid-template-columns:250px 1fr!important;
    transition:grid-template-columns .2s ease!important;
  }
  .app-shell.sidebar-collapsed{grid-template-columns:76px 1fr!important}

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    background:var(--sidebar)!important;
    color:var(--sidebar-text)!important;
    padding:24px 16px!important;
    display:flex!important;
    flex-direction:column!important;
    position:sticky!important;
    top:0!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:100vh!important;
    min-height:0!important;
    overflow:visible!important;
    z-index:auto!important;
    border-radius:0!important;
    box-shadow:none!important;
    transform:none!important;
    transition:none!important;
  }
  .app-shell.sidebar-collapsed .sidebar{
    padding-left:12px!important;
    padding-right:12px!important;
  }

  .brand,
  .app-shell.sidebar-collapsed .brand{
    height:92px!important;
    min-height:92px!important;
    margin:0!important;
    padding:0 8px!important;
    display:flex!important;
    gap:12px!important;
    align-items:center!important;
    justify-content:flex-start!important;
    overflow:hidden!important;
    opacity:1!important;
    visibility:visible!important;
  }
  .brand-wordmark{
    width:auto!important;
    min-width:0!important;
    min-height:100%!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:flex-start!important;
    line-height:1.15!important;
    text-align:left!important;
  }
  .brand-title{
    display:block!important;
    color:#fff!important;
    font-size:28px!important;
    line-height:1!important;
    font-weight:850!important;
    letter-spacing:.01em!important;
    white-space:nowrap!important;
  }
  .brand-subtitle{
    display:block!important;
    margin-top:7px!important;
    color:#98a2b3!important;
    font-size:11px!important;
    line-height:1.2!important;
    font-weight:500!important;
    letter-spacing:.01em!important;
    white-space:nowrap!important;
  }
  .app-shell.sidebar-collapsed .brand{
    justify-content:center!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .app-shell.sidebar-collapsed .brand-wordmark{
    width:100%!important;
    min-height:100%!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }
  .app-shell.sidebar-collapsed .brand-title{
    font-size:11.5px!important;
    line-height:1!important;
    letter-spacing:0!important;
  }
  .app-shell.sidebar-collapsed .brand-subtitle{display:none!important}

  .sidebar #nav,
  .app-shell.sidebar-collapsed .sidebar #nav{
    display:grid!important;
    grid-template-columns:none!important;
    gap:6px!important;
    margin:18px 0 0!important;
    padding:0!important;
    width:auto!important;
    max-width:none!important;
    overflow:visible!important;
    overscroll-behavior:auto!important;
    scrollbar-width:auto!important;
    flex:initial!important;
  }
  .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar nav button{
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:11px 13px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:var(--sidebar-text)!important;
    text-align:left!important;
    font:inherit!important;
    font-weight:400!important;
    white-space:normal!important;
    overflow:visible!important;
    transform:none!important;
    transition:none!important;
  }
  .sidebar nav button:hover,
  .sidebar nav button.active{
    background:#1d2939!important;
    color:#fff!important;
  }
  .app-shell.sidebar-collapsed .sidebar nav button{
    justify-content:center!important;
    padding-left:10px!important;
    padding-right:10px!important;
  }

  .nav-icon,
  .app-shell.sidebar-collapsed .sidebar .nav-icon,
  .sidebar-toggle .nav-icon,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-icon{
    width:18px!important;
    min-width:18px!important;
    height:18px!important;
    display:inline-grid!important;
    place-items:center!important;
    flex:0 0 18px!important;
    margin:0!important;
    transform:none!important;
  }
  .nav-icon svg,
  .app-shell.sidebar-collapsed .sidebar .nav-icon svg,
  .sidebar-toggle .nav-icon svg,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-icon svg{
    width:18px!important;
    height:18px!important;
    display:block!important;
    fill:currentColor!important;
  }
  .sidebar .nav-label,
  .sidebar-toggle .nav-label{
    display:inline!important;
    min-width:0!important;
    max-width:none!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    transition:none!important;
  }
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{display:none!important}

  .sidebar-bottom,
  .app-shell.sidebar-collapsed .sidebar-bottom{
    position:static!important;
    inset:auto!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    margin-top:auto!important;
    padding:0!important;
    overflow:visible!important;
    display:block!important;
  }
  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    position:relative!important;
    inset:auto!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0 0 8px!important;
    padding:10px 13px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:var(--sidebar-text)!important;
    text-align:left!important;
    font:inherit!important;
    overflow:visible!important;
    transform:none!important;
  }
  .sidebar-toggle:hover{background:#1d2939!important;color:#fff!important}
  .app-shell.sidebar-collapsed .sidebar-toggle{
    justify-content:center!important;
    padding-left:10px!important;
    padding-right:10px!important;
  }
  .sidebar-toggle-icon{transition:transform .2s ease!important}
  .app-shell.sidebar-collapsed .sidebar-toggle-icon{transform:rotate(180deg)!important}

  .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer{
    position:static!important;
    inset:auto!important;
    width:auto!important;
    height:auto!important;
    max-height:none!important;
    margin-top:0!important;
    padding:15px 8px 0!important;
    border-top:1px solid rgba(255,255,255,.1)!important;
    color:#98a2b3!important;
    font-size:12px!important;
    line-height:inherit!important;
    opacity:1!important;
    visibility:visible!important;
    overflow:visible!important;
    white-space:normal!important;
    pointer-events:auto!important;
    transition:none!important;
  }
  .app-shell.sidebar-collapsed .sidebar-footer{display:none!important}

  /* V13 collapsed tooltip geometry and presentation. */
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    content:attr(data-tooltip)!important;
    display:block!important;
    position:absolute!important;
    left:calc(100% + 12px)!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    z-index:200!important;
    width:auto!important;
    max-width:none!important;
    white-space:nowrap!important;
    pointer-events:none!important;
    padding:7px 9px!important;
    border-radius:7px!important;
    background:#101828!important;
    color:#fff!important;
    border:1px solid rgba(255,255,255,.12)!important;
    box-shadow:0 8px 24px rgba(0,0,0,.22)!important;
    font-size:12px!important;
    font-weight:650!important;
    line-height:1!important;
    opacity:0!important;
    visibility:hidden!important;
    transition:opacity .12s ease,visibility .12s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]:hover::after,
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]:focus-visible::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]:hover::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]:focus-visible::after{
    opacity:1!important;
    visibility:visible!important;
  }

  /* Exact V13 light-theme sidebar. */
  body:not(.dark){--sidebar:#fff;--sidebar-text:#475467}
  body:not(.dark) .sidebar{
    background:#fff!important;
    color:#475467!important;
    border-right:1px solid var(--line)!important;
  }
  body:not(.dark) .brand-title{color:#101828!important}
  body:not(.dark) .brand-subtitle{color:#667085!important}
  body:not(.dark) .sidebar nav button,
  body:not(.dark) .sidebar-toggle{color:#475467!important}
  body:not(.dark) .sidebar nav button:hover,
  body:not(.dark) .sidebar nav button.active,
  body:not(.dark) .sidebar-toggle:hover{background:#f2f4f7!important;color:#101828!important}
  body:not(.dark) .sidebar-footer{border-top-color:#e4e7ec!important;color:#667085!important}
  body:not(.dark) .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  body:not(.dark) .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    background:#fff!important;
    color:#101828!important;
    border-color:#e4e7ec!important;
    box-shadow:0 8px 24px rgba(16,24,40,.14)!important;
  }
  body.dark .sidebar{background:#101828!important;color:#cbd5e1!important;border-right:0!important}
  body.dark .brand-title{color:#fff!important}
  body.dark .brand-subtitle{color:#98a2b3!important}
}

/* Exact V13 responsive sidebar behavior. */
@media(max-width:960px){
  .app-shell,
  .app-shell.sidebar-collapsed{
    min-height:100vh!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    transition:grid-template-columns .2s ease!important;
  }
  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    position:static!important;
    inset:auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    padding:12px!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:visible!important;
    z-index:auto!important;
    border-radius:0!important;
    transform:none!important;
    transition:none!important;
  }
  .brand,
  .app-shell.sidebar-collapsed .brand{
    height:auto!important;
    min-height:auto!important;
    margin:0!important;
    padding:4px 8px 18px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    overflow:hidden!important;
  }
  .brand-wordmark,
  .app-shell.sidebar-collapsed .brand-wordmark{
    width:auto!important;
    min-width:0!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:flex-start!important;
    text-align:left!important;
  }
  .brand-title,
  .app-shell.sidebar-collapsed .brand-title{
    display:block!important;
    font-size:24px!important;
    line-height:1!important;
    font-weight:850!important;
    letter-spacing:.01em!important;
    white-space:nowrap!important;
  }
  .brand-subtitle,
  .app-shell.sidebar-collapsed .brand-subtitle{
    display:block!important;
    margin-top:7px!important;
    font-size:11px!important;
    line-height:1.2!important;
    white-space:nowrap!important;
  }
  .sidebar #nav,
  .app-shell.sidebar-collapsed .sidebar #nav{
    display:flex!important;
    flex-direction:row!important;
    gap:6px!important;
    margin:0!important;
    padding:0!important;
    width:auto!important;
    overflow:auto!important;
    scrollbar-width:auto!important;
  }
  .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar nav button{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:11px 13px!important;
    border-radius:9px!important;
    font-weight:400!important;
    white-space:nowrap!important;
    overflow:visible!important;
  }
  .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar .nav-label{
    display:inline!important;
    min-width:0!important;
    max-width:none!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    opacity:1!important;
    visibility:visible!important;
  }
  .nav-icon,
  .app-shell.sidebar-collapsed .sidebar .nav-icon{
    width:18px!important;
    min-width:18px!important;
    height:18px!important;
    flex:0 0 18px!important;
  }
  .nav-icon svg,
  .app-shell.sidebar-collapsed .sidebar .nav-icon svg{width:18px!important;height:18px!important}
  .sidebar-toggle,
  .sidebar-bottom{display:none!important}
  .sidebar-footer{display:none!important}
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{content:none!important;display:none!important}
}


/* V20: fixed sidebar toggle + polished bidirectional sidebar animation + blank brand area */
@media(min-width:961px){
  .app-shell,
  .app-shell.sidebar-collapsed{
    grid-template-columns:250px minmax(0,1fr)!important;
    transition:grid-template-columns .36s cubic-bezier(.22,1,.36,1)!important;
    will-change:grid-template-columns;
  }
  .app-shell.sidebar-collapsed{grid-template-columns:76px minmax(0,1fr)!important}

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    position:sticky!important;
    top:0!important;
    height:100vh!important;
    padding:24px 16px!important;
    overflow:visible!important;
    transition:padding .36s cubic-bezier(.22,1,.36,1),background-color .2s ease,border-color .2s ease!important;
    will-change:padding;
  }
  .app-shell.sidebar-collapsed .sidebar{padding-left:12px!important;padding-right:12px!important}

  /* Keep the former V13 branding footprint but leave it intentionally blank. */
  .brand,
  .app-shell.sidebar-collapsed .brand{
    height:92px!important;
    min-height:92px!important;
    margin:0!important;
    padding:0 8px!important;
    display:block!important;
    overflow:hidden!important;
    pointer-events:none!important;
  }
  .brand-wordmark,.brand-title,.brand-subtitle{display:none!important}

  .sidebar #nav,
  .app-shell.sidebar-collapsed .sidebar #nav{
    margin:18px 0 0!important;
    gap:6px!important;
  }

  /* Animate menu geometry instead of switching display/justify states mid-transition. */
  .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar nav button{
    display:grid!important;
    grid-template-columns:18px minmax(0,1fr)!important;
    align-items:center!important;
    justify-content:stretch!important;
    column-gap:10px!important;
    padding:11px 13px!important;
    transition:padding .36s cubic-bezier(.22,1,.36,1),column-gap .30s cubic-bezier(.22,1,.36,1),background-color .18s ease,color .18s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar nav button{
    grid-template-columns:18px 0fr!important;
    column-gap:0!important;
    padding-left:17px!important;
    padding-right:17px!important;
  }

  .sidebar .nav-label,
  .sidebar-toggle .nav-label,
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    display:block!important;
    min-width:0!important;
    max-width:180px!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    text-overflow:clip!important;
    opacity:1!important;
    visibility:visible!important;
    transform:translateX(0)!important;
    transition:max-width .32s cubic-bezier(.22,1,.36,1),opacity .18s ease,transform .32s cubic-bezier(.22,1,.36,1)!important;
  }
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    max-width:0!important;
    opacity:0!important;
    visibility:hidden!important;
    transform:translateX(-6px)!important;
  }

  .nav-icon,
  .sidebar-toggle .nav-icon{
    transition:color .18s ease,transform .36s cubic-bezier(.22,1,.36,1)!important;
  }

  /* Anchor the toggle to one viewport position in both sidebar states. */
  .sidebar-bottom,
  .app-shell.sidebar-collapsed .sidebar-bottom{
    position:static!important;
    margin:0!important;
    padding:0!important;
  }
  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    position:absolute!important;
    left:16px!important;
    bottom:58px!important;
    right:auto!important;
    top:auto!important;
    width:218px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:18px minmax(0,1fr)!important;
    align-items:center!important;
    justify-content:stretch!important;
    column-gap:10px!important;
    padding:10px 13px!important;
    transition:width .36s cubic-bezier(.22,1,.36,1),column-gap .30s cubic-bezier(.22,1,.36,1),background-color .18s ease,color .18s ease!important;
    z-index:3!important;
  }
  .app-shell.sidebar-collapsed .sidebar-toggle{
    width:44px!important;
    grid-template-columns:18px 0fr!important;
    column-gap:0!important;
    padding-left:13px!important;
    padding-right:13px!important;
  }
  .sidebar-toggle-icon{transition:transform .36s cubic-bezier(.22,1,.36,1)!important}
  .app-shell.sidebar-collapsed .sidebar-toggle-icon{transform:rotate(180deg)!important}

  .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer{
    position:absolute!important;
    left:16px!important;
    right:16px!important;
    bottom:22px!important;
    width:auto!important;
    margin:0!important;
    padding:10px 8px 0!important;
    opacity:1!important;
    visibility:visible!important;
    display:block!important;
    transition:opacity .16s ease,visibility .16s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar-footer{
    display:block!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  .main{
    min-width:0!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .app-shell,.sidebar,.sidebar nav button,.sidebar-toggle,.sidebar .nav-label,.sidebar-footer,.sidebar-toggle-icon{transition:none!important}
}

/* V21: reliable bidirectional sidebar motion + unclipped collapsed hover tooltips */
@media(min-width:961px){
  /* Let the first grid track follow the sidebar's animated physical width.
     This is more reliable than interpolating grid-template-columns directly. */
  .app-shell,
  .app-shell.sidebar-collapsed{
    grid-template-columns:auto minmax(0,1fr)!important;
    transition:none!important;
  }

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar{
    box-sizing:border-box!important;
    width:250px!important;
    min-width:0!important;
    max-width:none!important;
    transition:
      width .38s cubic-bezier(.22,1,.36,1),
      padding-left .38s cubic-bezier(.22,1,.36,1),
      padding-right .38s cubic-bezier(.22,1,.36,1),
      background-color .20s ease,
      border-color .20s ease!important;
    will-change:width,padding-left,padding-right;
  }
  .app-shell.sidebar-collapsed .sidebar{
    width:76px!important;
  }

  /* Keep the menu's column model stable while only the available width,
     gap and label visibility interpolate. This prevents expansion snapping. */
  .sidebar nav button,
  .app-shell.sidebar-collapsed .sidebar nav button{
    grid-template-columns:18px minmax(0,1fr)!important;
    transition:
      padding-left .38s cubic-bezier(.22,1,.36,1),
      padding-right .38s cubic-bezier(.22,1,.36,1),
      column-gap .34s cubic-bezier(.22,1,.36,1),
      background-color .18s ease,
      color .18s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar nav button{
    column-gap:0!important;
  }

  .sidebar .nav-label,
  .sidebar-toggle .nav-label,
  .app-shell.sidebar-collapsed .sidebar .nav-label,
  .app-shell.sidebar-collapsed .sidebar-toggle .nav-label{
    transition:
      max-width .34s cubic-bezier(.22,1,.36,1),
      opacity .20s ease,
      transform .34s cubic-bezier(.22,1,.36,1)!important;
  }

  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar-toggle{
    grid-template-columns:18px minmax(0,1fr)!important;
    transition:
      width .38s cubic-bezier(.22,1,.36,1),
      padding-left .38s cubic-bezier(.22,1,.36,1),
      padding-right .38s cubic-bezier(.22,1,.36,1),
      column-gap .34s cubic-bezier(.22,1,.36,1),
      background-color .18s ease,
      color .18s ease!important;
  }
  .app-shell.sidebar-collapsed .sidebar-toggle{column-gap:0!important}

  /* Use the body-level tooltip in collapsed mode so labels remain fully visible
     outside the 76px sidebar and are never clipped by nav/sidebar geometry. */
  .sidebar-hover-tooltip{display:block!important}
  .app-shell.sidebar-collapsed .sidebar nav button[data-tooltip]::after,
  .app-shell.sidebar-collapsed .sidebar-toggle[data-tooltip]::after{
    content:none!important;
    display:none!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .sidebar,
  .app-shell.sidebar-collapsed .sidebar,
  .sidebar nav button,
  .sidebar-toggle,
  .sidebar .nav-label,
  .sidebar-toggle .nav-label{
    transition:none!important;
  }
}
