/*
 * =========================================================
 *  GOVR-VISA — Admin Panel · Global CSS
 *  Design system extracted from Jemixo School ERP prototype
 *  Font: DM Sans (Google Fonts)
 *  Author: Production Build  |  Version: 1.0.0
 * =========================================================
 *
 *  TABLE OF CONTENTS
 *  ─────────────────
 *  01. CSS Custom Properties (Design Tokens)
 *  02. Reset & Base
 *  03. Typography
 *  04. Layout — Shell (Sidebar + Main)
 *  05. Sidebar / Nav
 *  06. Topbar / Header
 *  07. Page Header
 *  08. Cards & Panels
 *  09. Stat / KPI Cards
 *  10. Data Tables
 *  11. Buttons
 *  12. Form Controls (Input, Select, Textarea, Checkbox, Toggle)
 *  13. Badge, Status Pill & Chip
 *  14. Modal
 *  15. Drawer (Side-panel)
 *  16. Toast Notifications
 *  17. Skeleton / Shimmer Loaders
 *  18. Empty State
 *  19. Avatars & Initials
 *  20. Pagination
 *  21. Tabs
 *  22. Progress Bar
 *  23. Divider
 *  24. Utility Helpers
 *  25. Animations & Keyframes
 *  26. Responsive — Mobile Breakpoints
 * =========================================================
 */


/* ─── 01. CSS CUSTOM PROPERTIES (DESIGN TOKENS) ─────────────────────────── */
:root {
  /* --- Brand Colors --- */
  --navy:    #0A1628;   /* primary text / sidebar bg */
  --navy-2:  #1F3357;
  --navy-3:  #4F668D;
  --navy-4:  #8A99B3;
  --navy-5:  #C5CCD9;
  --navy-6:  #E8EBF0;  /* subtle bg / active nav */

  --teal:    #1D9E75;   /* primary accent / CTA */
  --teal-2:  #178A66;
  --teal-3:  #5DCAA5;
  --teal-4:  #C1E8D9;
  --teal-5:  #E6F5EF;  /* teal tinted bg */

  --gold:    #D4AF37;   /* gold accent / premium */
  --gold-2:  #B8962C;
  --gold-5:  #FBF5E0;

  /* --- Semantic Colors --- */
  --red:     #E5484D;
  --red-bg:  #FEEBEC;
  --amber:   #D97706;
  --amber-bg:#FEF3C7;
  --blue:    #3858E9;
  --blue-bg: #E6EBFB;
  --green:   var(--teal);
  --green-bg:var(--teal-5);

  /* --- Surface & Border --- */
  --bg:      #FFFFFF;
  --bg-page: #F0EEE9;  /* page background (cream) */
  --bg-muted:#FAFAF7;  /* muted surface */
  --border:  #ECEEF2;
  --border-2:#E1E5EC;

  /* --- Text --- */
  --text:    #0A1628;
  --muted:   #6B7690;
  --muted-2: #9AA3B5;

  /* --- Layout --- */
  --sidebar-w:     220px;
  --sidebar-w-dense:200px;
  --topbar-h:      52px;

  /* --- Radius --- */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(10,22,40,.05);
  --shadow-sm: 0 1px 4px rgba(10,22,40,.06), 0 1px 2px rgba(10,22,40,.04);
  --shadow:    0 4px 12px rgba(10,22,40,.08), 0 1px 3px rgba(10,22,40,.04);
  --shadow-md: 0 8px 24px rgba(10,22,40,.10), 0 2px 6px rgba(10,22,40,.05);
  --shadow-lg: 0 18px 48px rgba(10,22,40,.14), 0 4px 10px rgba(10,22,40,.06);

  /* --- Transition --- */
  --transition: 0.14s ease;

  /* --- Typography --- */
  --font:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}


/* ─── 02. RESET & BASE ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--teal-2); }

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button { cursor: pointer; }

hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* Scrollbar — thin webkit */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-5); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-4); }


/* ─── 03. TYPOGRAPHY ─────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.2px;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
h5 { font-size: 13.5px; }
h6 { font-size: 12px;  letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }

.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 13.5px; }
.text-md   { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }

.font-regular  { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-navy   { color: var(--navy); }
.text-muted  { color: var(--muted); }
.text-muted2 { color: var(--muted-2); }
.text-teal   { color: var(--teal); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-gold   { color: var(--gold); }
.text-blue   { color: var(--blue); }

.label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 0 4px;
}


/* ─── 04. LAYOUT — SHELL ─────────────────────────────────────────────────── */
.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Main content area (right of sidebar) */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Scrollable page body */
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-page);
}

