/* ============================================================
   TREKKO ADMIN — Stripe-flavoured design tokens
   ============================================================ */

:root {
  /* ---------- color: surface ---------- */
  --bg-app: #f6f9fc;            /* viewport background */
  --bg-surface: #ffffff;         /* cards, tables, modals */
  --bg-subtle: #f7fafc;          /* table head, hover, code, etc. */
  --bg-hover: #f5f6f8;
  --bg-overlay: rgba(10, 37, 64, 0.45);

  /* ---------- color: ink ---------- */
  --ink-1: #0a2540;              /* primary text */
  --ink-2: #425466;              /* secondary */
  --ink-3: #697386;              /* tertiary */
  --ink-4: #8898aa;              /* placeholder / icon-only */
  --ink-inverse: #ffffff;

  /* ---------- color: border ---------- */
  --border: #e3e8ee;             /* default 1px */
  --border-strong: #c1c9d2;
  --border-hairline: #eff1f4;    /* faint dividers */

  /* ---------- color: brand ---------- */
  --indigo: #635bff;
  --indigo-600: #5851e6;
  --indigo-700: #4b45c4;
  --indigo-50: #f5f4ff;
  --indigo-100: #e0deff;

  --cyan: #00d4ff;
  --cyan-700: #008db8;

  /* semantic */
  --success: #0e6245;
  --success-bg: #cbf4c9;
  --success-border: #6ed19a;
  --warning: #983705;
  --warning-bg: #fcedb9;
  --warning-border: #e0b341;
  --danger: #983834;
  --danger-bg: #fde2dd;
  --danger-border: #efa49a;
  --info: #3d4eac;
  --info-bg: #d9e2fe;
  --info-border: #9da9eb;
  --neutral-bg: #e7ebf0;
  --neutral-fg: #3c4257;

  /* chart palette */
  --c1: #635bff;
  --c2: #00d4ff;
  --c3: #0e7c66;
  --c4: #ff9f43;
  --c5: #d4366a;
  --c6: #4b45c4;
  --c7: #a78bfa;
  --c-grid: #eaeef3;

  /* ---------- radius ---------- */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 999px;

  /* ---------- shadow ---------- */
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(50, 50, 93, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 0 0 1px rgba(0, 0, 0, 0.05),
    0 4px 12px -2px rgba(50, 50, 93, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 0 0 1px rgba(10, 37, 64, 0.08),
    0 15px 35px -5px rgba(50, 50, 93, 0.18),
    0 5px 15px -5px rgba(0, 0, 0, 0.1);
  --shadow-focus: 0 0 0 4px rgba(99, 91, 255, 0.22);

  /* ---------- layout ---------- */
  --side-w: 244px;
  --top-h: 60px;

  /* ---------- type ---------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas,
    monospace;
}

/* ============================================================
   reset
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-1);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--indigo-600); }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border-hairline); margin: 16px 0; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d1d8e0; border-radius: 999px; border: 2px solid var(--bg-app); }
::-webkit-scrollbar-thumb:hover { background: #aab4be; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   app shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "side top" "side main";
  height: 100vh;
  min-height: 600px;
}
.app--auth { display: block; height: 100vh; background: var(--bg-app); }

/* ---------- sidebar ---------- */
.side {
  grid-area: side;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--top-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
}
.side__brand-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--indigo) 0%, #8d6eff 100%);
  border-radius: 7px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 4px rgba(99, 91, 255, 0.35);
}
.side__brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}
.side__brand-env {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--indigo-50);
  color: var(--indigo);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side__nav { flex: 1; overflow-y: auto; padding: 12px 10px 24px; }
.side__group { margin-top: 14px; }
.side__group:first-child { margin-top: 4px; }
.side__group-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-4);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 10px 6px;
}

