/* Prototype look: a solid blue header across the top, a white menu card on the left, flat white cards and blue
   buttons. Loaded after app.css only when this browser has it switched on (?ui=new; ?ui=classic turns it off). */
:root {
  --bg: #f3f4f9; --card: #ffffff; --text: #1f2430; --muted: #6b7183; --line: #e4e6ef;
  --brand: #4a5ee8; --brand-ink: #ffffff; --brand-soft: #edf0fe; --side-ink: #4b5163;
  --top: #4a5ee8; --top-ink: #ffffff; --radius: 10px; --shadow: none;
  --top-h: 56px; --side-w: 210px; --gap: .75rem;
}
html[data-nav=collapsed] { --side-w: 64px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #11131a; --card: #1a1d27; --text: #e6e8f0; --muted: #9aa0b3; --line: #2a2e3b; --brand: #8191ff; --brand-soft: #242a4c; --side-ink: #c9cde0; --top: #3343c4; }
}
:root[data-theme="dark"] { --bg: #11131a; --card: #1a1d27; --text: #e6e8f0; --muted: #9aa0b3; --line: #2a2e3b; --brand: #8191ff; --brand-soft: #242a4c; --side-ink: #c9cde0; --top: #3343c4; }

html { font-size: 14px; }
body { font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif; }
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }

/* Blue header across the whole top, with the logo and name on the left */
body.has-side { padding-top: var(--top-h); }
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: var(--top); border: 0; color: var(--top-ink); }
body.has-side .topbar { margin-left: 0; }
.topbar-inner { min-height: var(--top-h); padding: 0 1.25rem; justify-content: flex-start; gap: .9rem; }
.top-brand { display: inline-flex; margin-right: 1.25rem; color: var(--top-ink); font-size: 1.8rem; font-weight: 700; letter-spacing: -.015em; line-height: 1; gap: .6rem; }
.top-brand .brand-logo { width: 32px; height: 32px; padding: 0; background: transparent; }
.topbar select, .topbar .theme-switch { background: rgb(255 255 255 / 14%); color: var(--top-ink); border: 1px solid rgb(255 255 255 / 35%); border-radius: var(--radius); }
.topbar select:focus { outline: 2px solid rgb(255 255 255 / 55%); border-color: #fff; }
.topbar select option { color: #1f2430; background: #fff; }
.topbar .theme-switch:hover { background: rgb(255 255 255 / 24%); color: var(--top-ink); }
.topbar .groupname { color: var(--top-ink); }
.ask-btn { color: var(--top-ink); border: 1px solid rgb(255 255 255 / 45%); background: rgb(255 255 255 / 14%); box-shadow: none; border-radius: var(--radius); }
.ask-btn:hover, .ask-btn.on { background: rgb(255 255 255 / 24%); box-shadow: none; }
.acctmenu-btn:hover, .acctmenu[open] > .acctmenu-btn { border-color: rgb(255 255 255 / 55%); }
.acctmenu-btn.active { border-color: #fff; }
.acctmenu-pop { color: var(--text); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(20 25 50 / 18%); }
.burger span { background: var(--top-ink); }
.theme-switch { border-radius: var(--radius); }

/* The menu: a white card down the left */
.sidenav { top: calc(var(--top-h) + var(--gap)); left: var(--gap); bottom: var(--gap); width: var(--side-w); border: 1px solid var(--line); border-radius: var(--radius); }
.side-brand { display: none; }
body.has-side .page { margin-left: calc(var(--side-w) + var(--gap)); }
.sidelinks { padding: .45rem 0; gap: .05rem; }
.sidenav { scrollbar-width: thin; }
.sidelinks a { padding: .45rem 1rem; border-radius: 0; font-size: 1rem; font-weight: 400; color: var(--side-ink); gap: .7rem; }
.sidelinks a:hover { background: var(--bg); color: var(--text); }
.sidelinks a.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.sidelinks .navicon { width: 20px; height: 20px; }
.sidegroup { margin: .75rem 1rem .25rem; font-size: .72rem; color: var(--muted); opacity: 1; }
.side-collapse { margin: .5rem .8rem .9rem; padding: .6rem .6rem; color: var(--muted); border-radius: var(--radius); }
html[data-nav=collapsed] .sidelinks a { padding: .5rem 0; }
html[data-nav=collapsed] .sidegroup { margin: .6rem .8rem; }

/* Page, cards and controls: flat, roomy, blue accents */
.page { padding: var(--gap) 1.25rem 1.25rem var(--gap); }
.card { border-radius: var(--radius); box-shadow: none; }
.card.flush { padding: 0; }
.btn { border-radius: var(--radius); border-color: var(--brand); color: var(--brand); background: var(--card); }
.btn:hover { background: var(--brand-soft); }
.btn.primary { color: var(--brand-ink); background: var(--brand); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.btn.ghost, .btn.ghost:hover { border-color: transparent; }
input, select, textarea { border-radius: 4px; }
.count { border-radius: 4px; }
table.data th { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.tabs a.active { color: var(--brand); }

/* Phones and tablets: the header scrolls with the page and the menu slides in from the left, full height */
@media (max-width: 900px) {
  body.has-side { padding-top: 0; }
  .topbar { position: sticky; }
  .topbar-inner { padding: 0 .75rem; }
  .top-brand { font-size: 1.5rem; margin-right: auto; }
  .sidenav { top: 0; left: 0; bottom: 0; border-radius: 0; border: 0; width: 280px; }
  body.has-side .page { margin-left: 0; }
  .page { padding: 1rem; }
  .usermenu.in-side select, .usermenu.in-side .theme-switch { background: var(--card); color: var(--text); border-color: var(--line); }
}
@media print { body.has-side { padding-top: 0; } body.has-side .page { margin-left: 0; } }

/* Charts: bars in the header's blue */
:root { --series-1: #4a5ee8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #7383ff; } }
:root[data-theme="dark"] { --series-1: #7383ff; }

/* One height for every button and dropdown, in the top bar and on every page */
:root { --ctl-h: 34px; --control-h: var(--ctl-h); }
.btn, .btn.small { height: var(--ctl-h); min-height: var(--ctl-h); padding: 0 .85rem; font-size: .9rem; justify-content: center; line-height: 1.2; }
select, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]) { min-height: var(--ctl-h); }
.topbar select, .topbar .theme-switch, .ask-btn { height: var(--ctl-h); min-height: var(--ctl-h); padding: 0 .8rem; font-size: .9rem; border-radius: var(--radius); }
.topbar select { padding-right: 1.8rem; }
.acctmenu-btn { padding: 1px; }
.acctmenu-btn .avatar { width: 28px; height: 28px; }