.page-body--sm { padding: 16px; }
.page-body--lg { padding: 32px; }


/* ─── 05. SIDEBAR / NAV ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition);
}

/* Logo / Brand area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar-brand__logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand__name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.sidebar-brand__sub {
  font-size: 10px;
  color: rgba(255,255,255,.45);
  font-weight: 500;
  margin-top: 1px;
}

/* Nav scroll area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

/* Nav group label */
.nav-group-label {
  padding: 10px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

/* Nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  margin: 1px 8px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
}

.nav-item.active {
  background: rgba(255,255,255,.10);
  color: #fff;
  font-weight: 600;
}

.nav-item__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .nav-item__icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.7);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.5;
}

.nav-item.active .nav-badge {
  background: var(--teal);
  color: #fff;
}

/* Sidebar footer — user profile */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.sidebar-user__name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user__role {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
}


/* ─── 06. TOPBAR / HEADER ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__search {
  flex: 1;
  max-width: 340px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.topbar__icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
  position: relative;
}
.topbar__icon-btn:hover {
  background: var(--navy-6);
  color: var(--navy);
  border-color: var(--border-2);
}

.topbar__icon-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid #fff;
}


/* ─── 07. PAGE HEADER ────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header--border {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.page-header__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.page-header__sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.breadcrumb__sep {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.breadcrumb__item { color: var(--muted-2); }
.breadcrumb__item--active { color: var(--navy); font-weight: 500; }
.breadcrumb__item:not(.breadcrumb__item--active):hover { color: var(--navy-3); }


/* ─── 08. CARDS & PANELS ─────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card--elevated {
  box-shadow: var(--shadow-sm);
}

.card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.1px;
}

.card__subtitle {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

.card__body { padding: 20px; }
.card__body--sm { padding: 14px 16px; }
.card__body--none { padding: 0; }

.card__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ─── 09. STAT / KPI CARDS ───────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-card__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-card__value--md { font-size: 20px; }
.stat-card__value--sm { font-size: 16px; }

.stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}

.stat-card__delta--up   { color: var(--teal); }
.stat-card__delta--down { color: var(--red); }

.stat-card__footer {
  font-size: 11.5px;
  color: var(--muted);
}

.stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy-6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-3);
  flex-shrink: 0;
}

/* Icon tone variants */
.stat-card__icon--teal  { background: var(--teal-5);    color: var(--teal); }
.stat-card__icon--gold  { background: var(--gold-5);    color: var(--gold-2); }
.stat-card__icon--red   { background: var(--red-bg);    color: var(--red); }
.stat-card__icon--blue  { background: var(--blue-bg);   color: var(--blue); }
.stat-card__icon--amber { background: var(--amber-bg);  color: var(--amber); }


/* ─── 10. DATA TABLES ────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-toolbar__search { flex: 1; min-width: 200px; max-width: 320px; }
.table-toolbar__filters { display: flex; gap: 6px; flex-wrap: wrap; }
.table-toolbar__actions { display: flex; gap: 6px; margin-left: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* CLEAN variant — comfortable density */
.table thead th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: left;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.table th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.table th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }

.table tbody td {
  padding: 11px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background var(--transition);
  cursor: default;
}

.table tbody tr:hover td { background: #F8F9FC; }
.table tbody tr.selected td { background: var(--teal-5); }

/* Sortable column header */
.table th.sortable {
  cursor: pointer;
}
.table th.sortable:hover { color: var(--navy); }

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* DENSE variant */
.table--dense thead th { padding: 7px 10px; font-size: 10.5px; }
.table--dense tbody td { padding: 7px 10px; font-size: 12.5px; }

/* Checkbox column */
.table th.col-check,
.table td.col-check {
  width: 40px;
  padding-left: 16px;
  padding-right: 4px;
}

/* Numeric column — right-align */
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Table footer / pagination row */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  gap: 12px;
  flex-wrap: wrap;
}

.table-footer__info {
  font-size: 12px;
  color: var(--muted);
}

/* Row actions (appear on hover) */
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

tr:hover .row-actions { opacity: 1; }

.row-action-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}

.row-action-btn:hover {
  background: var(--navy-6);
  border-color: var(--border);
  color: var(--navy);
}

