/* ============================================================================
   Sign-Up Management Center — namespaced design system (.adm)
   "tmERIK baby": tmERIK/WAVE palette (Open Sans, WAVE blue #006FDE, crisp radii,
   #dee2e6 borders, #212121 ink) fused with a slick, compact admin layout.
   Fully scoped under .adm so the signup brand CSS never reaches it.
   ========================================================================== */

.adm {
  /* ---- light (tmERIK) ---- */
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef2;
  --line: #dee2e6;
  --line-strong: #cdd2d9;
  --ink: #212121;
  --ink-2: #5c616b;
  --ink-3: #a0a0a0;
  --accent: #006fde;
  --accent-ink: #ffffff;
  --accent-hover: #004dbc;
  --accent-soft: rgba(0, 111, 222, 0.09);
  --accent-line: rgba(0, 111, 222, 0.38);
  --pending: #9a6300;
  --pending-bg: rgba(247, 168, 35, 0.16);
  --done: #157a44;
  --done-bg: rgba(15, 186, 123, 0.16);
  --danger: #e03131;
  --danger-bg: rgba(240, 62, 62, 0.12);
  --shadow-sm: 0 1px 2px rgba(33, 37, 41, 0.06);
  --shadow-md: 0 4px 12px rgba(33, 37, 41, 0.08);
  --shadow-lg: 0 16px 44px rgba(33, 37, 41, 0.16);

  --font-ui: 'Montserrat', 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Harmonised: everything is Montserrat. .adm-mono keeps tabular figures for aligned numbers/ids. */
  --font-mono: 'Montserrat', 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-pill: 999px;

  position: relative;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.adm[data-theme='dark'] {
  --bg: #14161a;
  --surface: #1b1e24;
  --surface-2: #21252c;
  --surface-3: #2a2f37;
  --line: #2c313a;
  --line-strong: #3b414b;
  --ink: #e7e9ec;
  --ink-2: #9aa0aa;
  --ink-3: #6e747e;
  --accent: #3d8bff;
  --accent-ink: #0b0d12;
  --accent-hover: #5b9cff;
  --accent-soft: rgba(61, 139, 255, 0.15);
  --accent-line: rgba(61, 139, 255, 0.42);
  --pending: #e7a948;
  --pending-bg: rgba(231, 169, 72, 0.15);
  --done: #4cc38a;
  --done-bg: rgba(76, 195, 138, 0.15);
  --danger: #ff6b61;
  --danger-bg: rgba(255, 107, 97, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 22px 56px rgba(0, 0, 0, 0.6);
}

/* Accent presets (data-accent). "blue" is the default and uses the base tokens above.
   Declared after the dark block so a chosen accent applies in both light and dark. */
.adm[data-accent='teal']   { --accent: #0d9488; --accent-hover: #0f766e; --accent-soft: rgba(13, 148, 136, 0.10); --accent-line: rgba(13, 148, 136, 0.40); --accent-ink: #ffffff; }
.adm[data-accent='indigo'] { --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: rgba(79, 70, 229, 0.10); --accent-line: rgba(79, 70, 229, 0.40); --accent-ink: #ffffff; }
.adm[data-accent='violet'] { --accent: #7c3aed; --accent-hover: #6d28d9; --accent-soft: rgba(124, 58, 237, 0.10); --accent-line: rgba(124, 58, 237, 0.40); --accent-ink: #ffffff; }
.adm[data-accent='amber']  { --accent: #d97706; --accent-hover: #b45309; --accent-soft: rgba(217, 119, 6, 0.12); --accent-line: rgba(217, 119, 6, 0.42); --accent-ink: #ffffff; }
/* Brighter accent variants for dark mode (the light hues above look too muted on the dark ground). */
.adm[data-theme='dark'][data-accent='teal']   { --accent: #19bda9; --accent-hover: #2dd4bf; --accent-soft: rgba(25, 189, 169, 0.16); --accent-line: rgba(25, 189, 169, 0.44); }
.adm[data-theme='dark'][data-accent='indigo'] { --accent: #6d76f0; --accent-hover: #8b91f5; --accent-soft: rgba(109, 118, 240, 0.18); --accent-line: rgba(109, 118, 240, 0.46); }
.adm[data-theme='dark'][data-accent='violet'] { --accent: #9a6cf5; --accent-hover: #b591f8; --accent-soft: rgba(154, 108, 245, 0.18); --accent-line: rgba(154, 108, 245, 0.46); }
.adm[data-theme='dark'][data-accent='amber']  { --accent: #e79325; --accent-hover: #f4b04a; --accent-soft: rgba(231, 147, 37, 0.18); --accent-line: rgba(231, 147, 37, 0.46); }

.adm *, .adm *::before, .adm *::after { box-sizing: border-box; }
.adm h1, .adm h2, .adm h3, .adm p { margin: 0; }
.adm ::selection { background: var(--accent-soft); }

.adm :focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-line);
  border-radius: var(--radius-sm);
}

.adm-mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.adm-muted { color: var(--ink-2); }
.adm-faint { color: var(--ink-3); }

/* ============================================================================
   Shell: full-width WAVE-blue top bar, navy left rail, fluid content (tmERIK look)
   ========================================================================== */
.adm-shell { display: flex; flex-direction: column; height: 100vh; }

.adm-topbar { flex: none; height: 46px; background: var(--accent); color: #fff; z-index: 20; }
.adm-topbar__inner {
  height: 100%; width: 100%; padding: 0 16px 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.adm-brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; cursor: pointer; padding: 4px 6px; margin-left: -6px; border-radius: var(--radius-sm); transition: background-color 0.12s ease; }
.adm-brand:hover { background: rgba(255, 255, 255, 0.12); }
.adm-brand__mark { font-weight: 800; font-size: 14px; letter-spacing: -0.3px; }
.adm-brand__title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-brand__mid { opacity: 0.6; margin: 0 3px; }
.adm-brand__sep { opacity: 0.45; font-weight: 300; margin: 0 5px; }
.adm-brand__chip { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; background: rgba(255, 255, 255, 0.18); color: #fff; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.adm-topbar__controls { display: flex; align-items: center; gap: 10px; }

/* controls tuned for the blue bar — specificity kept above the generic .adm-btn/.adm-seg rules */
.adm-topbar .adm-iconbtn { height: 30px; width: 30px; background: transparent; border: 0; color: #eaf2ff; }
.adm-topbar .adm-iconbtn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.adm-topbar .adm-btn.adm-btn--ghost { height: 30px; padding-top: 0; padding-bottom: 0; background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.adm-topbar .adm-btn.adm-btn--ghost:hover { background: rgba(255, 255, 255, 0.26); color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.adm-topbar .adm-seg { height: 30px; background: rgba(255, 255, 255, 0.16); border: 0; align-items: center; }
.adm-topbar .adm-seg__opt { color: #dbe8fb; }
.adm-topbar .adm-seg__opt:not(.adm-seg__opt--active):hover { color: #fff; }
.adm-topbar .adm-seg__opt--active { color: var(--accent); background: #fff; }

/* body = navy sidebar + fluid content */
.adm-body { flex: 1; display: flex; min-height: 0; }

/* Sidebar is derived from the accent (darkened toward navy) so it tracks the palette; text uses
   white tints so it stays legible on any accent hue. Topbar & selected item use the accent directly. */
.adm-side { width: 230px; flex: none; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 72%, #08182b) 0%, color-mix(in srgb, var(--accent) 42%, #060f1a) 100%); display: flex; flex-direction: column; padding: 12px 10px; }
.adm-side__group { color: rgba(255, 255, 255, 0.5); font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; padding: 10px 12px 6px; }
.adm-nav { appearance: none; border: 0; background: transparent; width: 100%; text-align: left; font: inherit; font-weight: 600; display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0; border-radius: 6px; color: rgba(255, 255, 255, 0.82); cursor: pointer; position: relative; }
.adm-nav svg { width: 17px; height: 17px; flex: none; opacity: 0.92; }
.adm-nav:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
/* Sidebar sits on a coloured ground in every theme, so the selected item stays white (not --accent-ink,
   which is near-black in dark mode). */
.adm-nav--on, .adm-nav--on:hover { background: var(--accent); color: #fff; }
.adm-nav--on::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 30%, #ffffff); }
.adm-nav__count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: rgba(255, 255, 255, 0.6); font-feature-settings: 'tnum' 1; }
.adm-nav--on .adm-nav__count { color: rgba(255, 255, 255, 0.95); }
.adm-side__foot { margin-top: auto; padding: 12px; color: rgba(255, 255, 255, 0.5); font-size: 10.5px; font-family: var(--font-mono); letter-spacing: 0.02em; border-top: 1px solid rgba(255, 255, 255, 0.14); user-select: all; }

.adm-main { flex: 1; min-width: 0; padding: 20px 22px 40px; overflow-y: auto; }

/* ============================================================================
   Controls
   ========================================================================== */
.adm-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 13px; line-height: 1;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.adm-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.adm-btn > svg { width: 14px; height: 14px; flex: none; margin-right: -1px; }
.adm-btn--sm > svg { width: 13px; height: 13px; }
.adm-btn--primary { background: var(--accent); color: var(--accent-ink); }
.adm-btn--primary:hover:not([disabled]) { background: var(--accent-hover); }
.adm-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.adm-btn--ghost:hover:not([disabled]) { border-color: var(--ink-3); background: var(--surface-2); }
.adm-btn--danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.adm-btn--danger:hover:not([disabled]) { background: var(--danger); color: #fff; border-color: var(--danger); }
.adm-btn--block { width: 100%; }
.adm-btn--sm { padding: 6px 11px; font-size: 12.5px; }

.adm-iconbtn {
  appearance: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.adm-iconbtn:hover { color: var(--ink); border-color: var(--ink-3); }
.adm-iconbtn[disabled] { opacity: 0.6; cursor: not-allowed; }
.adm-iconbtn svg { width: 16px; height: 16px; }
.adm-iconbtn--spin svg { animation: adm-spin 0.7s linear infinite; }
@keyframes adm-spin { to { transform: rotate(360deg); } }

.adm-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.adm-seg__opt {
  appearance: none; border: 0; background: transparent; font: inherit; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.03em; color: var(--ink-3); padding: 4px 9px; border-radius: 3px; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.adm-seg__opt:hover { color: var(--ink-2); }
.adm-seg__opt--active { color: var(--accent-ink); background: var(--accent); }

.adm-input, .adm-select {
  appearance: none; width: 100%; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.adm-input::placeholder { color: var(--ink-3); }
.adm-input:focus, .adm-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.adm-select {
  padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ============================================================================
   Page headings
   ========================================================================== */
.adm-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
/* Detail & create: buttons sit right after the title (left-aligned), matching the capped-width content. */
.adm-pagehead--left { align-items: center; justify-content: flex-start; gap: 18px; }
.adm-title { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }

/* ---------------------------------------------------------------------------
   Page action bar — one shell on every page: title/subtitle on top, buttons below (left-aligned)
   --------------------------------------------------------------------------- */
.adm-actionbar { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 16px; }
.adm-actionbar .adm-title { font-size: 18px; }
.adm-actionbar__sub { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.adm-actionbar__row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.adm-actionbar__sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 5px; flex: none; }
/* Neutral buttons on the edit/detail/create bars; --head (overview) keeps its coloured CTA. Danger keeps red. */
.adm-actionbar:not(.adm-actionbar--head) .adm-btn { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); box-shadow: none; font-weight: 600; }
.adm-actionbar:not(.adm-actionbar--head) .adm-btn:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
.adm-actionbar:not(.adm-actionbar--head) .adm-btn > svg { color: var(--ink-3); }
.adm-actionbar:not(.adm-actionbar--head) .adm-btn--danger, .adm-actionbar:not(.adm-actionbar--head) .adm-btn--danger > svg { color: var(--danger); }
.adm-actionbar:not(.adm-actionbar--head) .adm-btn--danger:hover:not([disabled]) { background: var(--danger); color: #fff; border-color: var(--danger); }
.adm-actionbar:not(.adm-actionbar--head) .adm-btn--danger:hover:not([disabled]) > svg { color: #fff; }
.adm-title__app { color: var(--ink-3); font-weight: 600; }
.adm-title__app::before { content: '·'; margin: 0 8px; color: var(--line-strong); }
.adm-back {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; color: var(--ink-2);
  padding: 0; margin-bottom: 8px; transition: color 0.15s ease;
}
.adm-back:hover { color: var(--accent); }

/* ============================================================================
   Toolbar
   ========================================================================== */
.adm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.adm-toolbar .adm-select { width: auto; min-width: 170px; }
.adm-toolbar__search { position: relative; flex: 1; min-width: 220px; }
.adm-toolbar__search > .adm-input { padding-left: 32px; }
.adm-toolbar__search > .adm-input.adm-input--clearable { padding-right: 34px; }
.adm-toolbar__search > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.adm-search__clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.adm-search__clear:hover { background: var(--surface-3, var(--surface-2)); color: var(--ink); }
.adm-search__clear svg { width: 13px; height: 13px; }

/* ============================================================================
   Card
   ========================================================================== */
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.adm-card--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.adm-card__pad { padding: 15px 16px; }
.adm-card__title { font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }

/* ============================================================================
   Table (compact)
   ========================================================================== */
/* table-layout:fixed keeps column widths stable so rows don't "dance" when re-sorting. */
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.adm-table thead th {
  position: relative;
  text-align: left; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap;
}
/* Drag handle on each column's right edge; the last column isn't resizable (nothing to its right). */
.adm-col-resize { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.adm-col-resize::after { content: ''; position: absolute; top: 6px; bottom: 6px; right: 4px; width: 2px; border-radius: 2px; background: transparent; transition: background .12s ease; }
.adm-col-resize:hover::after, .adm-col-resize--active::after { background: var(--accent); }
body.adm-col-resizing { cursor: col-resize; user-select: none; }
.adm-table thead .adm-sort {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
.adm-table thead .adm-sort:hover { color: var(--ink-2); }
.adm-table thead .adm-sort--active { color: var(--ink); }
.adm-sort__ind { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: 0; }

.adm-table tbody tr { height: 48px; }
/* Text content hangs from the top so first lines line up across columns; the status
   badge is nudged to sit on that same first line for a deliberate, aligned look. */
.adm-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-table tbody td:first-child { padding-top: 10px; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-hl { background: rgba(255, 214, 0, 0.5); color: var(--ink); border-radius: 2px; padding: 0 1px; }
.adm-row { cursor: pointer; transition: background-color 0.12s ease; }
.adm-row:hover td { background: var(--surface-2); }
.adm-row td:first-child { position: relative; }
.adm-row:hover td:first-child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.adm-cell-empty { text-align: center; color: var(--ink-3); padding: 40px 0 !important; }
.adm-cell-chevron { text-align: right; color: var(--ink-3); width: 1px; }
.adm-cell-sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================================
   Analytics dashboard — KPIs + custom SVG charts, all themed via .adm tokens
   ========================================================================== */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.adm-kpi__val { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.adm-kpi__unit { font-size: 15px; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.adm-kpi__label { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.adm-charts { display: flex; flex-direction: column; gap: 14px; }
.adm-charts__row { display: grid; gap: 14px; }
.adm-charts__row--split { grid-template-columns: 2fr 1fr; }
.adm-charts__row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adm-chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; min-width: 0; }
.adm-chart__title { font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.adm-chart__empty { color: var(--ink-3); font-size: 12.5px; padding: 20px 0; text-align: center; }

.adm-bars { display: flex; flex-direction: column; gap: 8px; }
.adm-bar { display: grid; grid-template-columns: minmax(60px, 34%) 1fr auto; align-items: center; gap: 10px; }
.adm-bar__label { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-bar__track { height: 8px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.adm-bar__fill { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); min-width: 2px; }
.adm-bar__val { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.adm-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.adm-legend--col { flex-direction: column; gap: 8px; margin-top: 0; }
.adm-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.adm-legend__item b { color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.adm-legend__dot--a { background: var(--accent); }
.adm-legend__dot--b { background: var(--done); }
.adm-legend__dot--pending { background: var(--pending); }
.adm-legend__dot--done { background: var(--done); }
.adm-legend__dot--arch { background: var(--ink-3); }

/* trend fills its column; the 2fr column keeps it from ballooning */
.adm-line { display: block; width: 100%; height: auto; }
.adm-line__grid { stroke: var(--line); stroke-width: 1; }
.adm-line__ytick { fill: var(--ink-3); font-size: 9px; text-anchor: end; font-family: var(--font-mono); }
.adm-line__xtick { fill: var(--ink-3); font-size: 9px; text-anchor: middle; }
.adm-line__area { fill: var(--accent-soft); stroke: none; }
.adm-line__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.adm-line__line--a { stroke: var(--accent); }
.adm-line__line--b { stroke: var(--done); }
.adm-line__dot { stroke: var(--surface); stroke-width: 1.5; }
.adm-line__dot--a { fill: var(--accent); }
.adm-line__dot--b { fill: var(--done); }
.adm-line__band { cursor: default; }

.adm-chart__desc { font-size: 12px; color: var(--ink-2); margin: -6px 0 12px; }
.adm-chart__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.adm-chart__foot .adm-legend { margin-top: 0; }
.adm-chart__hint { font-size: 11px; color: var(--ink-3); }

/* trend drill-down nav (breadcrumb + one-level-up arrow) */
.adm-trend__nav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 26px; }
.adm-iconbtn--sm { width: 26px; height: 26px; }
.adm-iconbtn--sm svg { width: 14px; height: 14px; }
.adm-trend__crumbs { display: inline-flex; align-items: center; gap: 6px; }
.adm-trend__crumb { appearance: none; border: 0; background: transparent; padding: 0; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.adm-trend__crumb:hover { text-decoration: underline; }
.adm-trend__crumb--cur { color: var(--ink); font-weight: 600; cursor: default; text-decoration: none; }
.adm-trend__sep { color: var(--ink-3); }
.adm-line__band--drill { cursor: pointer; }

.adm-donutwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.adm-donut { width: 128px; height: 128px; flex: none; }
.adm-donut__track { fill: none; stroke: var(--surface-3); stroke-width: 14; }
.adm-donut__seg { fill: none; stroke-width: 14; }
.adm-donut__seg--pending { stroke: var(--pending); }
.adm-donut__seg--done { stroke: var(--done); }
.adm-donut__seg--arch { stroke: var(--ink-3); }
.adm-donut__num { text-anchor: middle; fill: var(--ink); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-donut__cap { text-anchor: middle; fill: var(--ink-3); font-size: 8px; letter-spacing: 0.10em; text-transform: uppercase; }

/* subtle column highlight when hovering a month (CSS fill overrides the inline transparent) */
.adm-line__band:hover { fill: var(--accent-soft); }

/* styled hover tooltip (positioned by admTip in App.razor) */
.adm-tip {
  position: fixed; z-index: 200; pointer-events: none;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 8px 10px; font-size: 12px; line-height: 1.4; max-width: 260px; white-space: nowrap;
}
.adm-tip__t { font-weight: 700; margin-bottom: 5px; }
.adm-tip__row { display: flex; align-items: center; gap: 7px; }
.adm-tip__row + .adm-tip__row { margin-top: 2px; }
.adm-tip__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.adm-tip__dot--a { background: var(--accent); }
.adm-tip__dot--b { background: var(--done); }
.adm-tip__l { color: var(--ink-2); }
.adm-tip__row b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .adm-charts__row--split { grid-template-columns: 1fr; }
  .adm-charts__row--three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .adm-charts__row--three { grid-template-columns: 1fr; }
}

/* ============================================================================
   Badge
   ========================================================================== */
.adm-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-sm);
}
.adm-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.adm-badge--pending { color: var(--pending); background: var(--pending-bg); }
.adm-badge--done { color: var(--done); background: var(--done-bg); }
.adm-badge--danger { color: var(--danger); background: var(--danger-bg); }
.adm-badge--neutral { color: var(--ink-2); background: var(--surface-3); }

/* ============================================================================
   Detail
   ========================================================================== */
.adm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .adm-grid2 { grid-template-columns: 1fr; } }

.adm-props { display: grid; grid-template-columns: 140px 1fr; gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.adm-props dt, .adm-props dd { background: var(--surface); margin: 0; padding: 7px 12px; }
.adm-props dt { color: var(--ink-3); font-size: 11.5px; }
.adm-props dd { color: var(--ink); word-break: break-word; }

.adm-linkbox { display: flex; gap: 8px; }
.adm-linkbox .adm-input { flex: 1; font-family: var(--font-mono); font-size: 12px; }
.adm-linkbox__actions { display: flex; align-items: center; gap: 14px; margin-top: 9px; }
.adm-link { color: var(--accent); text-decoration: none; font-size: 12.5px; }
.adm-link:hover { text-decoration: underline; }

.adm-code {
  margin: 0; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--ink); overflow: auto; max-height: 380px;
}

.adm-codebox { position: relative; }
.adm-codebox__copy { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; background: var(--surface); }
.adm-codebox__copy svg { width: 14px; height: 14px; }

/* ---- services ---- */
.adm-rate { display: inline-flex; align-items: baseline; gap: 6px; margin-bottom: 12px; padding: 7px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.adm-rate__value { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--ink); }
.adm-rate__label { font-size: 11.5px; color: var(--ink-3); }
.adm-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.adm-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; color: var(--ink-2);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.adm-chip--on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.adm-chip__check { display: inline-grid; place-items: center; width: 14px; height: 14px; color: var(--accent); }
.adm-chip__check svg { width: 14px; height: 14px; }
.adm-chip__name { font-weight: 600; }
.adm-chip__meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.adm-chip--off .adm-chip__name { text-decoration: line-through; opacity: 0.7; }

/* ---- tabs (detail) ---- */
.adm-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.adm-tabbtn {
  appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 12.5px;
  color: var(--ink-3); padding: 11px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.adm-tabbtn:hover { color: var(--ink-2); }
.adm-tabbtn--active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- service list ---- */
.adm-svc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.adm-svc__item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.adm-svc__item:last-child { border-bottom: 0; }
.adm-svc__box { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line-strong); color: transparent; }
.adm-svc__box--on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.adm-svc__box svg { width: 12px; height: 12px; }
.adm-svc__name { font-weight: 600; color: var(--ink); }
.adm-svc__item:not(.adm-svc__item--on) .adm-svc__name { color: var(--ink-2); font-weight: 500; }
.adm-svc__badge { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 3px; }
.adm-svc__dur { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.adm-svc__price { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--ink); min-width: 56px; text-align: right; }

/* ---- create/edit form ---- */
.adm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.adm-ff { display: flex; flex-direction: column; gap: 5px; }
.adm-ff--full { grid-column: 1 / -1; }
.adm-ff__label { font-size: 11.5px; color: var(--ink-2); }
.adm-input[type='number'] { font-family: var(--font-mono); }

.adm-svcedit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-svcedit__item { display: flex; align-items: center; gap: 8px; }
.adm-svcedit__name { flex: 1; }
.adm-svcedit__min { width: 76px; }
.adm-svcedit__unit { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-left: -2px; }
.adm-svcedit__sel { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.adm-svcedit__sel input { accent-color: var(--accent); }

.adm-raw { margin: 0; }
.adm-raw > summary { cursor: pointer; font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; user-select: none; }
.adm-raw > summary:hover { color: var(--ink-2); }
.adm-raw[open] > summary { margin-bottom: 10px; }

/* ============================================================================
   Pager
   ========================================================================== */
.adm-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.adm-pager__range { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.adm-pager__btns { display: flex; align-items: center; gap: 8px; }

/* ============================================================================
   Alert
   ========================================================================== */
.adm-alert { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; background: var(--danger-bg); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

/* ============================================================================
   Login
   ========================================================================== */
.adm-login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--accent-soft) 0%, transparent 55%),
    var(--bg);
}
.adm-login::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: 0.6;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, black, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 40%, black, transparent 75%);
}
.adm-login__controls { position: fixed; top: 18px; right: 22px; display: flex; gap: 9px; }
.adm-login__card { position: relative; width: 100%; max-width: 372px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 28px; }
.adm-login__brand { margin-bottom: 18px; }
.adm-login__heading { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.adm-field { margin-top: 14px; }
.adm-field__label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 6px; }
.adm-login__hint { margin-top: 16px; font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }

/* ============================================================================
   Motion
   ========================================================================== */
@keyframes adm-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.adm-rise { animation: adm-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.adm-rise-1 { animation-delay: 0.03s; }
.adm-rise-2 { animation-delay: 0.08s; }
.adm-rise-3 { animation-delay: 0.13s; }
.adm-login__card { animation: adm-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

@media (prefers-reduced-motion: reduce) { .adm, .adm * { animation: none !important; transition: none !important; } }

/* ============================================================================
   Modal / Help
   ========================================================================== */
.adm-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 24px; background: rgba(15, 18, 22, 0.46); animation: adm-fade 0.16s ease both; }
.adm-modal__panel { display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: 86vh; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: adm-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
.adm-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.adm-modal__title { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.adm-modal__title svg { width: 18px; height: 18px; color: var(--accent); }
.adm-modal__body { padding: 2px 18px 10px; overflow-y: auto; }
@keyframes adm-fade { from { opacity: 0; } to { opacity: 1; } }

.adm-help__intro { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 16px 0 4px; }
.adm-help__sec { padding: 14px 0; border-top: 1px solid var(--line); }
.adm-help__sec--first { border-top: 0; padding-top: 16px; }
.adm-help__h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.adm-help__h svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.adm-help__t { font-size: 13px; color: var(--ink); line-height: 1.5; margin: 0; }
.adm-help__tip { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin: 5px 0 0; }

/* About / changelog dialog */
.adm-about__app { margin: 14px 0 4px; }
.adm-about__name { font-weight: 700; font-size: 14px; color: var(--ink); }
.adm-about__meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.adm-about__rel { padding: 14px 0; border-top: 1px solid var(--line); }
.adm-about__relhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.adm-about__ver { font-weight: 700; font-size: 13.5px; color: var(--accent); font-variant-numeric: tabular-nums; }
.adm-about__date { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.adm-about__list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.adm-about__list li { font-size: 12.5px; color: var(--ink); line-height: 1.5; }
.adm-about__hist { padding: 12px 0 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.adm-about__histh { font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.adm-about__histlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.adm-about__histlist li { display: flex; align-items: baseline; gap: 10px; font-size: 12px; }
.adm-about__histlist .adm-about__date { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Settings dialog */
.adm-set__sec { padding: 14px 0; border-top: 1px solid var(--line); }
.adm-set__sec:first-child { border-top: 0; padding-top: 16px; }
.adm-set__h { font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.adm-set__label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 5px; }
.adm-set__hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin-top: 8px; }
.adm-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); position: relative; }
.adm-swatch--on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.adm-swatch:hover { transform: scale(1.08); }
/* spinner shown inside a normal button (e.g. tenant check) */
.adm-btn__spin { display: inline-flex; }
.adm-btn__spin svg { width: 13px; height: 13px; animation: adm-spin 0.7s linear infinite; }

/* Info popover (e.g. the field help beside the Reference label) */
.adm-ff__labelrow { display: flex; align-items: center; gap: 6px; }
.adm-pop { position: relative; display: inline-flex; }
.adm-pop__btn { appearance: none; border: 0; background: transparent; padding: 0; margin: 0; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; }
.adm-pop__btn:hover { color: var(--accent); }
.adm-pop__btn svg { width: 14px; height: 14px; }
.adm-pop__scrim { position: fixed; inset: 0; z-index: 60; }
/* Fixed + JS-anchored so it escapes the card's overflow:hidden. Starts hidden; top/left/opacity are set at runtime once placed (prevents a top-left flicker). */
.adm-pop__panel { position: fixed; top: 0; left: 0; z-index: 61; width: min(460px, 82vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); padding: 13px 15px; opacity: 0; transition: opacity 0.12s ease; }
.adm-pop__panel.adm-formhints { margin-top: 0; }

/* Field hints under the create/edit form (bold labels + inline terms, spaced paragraphs). */
.adm-formhints { margin-top: 13px; font-size: 12px; line-height: 1.55; color: var(--ink-3); }
.adm-formhints p { margin: 0 0 10px; }
.adm-formhints p:last-child { margin-bottom: 0; }
.adm-formhints strong { color: var(--ink-2); font-weight: 700; }
