/* ═══════════════════════════════════════════════════════════════
   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;
}

/* ── 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: 680px; margin: 0 auto; padding: 0 16px; }
.page-content { width: 100%; box-sizing: border-box; }
@media (min-width: 769px) {
  .page-content { max-width: 680px; margin: 0 auto; padding: 0 24px 40px; }
}
.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, 0 1px 4px rgba(0,0,0,0.06));
  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); }

/* ── FOOTER ── */
.site-footer {
  max-width: 100%;
  margin: 48px auto 0;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
}

/* ── 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: var(--red);
}
.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: 4px 2px;
}
.mobile-nav-icon { font-size: 18px; }
.mobile-nav-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text3);
}
.mobile-nav-item.active .mobile-nav-label { color: var(--red); }
@media (max-width: 768px) {
  /* Slim mobile topbar — hide wordmark/links, keep right-side actions */
  .nav { height: 48px !important; padding: 0 14px !important; }
  .nav-links { display: none !important; }
  .nav-wordmark { display: none !important; }
  .mobile-nav { display: block !important; }
  body { padding-top: 48px !important; padding-bottom: var(--nav-h) !important; }
  /* Override hdr top-padding since body already clears the slim nav */
  .hdr, .hod-hdr, .page-hdr { padding-top: 14px !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: 769px) {
  .page-header {
    padding: 18px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: sticky;
    top: 0;
    z-index: 89;
    max-width: 680px;
    margin: 0 auto;
    border-left: none;
    border-right: none;
  }
}

/* ── 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); }
}

/* ── 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: 11px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
}
.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: 14px;
  border: 1px solid rgba(0,0,0,0.04);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.cell:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* ── Staggered entrance animation ── */
@media (prefers-reduced-motion: no-preference) {
  .bento .cell {
    opacity: 0;
    transform: translateY(16px);
    animation: cellEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--i, 0) * 0.05s + 0.05s);
  }
  @keyframes cellEnter {
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .bento .cell { opacity: 1; }
}
.cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cell-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.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: 10px 16px; }
.section-normal { padding: 16px; }
.section-loose { padding: 20px 16px; }

/* ── COMMON PATTERNS ── */
.text-xs-muted { font-size: 11px; color: var(--text2); }
.text-xs-muted strong { font-weight: 600; }
.text-right { text-align: right; }
.flex-1 { flex: 1; }
.flex-center { display: flex; align-items: center; gap: 10px; }
.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; }
.empty-sm { text-align: center; padding: 20px; color: var(--text2); font-size: 13px; }
.font-semibold { font-weight: 600; }
.text-red { color: var(--critical); }
.text-dark { color: var(--text); }
.text-muted { color: var(--text2); }
.text-xs-10 { font-size: 10px; }
.text-sm-13 { font-size: 13px; }
.text-base-15 { font-size: 15px; }
.pill { display: inline-block; padding: 1px 5px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.pill-red { background: #FF3B30; color: #fff; }

/* ── 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; }
}

/* ── MOTIONSITES ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.anim-scale-in {
  opacity: 0;
  animation: scaleIn 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.anim-slide-left {
  opacity: 0;
  animation: slideInLeft 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.anim-slide-right {
  opacity: 0;
  animation: slideInRight 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.anim-bounce-in {
  opacity: 0;
  animation: bounceIn 0.4s ease both;
}

.hover-lift {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

@media (prefers-reduced-motion: reduce) {
  .anim-fade-up, .anim-scale-in, .anim-slide-left, .anim-slide-right, .anim-bounce-in {
    animation: none;
    opacity: 1;
  }
  .hover-lift:hover { transform: none; }
}

/* ── INLINE STYLE EXTRACTS ── */
.field-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.field-input:focus { outline: none; border-color: var(--red); }
.field-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  resize: none;
}
.field-textarea:focus { outline: none; border-color: var(--red); }
.field-date {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.field-number {
  width: 80px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  background: var(--surface);
}
.card-inline {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 16px;
}
.card-tint-red {
  background: var(--red-tint);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--red);
}
.card-tint-green {
  background: var(--green-tint);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--green-dk);
}

/* ── 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; }
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --surface: #1A1A1A;
  --card: #222222;
  --card2: #1E1E1E;
  --nav-bg: rgba(26,26,26,0.88);
  --text: #F5F5F7;
  --text2: #8E8E93;
  --text3: #636366;
  --border: rgba(255,255,255,0.1);
  --divider: rgba(255,255,255,0.06);
  --surface: #1A1A1A;
  --disabled-bg: #333;
  --disabled-text: #666;
  --pass-bg: rgba(27,122,58,0.15);
  --warn-bg: rgba(139,69,0,0.15);
  --fail-bg: rgba(255,59,48,0.15);
  --red-tint: rgba(200,16,46,0.15);
  --green-tint: rgba(52,199,89,0.15);
  --amber-tint: rgba(255,149,0,0.15);
}
[data-theme="dark"] body {
  background: #111;
}
[data-theme="dark"] .nav {
  background: rgba(26,26,26,0.88);
  border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .bottom-nav {
  background: rgba(26,26,26,0.88);
  border-top-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .card, [data-theme="dark"] .card-flat {
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .btn-secondary {
  background: #333;
  border-color: rgba(255,255,255,0.1);
  color: #F5F5F7;
}
[data-theme="dark"] .btn-secondary:hover { background: #444; }
[data-theme="dark"] .form-input, [data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea, [data-theme="dark"] .field-input,
[data-theme="dark"] .field-textarea, [data-theme="dark"] .field-date,
[data-theme="dark"] .field-number {
  background: #2A2A2A;
  border-color: rgba(255,255,255,0.1);
  color: #F5F5F7;
}
[data-theme="dark"] .form-input:focus, [data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus, [data-theme="dark"] .field-input:focus,
[data-theme="dark"] .field-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.2);
}
[data-theme="dark"] .table th { background: #2A2A2A; }
[data-theme="dark"] .table td { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .table tr:hover { background: #2A2A2A; }
[data-theme="dark"] .progress { background: #333; }
[data-theme="dark"] .nav-btn {
  background: #333;
  border-color: rgba(255,255,255,0.1);
  color: #8E8E93;
}
[data-theme="dark"] .nav-btn:hover { background: #444; color: #F5F5F7; }
[data-theme="dark"] .nav-user {
  background: #2A2A2A;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .nav-user:hover { background: #333; }
[data-theme="dark"] .site-footer { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .badge-success { background: rgba(52,199,89,0.15); }
[data-theme="dark"] .badge-warning { background: rgba(255,149,0,0.15); }
[data-theme="dark"] .badge-danger { background: rgba(255,59,48,0.15); }
[data-theme="dark"] .badge-info { background: rgba(0,122,255,0.15); }
[data-theme="dark"] .card-inline { background: #2A2A2A; }
[data-theme="dark"] .card-tint-red { background: rgba(200,16,46,0.15); }
[data-theme="dark"] .card-tint-green { background: rgba(52,199,89,0.15); }