.row-action-btn--danger:hover {
  background: var(--red-bg);
  border-color: #F5C9CB;
  color: var(--red);
}


/* ─── 11. BUTTONS ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.2;
  font-family: var(--font);
  text-decoration: none;
  letter-spacing: -0.05px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — Navy */
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }

/* Teal — main action */
.btn-teal {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn-teal:hover { background: var(--teal-2); border-color: var(--teal-2); }

/* Secondary — outlined */
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border-color: var(--border-2);
  box-shadow: 0 1px 0 rgba(10,22,40,.04);
}
.btn-secondary:hover {
  border-color: var(--navy-4);
  background: #FAFBFC;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--navy-6); }

/* Danger */
.btn-danger {
  background: #fff;
  color: var(--red);
  border-color: #F5C9CB;
}
.btn-danger:hover { background: var(--red-bg); }

/* Danger Filled */
.btn-danger-filled {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger-filled:hover { background: #CC3A3E; }

/* Gold */
.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }

/* Link */
.btn-link {
  background: transparent;
  color: var(--teal);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-link:hover { color: var(--teal-2); }

/* Sizes */
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 10px 18px; font-size: 14.5px; }
.btn-xl { padding: 12px 22px; font-size: 15px; }

.btn-full { width: 100%; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }
.btn-icon.btn-sm { padding: 5px; width: 28px; height: 28px; }

/* Loading spinner inside button */
.btn .btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ─── 12. FORM CONTROLS ──────────────────────────────────────────────────── */

/* --- Input --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.1px;
}

.form-label .required { color: var(--red); margin-left: 2px; }

.form-hint {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.4;
}

.form-error {
  font-size: 11.5px;
  color: var(--red);
  line-height: 1.4;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

.input-wrap--error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(229,72,77,.10) !important;
}

.input-wrap--sm { padding: 5px 10px; }

.input-wrap .input-icon {
  color: var(--muted-2);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.input-wrap input,
.input-wrap textarea {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  width: 100%;
  padding: 0;
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: var(--muted-2);
}

.input-wrap .input-suffix {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Standalone input (no wrapper) */
.form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

.form-input--sm { padding: 5px 10px; font-size: 12.5px; }
.form-input--error { border-color: var(--red) !important; }

/* --- Select --- */
.form-select {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7690' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

.form-select--sm { padding: 5px 28px 5px 10px; font-size: 12.5px; }

/* --- Textarea --- */
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

/* --- Checkbox --- */
.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--navy-5);
  border-radius: 4px;
  background: #fff;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.checkbox-wrap input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  position: absolute;
  top: 2px;
  left: 4px;
  width: 5px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-wrap input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(29,158,117,.2);
}

.checkbox-label {
  font-size: 13px;
  color: var(--text);
}

/* --- Toggle / Switch --- */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle__track {
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--navy-5);
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle__track.is-on { background: var(--teal); }

.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: left var(--transition);
}

.toggle__track.is-on .toggle__thumb { left: 16px; }

.toggle__track--sm { width: 28px; height: 16px; }
.toggle__track--sm .toggle__thumb { width: 12px; height: 12px; }
.toggle__track--sm.is-on .toggle__thumb { left: 14px; }

.toggle__label { font-size: 13px; color: var(--text); }

/* --- Form Row / Grid --- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}


/* ─── 13. BADGE, STATUS PILL & CHIP ──────────────────────────────────────── */

/* Status Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  line-height: 1.5;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.pill--sm { padding: 1px 7px; font-size: 10.5px; }

.pill__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Status colors */
.pill-active    { background: var(--teal-5);    color: var(--teal-2);  }
.pill-active    .pill__dot { background: var(--teal); }

