/* ═══════════════════════════════════════════════════════════════
   OpsAIHub Shared Design System
   Tim Hortons India — Ops Connect
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

/* ── CSS VARIABLES ── */
:root {
  /* Brand */
  --red: #C8102E;
  --red-dark: #9B0D22;
  --white: #FFFFFF;
  --dark: #1A1A1A;

  /* Surfaces */
  --surface: #F5F5F7;
  --card: #FCFCFD;
  --card2: #F7F7F9;
  --nav-bg: rgba(255,255,255,0.85);

  /* Text */
  --text: #1D1D1F;
  --text2: #6E6E73;
  --text3: #8E8E93;

  /* Borders */
  --border: #E5E5EA;
  --divider: #F2F2F7;

  /* Status */
  --success: #34C759;
  --warning: #FF9500;
  --critical: #FF3B30;
  --blue: #007AFF;
  --fail: #FF3B30;

  /* Extended palette */
  --gold: #FFD700;
  --green: #34C759;
  --amber: #FF9500;
  --purple: #AF52DE;
  --ipl: #0066CC;
  --teal: #30B0C7;
  --green-dk: #1B7A3A;
  --grey-mid: #8E8E93;
  --grey-dk: #636366;

  /* Tints */
  --red-tint: rgba(200,16,46,0.1);
  --green-tint: rgba(52,199,89,0.12);
  --amber-tint: rgba(255,149,0,0.12);

  /* Disabled */
  --disabled-bg: #E5E5EA;
  --disabled-text: #AEAEB2;

  /* Semantic status */
  --pass: #1B7A3A;
  --pass-bg: #E8F8ED;
  --warn: #8B4500;
  --warn-bg: #FFF3E0;
  --fail-bg: #FEE8E8;

  /* AI Academy (tasks.html) */
  --indigo: #6366F1;
  --indigo-dk: #4F46E5;
  --indigo-lt: #a5b4fc;
  --navy: #0D0D2B;
  --navy-2: #1A1040;
  --navy-3: #0F172A;
  --navy-4: #1E1B4B;
  --navy-event: #0D0D1A;
  --navy-event-2: #1A0508;
  --tag-claude-bg: #EDE9FE;
  --tag-claude-text: #5B21B6;
  --tag-gpt-bg: #D1FAE5;
  --tag-gpt-text: #065F46;
  --tag-gemini-bg: #DBEAFE;
  --tag-gemini-text: #1E40AF;
  --tag-skills-bg: #FEF3C7;
  --tag-skills-text: #92400E;
  --success-bg: #E8F8ED;
  --watched-bg: #F0FDF4;

  /* Indigo semi-transparent tints (AI Academy section) */
  --indigo-tint: oklch(55% 0.22 265 / 0.1);
  --indigo-tint-md: oklch(55% 0.22 265 / 0.2);
  --indigo-tint-border: oklch(55% 0.22 265 / 0.4);
  --indigo-glow: oklch(55% 0.22 265 / 0.35);
  --indigo-label: oklch(78% 0.13 265 / 0.8);
  --indigo-label-dim: oklch(78% 0.13 265 / 0.7);
  --green-tint-border: oklch(74% 0.16 145 / 0.4);
  --green-tint-bg: oklch(74% 0.16 145 / 0.15);

  /* Layout */
  --nav-h: 72px;
  --nav-w: 220px;

  /* Z-index */
  --z-raised: 1;
  --z-nav: 100;
  --z-toast: 200;
  --z-overlay: 300;
  --z-drawer: 350;
  --z-modal: 400;
  --z-wall: 500;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-red: 0 4px 16px rgba(200,16,46,0.3);
  --shadow-red-hover: 0 6px 28px rgba(200,16,46,0.45);

  /* Easing + duration */
  --ease-out: cubic-bezier(0.25, 0, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-short: 120ms;
  --dur-base: 200ms;
  --dur-long: 320ms;
}

/* ── THEME TRANSITION ── */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ── THEME TOGGLE ICON ── */
@keyframes theme-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.6); }
  100% { transform: rotate(360deg) scale(1); }
}
#themeToggle.spin svg {
  animation: theme-spin 0.4s ease;
}

