/* ==========================================================================
   HAJIRI DESIGN SYSTEM — Foundation
   Attendance & workforce management for showroom teams.

   Layer 1 of 3:
     theme.css       tokens, reset, typography, shell, primitives
     components.css  modal, drawer, toast, tabs, timeline, calendar, ...
     dashboard.css   page-level compositions

   Brand: Royal Green. Status green is deliberately a brighter, cooler
   emerald so "present / inside fence / approved" never reads as chrome.
   ========================================================================== */

/* --------------------------------------------------------------- tokens */
:root {
  /* ---- Brand: royal green ------------------------------------------- */
  --brand-50:  #ECF6F0;
  --brand-100: #D3EADD;
  --brand-200: #A6D4BC;
  --brand-300: #6FB795;
  --brand-400: #3B9670;
  --brand-500: #157A4E;   /* core brand */
  --brand-600: #11633F;   /* hover / pressed */
  --brand-700: #0D4E32;
  --brand-800: #0A3A26;   /* brand ink */
  --brand-900: #072A1C;
  --brand-950: #051C13;   /* sidebar base */

  --brand:      var(--brand-500);
  --brand-d:    var(--brand-600);
  --brand-dd:   var(--brand-700);
  --brand-ink:  var(--brand-800);
  --brand-soft: var(--brand-50);
  --brand-t:    rgba(21, 122, 78, 0.10);
  --brand-t2:   rgba(21, 122, 78, 0.18);
  --brand-ring: rgba(21, 122, 78, 0.22);

  /* ---- Surfaces ------------------------------------------------------ */
  --canvas:    #F6F8F7;
  --surface:   #FFFFFF;
  --surface-2: #F2F5F4;
  --surface-3: #E7ECEA;
  --line:      #E3E8E6;
  --line-2:    #CFD7D4;
  --line-3:    #B4BFBB;

  /* ---- Text ---------------------------------------------------------- */
  --ink:   #0E1A15;
  --ink-2: #33443C;
  --ink-3: #63756D;
  --ink-4: #8C9A94;
  --ink-on-brand: #FFFFFF;

  /* ---- Status -------------------------------------------------------- */
  --ok:      #0E9F6E;   /* present, checked in, inside fence, approved */
  --ok-d:    #0B7F58;
  --ok-t:    rgba(14, 159, 110, 0.12);
  --ok-line: rgba(14, 159, 110, 0.28);

  --warn:      #C97A09;   /* pending, on leave, late */
  --warn-d:    #A36105;
  --warn-t:    rgba(201, 122, 9, 0.12);
  --warn-line: rgba(201, 122, 9, 0.28);

  --bad:      #D4322E;   /* absent, outside fence, rejected */
  --bad-d:    #AC2522;
  --bad-t:    rgba(212, 50, 46, 0.10);
  --bad-line: rgba(212, 50, 46, 0.26);

  --info:      #1D6FD0;   /* holiday, neutral notices */
  --info-d:    #17579F;
  --info-t:    rgba(29, 111, 208, 0.10);
  --info-line: rgba(29, 111, 208, 0.26);

  --violet:      #6D4AC7;  /* platform console only */
  --violet-d:    #573B9E;
  --violet-t:    rgba(109, 74, 199, 0.12);
  --violet-line: rgba(109, 74, 199, 0.26);

  /* ---- Sidebar ------------------------------------------------------- */
  --nav-bg:        #07231A;
  --nav-bg-2:      #051C13;
  --nav-line:      rgba(255, 255, 255, 0.09);
  --nav-ink:       #C8D6D0;
  --nav-ink-dim:   #7E938B;
  --nav-ink-hi:    #FFFFFF;
  --nav-hover:     rgba(255, 255, 255, 0.07);
  --nav-active:    var(--brand-500);

  /* ---- Elevation (restrained; cards lean on border + spacing) -------- */
  --e1: 0 1px 2px rgba(14, 26, 21, 0.05);
  --e2: 0 2px 4px rgba(14, 26, 21, 0.05), 0 1px 2px rgba(14, 26, 21, 0.04);
  --e3: 0 8px 20px rgba(14, 26, 21, 0.08), 0 2px 6px rgba(14, 26, 21, 0.04);
  --e4: 0 20px 44px rgba(14, 26, 21, 0.14), 0 6px 14px rgba(14, 26, 21, 0.06);

  /* ---- Radius -------------------------------------------------------- */
  --r-xs:   4px;
  --r-sm:   6px;
  --r:      8px;
  --r-md:  10px;
  --r-lg:  12px;
  --r-xl:  14px;
  --r-2xl: 20px;
  --r-pill: 9999px;

  /* ---- Spacing scale (4 / 8) ----------------------------------------- */
  --s1:  4px;  --s2:  8px;  --s3: 12px;  --s4: 16px;
  --s5: 20px;  --s6: 24px;  --s8: 32px;  --s10: 40px;  --s12: 48px;

  /* ---- Layout -------------------------------------------------------- */
  --sidebar-w: 252px;
  --sidebar-w-mini: 72px;
  --topbar-h: 64px;
  --page-max: 1360px;

  /* ---- Type ---------------------------------------------------------- */
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Inter', system-ui, sans-serif;
  /* The wordmark only. Outfit's geometric shapes and tall x-height read as a
     considered brand at 16px as well as 48px, and it carries the weight the
     sidebar and nav need without the tight, squarish feel of the body face. */
  --font-brand: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* ---- Motion (150–250ms) -------------------------------------------- */
  --t-fast: 150ms;
  --t-base: 200ms;
  --t-slow: 250ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0.05, 0.36, 1);

  --z-nav: 40;
  --z-topbar: 30;
  --z-overlay: 60;
  --z-drawer: 70;
  --z-modal: 80;
  --z-toast: 90;
}