.pill-inactive  { background: #F3F4F6;          color: #4B5563; }
.pill-inactive  .pill__dot { background: #9CA3AF; }

.pill-on-leave,
.pill-pending   { background: var(--amber-bg);  color: var(--amber); }
.pill-on-leave  .pill__dot,
.pill-pending   .pill__dot { background: var(--amber); }

.pill-trial     { background: var(--blue-bg);   color: var(--blue); }
.pill-trial     .pill__dot { background: var(--blue); }

.pill-suspended,
.pill-overdue   { background: var(--red-bg);    color: var(--red); }
.pill-suspended .pill__dot,
.pill-overdue   .pill__dot { background: var(--red); }

.pill-paid      { background: var(--teal-5);    color: var(--teal-2); }
.pill-paid      .pill__dot { background: var(--teal); }

.pill-partial   { background: var(--amber-bg);  color: var(--amber); }
.pill-partial   .pill__dot { background: var(--amber); }

.pill-scheduled { background: var(--blue-bg);   color: var(--blue); }
.pill-scheduled .pill__dot { background: var(--blue); }

.pill-grading   { background: var(--gold-5);    color: var(--gold-2); }
.pill-grading   .pill__dot { background: var(--gold); }

.pill-published { background: var(--teal-5);    color: var(--teal-2); }
.pill-published .pill__dot { background: var(--teal); }

/* Numeric Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--navy-6);
  color: var(--navy-3);
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.badge-teal  { background: var(--teal-5);  color: var(--teal-2); }
.badge-red   { background: var(--red-bg);  color: var(--red); }
.badge-amber { background: var(--amber-bg);color: var(--amber); }
.badge-navy  { background: var(--navy);    color: #fff; }

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: #F3F4F6;
  color: #374151;
  cursor: default;
}

.chip--clickable { cursor: pointer; transition: all var(--transition); }
.chip--clickable:hover { background: var(--navy-6); }
.chip--active { background: var(--navy); color: #fff; }

.chip--teal  { background: var(--teal-5);   color: var(--teal-2); }
.chip--gold  { background: var(--gold-5);   color: #8D6E18; }
.chip--navy  { background: var(--navy-6);   color: var(--navy); }
.chip--red   { background: var(--red-bg);   color: var(--red); }

.chip__remove {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.chip__remove:hover { opacity: 1; }


/* ─── 14. MODAL ──────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,22,40,.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}

.modal {
  width: 520px;
  max-width: 100%;
  max-height: 92vh;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(10,22,40,.22), 0 2px 6px rgba(10,22,40,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .2s cubic-bezier(.2,.9,.3,1);
}

.modal--sm  { width: 400px; }
.modal--lg  { width: 680px; }
.modal--xl  { width: 860px; }

.modal__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.modal__title    { font-size: 15px; font-weight: 600; color: var(--navy); }
.modal__subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.modal__close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.modal__close:hover { background: var(--navy-6); color: var(--navy); }

.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}


/* ─── 15. DRAWER ─────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10,22,40,.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 160;
  width: 480px;
  max-width: 100%;
  background: var(--bg);
  box-shadow: -12px 0 32px rgba(10,22,40,.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2,.9,.3,1);
}

.drawer.is-open { transform: translateX(0); }

.drawer--sm { width: 360px; }
.drawer--lg { width: 620px; }

.drawer__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.drawer__title    { font-size: 15px; font-weight: 600; color: var(--navy); }
.drawer__subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.drawer__close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.drawer__close:hover { background: var(--navy-6); color: var(--navy); }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}


/* ─── 16. TOAST NOTIFICATIONS ────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 6px 24px rgba(10,22,40,.14), 0 1px 3px rgba(10,22,40,.06);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1);
}

.toast--success { border-left: 3px solid var(--teal); }
.toast--error   { border-left: 3px solid var(--red); }
.toast--info    { border-left: 3px solid var(--blue); }
.toast--warning { border-left: 3px solid var(--amber); }

.toast__icon {
  margin-top: 1px;
  flex-shrink: 0;
}

.toast--success .toast__icon { color: var(--teal); }
.toast--error   .toast__icon { color: var(--red); }
.toast--info    .toast__icon { color: var(--blue); }
.toast--warning .toast__icon { color: var(--amber); }

.toast__body { flex: 1; min-width: 0; }

.toast__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.toast__message {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.toast__close {
  background: transparent;
  border: none;
  color: var(--muted-2);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  transition: color var(--transition);
  flex-shrink: 0;
  margin-left: 4px;
}
.toast__close:hover { color: var(--navy); }


/* ─── 17. SKELETON / SHIMMER LOADERS ─────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    #EEF0F3 0%,
    #F6F7F9 50%,
    #EEF0F3 100%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text   { height: 12px; border-radius: 4px; }
.skeleton--title  { height: 18px; border-radius: 4px; }
.skeleton--circle { border-radius: 50%; }
.skeleton--btn    { height: 32px; border-radius: var(--radius); }
.skeleton--avatar { width: 32px; height: 32px; border-radius: 50%; }
.skeleton--card   { height: 120px; border-radius: var(--radius-lg); }


/* ─── 18. EMPTY STATE ────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.empty-state--compact { padding: 40px 24px; }

.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--navy-6);
  color: var(--navy-3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-state--compact .empty-state__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.empty-state__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.empty-state--compact .empty-state__title { font-size: 13.5px; }

.empty-state__body {
  font-size: 13px;
  color: var(--muted);
  max-width: 300px;
  line-height: 1.5;
  margin-bottom: 18px;
}


/* ─── 19. AVATARS & INITIALS ─────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar--sm { width: 24px; height: 24px; }
.avatar--md { width: 36px; height: 36px; }
.avatar--lg { width: 48px; height: 48px; }
.avatar--xl { width: 64px; height: 64px; }

.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  font-size: 12px;
  width: 32px;
  height: 32px;
}

.avatar-initials--sm { width: 24px; height: 24px; font-size: 9px; }
.avatar-initials--md { width: 36px; height: 36px; font-size: 13px; }
.avatar-initials--lg { width: 48px; height: 48px; font-size: 16px; }

/* Avatar group stack */
.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar,
.avatar-stack .avatar-initials {
  margin-left: -8px;
  border: 2px solid #fff;
}

.avatar-stack .avatar:first-child,
.avatar-stack .avatar-initials:first-child { margin-left: 0; }

/* User row */
.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-row__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.user-row__sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}


/* ─── 20. PAGINATION ─────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination__btn:hover {
  background: var(--navy-6);
  color: var(--navy);
}

.pagination__btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 600;
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination__ellipsis {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 12px;
}


/* ─── 21. TABS ───────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 2px;
}

.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
}

.tab:hover { color: var(--navy); }

.tab.active {
  color: var(--navy);
  font-weight: 600;
  border-bottom-color: var(--navy);
}

/* Pill tabs variant */
.tabs--pill {
  border-bottom: none;
  background: var(--navy-6);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.tabs--pill .tab {
  border-bottom: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  margin-bottom: 0;
}

.tabs--pill .tab.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}


/* ─── 22. PROGRESS BAR ───────────────────────────────────────────────────── */
.progress {
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: var(--navy-6);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  border-radius: 6px;
  background: var(--teal);
  transition: width 0.4s ease;
}

.progress--sm { height: 4px; }
.progress--lg { height: 10px; }

.progress__fill--amber  { background: var(--amber); }
.progress__fill--red    { background: var(--red); }
.progress__fill--gold   { background: var(--gold); }
.progress__fill--blue   { background: var(--blue); }

/* Progress with label */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}

