/* Payless brand: #FF1717 red, black/white, Poppins — pulled from payless.africa,
   dialed back from marketing-bold to a calm operating tool. Semantic tier colors
   (good/warning/critical) are intentionally a separate palette from the brand
   red so "primary action" never gets confused with "this is dangerous". */
:root{
  --brand: #FF1717;
  --brand-dark: #D00E1F;
  --brand-ink: #FFFFFF;
  --brand-tint: #FFEAEA;

  /* Secondary badge accents for dashboard stat cards — pulled from Payless's
     own marketing site (the violet/orange used there as secondary accents),
     kept clearly subordinate to brand red. */
  --badge-violet: #8B5CF6; --badge-violet-bg: #F1EBFF;
  --badge-blue: #2F6FED; --badge-blue-bg: #E8EFFE;
  --badge-orange: #F4793F; --badge-orange-bg: #FDEAE0;

  --bg: #F5F4F1;
  --surface: #FFFFFF;
  --surface-2: #F0EDEA;
  --ink: #17151A;
  --ink-muted: #625F68;
  --ink-faint: #97939C;
  --line: #E6E2DD;

  --good: #1E8E5A; --good-bg: #E4F3EA;
  --warning: #B7791F; --warning-bg: #FBEED9;
  --critical: #9A1B3A; --critical-bg: #F7E1E6;

  --shadow-sm: 0 1px 2px rgba(23,21,26,0.05);
  --shadow-md: 0 8px 24px -8px rgba(23,21,26,0.12), 0 1px 2px rgba(23,21,26,0.05);
  --shadow-lg: 0 24px 56px -16px rgba(23,21,26,0.20);
  --radius: 20px;
  --radius-sm: 12px;
}
@media (prefers-color-scheme: dark){
  :root{
    --brand: #FF3B3B; --brand-dark: #FF1717; --brand-ink: #17151A; --brand-tint: #3A1414;
    --badge-violet: #A78BFA; --badge-violet-bg: #2A2140;
    --badge-blue: #6C9CFF; --badge-blue-bg: #1B2740;
    --badge-orange: #FF9466; --badge-orange-bg: #3A2416;
    --bg: #131215; --surface: #1B1A1E; --surface-2: #221F24; --ink: #F2F0EE;
    --ink-muted: #A7A3AC; --ink-faint: #706C77; --line: #322F35;
    --good: #4FBE8B; --good-bg: #133427; --warning: #E0A94E; --warning-bg: #3A2C13;
    --critical: #E5647F; --critical-bg: #3B1620;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4); --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
    --shadow-lg: 0 24px 56px -16px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"]{
  --brand: #FF3B3B; --brand-dark: #FF1717; --brand-ink: #17151A; --brand-tint: #3A1414;
  --badge-violet: #A78BFA; --badge-violet-bg: #2A2140;
  --badge-blue: #6C9CFF; --badge-blue-bg: #1B2740;
  --badge-orange: #FF9466; --badge-orange-bg: #3A2416;
  --bg: #131215; --surface: #1B1A1E; --surface-2: #221F24; --ink: #F2F0EE;
  --ink-muted: #A7A3AC; --ink-faint: #706C77; --line: #322F35;
  --good: #4FBE8B; --good-bg: #133427; --warning: #E0A94E; --warning-bg: #3A2C13;
  --critical: #E5647F; --critical-bg: #3B1620;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4); --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 56px -16px rgba(0,0,0,0.6);
}
:root[data-theme="light"]{
  --brand: #FF1717; --brand-dark: #D00E1F; --brand-ink: #FFFFFF; --brand-tint: #FFEAEA;
  --badge-violet: #8B5CF6; --badge-violet-bg: #F1EBFF;
  --badge-blue: #2F6FED; --badge-blue-bg: #E8EFFE;
  --badge-orange: #F4793F; --badge-orange-bg: #FDEAE0;
  --bg: #F5F4F1; --surface: #FFFFFF; --surface-2: #F0EDEA; --ink: #17151A;
  --ink-muted: #625F68; --ink-faint: #97939C; --line: #E6E2DD;
  --good: #1E8E5A; --good-bg: #E4F3EA; --warning: #B7791F; --warning-bg: #FBEED9;
  --critical: #9A1B3A; --critical-bg: #F7E1E6;
  --shadow-sm: 0 1px 2px rgba(23,21,26,0.05); --shadow-md: 0 8px 24px -8px rgba(23,21,26,0.12), 0 1px 2px rgba(23,21,26,0.05);
  --shadow-lg: 0 24px 56px -16px rgba(23,21,26,0.20);
}

*{ box-sizing: border-box; }
html{ color-scheme: light dark; }
body{
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.mono{ font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", monospace; font-variant-numeric: tabular-nums; }
button{ font: inherit; color: inherit; }
input, select{ font: inherit; }
h1, h2, h3{ font-weight: 700; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.hidden{ display: none !important; }

@keyframes stepIn{ from{ opacity: 0; transform: translateY(6px); } to{ opacity: 1; transform: translateY(0); } }
#step1:not(.hidden), #step2:not(.hidden), #step3:not(.hidden), #step4:not(.hidden){ animation: stepIn 220ms cubic-bezier(0.16,1,0.3,1); }

/* ---- top bar ---- */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand{ display: flex; align-items: center; gap: 12px; }
.brand-mark{ width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.brand-mark svg{ width: 100%; height: 100%; display: block; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-name{ font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub{ font-size: 11.5px; color: var(--ink-faint); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

.topbar .who{ display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-muted); }
.user-label{ font-weight: 500; }
.db-pill{
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600;
}
.db-pill::before{ content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.db-pill.ok{ background: var(--good-bg); color: var(--good); }
.db-pill.bad{ background: var(--critical-bg); color: var(--critical); }

.icon-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-muted); cursor: pointer;
}
.icon-btn:hover{ background: var(--surface-2); color: var(--ink); }
.icon-btn svg{ width: 16px; height: 16px; }
.icon-btn .icon-moon, #themeToggle .icon-moon{ display: none; }
:root[data-theme="dark"] .icon-btn .icon-sun, :root[data-theme="dark"] #themeToggle .icon-sun{ display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon, :root[data-theme="dark"] #themeToggle .icon-moon{ display: block; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .icon-btn .icon-sun, :root:not([data-theme="light"]) #themeToggle .icon-sun{ display: none; }
  :root:not([data-theme="light"]) .icon-btn .icon-moon, :root:not([data-theme="light"]) #themeToggle .icon-moon{ display: block; }
}

.link-btn{
  background: none; border: none; color: var(--ink-muted); cursor: pointer;
  text-decoration: underline; padding: 0; font-size: 13px;
}
.link-btn:hover{ color: var(--ink); }

/* ---- layout ---- */
.app-shell{
  display: grid; grid-template-columns: 232px 1fr; gap: 20px;
  padding: 20px 20px 20px 20px;
  min-height: calc(100vh - 59px);
  align-items: start;
}
@media (max-width: 760px){ .app-shell{ grid-template-columns: 1fr; padding: 12px; } }
.side-nav{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: calc(100vh - 99px);
  position: sticky; top: 20px;
}
.side-nav-top{ display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 760px){
  .side-nav{ min-height: auto; position: static; }
  .side-nav-top{ flex-direction: row; overflow-x: auto; gap: 4px; }
  .side-nav-top button{ flex-shrink: 0; }
}
.side-nav-top button{
  display: flex; align-items: center; gap: 10px;
  text-align: left; background: none; border: none; border-left: 2px solid transparent; border-radius: 0 8px 8px 0;
  padding: 10px 12px; color: var(--ink-muted); cursor: pointer; font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
}
.side-nav-top button svg{ width: 16px; height: 16px; flex-shrink: 0; }
.side-nav-top button:hover{ background: var(--surface-2); color: var(--ink); }
.side-nav-top button.active{ background: var(--brand-tint); color: var(--brand-dark); border-left-color: var(--brand); font-weight: 600; }

/* ---- sidebar bottom: user menu ---- */
.side-nav-bottom{ position: relative; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.side-nav-user{
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px;
  background: none; border: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.side-nav-user:hover{ background: var(--surface-2); }
.side-nav-user .avatar-badge{ width: 32px; height: 32px; font-size: 12px; }
.side-nav-user-text{ display: flex; flex-direction: column; flex: 1; min-width: 0; }
.side-nav-user-name{ font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav-user-role{ font-size: 11px; color: var(--ink-faint); text-transform: capitalize; }
.side-nav-user-chevron{ width: 14px; height: 14px; color: var(--ink-faint); flex-shrink: 0; transition: transform 150ms; }
.side-nav-user[aria-expanded="true"] .side-nav-user-chevron{ transform: rotate(180deg); }

.side-nav-menu{
  position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 20;
}
.side-nav-menu button{
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  background: none; border: none; cursor: pointer; font-size: 13px; color: var(--ink); text-align: left; width: 100%;
}
.side-nav-menu button:hover{ background: var(--surface-2); }
.side-nav-menu button svg{ width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-muted); }
.side-nav-menu #signOutBtn{ color: var(--critical); }
.side-nav-menu #signOutBtn svg{ color: var(--critical); }

.view{ padding: 30px 32px; max-width: 900px; min-width: 0; }
@media (max-width: 760px){ .view{ padding: 20px 16px; } }
.view.view-wide{ max-width: none; }

/* ---- login ---- */
.login-wrap{
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(60% 50% at 15% 8%, var(--brand-tint), transparent 60%),
    var(--bg);
}
.login-card{
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow-lg);
}
.login-mark{ width: 44px; height: 44px; border-radius: 12px; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow-md); }
.login-mark svg{ width: 100%; height: 100%; display: block; }
.login-card h1{ font-size: 20px; margin-bottom: 4px; font-weight: 800; }
.login-card .sub{ font-size: 13px; color: var(--ink-muted); margin-bottom: 22px; }
.field{ margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label{ font-size: 12.5px; color: var(--ink-muted); font-weight: 600; }
.field input, .field select, .field textarea{
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); transition: border-color 120ms, box-shadow 120ms;
  font: inherit;
}
.field textarea{ resize: vertical; min-height: 44px; }
.field input:focus, .field select:focus, .field textarea:focus, button:focus-visible, .icon-btn:focus-visible{
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.field .hint{ font-size: 11.5px; color: var(--ink-faint); }

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 100px; border: 1px solid transparent;
  cursor: pointer; font-size: 13.5px; font-weight: 600; transition: transform 100ms, background 120ms, box-shadow 120ms;
}
.btn:active{ transform: scale(0.98); }
.btn.primary{ background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn.primary:hover{ background: var(--brand-dark); }
.btn.primary:disabled{ opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.secondary{ background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.secondary:hover{ background: var(--surface-2); }
.btn.danger{ background: var(--critical); color: white; }
.btn.danger:hover{ filter: brightness(1.08); }
.btn-row{ display: flex; gap: 10px; margin-top: 18px; }

.error-banner{
  background: var(--critical-bg); color: var(--critical); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--critical) 25%, transparent);
}
.warn-banner{
  background: var(--warning-bg); color: var(--warning); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px;
}

/* ---- steps ---- */
.steps{ display: flex; gap: 0; margin-bottom: 28px; flex-wrap: wrap; }
.step-chip{
  display: flex; align-items: center; gap: 8px; padding: 6px 0; margin-right: 22px;
  font-size: 12.5px; color: var(--ink-faint); position: relative;
}
.step-chip .n{
  width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.step-chip.active{ color: var(--ink); font-weight: 600; }
.step-chip.active .n{ background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.step-chip.done .n{ background: var(--good-bg); border-color: var(--good); color: var(--good); }

.view h2{ font-size: 21px; margin-bottom: 4px; font-weight: 700; }
.view .lede{ color: var(--ink-muted); font-size: 13.5px; margin-bottom: 22px; max-width: 60ch; }

.op-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 700px){ .op-grid{ grid-template-columns: 1fr; } }
.op-card{
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm); transition: border-color 140ms, box-shadow 140ms, transform 140ms;
}
.op-card:hover{ border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.op-card:disabled{ cursor: not-allowed; opacity: 0.5; transform: none; box-shadow: none; }
.op-card-head{ display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.op-card .op-title{ font-weight: 700; font-size: 15px; margin-top: 2px; }
.op-card .op-desc{ font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; flex: 1; }
.op-card-footer{ display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.op-pill{
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 100px;
  font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); transition: background 140ms, color 140ms, border-color 140ms;
}
.op-card:hover .op-pill{ background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.op-card:disabled .op-pill{ background: var(--surface-2); color: var(--ink-faint); border-color: var(--line); }
.op-pill svg{ width: 13px; height: 13px; }

.chip{
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.chip::before{ content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.tier-1{ background: var(--good-bg); color: var(--good); }
.chip.tier-2{ background: var(--warning-bg); color: var(--warning); }
.chip.tier-3{ background: var(--critical-bg); color: var(--critical); }

.panel{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.form-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 600px){ .form-grid{ grid-template-columns: 1fr; } }
.form-grid .field.full{ grid-column: 1 / -1; }

.table-wrap{ overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table{ width: 100%; border-collapse: collapse; font-size: 13px; }
thead th{
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint); font-weight: 700; padding: 10px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td{ padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td{ border-bottom: none; }
tbody tr:hover td{ background: var(--surface-2); }
td.changed{ background: var(--brand-tint); font-weight: 700; color: var(--brand-dark); }
.empty-note{ color: var(--ink-faint); font-size: 13px; padding: 14px; }

.compare-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px){ .compare-grid{ grid-template-columns: 1fr; } }
.compare-grid h3{ font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 8px; font-weight: 700; }

.done-panel{ text-align: center; padding: 42px 20px; }
.done-panel .icon{
  font-size: 26px; margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.done-panel.executed .icon{ color: var(--good); background: var(--good-bg); }
.done-panel.pending_approval .icon{ color: var(--warning); background: var(--warning-bg); }
.done-panel.failed .icon{ color: var(--critical); background: var(--critical-bg); }

.activity-row{ font-size: 12.5px; }
.activity-row .op-label{ font-weight: 600; }
.reason-cell{ max-width: 220px; white-space: normal; }

.chip.status-pending_approval{ background: var(--warning-bg); color: var(--warning); }
.chip.status-executed{ background: var(--good-bg); color: var(--good); }
.chip.status-rejected{ background: var(--surface-2); color: var(--ink-muted); }
.chip.status-failed{ background: var(--critical-bg); color: var(--critical); }

.op-card .role-note{ font-size: 11px; color: var(--warning); font-weight: 600; }

/* Decision controls (textarea, OTP step-up, result banner) — shared markup
   from decisionControlsHtml(), mounted only on the request detail page now
   that Approvals is a table. Unscoped so it doesn't depend on a wrapper class. */
.otp-step{ margin-top: 4px; }
#detailDecisionControls textarea{
  width: 100%; min-height: 56px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font: inherit; resize: vertical; margin-bottom: 10px;
}
#detailDecisionControls textarea:focus{ outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.approval-result{ font-size: 13px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); }
.approval-result.ok{ background: var(--good-bg); color: var(--good); }
.approval-result.err{ background: var(--critical-bg); color: var(--critical); }

a{ color: var(--brand); }

/* ---- login stages ---- */
.login-card h1{ font-size: 20px; margin-bottom: 4px; font-weight: 800; }
.login-card .sub{ font-size: 13px; color: var(--ink-muted); margin-bottom: 22px; }
.otp-inputs{ display: flex; gap: 8px; margin-bottom: 4px; }
.otp-inputs input{
  width: 42px; height: 52px; text-align: center; font-size: 20px; font-weight: 700;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink);
}
.otp-inputs input:focus{ outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.login-links{ display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px; }
.login-links button{ background: none; border: none; color: var(--ink-muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }
.login-links button:hover{ color: var(--brand); }
.info-banner{
  background: var(--surface-2); color: var(--ink-muted); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
}
.success-banner{
  background: var(--good-bg); color: var(--good); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px;
}

/* ---- modal ---- */
.modal-overlay{
  position: fixed; inset: 0; background: rgba(10,9,11,0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-card{
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-lg);
}
.modal-card h3{ font-size: 17px; margin-bottom: 16px; font-weight: 700; }

/* ---- users admin ---- */
.role-pill{
  display: inline-flex; padding: 3px 9px; border-radius: 100px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-muted); text-transform: capitalize;
}
.temp-password-box{
  font-family: ui-monospace, "SF Mono", monospace; font-size: 15px; font-weight: 700;
  background: var(--brand-tint); color: var(--brand-dark); padding: 8px 12px; border-radius: var(--radius-sm);
  display: inline-block; margin: 6px 0; letter-spacing: 0.02em;
}
select{
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); width: 100%;
}
select:focus{ outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.inline-select{ padding: 4px 8px; font-size: 12.5px; width: auto; }
.status-dot{ display:inline-flex; align-items:center; gap:5px; font-size:12.5px; }
.status-dot::before{ content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.status-dot.active{ color: var(--good); }
.status-dot.inactive{ color: var(--ink-faint); }

/* ---- dashboard: stat cards ---- */
.stat-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 640px){ .stat-grid{ grid-template-columns: 1fr; } }
.stat-card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 14px;
  transition: transform 140ms, box-shadow 140ms;
}
.stat-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-top{ display: flex; align-items: center; justify-content: space-between; }
.stat-icon{ width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg{ width: 20px; height: 20px; }
.stat-icon.brand{ background: var(--brand-tint); color: var(--brand-dark); }
.stat-icon.violet{ background: var(--badge-violet-bg); color: var(--badge-violet); }
.stat-icon.blue{ background: var(--badge-blue-bg); color: var(--badge-blue); }
.stat-icon.orange{ background: var(--badge-orange-bg); color: var(--badge-orange); }
.stat-trend{
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
}
.stat-trend.up{ background: var(--good-bg); color: var(--good); }
.stat-trend.attention{ background: var(--warning-bg); color: var(--warning); }
.stat-trend.neutral{ background: var(--surface-2); color: var(--ink-muted); }
.stat-value{ font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-label{ font-size: 13px; color: var(--ink-muted); font-weight: 500; }

/* ---- dashboard: layout ---- */
.dash-grid{ display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px){ .dash-grid{ grid-template-columns: 1fr; } }
.panel-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3{ font-size: 15px; font-weight: 700; }
.panel-head a.view-all, .panel-head button.view-all{
  font-size: 12.5px; color: var(--brand); background: none; border: none; cursor: pointer; text-decoration: none; font-weight: 600;
}

.status-bar{ display: flex; height: 10px; border-radius: 100px; overflow: hidden; background: var(--surface-2); margin: 10px 0 14px; }
.status-bar span{ height: 100%; }
.status-legend{ display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-muted); }
.status-legend .dot{ display: inline-flex; align-items: center; gap: 6px; }
.status-legend .dot::before{ content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.quick-actions{ display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.quick-action-card{
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; transition: border-color 140ms, box-shadow 140ms;
}
.quick-action-card:hover{ border-color: var(--brand); box-shadow: var(--shadow-md); }
.quick-action-card .title{ font-weight: 700; font-size: 13.5px; }
.quick-action-card .desc{ font-size: 12px; color: var(--ink-muted); }

/* ---- avatars ---- */
.avatar-badge{
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-muted); flex-shrink: 0;
}
.name-with-avatar{ display: flex; align-items: center; gap: 9px; }

/* ---- toggle switch ---- */
.toggle{
  position: relative; width: 38px; height: 22px; border-radius: 100px; background: var(--line);
  border: none; cursor: pointer; transition: background 150ms; flex-shrink: 0; padding: 0;
}
.toggle::after{
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: white; box-shadow: var(--shadow-sm); transition: transform 150ms;
}
.toggle.on{ background: var(--good); }
.toggle.on::after{ transform: translateX(16px); }
.toggle:disabled{ opacity: 0.5; cursor: not-allowed; }

/* ---- pagination ---- */
.pager{ display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 14px; }
.pager-info{ font-size: 12.5px; color: var(--ink-faint); }
.pager-btns{ display: flex; align-items: center; gap: 10px; }
.pager-btns .btn{ padding: 7px 16px; font-size: 12.5px; }
.pager-page{ font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; }