.side__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
  width: 100%;
  text-align: left;
  position: relative;
  transition: background 80ms, color 80ms;
}
.side__item:hover { background: var(--bg-subtle); color: var(--ink-1); }
.side__item--active {
  background: var(--indigo-50);
  color: var(--indigo);
}
.side__item--active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px; bottom: 6px;
  width: 3px;
  background: var(--indigo);
  border-radius: 0 3px 3px 0;
}
.side__item svg { width: 16px; height: 16px; flex-shrink: 0; }
.side__item-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}
.side__item--active .side__item-badge { background: var(--indigo-100); color: var(--indigo-700); }

.side__foot {
  padding: 12px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  gap: 10px;
}
.side__avatar {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9f43, #d4366a);
  color: #fff;
  font-weight: 600; font-size: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.side__who { line-height: 1.2; min-width: 0; flex: 1; }
.side__who-name { font-size: 12.5px; font-weight: 600; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__who-role { font-size: 11px; color: var(--ink-3); }

/* ---------- topbar ---------- */
.top {
  grid-area: top;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 18px;
}
.top__crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
  min-width: 0;
}
.top__crumbs a { color: var(--ink-3); }
.top__crumbs a:hover { color: var(--ink-1); }
.top__crumbs > .sep { color: var(--ink-4); }
.top__crumbs > .now { color: var(--ink-1); font-weight: 500; }
.top__search {
  margin-left: auto;
  position: relative;
  width: 280px;
}
.top__search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-app);
  font-size: 13px;
  transition: border 120ms, box-shadow 120ms, background 120ms;
}
.top__search input:focus { outline: none; border-color: var(--indigo); background: #fff; box-shadow: var(--shadow-focus); }
.top__search svg { position: absolute; left: 10px; top: 9px; color: var(--ink-4); }
.top__kbd {
  position: absolute; right: 8px; top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink-3);
}
.top__icons { display: flex; gap: 4px; }
.top__icon {
  width: 34px; height: 34px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-2);
  position: relative;
}
.top__icon:hover { background: var(--bg-subtle); color: var(--ink-1); }
.top__icon .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--danger-border); border: 2px solid #fff;
}

/* ---------- main scroll area ---------- */
.main {
  grid-area: main;
  overflow-y: auto;
  background: var(--bg-app);
}
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 64px;
}

/* ============================================================
   page header
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-1);
  margin: 0 0 4px;
}
.page-head__sub {
  font-size: 13.5px;
  color: var(--ink-3);
}
.page-head__actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   tabs (segmented)
   ============================================================ */
.tabs {
  display: inline-flex;
  border-bottom: 1px solid var(--border);
  gap: 4px;
  margin-bottom: 20px;
}
.tabs__tab {
  padding: 9px 4px;
  margin: 0 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  position: relative;
  margin-bottom: -1px;
  transition: color 100ms;
}
.tabs__tab:first-child { margin-left: 0; }
.tabs__tab:hover { color: var(--ink-1); }
.tabs__tab--active { color: var(--indigo); }
.tabs__tab--active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--indigo);
  border-radius: 2px;
}

/* segmented control */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 7px;
  gap: 0;
}
.segmented__opt {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: 5px;
  transition: background 100ms, color 100ms;
}
.segmented__opt:hover { color: var(--ink-1); }
.segmented__opt--active { background: #fff; color: var(--ink-1); box-shadow: var(--shadow-xs); }

/* ============================================================
   buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: background 100ms, color 100ms, box-shadow 100ms, border 100ms;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn--primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06), inset 0 -1px 0 rgba(0,0,0,0.12);
}
.btn--primary:hover { background: var(--indigo-600); }
.btn--primary:active { background: var(--indigo-700); }

.btn--secondary {
  background: #fff;
  color: var(--ink-1);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.btn--ghost { color: var(--ink-2); }
.btn--ghost:hover { background: var(--bg-subtle); color: var(--ink-1); }

.btn--danger { background: #fff; color: var(--danger); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger-border); }

.btn--success { background: #0e7c66; color: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.06), inset 0 -1px 0 rgba(0,0,0,0.12); }
.btn--success:hover { background: #0a6553; }

.btn--warning { background: #f59e0b; color: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.06), inset 0 -1px 0 rgba(0,0,0,0.12); }
.btn--warning:hover { background: #d97706; }

.btn--sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 5px; }
.btn--lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--icon { padding: 0; width: 32px; }
.btn--icon.btn--sm { width: 26px; }
.btn--block { width: 100%; }

/* ============================================================
   form
   ============================================================ */
.field { display: block; }
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field__hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.field__error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.input,
.select,
.textarea {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13.5px;
  color: var(--ink-1);
  box-shadow: var(--shadow-xs);
  transition: border 100ms, box-shadow 100ms;
}
.input::placeholder { color: var(--ink-4); }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: var(--shadow-focus);
}
.textarea { height: auto; padding: 8px 11px; min-height: 80px; line-height: 1.5; }

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%23697386' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.input--search { padding-left: 32px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><circle cx='6' cy='6' r='4.5' fill='none' stroke='%238898aa' stroke-width='1.5'/><path stroke='%238898aa' stroke-width='1.5' stroke-linecap='round' d='M9.5 9.5L12 12'/></svg>"); background-repeat: no-repeat; background-position: 10px center; }

