/* Design tokens — "Indigo slate" palette.
   Loaded after Bootstrap's CSS, before main.css/custom.css, so it can both
   define app-specific tokens and override Bootstrap's own theme variables.
   Verified against Bootstrap 5.3.2's compiled CSS: .bg-*, .border-*, .text-bg-*
   utilities and the body font genuinely read the --bs-* root variables below,
   so overriding them here retints those classes app-wide. .btn-* and .table-*
   variant classes bake in hardcoded hex per-class instead, so those are
   overridden directly further down. */

:root {
  /* ---- App tokens ---- */
  --tcm-primary: #4F46E5;
  --tcm-primary-hover: #4338CA;
  --tcm-primary-active: #3730A3;
  --tcm-primary-light: #EEF0FF;
  --tcm-primary-text-on-light: #3730A3;

  --tcm-gray-50: #F8FAFC;
  --tcm-gray-100: #F1F5F9;
  --tcm-gray-200: #E2E8F0;
  --tcm-gray-300: #CBD5E1;
  --tcm-gray-400: #94A3B8;
  --tcm-gray-500: #64748B;
  --tcm-gray-600: #475569;
  --tcm-gray-700: #334155;
  --tcm-gray-800: #1E293B;
  --tcm-gray-900: #0F172A;

  --tcm-surface: #FFFFFF;
  --tcm-surface-alt: var(--tcm-gray-50);
  --tcm-border: var(--tcm-gray-200);
  --tcm-text: var(--tcm-gray-800);
  --tcm-text-muted: var(--tcm-gray-500);

  --tcm-success: #059669;
  --tcm-success-hover: #047857;
  --tcm-warning: #D97706;
  --tcm-warning-hover: #B45309;
  --tcm-danger: #DC2626;
  --tcm-danger-hover: #B91C1C;
  --tcm-info: #0284C7;
  --tcm-info-hover: #0369A1;
  --tcm-secondary: #64748B;
  --tcm-secondary-hover: #475569;

  --tcm-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tcm-font-size-sm: 0.8125rem;
  --tcm-font-size-base: 0.9375rem;
  --tcm-font-size-lg: 1.125rem;
  --tcm-font-size-xl: 1.5rem;

  --tcm-space-1: 4px;
  --tcm-space-2: 8px;
  --tcm-space-3: 12px;
  --tcm-space-4: 16px;
  --tcm-space-5: 24px;
  --tcm-space-6: 32px;

  --tcm-radius-sm: 6px;
  --tcm-radius-md: 10px;
  --tcm-radius-lg: 14px;
  --tcm-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --tcm-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.10);

  /* ---- Bootstrap root variable overrides (genuinely read by .bg-*, .border-*,
     .text-bg-*, and body font/color/bg) ---- */
  --bs-primary: var(--tcm-primary);
  --bs-primary-rgb: 79, 70, 229;
  --bs-success: var(--tcm-success);
  --bs-success-rgb: 5, 150, 105;
  --bs-warning: var(--tcm-warning);
  --bs-warning-rgb: 217, 119, 6;
  --bs-danger: var(--tcm-danger);
  --bs-danger-rgb: 220, 38, 38;
  --bs-info: var(--tcm-info);
  --bs-info-rgb: 2, 132, 199;
  --bs-secondary: var(--tcm-secondary);
  --bs-secondary-rgb: 100, 116, 139;
  --bs-body-font-family: var(--tcm-font-sans);
  --bs-body-color: var(--tcm-text);
  --bs-body-bg: var(--tcm-surface);
  --bs-border-color: var(--tcm-border);
  --bs-link-color: var(--tcm-primary);
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: var(--tcm-primary-hover);
  --bs-link-hover-color-rgb: 67, 56, 202;
  --bs-border-radius: var(--tcm-radius-sm);
  --bs-border-radius-lg: var(--tcm-radius-lg);
}

/* Bootstrap hardcodes black text on .text-bg-info, assuming its original
   bright cyan. Our info tone is darker, so white text reads better. */
.text-bg-info {
  color: #fff !important;
}

/* Bootstrap hardcodes a blue focus ring on form controls regardless of
   theme color. This is genuinely read by every .modal-content (border
   radius + border color already token-driven via --bs-border-* above),
   but the focus ring needs its own override since it bakes in raw hex. */