/* System theme indicator dot */
@keyframes systemDotPulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(0,122,255,0.4); }
  50% { box-shadow: 0 1px 8px rgba(0,122,255,0.7), 0 0 12px rgba(0,122,255,0.3); }
}
.theme-system-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 50%;
  border: 2px solid var(--card);
  pointer-events: none;
  animation: systemDotPulse 2s ease-in-out infinite;
}
.theme-system-dot::after {
  content: 'System theme';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.theme-system-dot:hover::after {
  opacity: 1;
}
#themeToggle {
  position: relative;
}

/* Hide floating toggle on mobile when bottom-nav is visible */
@media (max-width: 768px) {
  #themeFloating { display: none; }
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --surface: #111113;
  --card: #1C1C1E;
  --card2: #2C2C2E;
  --nav-bg: rgba(17,17,19,0.88);

  --text: #F5F5F7;
  --text2: #A1A1A6;
  --text3: #6E6E73;

  --border: #38383A;
  --divider: #2C2C2E;

  --disabled-bg: #38383A;
  --disabled-text: #636366;

  --pass-bg: rgba(52,199,89,0.15);
  --warn-bg: rgba(255,149,0,0.15);
  --fail-bg: rgba(255,59,48,0.15);

  --red-tint: rgba(200,16,46,0.2);
  --green-tint: rgba(52,199,89,0.2);
  --amber-tint: rgba(255,149,0,0.2);

  --shadow-soft: rgba(0,0,0,0.2);
  --shadow-mid: rgba(0,0,0,0.3);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── FOCUS ── */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.text-muted { color: var(--text2); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; letter-spacing: 0.5px; }

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 8px var(--shadow-soft);
  border: 1px solid var(--border);
}
.card-flat {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 16px; }
.card-body-lg { padding: 20px 24px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease-out;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-ghost {
  background: transparent;
  color: var(--red);
}
.btn-ghost:hover { background: var(--red-tint); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 14px; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-success { background: var(--green-tint); color: var(--green-dk); }
.badge-warning { background: var(--amber-tint); color: #B36200; }
.badge-danger { background: rgba(255,59,48,0.12); color: var(--critical); }
.badge-info { background: rgba(0,122,255,0.12); color: var(--blue); }
.badge-neutral { background: var(--surface); color: var(--text2); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-tint);
}
.form-input::placeholder { color: var(--text3); }
.form-textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.form-hint { font-size: 12px; color: var(--text2); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--critical); margin-top: 4px; }

/* ── TABLES ── */
.table-wrap {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  background: var(--surface);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: var(--surface); }

/* ── PROGRESS ── */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
}
.progress-bar-red { background: var(--red); }
.progress-bar-green { background: var(--success); }
.progress-bar-amber { background: var(--warning); }

/* ── AVATAR ── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }

/* ── NAVIGATION ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: var(--z-nav);
  transform: translateZ(0);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  padding: 8px 12px;
  min-width: 56px;
}
.nav-icon { font-size: 22px; }
.nav-label { font-size: 10px; font-weight: 500; color: var(--text2); }
.nav-item.active .nav-label { color: var(--red); font-weight: 700; }

/* ── TOP NAV ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.nav-wordmark {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.nav-wordmark span { color: var(--red); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--red); }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: 100px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-user:hover {
  background: var(--card);
  border-color: var(--text3);
}
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 600;
}
.nav-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-btn:hover {
  background: var(--card);
  color: var(--text);
}

/* ── BODY PADDING ── */
body {
  padding-top: var(--nav-h);
}