.progress-label__pct {
  font-weight: 600;
  color: var(--navy);
}


/* ─── 23. DIVIDER ────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.divider--vertical {
  border: none;
  border-left: 1px solid var(--border);
  margin: 0 12px;
  align-self: stretch;
}

.divider--label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.divider--label::before,
.divider--label::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.divider--label span {
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
}


/* ─── 24. UTILITY HELPERS ────────────────────────────────────────────────── */

/* Display */
.d-flex       { display: flex; }
.d-inline-flex{ display: inline-flex; }
.d-grid       { display: grid; }
.d-block      { display: block; }
.d-none       { display: none; }

/* Flex */
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-1       { flex: 1; }
.flex-shrink-0{ flex-shrink: 0; }

/* Gap */
.gap-2  { gap: 2px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* Spacing */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Text */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-word  { word-break: break-word; }
.uppercase   { text-transform: uppercase; }
.capitalize  { text-transform: capitalize; }

/* Width / Height */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-w-0 { min-width: 0; }

/* Overflow */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-x-auto  { overflow-x: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.select-none    { user-select: none; }

/* Colors (bg) */
.bg-white   { background: #fff; }
.bg-page    { background: var(--bg-page); }
.bg-muted   { background: var(--bg-muted); }
.bg-teal    { background: var(--teal-5); }
.bg-navy    { background: var(--navy-6); }

/* Border */
.border        { border: 1px solid var(--border); }
.border-b      { border-bottom: 1px solid var(--border); }
.border-t      { border-top: 1px solid var(--border); }
.rounded       { border-radius: var(--radius); }
.rounded-lg    { border-radius: var(--radius-lg); }
.rounded-full  { border-radius: 9999px; }

/* Numeric formatting */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Mono */
.font-mono { font-family: var(--font-mono); }

/* Spinner standalone */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--navy-5);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner--sm { width: 14px; height: 14px; }
.spinner--lg { width: 28px; height: 28px; border-width: 3px; }


/* ─── 25. ANIMATIONS & KEYFRAMES ─────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,158,117,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(29,158,117,.0); }
}


/* ─── 26. RESPONSIVE — MOBILE BREAKPOINTS ────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --topbar-h: 48px;
  }

  .page-body {
    padding: 16px;
  }

  /* Sidebar becomes off-canvas drawer on mobile */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2,.9,.3,1);
  }

  .sidebar.is-open { transform: translateX(0); }

  /* Mobile backdrop for sidebar */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(10,22,40,.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hamburger button (show only on mobile) */
  .topbar__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--navy);
  }

  /* Stat grid — 2 columns on mobile */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card__value { font-size: 20px; }

  /* Table → stacked cards */
  .table-card-mobile { display: block; }

  .table-card-mobile table,
  .table-card-mobile thead,
  .table-card-mobile tbody,
  .table-card-mobile th,
  .table-card-mobile td,
  .table-card-mobile tr {
    display: block;
  }

  .table-card-mobile thead { display: none; }

  .table-card-mobile tbody tr {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    padding: 12px 14px;
  }

  .table-card-mobile td {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }

  .table-card-mobile td::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: 100px;
    flex-shrink: 0;
    padding-top: 1px;
  }

  /* Form rows → single column */
  .form-row, .form-row--3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Modal full-screen on mobile */
  .modal-backdrop { padding: 0; align-items: flex-end; }

  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
  }

  /* Drawer full-width on mobile */
  .drawer { width: 100%; }

  /* Page header stacked */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Tabs scroll */
  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }

  /* Toast full width */
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast { min-width: 0; max-width: 100%; width: 100%; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  .stat-card { padding: 14px 14px 12px; }
  .stat-card__value { font-size: 18px; }

  .page-header__title { font-size: 16px; }

  .btn { font-size: 13px; }

  .topbar { padding: 0 14px; }

  .topbar__search { display: none; }
}