.form-control:focus,
.form-select:focus {
  border-color: var(--tcm-primary);
  box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

/* ---- Button variant overrides (hardcoded hex in Bootstrap, so overridden
   directly per class) ---- */
.btn-primary {
  --bs-btn-bg: var(--tcm-primary);
  --bs-btn-border-color: var(--tcm-primary);
  --bs-btn-hover-bg: var(--tcm-primary-hover);
  --bs-btn-hover-border-color: var(--tcm-primary-hover);
  --bs-btn-active-bg: var(--tcm-primary-active);
  --bs-btn-active-border-color: var(--tcm-primary-active);
  --bs-btn-disabled-bg: var(--tcm-primary);
  --bs-btn-disabled-border-color: var(--tcm-primary);
}
.btn-success {
  --bs-btn-bg: var(--tcm-success);
  --bs-btn-border-color: var(--tcm-success);
  --bs-btn-hover-bg: var(--tcm-success-hover);
  --bs-btn-hover-border-color: var(--tcm-success-hover);
  --bs-btn-active-bg: var(--tcm-success-hover);
  --bs-btn-active-border-color: var(--tcm-success-hover);
  --bs-btn-disabled-bg: var(--tcm-success);
  --bs-btn-disabled-border-color: var(--tcm-success);
}
.btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--tcm-warning);
  --bs-btn-border-color: var(--tcm-warning);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--tcm-warning-hover);
  --bs-btn-hover-border-color: var(--tcm-warning-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--tcm-warning-hover);
  --bs-btn-active-border-color: var(--tcm-warning-hover);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--tcm-warning);
  --bs-btn-disabled-border-color: var(--tcm-warning);
}
.btn-info {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--tcm-info);
  --bs-btn-border-color: var(--tcm-info);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--tcm-info-hover);
  --bs-btn-hover-border-color: var(--tcm-info-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--tcm-info-hover);
  --bs-btn-active-border-color: var(--tcm-info-hover);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--tcm-info);
  --bs-btn-disabled-border-color: var(--tcm-info);
}

/* ---- Table variant overrides (same hardcoded-hex situation as buttons) ---- */
.table-warning {
  --bs-table-color: #000;
  --bs-table-bg: #FEF3C7;
  --bs-table-border-color: #FDE68A;
  --bs-table-striped-bg: #FDECC8;
  --bs-table-hover-bg: #FDE9BD;
}
.table-success {
  --bs-table-color: #000;
  --bs-table-bg: #D1FAE5;
  --bs-table-border-color: #A7F3D0;
  --bs-table-striped-bg: #C6F6DD;
  --bs-table-hover-bg: #BBF3D3;
}
.table-info {
  --bs-table-color: #000;
  --bs-table-bg: #E0F2FE;
  --bs-table-border-color: #BAE6FD;
  --bs-table-striped-bg: #D3ECFC;
  --bs-table-hover-bg: #C7E7FB;
}
.table-secondary {
  --bs-table-color: #000;
  --bs-table-bg: var(--tcm-gray-100);
  --bs-table-border-color: var(--tcm-gray-200);
  --bs-table-striped-bg: #E8EDF2;
  --bs-table-hover-bg: #DEE5EC;
}

/* Kiosk roster panel headers (checkin_home.html roster partials): a solid
   semantic-colored bar replacing the old plain-text title line above each
   table, matching that table's table-{color} variant above. */
.panel-head {
  margin-top: var(--tcm-space-4);
  padding: var(--tcm-space-2) var(--tcm-space-3);
  font-weight: 700;
  color: #fff;
  border-radius: var(--tcm-radius-sm) var(--tcm-radius-sm) 0 0;
}
.panel-head .count { font-weight: 400; }
.panel-head-warning   { background: var(--tcm-warning); }
.panel-head-success   { background: var(--tcm-success); }
.panel-head-info      { background: var(--tcm-info); }
.panel-head-secondary { background: var(--tcm-secondary); }

/* Page title (checkin_home.html, and eventually students/staff reports):
   replaces the old "<p class='fs-5 badge badge-mine'>" hack of stretching a
   status-pill component into a heading. Plain bold type in the primary
   color instead - colored fills stay reserved for status/count elements
   like .panel-head and .stat-chip below it. */