/* Legacy aliases — older templates still reference these names. */
:root {
  --bg: var(--canvas); --bg2: var(--surface); --surface2: var(--surface-2);
  --surface-hover: var(--surface-2);
  --border: var(--line); --border-light: var(--line-2);
  --text: var(--ink-2); --text-hi: var(--ink); --text-mid: var(--ink-2); --text-dim: var(--ink-3);
  --blue: var(--brand); --blue-d: var(--brand-d);
  --green: var(--ok); --green-d: var(--ok-d);
  --brand-green: var(--brand); --brand-green-l: var(--brand-400); --brand-green-d: var(--brand-d);
  --red: var(--bad); --crimson: var(--bad); --crimson-d: var(--bad-d);
  --gold: var(--warn); --gold-d: var(--warn-d); --amber: var(--warn);
  --blue-bg: var(--brand-t); --green-bg: var(--ok-t);
  --red-bg: var(--bad-t); --amber-bg: var(--warn-t);
  --aphd-grad: none;
  --ease-out-quint: var(--ease);
  --ease-in-out-cubic: var(--ease-in-out);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--brand-d); text-decoration: none; }
a:hover { color: var(--brand-dd); text-decoration: underline; }
img, svg { max-width: 100%; }
ul, ol { list-style: none; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
::selection { background: var(--brand-t2); color: var(--brand-800); }
.hidden, [hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- icons */
.ic {
  width: 20px; height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  pointer-events: none;
}
.ic-14 { width: 14px; height: 14px; stroke-width: 2; }
.ic-16 { width: 16px; height: 16px; stroke-width: 1.9; }
.ic-18 { width: 18px; height: 18px; stroke-width: 1.8; }
.ic-20 { width: 20px; height: 20px; }
.ic-22 { width: 22px; height: 22px; stroke-width: 1.7; }
.ic-24 { width: 24px; height: 24px; stroke-width: 1.65; }
.ic-28 { width: 28px; height: 28px; stroke-width: 1.55; }
.ic-32 { width: 32px; height: 32px; stroke-width: 1.5; }
.ic-40 { width: 40px; height: 40px; stroke-width: 1.4; }
/* Legacy alias used by a handful of older templates. */
.icon-svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-svg.sm { width: 15px; height: 15px; }
.icon-svg.lg { width: 22px; height: 22px; }

/* Icon tile — the tinted square behind an icon on cards and dialogs. */
.ic-tile {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-2);
}
.ic-tile.sm { width: 32px; height: 32px; border-radius: var(--r-sm); }
.ic-tile.lg { width: 48px; height: 48px; border-radius: var(--r-lg); }
.ic-tile.xl { width: 64px; height: 64px; border-radius: var(--r-xl); }
.ic-tile.t-brand { background: var(--brand-t);  color: var(--brand-d); }
.ic-tile.t-ok    { background: var(--ok-t);     color: var(--ok-d); }
.ic-tile.t-warn  { background: var(--warn-t);   color: var(--warn-d); }
.ic-tile.t-bad   { background: var(--bad-t);    color: var(--bad-d); }
.ic-tile.t-info  { background: var(--info-t);   color: var(--info-d); }
.ic-tile.t-violet{ background: var(--violet-t); color: var(--violet-d); }
.ic-tile.t-mute  { background: var(--surface-2);color: var(--ink-3); }

/* --------------------------------------------------------------- motion */
@keyframes h-fade      { from { opacity: 0 } to { opacity: 1 } }
@keyframes h-rise      { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes h-pop       { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: none } }
@keyframes h-slide-r   { from { transform: translateX(100%) } to { transform: none } }
@keyframes h-slide-d   { from { opacity: 0; transform: translateY(-10px) } to { opacity: 1; transform: none } }
@keyframes h-pulse     { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes h-ring      { 0% { box-shadow: 0 0 0 0 var(--ok-t) } 70% { box-shadow: 0 0 0 8px transparent } 100% { box-shadow: 0 0 0 0 transparent } }
@keyframes h-shimmer   { from { background-position: -420px 0 } to { background-position: 420px 0 } }
@keyframes h-spin      { to { transform: rotate(360deg) } }

.anim-rise { animation: h-rise var(--t-slow) var(--ease) both; }
.stagger > * { animation: h-rise var(--t-slow) var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 40ms }
.stagger > *:nth-child(3) { animation-delay: 80ms }
.stagger > *:nth-child(4) { animation-delay: 120ms }
.stagger > *:nth-child(5) { animation-delay: 160ms }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: var(--z-nav);
  transition: transform var(--t-slow) var(--ease-in-out), width var(--t-slow) var(--ease-in-out);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 18px;
  border-bottom: 1px solid var(--nav-line);
  flex: 0 0 auto;
}
.sidebar-brand .mark { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; }
.sidebar-brand .wordmark { min-width: 0; }
.sidebar-brand .wordmark h2 {
  font-family: var(--font-brand); font-size: 18px; font-weight: 700; color: var(--nav-ink-hi);
  letter-spacing: -0.015em; line-height: 1.15;
}
.sidebar-brand .wordmark span {
  display: block; font-size: 10px; font-weight: 600; color: var(--nav-ink-dim);
  letter-spacing: 0.1em; text-transform: uppercase; margin-top: 1px;
}
.sidebar-collapse {
  margin-left: auto; color: var(--nav-ink-dim); padding: 6px; border-radius: var(--r-sm);
  display: grid; place-items: center; transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-collapse:hover { background: var(--nav-hover); color: var(--nav-ink-hi); }

/* Organisation card */
.org-card { padding: 14px 14px 6px; flex: 0 0 auto; }
.org-card > summary, .org-card .org-static {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.06); border: 1px solid var(--nav-line);
  cursor: pointer; list-style: none; transition: background var(--t-fast);
}
.org-card .org-static { cursor: default; }
.org-card > summary::-webkit-details-marker { display: none; }
.org-card > summary:hover { background: rgba(255,255,255,0.1); }
.org-card .org-avatar {
  width: 30px; height: 30px; border-radius: var(--r-sm); flex: 0 0 auto;
  background: var(--brand-500); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; overflow: hidden;
}
.org-card .org-avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.org-card .org-meta { min-width: 0; flex: 1; }
.org-card .org-meta b {
  display: block; font-size: 13px; font-weight: 700; color: var(--nav-ink-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.org-card .org-meta span {
  display: block; font-size: 11px; color: var(--nav-ink-dim); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-card .caret { color: var(--nav-ink-dim); transition: transform var(--t-base) var(--ease); }
.org-card[open] .caret { transform: rotate(180deg); }
.org-menu {
  margin-top: 6px; padding: 6px; border-radius: var(--r-md);
  background: rgba(0,0,0,0.28); border: 1px solid var(--nav-line);
  animation: h-slide-d var(--t-base) var(--ease) both;
}
.org-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: var(--r-sm); color: var(--nav-ink);
  font-size: 13px; font-weight: 500; transition: background var(--t-fast);
}
.org-menu button:hover { background: var(--nav-hover); color: var(--nav-ink-hi); }
.org-menu button.on { color: var(--nav-ink-hi); font-weight: 700; }
.org-menu button.on::after { content: ''; }

/* Navigation */
.sidebar-nav { flex: 1 1 auto; padding: 8px 12px 16px; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-nav::-webkit-scrollbar { width: 6px }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px }
.nav-group { margin-bottom: 20px; }
.nav-group:last-child { margin-bottom: 0; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--nav-ink-dim); padding: 0 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r); margin-bottom: 2px;
  color: var(--nav-ink); font-size: 13.5px; font-weight: 500;
  position: relative; transition: background var(--t-fast), color var(--t-fast);
}
.nav-item .ic { width: 20px; height: 20px; opacity: .9; }
.nav-item:hover { background: var(--nav-hover); color: var(--nav-ink-hi); text-decoration: none; }
.nav-item.active {
  background: var(--nav-active); color: #fff; font-weight: 650;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.nav-item.active .ic { opacity: 1; }
.nav-item .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  flex: 0 0 auto; min-width: 20px; text-align: center;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--r-pill); font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-count { background: rgba(255,255,255,.22); }

/* Sidebar footer / profile */
.sidebar-foot { flex: 0 0 auto; padding: 12px; border-top: 1px solid var(--nav-line); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md);
  transition: background var(--t-fast); width: 100%; text-align: left;
}
.sidebar-user:hover { background: var(--nav-hover); text-decoration: none; }
.sidebar-user .avatar {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--r-pill);
  background: rgba(255,255,255,.12); color: var(--nav-ink-hi);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .who b {
  display: block; font-size: 13px; font-weight: 650; color: var(--nav-ink-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.sidebar-user .who span {
  display: block; font-size: 11px; color: var(--nav-ink-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-signout {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; margin-top: 2px; border-radius: var(--r);
  color: var(--nav-ink-dim); font-size: 13px; font-weight: 550;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-signout:hover { background: rgba(212,50,46,.16); color: #FCA5A5; }

.sidebar-scrim {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(7, 35, 26, .55); backdrop-filter: blur(2px);
  animation: h-fade var(--t-fast) ease both;
}
.sidebar-scrim.show { display: block; }

/* Collapsed (icon-only) mode — desktop */
@media (min-width: 1025px) {
  body.nav-mini .sidebar { width: var(--sidebar-w-mini); }
  body.nav-mini .main-area { margin-left: var(--sidebar-w-mini); }
  body.nav-mini .sidebar-brand { padding: 0 20px; justify-content: center; }
  body.nav-mini .sidebar-brand .wordmark,
  body.nav-mini .sidebar-brand .sidebar-collapse,
  body.nav-mini .org-card,
  body.nav-mini .nav-group-label,
  body.nav-mini .nav-item .nav-label,
  body.nav-mini .sidebar-user .who,
  body.nav-mini .sidebar-signout span { display: none; }
  body.nav-mini .nav-item { justify-content: center; padding: 11px 0; }
  body.nav-mini .nav-item .nav-count {
    position: absolute; top: 3px; right: 8px; min-width: 16px; padding: 0 4px; font-size: 10px;
  }
  body.nav-mini .nav-group { margin-bottom: 12px; }
  body.nav-mini .nav-group + .nav-group { border-top: 1px solid var(--nav-line); padding-top: 12px; }
  body.nav-mini .sidebar-user, body.nav-mini .sidebar-signout { justify-content: center; }
}

/* Main column */
.main-area {
  margin-left: var(--sidebar-w); flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  transition: margin-left var(--t-slow) var(--ease-in-out);
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex; align-items: center; gap: var(--s4);
  height: var(--topbar-h); padding: 0 28px;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: var(--z-topbar);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-title { min-width: 0; }
.topbar-title h1 {
  font-size: 19px; font-weight: 750; color: var(--ink);
  letter-spacing: -0.022em; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title .sub-text {
  font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center;
  color: var(--ink-3); position: relative; transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: var(--r-sm); }
.icon-btn.has-dot::after {
  content: ''; position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--bad);
  border: 2px solid var(--surface);
}
.hamburger { display: none; }

/* ---------------------------------------------------------------- page */
.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 24px 28px 72px; }
.page.wide { max-width: none; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap;
}
.page-head h2 { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); }
.page-head p { font-size: 14px; color: var(--ink-3); margin-top: 4px; max-width: 70ch; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); margin: 0 0 12px;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 14px; flex-wrap: wrap;
}
.section-head h3 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
.section-head p { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }

/* --------------------------------------------------------------- typography */
h1, h2, h3, h4, h5 { letter-spacing: -0.018em; color: var(--ink); font-weight: 700; }
.help { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
/* A consent notice is not hint text: it has to be read before the upload, not
   skimmed past, so it gets a surface of its own rather than sitting in the
   same grey as "at least 8 characters". */
.help.consent {
  margin-top: 8px; padding: 10px 12px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
}
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.num, .money, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.money { font-weight: 650; color: var(--ink); }
.metric { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.strong { font-weight: 650; color: var(--ink); }
.t-ok { color: var(--ok-d) } .t-warn { color: var(--warn-d) }
.t-bad { color: var(--bad-d) } .t-brand { color: var(--brand-d) }
.nowrap { white-space: nowrap; }
.truncate { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  background: var(--brand); color: #fff;
  font-size: 13.5px; font-weight: 650; letter-spacing: -0.005em;
  border: 1px solid transparent; border-radius: var(--r);
  white-space: nowrap; box-shadow: var(--e1);
  transition: background var(--t-fast) ease, box-shadow var(--t-fast) ease,
              transform 90ms ease, border-color var(--t-fast) ease, color var(--t-fast) ease;
}
.btn:hover { background: var(--brand-d); color: #fff; text-decoration: none; box-shadow: var(--e2); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; transform: none; box-shadow: none;
}
.btn .ic { width: 16px; height: 16px; stroke-width: 2; }

.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-3); }
.btn.quiet { background: transparent; color: var(--ink-2); box-shadow: none; border-color: transparent; }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn.link { background: none; box-shadow: none; color: var(--brand-d); padding: 0 4px; height: auto; }
.btn.link:hover { background: none; text-decoration: underline; box-shadow: none; }
.btn.green { background: var(--ok); } .btn.green:hover { background: var(--ok-d); }
.btn.danger { background: var(--bad); } .btn.danger:hover { background: var(--bad-d); }
.btn.danger-ghost { background: var(--surface); color: var(--bad-d); border-color: var(--bad-line); box-shadow: none; }
.btn.danger-ghost:hover { background: var(--bad-t); border-color: var(--bad); }
.btn.warn { background: var(--warn); } .btn.warn:hover { background: var(--warn-d); }
.btn.dark { background: var(--ink); } .btn.dark:hover { background: var(--brand-800); }

.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.xs { height: 27px; padding: 0 9px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.btn.xs .ic { width: 13px; height: 13px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn.lg .ic { width: 18px; height: 18px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.icon-only.sm { width: 32px; }

.btn-group { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Segmented control — Today / This week / This month */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
}
.segmented a, .segmented button {
  padding: 6px 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  color: var(--ink-3); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.segmented a:hover, .segmented button:hover { color: var(--ink); text-decoration: none; }
.segmented a.on, .segmented button.on {
  background: var(--surface); color: var(--brand-d); box-shadow: var(--e1);
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
}
.card.pad-lg { padding: 24px; }
.card.pad-sm { padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.raised { box-shadow: var(--e2); }
.card > h2, .card-title {
  font-size: 18px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.015em; margin-bottom: 14px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  flex-wrap: wrap;
}
.card-head h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.card-head p { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 20px; }
.card-foot {
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* Metric cards */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi-row.five { grid-template-columns: repeat(5, 1fr); }
.kpi-row.three { grid-template-columns: repeat(3, 1fr); }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
  position: relative; overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) cubic-bezier(0.2, 0, 0, 1);
}
a.kpi:hover { border-color: var(--line-3); box-shadow: var(--e3); transform: translateY(-3px); text-decoration: none; }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kpi-top .kpi-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: -0.005em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kpi-val {
  font-size: 32px; font-weight: 750; color: var(--ink);
  letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.kpi-val .of { font-size: 15px; font-weight: 600; color: var(--ink-4); letter-spacing: -0.01em; }
.kpi-val.sm { font-size: 20px; letter-spacing: -0.02em; }
.kpi-sub {
  font-size: 12px; color: var(--ink-4); margin-top: 6px; font-weight: 500;
  display: flex; align-items: center; gap: 5px; min-height: 18px;
}
.kpi-sub .ic { width: 13px; height: 13px; }
.kpi-label { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
/* Legacy KPI icon classes */
.kpi-icon { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; }
.kpi-icon.i-brand { background: var(--brand-t); color: var(--brand-d) }
.kpi-icon.i-green { background: var(--ok-t); color: var(--ok-d) }
.kpi-icon.i-red   { background: var(--bad-t); color: var(--bad-d) }
.kpi-icon.i-gold  { background: var(--warn-t); color: var(--warn-d) }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 650; letter-spacing: -0.002em; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.badge.sq { border-radius: var(--r-xs); }
.badge.b-ok     { background: var(--ok-t);     color: var(--ok-d);     border-color: var(--ok-line) }
.badge.b-warn   { background: var(--warn-t);   color: var(--warn-d);   border-color: var(--warn-line) }
.badge.b-bad    { background: var(--bad-t);    color: var(--bad-d);    border-color: var(--bad-line) }
.badge.b-info   { background: var(--info-t);   color: var(--info-d);   border-color: var(--info-line) }
.badge.b-brand  { background: var(--brand-t);  color: var(--brand-d);  border-color: var(--brand-t2) }
.badge.b-violet { background: var(--violet-t); color: var(--violet-d); border-color: var(--violet-line) }
.badge.b-mute   { background: var(--surface-2);color: var(--ink-3);    border-color: var(--line) }

/* Status name → tone (used across register, people, leaves, invites) */
.st-present, .st-active, .st-approved, .st-accepted, .st-in, .st-inside, .st-paid, .st-open
  { background: var(--ok-t); color: var(--ok-d); border-color: var(--ok-line) }
.st-absent, .st-exited, .st-rejected, .st-revoked, .st-outside, .st-expired, .st-failed
  { background: var(--bad-t); color: var(--bad-d); border-color: var(--bad-line) }
.st-leave, .st-pending, .st-half, .st-late, .st-draft
  { background: var(--warn-t); color: var(--warn-d); border-color: var(--warn-line) }
.st-holiday, .st-weekly-off, .st-closed, .st-info
  { background: var(--info-t); color: var(--info-d); border-color: var(--info-line) }
.st-none, .st-unmarked { background: var(--surface-2); color: var(--ink-3); border-color: var(--line) }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: var(--r-pill); white-space: nowrap;
}
.pill .ic { width: 13px; height: 13px; color: var(--ink-3); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--ok-t); animation: h-pulse 2.4s ease-in-out infinite;
}

/* --------------------------------------------------------------- avatars */
.avatar {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--r-pill);
  background: var(--brand-100); color: var(--brand-800);
  display: grid; place-items: center; overflow: hidden;
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.avatar.ring-ok  { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok); }
.avatar.ring-bad { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bad); }
.emp-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.emp-cell .who { min-width: 0; }
.emp-cell .who b { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.emp-cell .who span { display: block; font-size: 12px; color: var(--ink-3); }
.role-s { font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- tables */
.tbl-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.tbl-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); flex-wrap: wrap;
}
.tbl-header h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }
.tbl-header .sub { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.tbl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-scroll.sticky { max-height: 62vh; overflow-y: auto; }
.tbl-scroll.sticky thead th { position: sticky; top: 0; z-index: 2; }

table { width: 100%; border-collapse: collapse; text-align: left; }
thead th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-4); padding: 10px 18px; white-space: nowrap;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
thead th.right, td.right { text-align: right; }
thead th.center, td.center { text-align: center; }
tbody td {
  padding: 12px 18px; font-size: 13.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
tbody td.wrap { white-space: normal; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.is-selected td { background: var(--brand-50); }
.row-btns { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

.tbl-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap;
}

/* ----------------------------------------------------------------- forms */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink);
  margin-bottom: 6px; letter-spacing: -0.005em;
}
.field .req { color: var(--bad); margin-left: 2px; }
.field .optional { color: var(--ink-4); font-weight: 500; font-size: 12px; margin-left: 5px; }

.input, .field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=tel], .field input[type=url],
.field input[type=date], .field input[type=time], .field input[type=search],
.field select, .field textarea {
  width: 100%; height: 40px; padding: 0 13px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 14px; font-family: inherit;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background var(--t-fast) ease;
  appearance: none; -webkit-appearance: none;
}
.field textarea, textarea.input { height: auto; min-height: 92px; padding: 10px 13px; resize: vertical; line-height: 1.55; }
.field select, select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2363756D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 36px;
  cursor: pointer;
}
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-3); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
.input:disabled, .field input:disabled, .field select:disabled, .field textarea:disabled {
  background: var(--surface-2); color: var(--ink-4); cursor: not-allowed; border-color: var(--line);
}
.input.sm { height: 34px; font-size: 13px; padding: 0 11px; }

.field-help { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.field-error {
  display: none; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 550; color: var(--bad-d); margin-top: 6px;
}
.field-error .ic { width: 14px; height: 14px; flex: 0 0 auto; }
.field.invalid .field-error { display: flex; }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .input-affix {
  border-color: var(--bad);
}
.field.invalid input:focus, .field.invalid select:focus,
.field.invalid textarea:focus, .field.invalid .input-affix:focus-within {
  box-shadow: 0 0 0 3px var(--bad-t);
}

/* Affixed input — ₹ prefix, unit suffix */
.input-affix {
  display: flex; align-items: center; height: 40px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-affix:hover { border-color: var(--line-3); }
.input-affix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.input-affix .affix {
  display: grid; place-items: center; flex: 0 0 auto; align-self: stretch;
  padding: 0 12px; font-size: 14px; font-weight: 650; color: var(--ink-3);
  background: var(--surface-2); border-right: 1px solid var(--line);
}
.input-affix .affix.suffix { border-right: none; border-left: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.input-affix input {
  flex: 1; min-width: 0; height: 100%; border: none; background: none;
  padding: 0 12px; font-size: 14px; font-variant-numeric: tabular-nums;
}
.input-affix input:focus { outline: none; box-shadow: none; }
.input-affix.sm { height: 34px; }
.input-affix.sm input, .input-affix.sm .affix { font-size: 13px; }

/* Input with a leading icon */
.input-icon { position: relative; }
.input-icon > .ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); width: 16px; height: 16px; pointer-events: none;
}
.input-icon input { padding-left: 36px; }

/* Search */
.search-box {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.search-box .ic { color: var(--ink-4); width: 16px; height: 16px; }
.search-box input {
  flex: 1; min-width: 0; width: 190px; border: none; background: none; outline: none;
  font-size: 13.5px; padding: 0;
}
.search-box select { border: none; background: none; outline: none; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.search-box.wide input { width: 100%; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px; height: 23px; border-radius: var(--r-pill); background: var(--line-3);
  position: relative; flex: 0 0 auto; transition: background var(--t-base) var(--ease);
}
.switch .track::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--e1); transition: transform var(--t-base) var(--ease);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--brand-ring); }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }
.switch .switch-text { min-width: 0; }
.switch .switch-text b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.switch .switch-text span { display: block; font-size: 12px; color: var(--ink-3); }

/* Checkbox & radio */
.check, .radio {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.45;
}
.check input, .radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box, .radio .box {
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px;
  border: 1.5px solid var(--line-3); background: var(--surface);
  display: grid; place-items: center;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check .box { border-radius: var(--r-xs); }
.radio .box { border-radius: 50%; }
.check .box::after {
  content: ''; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0); transform-origin: center; margin-top: -2px;
  transition: transform var(--t-fast) var(--ease);
}
.radio .box::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  transform: scale(0); transition: transform var(--t-fast) var(--ease);
}
.check input:checked + .box, .radio input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box::after, .radio input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.radio input:checked + .box::after { transform: scale(1); }
.check input:focus-visible + .box, .radio input:focus-visible + .box { box-shadow: 0 0 0 3px var(--brand-ring); }
.check-text b, .radio-text b { display: block; font-weight: 600; color: var(--ink); font-size: 13.5px; }
.check-text span, .radio-text span { display: block; font-size: 12px; color: var(--ink-3); }