/* ── MOBILE NAV ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 16px;
}
.mobile-nav-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  padding: 8px;
}
.mobile-nav-icon { font-size: 20px; }
.mobile-nav-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
}
.mobile-nav-item.active .mobile-nav-label { color: var(--red); }
@media (max-width: 768px) {
  .nav { display: none !important; }
  .mobile-nav { display: block !important; }
  body { padding-top: 0 !important; padding-bottom: var(--nav-h) !important; }
}

/* ── PAGE HEADER ── */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top,0px) + 14px) 20px 24px;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.page-sub {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
}
@media (min-width: 768px) {
  .page-header {
    padding: 22px 32px 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: sticky;
    top: 0;
    z-index: 89;
  }
}

/* ── STAT CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-text { font-size: 14px; color: var(--text2); }

/* ── LOADING ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; }

/* ── SKELETON LOADING ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0f0f0 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 12px; width: 60%; }
.skeleton-text-lg { height: 20px; width: 80%; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
  border-left: 4px solid var(--border);
}
.toast.removing { animation: toastOut 0.3s ease-in forwards; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--critical); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--blue); }
.toast-icon { font-size: 20px; flex-shrink: 0; line-height: 1; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 14px; font-weight: 700; color: var(--text); }
.toast-message { font-size: 13px; color: var(--text2); margin-top: 2px; line-height: 1.4; }
.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text3);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(100%) scale(0.95); }
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease-out;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── UTILITIES ── */
.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; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.rounded { border-radius: 12px; }
.rounded-lg { border-radius: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── NAV BUTTONS ── */
.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}
.nav-btn:hover { background: var(--card); border-color: var(--text3); }
.nav-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* ── BENTO CELLS ── */
.cell {
  background: var(--card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.cell:hover { box-shadow: var(--shadow-md); }
.cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.cell-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

/* ── SECTION RHYTHM ── */
.section-tight { padding: var(--space-md) var(--space-lg); }
.section-normal { padding: var(--space-lg); }
.section-loose { padding: var(--space-xl) var(--space-lg); }

/* ── COMMON PATTERNS ── */
.text-xs-muted { font-size: 11px; color: var(--text2); }
.text-xs-muted strong { font-weight: 600; }
.text-sm-muted { font-size: 13px; color: var(--text2); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex-1 { flex: 1; }
.flex-center { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row-border { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border); }
.row-border:last-child { border-bottom: none; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.mt-12 { margin-top: 12px; }
.p-20 { padding: 20px; }
.empty-sm { text-align: center; padding: 20px; color: var(--text2); font-size: 13px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-red { color: var(--critical); }
.text-green { color: var(--success); }
.text-amber { color: var(--warning); }
.text-dark { color: var(--text); }
.text-muted { color: var(--text2); }
.text-xs-9 { font-size: 9px; }
.text-xs-10 { font-size: 10px; }
.text-sm-13 { font-size: 13px; }
.text-base-15 { font-size: 15px; }
.text-lg-18 { font-size: 18px; }
.bg-red { background: var(--critical); color: #fff; }
.bg-green { background: var(--success); color: #fff; }
.bg-amber { background: var(--warning); color: #fff; }
.pill { display: inline-block; padding: 1px 5px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.pill-red { background: #FF3B30; color: #fff; }
.pill-green { background: #34C759; color: #fff; }
.pill-amber { background: #FF9500; color: #fff; }
.row-between-border { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row-between-border:last-child { border-bottom: none; }

/* ── FOOTER ── */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--text3);
}
.footer-brand { font-weight: 500; }
.footer-links { display: flex; gap: 24px; }
.footer-link {
  color: var(--text3);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--text); }
@media (max-width: 768px) {
  .footer-content { flex-direction: column; gap: 12px; text-align: center; }
}

/* ── SKELETON LOADING ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--divider) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 12px; width: 60%; }
.skeleton-text-lg { height: 20px; width: 80%; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 12px; }
  .toast-container { left: 12px; right: 12px; max-width: none; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; margin-top: auto; }
}