.page-title {
  font-weight: 700;
  color: var(--tcm-primary);
  font-size: var(--tcm-font-size-xl);
}

/* Kiosk stat-chip row (checkin_stats.html): a slim, single-line summary of
   the same counts shown in each roster panel-head below, so the front desk
   gets a total at a glance without scrolling. Deliberately compact (pill
   shape, small type) rather than full-height dashboard tiles. */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--tcm-font-size-sm);
  font-weight: 600;
  color: #fff;
  line-height: 1.6;
}
.stat-chip .num { font-weight: 700; }
.stat-chip .breakdown { font-weight: 400; opacity: 0.85; }
.stat-chip-warning   { background: var(--tcm-warning); }
.stat-chip-success   { background: var(--tcm-success); }
.stat-chip-info      { background: var(--tcm-info); }
.stat-chip-secondary { background: var(--tcm-secondary); }

/* Avatar-chip initials (student_list.html/staff_list.html Name column):
   reuses the existing --tcm-primary-light/-text-on-light pair already
   established for .badge-mine, so it matches the app's one existing
   avatar-ish element instead of inventing a new color pairing. */
.avatar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tcm-primary-light);
  color: var(--tcm-primary-text-on-light);
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: var(--tcm-space-2);
  flex-shrink: 0;
}

/* Status pill (student_list.html/staff_list.html Status column): same
   solid-fill-plus-white-text recipe as .stat-chip/.panel-head. */
.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--tcm-font-size-sm);
  font-weight: 600;
  color: #fff;
}
.status-pill-active   { background: var(--tcm-success); }
.status-pill-inactive  { background: var(--tcm-secondary); }

/* Kebab overflow-menu toggle (row actions in student_list.html/
   staff_list.html): hide Bootstrap's default dropdown-toggle caret
   triangle since this button is an icon-only kebab, not a labeled menu. */
.dropdown-toggle-no-caret::after { display: none; }

/* Sortable list-header links: plain, no underline until hover, so the
   ⇅/▲/▼ glyph reads as a header decoration rather than a normal link. */
.sort-link { color: inherit; text-decoration: none; cursor: pointer; }
.sort-link:hover { text-decoration: underline; }

/* Reports icon nav list (reports_home.html): grouped by category (Students/
   Staff), no project-defined nav-list/sidebar CSS existed anywhere to reuse,
   so this is net-new, token-driven like everything else. Active state
   reuses the same primary-light/-text-on-light pair already established
   for .avatar-chip/.badge-mine. */
.report-nav-group { margin-bottom: var(--tcm-space-4); }
.report-nav-group-label {
  font-size: var(--tcm-font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tcm-text-muted);
  padding: 0 var(--tcm-space-3);
  margin-bottom: var(--tcm-space-1);
}
.report-nav-item {
  display: flex;
  align-items: center;
  gap: var(--tcm-space-2);
  padding: var(--tcm-space-2) var(--tcm-space-3);
  border-radius: var(--tcm-radius-sm);
  color: var(--tcm-text);
  text-decoration: none;
}
.report-nav-item:hover { background: var(--tcm-surface-alt); }
.report-nav-item.active {
  background: var(--tcm-primary-light);
  color: var(--tcm-primary-text-on-light);
  font-weight: 600;
}

/* Numbered pagination links (partials/_pagination.html): the current page
   is a disabled button so it isn't clickable, but Bootstrap's default
   disabled style (0.65 opacity) reads as "unavailable" rather than "you are
   here" - override it to stay fully solid/highlighted instead of fading. */
.pagination .pagination-current:disabled {
  opacity: 1;
}

/* Navbar brand: two-line tenant identity */
.navbar-logo       { height: 40px; width: auto; object-fit: contain; }
.navbar-center-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tcm-text);
}
.navbar-app-name {
  font-size: 0.68rem;
  color: var(--tcm-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.navbar-env-badge {
  font-size: 0.58rem;
  font-weight: 600;
  background: var(--bs-warning);
  color: #000;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

.form-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tcm-text-muted);
  border-bottom: 1px solid var(--tcm-border);
  padding-bottom: 4px;
  margin-bottom: 12px;
  margin-top: 4px;
}