/* Radio card — used by working-hours and geofence radius pickers */
.radio-card {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 13px 14px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.radio-card:hover { border-color: var(--line-3); background: var(--surface-2); }
.radio-card:has(input:checked) {
  border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand) inset;
}
.radio-card input { position: absolute; opacity: 0; width: 0; height: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--line);
}

/* Fieldset block used on Settings */
.fieldset { padding: 20px 0; border-bottom: 1px solid var(--line); }
.fieldset:first-child { padding-top: 0; }
.fieldset:last-child { border-bottom: none; padding-bottom: 0; }
.fieldset > h4 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.fieldset > .help { margin-bottom: 14px; }

/* ---------------------------------------------------------------- alerts */
.msg, .alert {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; font-weight: 500; line-height: 1.5;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid transparent; margin-bottom: 14px;
}
.msg .ic, .alert .ic { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.msg > div, .alert > div { min-width: 0; flex: 1; }
.msg b, .alert b { font-weight: 700; }
.msg.ok, .msg.success, .alert.ok     { background: var(--ok-t);   color: var(--ok-d);   border-color: var(--ok-line) }
.msg.err, .msg.error, .alert.bad     { background: var(--bad-t);  color: var(--bad-d);  border-color: var(--bad-line) }
.msg.warning, .msg.warn, .alert.warn { background: var(--warn-t); color: var(--warn-d); border-color: var(--warn-line) }
.msg.info, .msg.debug, .alert.info   { background: var(--info-t); color: var(--info-d); border-color: var(--info-line) }
.alert.brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200) }
.alert a { color: inherit; text-decoration: underline; font-weight: 650; }

