:root {
  --ui-bg: #f4f7fc;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f1f5fb;
  --ui-text: #142440;
  --ui-muted: #52647f;
  --ui-line: #dce5f1;
  --ui-accent: #205bd6;
  --ui-radius: 12px;
}
.theme-dark {
  --ui-bg: #101827;
  --ui-surface: #1d2a3d;
  --ui-surface-soft: #162237;
  --ui-text: #f1f6ff;
  --ui-muted: #c1cee2;
  --ui-line: #40516b;
  --ui-accent: #a4c8ff;
}
body,.main,.content {background:var(--ui-bg);color:var(--ui-text)}
.sidebar {
  width:256px;
  padding:18px 13px;
  background:#fbfcff;
  color:#40516d;
  border-right:1px solid #dce5f1;
  box-shadow:4px 0 24px #203e6a08;
}
.sidebar .brand {color:#142440;margin-bottom:23px;padding:4px 8px;min-height:56px;font-size:16px}
.sidebar .brand small {color:#667998;font-size:9px;letter-spacing:1.7px}
.brand-mark {width:44px;height:44px;border-radius:12px;background:#e8f0ff;color:#205bd6;box-shadow:none}
.sidebar .nav-section {color:#536985;font-size:10px;font-weight:700;letter-spacing:1.5px;margin:18px 12px 8px}
.sidebar a,.sidebar .nav-item {color:#40516d;border-radius:10px;min-height:46px;margin:2px 0;font-weight:550}
.sidebar a:hover {background:#f0f5ff;color:#194cba}
.sidebar a.active,.sidebar a.active:hover {position:relative;background:#e7efff;color:#164fbe;font-weight:700}
.sidebar a.active::before {content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:#2465e5}
.sidebar .nav-unavailable {color:#536985}
.nav-soon {color:#536985;font-size:10px}
.sidebar-foot {border-top:1px solid #dce5f1}
.sidebar-foot a {font-weight:600}
.topbar {height:78px;padding:0 27px;background:var(--ui-surface);border-bottom:1px solid var(--ui-line);gap:18px}
.compact-brand {color:var(--ui-text)}
.crumb {font-size:12px;color:var(--ui-muted)}
.crumb strong {font-weight:700}
.global-search {height:44px;width:min(520px,44vw);border:1px solid var(--ui-line);border-radius:11px;background:var(--ui-surface-soft);box-shadow:none;padding:0 15px}
.global-search input {font-size:13px}
.global-search .badge {font-size:10px;border:1px solid var(--ui-line);background:var(--ui-surface);color:var(--ui-muted)}
.top-actions {gap:8px}
.top-actions .icon-button,.notification-menu>summary,.user-menu>summary {background:var(--ui-surface-soft);color:#3d5b87;border:1px solid var(--ui-line);border-radius:11px;box-shadow:none}
.user-menu>summary {border-radius:50%;border:2px solid var(--ui-surface);box-shadow:0 0 0 1px var(--ui-line)}
.content {padding:24px 28px 36px}
.panel,.card {border:1px solid var(--ui-line);border-radius:var(--ui-radius);box-shadow:0 4px 20px #24436709}
.button {min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:9px;font-weight:650;line-height:1.2;background:#205bd6}
.button.secondary {background:var(--ui-surface-soft);color:#294264;border:1px solid var(--ui-line)}
.button .ui-icon {width:17px;height:17px}
.back-link {display:inline-flex;align-items:center;gap:6px;text-decoration:none;font-weight:650}
.back-link .ui-icon {width:16px;height:16px}
.theme-dark .sidebar {background:#172338;color:#c4d0e2;border-color:#34445e;box-shadow:none}
.theme-dark .sidebar .brand {color:#f1f6ff}
.theme-dark .sidebar .brand small {color:#a2b5d0}
.theme-dark .brand-mark {background:#294b84;color:#d7e8ff}
.theme-dark .sidebar .nav-section {color:#94a9c8}
.theme-dark .sidebar a,.theme-dark .sidebar .nav-item {color:#c4d0e2}
.theme-dark .sidebar a:hover {background:#263c5c;color:#fff}
.theme-dark .sidebar a.active,.theme-dark .sidebar a.active:hover {background:#28528d;color:#fff}
.theme-dark .sidebar a.active::before {background:#a9cbff}
.theme-dark .sidebar .nav-unavailable {color:#a5b6cd}
.theme-dark .nav-soon {color:#b6c6db}
.theme-dark .sidebar-foot {border-color:#34445e}
.theme-dark .topbar {background:#152034;border-color:#34445e}
.theme-dark .global-search {background:#1e2d44;border-color:#40516b}
.theme-dark .global-search .badge {background:#253650}
.theme-dark .top-actions .icon-button,.theme-dark .notification-menu>summary {background:#263852;color:#e5efff;border-color:#40516b}
.theme-dark .button.secondary {background:#263852;color:#e6efff;border-color:#40516b}
.theme-dark .panel,.theme-dark .card {box-shadow:none}
.theme-dark .user-menu>summary {border-color:#152034}
.account-page {max-width:1100px}
.account-page-header {margin:0 0 22px}
.account-page-header h1 {font-size:28px;letter-spacing:-.035em}
.account-page .account-layout {grid-template-columns:220px minmax(0,1fr);gap:18px}
.account-form {grid-column:2;grid-row:1}
.account-aside {grid-column:1;grid-row:1;position:sticky;top:100px}
.account-section {border-radius:10px;background:var(--ui-surface-soft);border-color:var(--ui-line)}
.account-aside a {border-radius:8px;padding:10px!important}
.account-aside a[aria-current="location"] {background:#e7efff;color:#164fbe}
.theme-dark .account-aside a[aria-current="location"] {background:#28528d;color:#fff}
.login-shell {min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,480px);background:var(--ui-bg)}
.login-brand {display:flex;flex-direction:column;justify-content:space-between;padding:50px clamp(28px,6vw,90px);background:linear-gradient(145deg,#112d65,#0b1b37);color:#fff}
.login-brandmark {display:flex;align-items:center;gap:14px;font-size:20px;font-weight:750;letter-spacing:-.02em}
.login-brandmark .brand-mark {display:grid;place-items:center;cursor:default}
.login-brand h1 {max-width:600px;font-size:clamp(36px,4vw,64px);line-height:1.04;letter-spacing:-.045em;margin:0 0 20px}
.login-brand p {max-width:500px;color:#c8d9fa;font-size:17px;line-height:1.5;margin:0}
.login-brand small {color:#a9bde1;letter-spacing:.08em;text-transform:uppercase}
.login-side {display:grid;place-items:center;padding:28px;background:var(--ui-surface)}
.login-card {width:min(100%,380px);padding:0;border:0;box-shadow:none;background:transparent}
.login-card h2 {font-size:30px;letter-spacing:-.035em;margin-bottom:8px}
.login-card .login-intro {margin-bottom:27px}
.login-card label {font-weight:650;color:var(--ui-text)}
.login-card input {min-height:44px;width:100%;background:var(--ui-surface-soft);border-color:var(--ui-line)}
.login-card .button {width:100%;margin-top:24px;min-height:44px}
.tenant-card {max-width:600px;margin:5vh auto;padding:28px}
.tenant-card h1 {font-size:28px;letter-spacing:-.035em;margin-bottom:8px}
.tenant-card .tenant-intro {color:var(--ui-muted);margin-bottom:24px}
.tenant-card .tenant-option {display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface-soft);cursor:pointer}
.tenant-card .tenant-option input {margin:0}
.tenant-card .button {margin-top:16px;min-width:160px}
@media(max-width:1120px) {.sidebar {width:76px}.sidebar.collapsed {width:76px}.topbar {padding-inline:20px}}
@media(max-width:760px) {
  .sidebar {background:#fbfcff;width:min(300px,85vw)}
  .theme-dark .sidebar {background:#172338}
  .topbar {height:auto;min-height:116px;padding:10px 12px;gap:8px}
  .global-search {width:100%;height:42px}
  .content {padding:16px 12px 28px}
  .account-page .account-layout {grid-template-columns:minmax(0,1fr)}
  .account-form,.account-aside {grid-column:1;grid-row:auto}
  .account-aside {position:static}
  .login-shell {grid-template-columns:1fr;min-height:100vh}
  .login-brand {min-height:210px;padding:25px 22px}
  .login-brand h1 {font-size:32px;margin-top:26px;margin-bottom:8px}
  .login-brand p {font-size:14px}
  .login-brand small {display:none}
  .login-side {align-items:start;padding:22px 18px}
  .login-card {width:100%;max-width:420px}
  .tenant-card {margin:20px auto;padding:22px}
}
