:root {
  color-scheme: light;
  --canvas: #f5f6f4;
  --surface: #fff;
  --surface-soft: #f8f9f7;
  --ink: #202a29;
  --muted: #62716d;
  --line: #dfe5e1;
  --accent: #116653;
  --accent-soft: #e8f3ee;
  --rail: #182b29;
  --rail-text: #b8cac5;
  --shadow: 0 2px 6px #18372b05;
}
html.dark {
  color-scheme: dark;
  --canvas: #111b1a;
  --surface: #1a2725;
  --surface-soft: #20302c;
  --ink: #e5ede9;
  --muted: #a4b8ae;
  --line: #32443e;
  --accent: #87d6b4;
  --accent-soft: #233e33;
  --rail: #0c1614;
  --shadow: none;
}
html { font-family: Inter, "Segoe UI", system-ui, sans-serif; }
body { background: var(--canvas) !important; color: var(--ink); font-size: 14px; letter-spacing: -.012em; }
body > .flex.flex-1 { min-height: calc(100dvh - 72px); overflow: visible; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, [role="button"], a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid #3b9d83 !important; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 10000; padding: 12px 18px; background: var(--surface); border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.workspace-header { height: 72px; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand-link { display: flex; align-items: center; gap: 10px; min-width: 175px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--surface); display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 23px; font-weight: 750; letter-spacing: -.05em; }
.brand-context { font-size: 12px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 20px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; position: relative; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }
.icon-button svg { width: 18px; height: 18px; }
.header-actions #userMenuButton { border-radius: 9px; padding: 3px 8px 3px 3px; }
#headerUserInitials { background: var(--accent-soft); color: var(--accent); border-radius: 50%; }
#headerUserEmail { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
#loginBtn, #logoutBtn { min-height: 38px; background: var(--surface); border-color: var(--line); color: var(--ink); font-size: 12px; }
#userMenu { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: 0 12px 40px #0002; }
#sidebar { flex: 0 0 auto; position: sticky; top: 72px; height: calc(100dvh - 72px); width: 224px !important; background: var(--rail); color: var(--rail-text); border: none; padding: 24px 14px 18px; z-index: 30; overflow-y: auto; }
#sidebar.sidebar-collapsed { width: 76px !important; }
.nav-group-label { color: #829b92; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 650; padding: 12px 14px 10px; }
.nav-group-label:not(:first-child) { margin-top: 20px; }
.workspace-nav a { display: flex; align-items: center; gap: 12px; height: 43px; padding: 0 14px; border-radius: 7px; margin: 3px 0; font-size: 13px; color: #bdcec7; white-space: nowrap; }
.workspace-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.workspace-nav a:hover { background: #ffffff0c; color: #fff; }
.workspace-nav a[aria-current="page"] { background: #d4e8dd; color: #1a4435; font-weight: 650; }
.workspace-nav a[aria-current="page"]::after { content: ""; width: 5px; height: 5px; background: #1a4435; border-radius: 50%; margin-left: auto; }
.rail-footer { margin-top: auto; padding: 32px 14px 0; color: #87a195; font-size: 11px; line-height: 1.8; }
.rail-footer strong { display: block; color: #c7d7cf; font-weight: 500; }
.sidebar-collapsed .nav-text, .sidebar-collapsed .nav-group-label, .sidebar-collapsed .rail-footer { display: none !important; }
.sidebar-collapsed .workspace-nav a { padding: 0; justify-content: center; }
.sidebar-collapsed .workspace-nav a[aria-current]::after { display: none; }
main { min-width: 0; padding: 32px 36px 48px !important; background: var(--canvas); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 0 30px !important; }
.page-eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.page-eyebrow span { color: #91a199; }
main h1 { font-size: clamp(25px, 2.3vw, 32px) !important; line-height: 1.2; font-weight: 650 !important; letter-spacing: -.045em; color: var(--ink) !important; }
.page-description { margin-top: 10px; color: var(--muted); line-height: 1.6; max-width: 680px; font-size: 13px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; align-self: center; }
.page-actions:empty { display: none; }
.collection-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 28px; }
.overview-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 19px 22px; box-shadow: var(--shadow); }
.overview-label { font-size: 12px; color: var(--muted); }
.overview-value { font-size: 29px; font-weight: 600; margin-top: 7px; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.overview-note { font-size: 11px; color: var(--muted); margin-top: 3px; }
.page-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px !important; }
main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), main select, main textarea { border-color: var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: none; }
main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), main select { min-height: 40px; }
main input::placeholder, main textarea::placeholder { color: var(--muted); opacity: .9; }
main input[type="checkbox"], main input[type="radio"] { accent-color: #116653; }
main input[id*="Search"], main input[id*="search"] { min-width: min(290px, 100%); }
.primary-action, main .bg-brand-300, main .bg-brand-600 { background: #116653 !important; color: #fff !important; border: 1px solid #116653 !important; border-radius: 8px !important; min-height: 40px; padding: 9px 15px; font-weight: 550; font-size: 12px; box-shadow: 0 1px 2px #0001; }
.primary-action:hover, main .bg-brand-300:hover, main .bg-brand-600:hover { background: #0b5142 !important; }
main .rounded-2xl { border-radius: 11px; }
main > .bg-white, main section.bg-white, main .grid > .bg-white { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto !important; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
main > .table-scroll > table { min-width: 850px; }
main > .table-scroll td:first-child { min-width: 180px; }
main > .table-scroll td { white-space: nowrap; }
html.dark .text-brand-600, html.dark .text-brand-500 { color: var(--accent); }
thead { background: var(--surface-soft) !important; border-color: var(--line) !important; }
th { font-size: 10px !important; letter-spacing: .065em; text-transform: uppercase; color: var(--muted); font-weight: 600 !important; padding: 14px 18px !important; white-space: nowrap; }
td { padding: 18px !important; font-size: 12px; border-color: var(--line); color: var(--muted); max-width: 320px; overflow-wrap: anywhere; }
td:first-child { color: var(--ink); font-weight: 600; }
tbody tr { border-color: var(--line) !important; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-soft) !important; }
td .rounded-full { font-size: 10px; font-weight: 550; padding: 4px 9px; }
.empty-state { text-align: center; padding: 60px 24px !important; }
.empty-state strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-weight: 400; font-size: 12px; }
.table-empty-icon { width: 36px; height: 36px; margin: 0 auto 14px; color: #729184; }
body > div.fixed[id] { padding: 20px; backdrop-filter: blur(4px); }
body > div.fixed[id] > div { max-height: calc(100dvh - 40px); overflow: auto; border-radius: 14px; }
.ui-backdrop { display: none; }
.theme-sun { display: none; }
.dark .theme-sun { display: block; }
.dark .theme-moon { display: none; }
html.dark main .bg-white { background-color: var(--surface); }
html.dark main .text-slate-900, html.dark main .text-slate-800 { color: var(--ink); }
html.dark main .text-slate-600, html.dark main .text-slate-500 { color: var(--muted); }
@media (min-width: 1500px) { main { padding-left: 48px !important; padding-right: 48px !important; } }
@media (max-width: 1000px) { .brand-context { display: none; } main { padding: 26px 24px !important; } }
@media (max-width: 767px) {
  .workspace-header { height: 64px; padding: 0 16px; gap: 10px; }
  .brand-link { min-width: 0; gap: 8px; }
  .brand-name { font-size: 21px; }
  .header-actions { gap: 8px; }
  #loginBtn, #logoutBtn { padding: 7px 10px; font-size: 11px; }
  #sidebar, #sidebar.sidebar-collapsed { position: fixed; left: 0; top: 64px; height: calc(100dvh - 64px); width: 240px !important; transform: translateX(-100%); transition: transform .18s ease; z-index: 45; }
  body.nav-open #sidebar { transform: translateX(0); }
  .sidebar-collapsed .nav-text, .sidebar-collapsed .nav-group-label { display: block !important; }
  .sidebar-collapsed .workspace-nav a { padding: 0 14px; justify-content: flex-start; }
  body.nav-open .ui-backdrop { display: block; position: fixed; inset: 64px 0 0; z-index: 44; background: #06171080; }
  main { width: 100%; padding: 24px 16px 40px !important; }
  .page-heading { flex-wrap: wrap; gap: 16px; margin-bottom: 24px !important; }
  .page-description { font-size: 12px; }
  .page-actions { width: 100%; }
  .collection-overview { gap: 8px; margin-bottom: 22px; }
  .overview-item { padding: 14px 12px; }
  .overview-label { font-size: 10px; }
  .overview-value { font-size: 25px; }
  .overview-note { display: none; }
  .page-toolbar input { width: 100%; }
  th { padding: 12px !important; }
  td { padding: 14px 12px !important; }
  body > div.fixed[id] { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