/* Banner strip above the shell (impersonation, trial) */
.banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 9px 20px; font-size: 13px; font-weight: 550; flex-wrap: wrap; text-align: center;
}
.banner .ic { width: 16px; height: 16px; }
.banner.impersonate { background: var(--violet-d); color: #fff; }
.banner.impersonate .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff }
.banner.impersonate .btn:hover { background: rgba(255,255,255,.26) }
.banner.trial { background: var(--brand-800); color: var(--brand-100); }
.banner.trial b { color: #fff; }
.banner.trial .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.26); color: #fff }
.banner.trial .btn:hover { background: rgba(255,255,255,.24) }

/* ----------------------------------------------------------------- auth */
/* position/isolation let the sign-in pages carry the same doodle layer as the
   marketing pages: it sits at z-index -1 inside this element's own stacking
   context, so it paints over the canvas colour but under the card. */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); position: relative; isolation: isolate; overflow: hidden; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px;
  box-shadow: var(--e3);
}
.logo-block { text-align: center; margin-bottom: 26px; }
.logo-block .mark { width: 48px; height: 48px; }
.logo-block h2 { font-size: 22px; font-weight: 750; color: var(--ink); margin-top: 12px; letter-spacing: -0.025em; }
.logo-block p { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }

/* ------------------------------------------------------------- the mark */
/* An inline <svg> with no width/height falls back to the replaced-element
   default of 300x150 — which is exactly how the landing-page logo ended up
   enormous. Give it a sane size so no bare `.mark` can ever blow up; the
   scoped rules above and in app.css override this wherever a bigger mark is
   wanted. */