.checkbox {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  display: inline-grid; place-items: center;
  transition: background 80ms, border 80ms;
  vertical-align: middle;
}
.checkbox:checked { background: var(--indigo); border-color: var(--indigo); }
.checkbox:checked::after {
  content: ""; width: 9px; height: 9px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M2 5l2 2 4-4'/></svg>") no-repeat center / contain;
}
.checkbox:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.toggle {
  position: relative;
  display: inline-block;
  width: 32px; height: 18px;
  background: #c1c9d2;
  border-radius: 999px;
  transition: background 120ms;
  cursor: pointer;
  vertical-align: middle;
}
.toggle::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; background: #fff;
  border-radius: 999px;
  transition: transform 140ms;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle--on { background: var(--indigo); }
.toggle--on::after { transform: translateX(14px); }

/* ============================================================
   card
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
}
.card__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-1);
  margin: 0;
}
.card__sub { font-size: 12.5px; color: var(--ink-3); }
.card__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  border-top: 1px solid var(--border-hairline);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   metric / KPI card
   ============================================================ */
.metric {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.metric__label {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.metric__value {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.metric__value sup { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.metric__delta {
  font-size: 12px;
  font-weight: 500;
  display: inline-flex; gap: 4px; align-items: center;
}
.metric__delta--up { color: var(--success); }
.metric__delta--down { color: var(--danger); }

.metric__cmp { display: inline-flex; align-items: center; gap: 4px; }
.metric__cmp-lbl {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  text-transform: uppercase;
  background: var(--bg-subtle);
  padding: 1px 5px;
  border-radius: 4px;
}
.metric--accent::after {
  content: ""; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
  background: var(--indigo-50);
  border-radius: 999px;
  transform: translate(30%, -50%);
  pointer-events: none;
}

/* ============================================================
   tables
   ============================================================ */
.tbl-wrap {
  overflow-x: auto;
  background: var(--bg-surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.tbl {
  width: 100%;
  font-size: 13px;
  border-collapse: separate;
  border-spacing: 0;
}
.tbl thead th {
  background: var(--bg-subtle);
  color: var(--ink-3);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tbl thead th.num, .tbl tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl thead th.center, .tbl tbody td.center { text-align: center; }
.tbl thead th.sortable { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover { color: var(--ink-1); }
.tbl tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--ink-1);
  vertical-align: middle;
}
.tbl tbody tr { transition: background 80ms; }
.tbl tbody tr:hover { background: var(--bg-subtle); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.tbl .col-check { width: 36px; padding-right: 0; }
.tbl .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.tbl .muted { color: var(--ink-3); }
.tbl-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

/* ============================================================
   badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor;
  opacity: 0.8;
}
.badge--plain::before { display: none; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge--indigo { background: var(--indigo-50); color: var(--indigo); }

/* type-tag (Hotels / Rental Cars, etc) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 4px;
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}
.tag--hotel { background: #e8edff; color: var(--indigo-700); }
.tag--rental { background: #d9f3ee; color: #0e7c66; }
.tag--transfer { background: #ffe9d4; color: #a05a2c; }
.tag--flight { background: #ffe2f0; color: #b53b80; }
.tag--vip   { background: #f3e8ff; color: #6b21a8; }
.tag--vipas { background: #fff4cc; color: #92580c; }
.tag--ptour { background: #d9eaff; color: #0c5fb2; }

/* ============================================================
   misc
   ============================================================ */
.divider { height: 1px; background: var(--border-hairline); margin: 16px 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

.user-cell { display: inline-flex; align-items: center; gap: 8px; }
.avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.avatar--xl { width: 64px; height: 64px; font-size: 18px; }

/* ============================================================
   filter bar
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  flex-wrap: wrap;
}
.filter-bar .input--search { width: 280px; }
.filter-bar .select { width: auto; min-width: 130px; }
.filter-bar__group { display: flex; gap: 6px; align-items: center; }
.filter-bar .spacer { flex: 1; }
.tbl-wrap--linked { border: 1px solid var(--border); border-top: 0; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--indigo-50);
  border-bottom: 1px solid var(--indigo-100);
  font-size: 13px;
}
.bulk-bar__count { color: var(--indigo-700); font-weight: 600; }
.bulk-bar__actions { margin-left: auto; display: flex; gap: 6px; }

/* pagination */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-top: 1px solid var(--border-hairline);
  font-size: 13px; color: var(--ink-3);
  background: var(--bg-surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  border: 1px solid var(--border);
  border-top: 0;
}
.pager__nums { display: flex; gap: 4px; }
.pager__num {
  min-width: 28px; height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 13px;
  display: inline-grid; place-items: center;
  color: var(--ink-2);
}
.pager__num:hover { background: var(--bg-subtle); color: var(--ink-1); }
.pager__num--active { background: var(--indigo); color: #fff; }
.pager__num--active:hover { background: var(--indigo); color: #fff; }
.pager__num:disabled { color: var(--ink-4); cursor: not-allowed; }

/* ============================================================
   modal
   ============================================================ */
.modal-veil {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal--lg { max-width: 720px; }
.modal--xl { max-width: 920px; }
.modal__head {
  padding: 18px 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border-hairline);
}
.modal__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.modal__close {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.modal__close:hover { background: var(--bg-subtle); color: var(--ink-1); }
.modal__body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border-hairline);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--bg-subtle);
}

/* drawer (right slide-in) */
.drawer-veil {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 100;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(640px, 100vw);
  background: #fff;
  z-index: 101;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: drawer-in 220ms cubic-bezier(0.2, 0.7, 0.1, 1);
}
@keyframes drawer-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* description list */
.dl {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
}
.dl > dt, .dl > dd {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 13px;
  margin: 0;
}
.dl > dt {
  background: var(--bg-subtle);
  color: var(--ink-3);
  font-weight: 500;
  border-right: 1px solid var(--border-hairline);
}
.dl > dd { color: var(--ink-1); }
.dl > dt:last-of-type, .dl > dd:last-of-type { border-bottom: 0; }

/* ============================================================
   charts
   ============================================================ */
.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__sw { width: 10px; height: 10px; border-radius: 3px; }

/* ============================================================
   notification list
   ============================================================ */
.notif {
  position: absolute;
  top: 44px; right: 12px;
  width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
}
.notif__head { padding: 12px 14px; display: flex; align-items: center; border-bottom: 1px solid var(--border-hairline); }
.notif__title { font-weight: 600; font-size: 13.5px; }
.notif__list { max-height: 360px; overflow-y: auto; }
.notif__item { padding: 12px 14px; border-bottom: 1px solid var(--border-hairline); display: flex; gap: 10px; }
.notif__item:last-child { border-bottom: 0; }
.notif__item:hover { background: var(--bg-subtle); }
.notif__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--indigo); margin-top: 6px; flex-shrink: 0; }
.notif__item--read .notif__dot { background: transparent; }
.notif__body { flex: 1; font-size: 13px; line-height: 1.45; }
.notif__time { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