/* Hamburger — hidden on desktop */
@media (min-width: 769px) {
  .topbar__hamburger { display: none; }
  .sidebar-backdrop   { display: none; }
}

/* ─── 27. ADDITIONAL POLISH ──────────────────────────────────────────────── */

/* Ensure body always has correct background and font */
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Admin shell full height fix */
html, body { height: 100%; }
.admin-shell { height: 100vh; min-height: 0; }

/* Page body scrolling */
.page-body { overflow-y: auto; }

/* Card hover lift effect */
.card--hover {
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.card--hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Table row clickable */
.table tbody tr.clickable { cursor: pointer; }

/* Form section title */
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Sticky settings bar */
.settings-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 10;
  background: var(--bg-page);
  padding: 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Info box variants */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
}

.info-box--warning {
  background: var(--amber-bg);
  border: 1px solid #FDE68A;
  color: #92400E;
}

.info-box--info {
  background: var(--blue-bg);
  border: 1px solid #BFCDF8;
  color: #1E3A8A;
}

.info-box--success {
  background: var(--teal-5);
  border: 1px solid #A7D7C5;
  color: #065F46;
}

.info-box--danger {
  background: var(--red-bg);
  border: 1px solid #F5C9CB;
  color: #7F1D1D;
}

/* Code inline */
code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--navy-6);
  color: var(--navy-2);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Filter checkbox block (docs form) */
.filter-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.filter-block__header {
  background: var(--bg-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-block__body {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.filter-block__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}

.filter-block__item:hover { background: var(--bg-page); }

/* Status timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 14px;
}

.timeline-item__track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.timeline-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: 4px;
}

.timeline-item__dot--muted { background: var(--navy-5); }

.timeline-item__line {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
  min-height: 16px;
}

.timeline-item__content {
  flex: 1;
  padding-bottom: 16px;
}

.timeline-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.timeline-item__meta {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

.timeline-item__note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Refund / action panel */
.action-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Number input cleanup */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.6;
}

/* File input */
input[type="file"] {
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 5px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--navy);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-right: 10px;
}

input[type="file"]::file-selector-button:hover {
  background: var(--navy-6);
  border-color: var(--navy-5);
}

/* Smooth page entrance */
.page-body > * {
  animation: slideUp 0.18s ease both;
}

/* Focus visible for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Responsive grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Fix for inline form elements overflowing on mobile */
@media (max-width: 640px) {
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .table-toolbar__search { max-width: 100%; }
  .table-toolbar__filters { flex-direction: column; }
  .table-toolbar__actions { flex-direction: row; justify-content: flex-end; }
}