.mark {
  width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 8px; display: block;
}

/* -------------------------------------------------------------- helpers */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split.rail-left { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: grid; gap: 20px; }
.stack.sm { gap: 12px; }
.stack.lg { gap: 28px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.tight { gap: 6px; }
.spacer { flex: 1 1 auto; }
.mt-0{margin-top:0} .mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:12px}
.mt-4{margin-top:16px} .mt-5{margin-top:20px} .mt-6{margin-top:24px} .mt-8{margin-top:32px}
.mb-0{margin-bottom:0} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px}
.mb-4{margin-bottom:16px} .mb-5{margin-bottom:20px} .mb-6{margin-bottom:24px}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .kpi-row.five { grid-template-columns: repeat(3, 1fr); }
  .page { padding: 20px 22px 64px; }
}
@media (max-width: 1180px) {
  .split, .split.rail-left { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--e4); }
  .sidebar.open { transform: none; }
  .main-area { margin-left: 0; }
  .hamburger { display: grid; }
  .topbar { padding: 0 18px; }
  .kpi-row, .kpi-row.five, .kpi-row.three { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .page { padding: 18px 16px 80px; }
  .topbar { padding: 0 14px; }
  .topbar-title h1 { font-size: 17px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .split.even { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: var(--r-md); }
  .page-head h2 { font-size: 19px; }
  thead th, tbody td { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 560px) {
  .kpi-row, .kpi-row.five, .kpi-row.three { grid-template-columns: 1fr; gap: 10px; }
  .kpi-val { font-size: 25px; }
  .search-box input { width: 100%; }
  .top-actions .btn span.label { display: none; }
  .top-actions .btn { padding: 0 11px; }
}

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .topbar, .banner, .sidebar-scrim, .no-print, .toast-stack { display: none !important; }
  .main-area { margin-left: 0 !important; }
  .page { padding: 0; max-width: none; }
  .card, .tbl-wrap { border-color: #ccc; box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
