/* ============================================================
   STOREHUB — Premium Colour System v8
   Full Multi-Colour Palette: Orange · Yellow · Purple · Pink
   Teal · Sage Green · Lavender — All used, richly combined
   ============================================================ */

/* Print: clean report output (hide chrome + non-essential buttons) */
@media print {
  .sidebar, .header, .sidebar-foot, .no-print, .bottom-nav { display: none !important; }
  .app-body, .app-main, .content, main { margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #e5e7eb !important; break-inside: avoid; }
  body { background: #fff !important; }
}

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

:root {
  /* ══ CALM PROFESSIONAL SYSTEM ══
     Neutral cool-gray base + ONE indigo accent + 4 semantic colors.
     The loud legacy palette names are kept but repointed to calm values
     so nothing renders "rainbow" and no variable reference breaks.        */

  /* ── Brand accent = Indigo (the ONE accent) ── */
  --purple:        #4F46E5;   /* legacy name → brand */
  --purple-dark:   #4338CA;
  --purple-darker: #3730A3;
  --purple-light:  #EEF2FF;
  --purple-mid:    #C7D2FE;

  --primary:        #4F46E5;
  --primary-dark:   #4338CA;
  --primary-darker: #3730A3;
  --primary-light:  #EEF2FF;
  --primary-mid:    #C7D2FE;

  /* ── Legacy palette names → neutralised to semantic/brand ── */
  --orange:        #D97706;  --orange-dark:  #B45309;  --orange-light: #FEF3C7;  --orange-mid: #FDE68A;
  --yellow:        #D97706;  --yellow-dark:  #B45309;  --yellow-light: #FEF3C7;  --yellow-mid: #FDE68A;
  --pink:          #DC2626;  --pink-dark:    #B91C1C;  --pink-light:   #FEE2E2;  --pink-mid:   #FECACA;
  --teal:          #0284C7;  --teal-dark:    #0369A1;  --teal-light:   #E0F2FE;  --teal-mid:   #BAE6FD;
  --sage:          #16A34A;  --sage-dark:    #15803D;  --sage-darker:  #166534;  --sage-light: #DCFCE7;  --sage-mid: #BBF7D0;
  --lavender:      #6366F1;  --lavender-dark:#4F46E5;  --lavender-light:#EEF2FF;
  --peach:         #FEF3C7;  --coral:        #DC2626;  --coral-light:  #FEE2E2;

  /* ── Sidebar — clean white with subtle brand tint ── */
  --sidebar-bg:     #FFFFFF;
  --sidebar-bg2:    #FFFFFF;
  --sidebar-border: rgba(15,23,42,0.06);
  --sidebar-text:   #64748B;
  --sidebar-hover:  rgba(79,70,229,0.06);
  --sidebar-active: rgba(79,70,229,0.10);

  /* ── Gradients — flattened; only heroes + status keep a gentle blend ── */
  --gradient:          linear-gradient(135deg, #4F46E5 0%, #6366F1 100%); /* brand hero */
  --gradient-deep:     linear-gradient(135deg, #4338CA 0%, #4F46E5 100%);
  --gradient-hero:     linear-gradient(135deg, #4338CA 0%, #4F46E5 55%, #6366F1 100%);
  --gradient-lavender: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  --gradient-green:    linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
  --gradient-red:      linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  --gradient-pink:     linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  --gradient-orange:   linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  --gradient-yellow:   linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  --gradient-teal:     linear-gradient(135deg, #0284C7 0%, #0EA5E9 100%); /* info hero (report headers) */
  --gradient-blue:     linear-gradient(135deg, #0284C7 0%, #0EA5E9 100%);
  --gradient-sidebar:  linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);

  /* ── Semantic ── */
  --success:       #16A34A;  --success-dark:  #15803D;  --success-light: #DCFCE7;
  --warning:       #D97706;  --warning-dark:  #B45309;  --warning-light: #FEF3C7;
  --danger:        #DC2626;  --danger-dark:   #B91C1C;  --danger-light:  #FEE2E2;
  --info:          #0284C7;  --info-light:    #E0F2FE;

  /* ── Neutrals — cool slate ── */
  --dark:       #0F172A;
  --gray-900:   #0F172A;
  --gray-800:   #1E293B;
  --gray-700:   #334155;
  --gray-600:   #475569;
  --gray-500:   #64748B;
  --gray-400:   #94A3B8;
  --gray-300:   #CBD5E1;
  --gray-200:   #E2E8F0;
  --gray-100:   #F1F5F9;
  --gray-50:    #F8FAFC;
  --white:      #FFFFFF;

  /* ── Backgrounds — soft off-white surface, white cards ── */
  --bg:         #F5F6F9;
  --bg-card:    #FFFFFF;
  --bg-subtle:  #F8FAFC;

  /* ── Shadows — softer, single-color, calmer ── */
  --shadow-xs:     0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm:     0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:        0 2px 8px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04);
  --shadow-md:     0 6px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.05);
  --shadow-lg:     0 12px 28px rgba(15,23,42,0.10), 0 4px 10px rgba(15,23,42,0.06);
  --shadow-xl:     0 20px 40px rgba(15,23,42,0.12), 0 6px 16px rgba(15,23,42,0.07);
  --shadow-2xl:    0 28px 56px rgba(15,23,42,0.16), 0 10px 24px rgba(15,23,42,0.08);
  --shadow-purple: 0 4px 14px rgba(79,70,229,0.22);
  --shadow-orange: 0 4px 12px rgba(15,23,42,0.10);
  --shadow-pink:   0 4px 12px rgba(15,23,42,0.10);
  --shadow-teal:   0 4px 12px rgba(15,23,42,0.10);
  --shadow-sage:   0 4px 12px rgba(15,23,42,0.10);
  --shadow-yellow: 0 4px 12px rgba(15,23,42,0.10);
  --shadow-glow:   0 0 0 3px rgba(79,70,229,0.15);
  --shadow-inset:  inset 0 1px 2px rgba(15,23,42,0.05);

  /* ── Border Radius — unified, modern ── */
  --radius-xs:  8px;
  --radius-sm:  10px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 28px;
  --radius-full:9999px;

  /* convenience aliases */
  --shadow-blue:  var(--shadow-teal);
  --shadow-green: var(--shadow-sage);
  --shadow-red:   var(--shadow-pink);

  /* ── Transitions ── */
  --transition:      all 0.16s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.28s cubic-bezier(0.4,0,0.2,1);
  --spring:          all 0.26s cubic-bezier(0.34,1.4,0.64,1);

  /* ── Border ── */
  --border:     1px solid #E7EAF0;
  --border-strong: 1px solid #D5DAE3;
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-size: 14px;
}
/* Subtle dot-grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
.app { position: relative; z-index: 1; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, button, select, textarea { font-family: inherit; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: var(--gradient-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}
/* Background mesh gradient */
.login-page::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(79,70,229,0.16) 0%, transparent 65%);
  border-radius: 50%;
  top: -250px; right: -200px;
  animation: float 8s ease-in-out infinite;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.14) 0%, rgba(2,132,199,0.08) 60%, transparent 80%);
  border-radius: 50%;
  bottom: -180px; left: -130px;
  animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-28px) scale(1.04); }
}

.login-box {
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255,255,255,0.12);
  position: relative;
  z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon {
  width: 64px; height: 64px;
  background: var(--gradient);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
  box-shadow: var(--shadow-purple), 0 0 0 5px rgba(79,70,229,0.18);
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -0.8px; }
.login-logo p  { color: var(--gray-500); font-size: 13px; margin-top: 5px; font-weight: 400; }

.demo-creds {
  background: var(--gray-50);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 16px;
}
.demo-creds strong {
  display: block; margin-bottom: 8px;
  color: var(--gray-500); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.demo-cred-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 10px; margin: 0 -10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px; /* touch target */
}
.demo-cred-row:active { background: var(--primary-light); }
.demo-cred-row:hover  { background: var(--primary-light); }
.demo-cred-row .role  { font-weight: 600; color: var(--dark); font-size: 13px; }
.demo-cred-row .email { color: var(--gray-500); font-size: 11px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--gray-700);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--dark);
  transition: var(--transition);
  appearance: none;
  box-shadow: var(--shadow-inset);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.18), var(--shadow-inset);
}
.form-control:hover:not(:focus) { border-color: var(--gray-300); }
.form-control::placeholder { color: var(--gray-400); font-weight: 400; }
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-row  { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 5px; }

/* Live Search */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  font-size: 14px;
  font-weight: 500;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition);
  color: var(--dark);
  box-shadow: var(--shadow-xs);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
.search-input::placeholder { color: var(--gray-400); font-weight: 400; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

/* Flat, modern — no glossy shine overlay */
.btn::after { display: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,0.16);
  border: 1px solid transparent;
}
.btn-primary:hover { background: var(--primary-dark); }

/* State toggles = calm TONAL buttons (light tint + colored text) */
.btn-success {
  background: var(--success-light);
  color: var(--success-dark);
  box-shadow: none;
  border: 1px solid rgba(22,163,74,0.28);
}
.btn-success:hover { background: #C7F0D4; }

.btn-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
  box-shadow: none;
  border: 1px solid rgba(217,119,6,0.28);
}
.btn-warning:hover { background: #FDE8B8; }

/* Danger = solid red so destructive actions stay unmistakable */
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 2px rgba(220,38,38,0.16);
  border: 1px solid transparent;
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-outline {
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  box-shadow: none;
}
.btn-outline::after { display: none; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  box-shadow: none;
  border: none;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: var(--gray-100); color: var(--dark); }

.btn-white  {
  background: var(--white);
  color: var(--dark);
  box-shadow: var(--shadow-sm);
  border: var(--border);
}
.btn-white::after { display: none; }
.btn-white:hover { background: var(--gray-50); }

.btn-sm     { padding: 7px 13px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg     { padding: 13px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-block  { width: 100%; }
.btn-icon   { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); flex-shrink: 0; }
.btn-icon-sm { width: 32px; height: 32px; border-radius: var(--radius-xs); }
.btn-round  { border-radius: var(--radius-full); }

/* Task management action row — mobile friendly, consistent tap targets */
.task-actions { display: flex; gap: 6px; align-items: stretch; }
.task-actions .btn {
  flex: 1 1 0; min-width: 0; min-height: 38px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-weight: 600; font-size: 12.5px; border-radius: 9px; white-space: nowrap;
}
/* Soft, legible delete button (replaces washed-out gradient) */
.btn-del { background: #FDECEC; color: #DC3545; border: 1.5px solid var(--danger); box-shadow: none; }
.btn-del:hover { background: #FBDADA; transform: none; }
/* Inside an action row it becomes a fixed-width icon button */
.task-actions .btn-del { flex: 0 0 44px; min-width: 44px; padding: 0; font-size: 15px; }

/* Store switcher (admin, scales to any number of stores) */
.store-switcher {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: var(--border); border-radius: var(--radius-sm);
  padding: 0 12px 0 12px; margin-bottom: 14px; box-shadow: var(--shadow-xs);
  position: relative;
}
.store-switcher .ss-icon { font-size: 15px; flex-shrink: 0; }
.store-switcher .ss-select {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-size: 14px; font-weight: 700; color: var(--dark); padding: 11px 20px 11px 0;
  appearance: none; -webkit-appearance: none; cursor: pointer; font-family: inherit;
}
.store-switcher .ss-chev { position: absolute; right: 12px; color: var(--gray-400); font-size: 12px; pointer-events: none; }

/* Collapsible checklist sections (employee focus mode) */
.cl-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--primary-light);
  border: none; border-bottom: var(--border); border-top: 3px solid var(--primary);
  padding: 11px 16px; cursor: pointer; text-align: left; font-family: inherit;
}
.cl-head.done { border-top-color: var(--success); background: var(--success-light); }
.cl-head .cl-name { flex: 1; min-width: 0; font-weight: 800; font-size: 13px; color: var(--dark); }
.cl-head .cl-count {
  font-weight: 800; font-size: 11.5px; color: var(--gray-500);
  background: #fff; border: var(--border); border-radius: 20px; padding: 2px 9px; flex-shrink: 0;
}
.cl-head.done .cl-count { color: var(--success-dark); border-color: rgba(22,163,74,0.3); }
.cl-head .cl-chev { font-size: 12px; color: var(--gray-400); transition: transform 0.18s; flex-shrink: 0; }
.cl-head[aria-expanded="false"] .cl-chev { transform: rotate(-90deg); }
.cl-body { background: #fff; }

/* Compact task row + checklist grouping (mobile-first) */
.task-row { padding: 11px 14px; border-bottom: var(--border); }
.task-row .task-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.task-row .task-name { font-weight: 700; font-size: 13.5px; color: var(--dark); line-height: 1.3; min-width: 0; flex: 1; }
.task-row .task-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-300); flex-shrink: 0; }
.checklist-head {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  padding: 9px 14px; border-bottom: var(--border); border-left: 3px solid var(--primary);
  font-weight: 800; font-size: 12px; color: var(--dark); letter-spacing: .01em;
}
.checklist-head .cl-count { margin-left: auto; font-weight: 700; font-size: 10px; color: var(--gray-400); background: #fff; border-radius: 20px; padding: 2px 8px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.01em;
  line-height: 1.7;
}
.badge.success  { background: #DCFCE7; color: #15803D; }
.badge.warning  { background: #FEF3C7; color: #B45309; }
.badge.danger   { background: #FEE2E2; color: #B91C1C; }
.badge.info     { background: #DBEAFE; color: #1D4ED8; }
.badge.primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge.secondary{ background: var(--gray-100); color: var(--gray-600); }

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.36); }
  50%       { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}
.badge-pulse { animation: badge-pulse 2s ease-in-out infinite; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ============================================================
   FLASH ALERTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
  border: var(--border);
}
.alert.success { background: var(--success-light); color: #065F46; border-color: #A7F3D0; }
.alert.danger  { background: var(--danger-light);  color: #991B1B; border-color: #FECACA; }
.alert.warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert.info    { background: var(--info-light);    color: #075985; border-color: #BAE6FD; }
.alert .close  { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.45; line-height: 1; flex-shrink: 0; }

/* Toast */
.toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  width: calc(100vw - 28px);
  max-width: 400px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(26,26,46,0.16), 0 2px 8px rgba(26,26,46,0.10);
  font-size: 13.5px; font-weight: 500; color: var(--dark);
  pointer-events: all;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.34,1.36,0.64,1), opacity 0.28s ease;
  border-left: 4px solid var(--primary);
  width: 100%;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Coloured accent bar per type */
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info    { border-left-color: var(--info); }

/* Icon wrapper — coloured pill */
.toast-icon {
  font-size: 20px; flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100);
}
.toast-success .toast-icon { background: var(--success-light); }
.toast-danger  .toast-icon { background: var(--danger-light); }
.toast-warning .toast-icon { background: var(--warning-light); }

.toast-msg  { flex: 1; color: var(--dark); font-weight: 600; font-size: 13px; line-height: 1.4; }
.toast-close {
  background: var(--gray-100); border: none;
  color: var(--gray-500); cursor: pointer;
  font-size: 15px; line-height: 1;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.toast-close:hover { background: var(--gray-200); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; min-height: 100vh; }
.app-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  padding: 0 28px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(15,23,42,0.07);
  box-shadow: 0 1px 0 rgba(15,23,42,0.05);
}
.header-left  { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 16px; font-weight: 700; letter-spacing: -0.35px; color: var(--dark); }
.header-sub   { font-size: 12px; color: var(--gray-500); margin-top: 1px; font-weight: 400; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--gray-500);
  border: var(--border);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  overflow: visible; /* must NOT inherit btn overflow:hidden */
  transition: background .15s, color .15s;
}
.notif-btn:hover  { background: var(--primary-light); color: var(--primary); }
.notif-btn:active { transform: scale(0.93); }
.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid #fff;
  white-space: nowrap;
  pointer-events: none;
  animation: badge-pulse 2s ease-in-out infinite;
  line-height: 1;
}

/* Main */
.main { flex: 1; padding: 28px 28px 100px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  display: none;
  width: 240px;
  background: var(--gradient-sidebar);
  min-height: 100vh;
  flex-direction: column;
  position: sticky; top: 0;
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 2px 0 12px rgba(26,26,46,0.05);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-head {
  padding: 22px 16px 18px;
  display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.55);
}
.sidebar-brand {
  font-size: 15px; font-weight: 800; color: var(--dark);
  letter-spacing: -0.4px;
}

.sidebar-nav { padding: 12px 8px; flex: 1; }
.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--gray-400);
  padding: 18px 10px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  transition: var(--transition);
  font-size: 13px; font-weight: 500;
  position: relative;
  letter-spacing: -0.01em;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--dark);
}
.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--primary-darker);
  font-weight: 700;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 2.5px;
  background: var(--lavender);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(99,102,241,0.85);
}

.sidebar-foot {
  padding: 12px 8px 20px;
  border-top: 1px solid var(--sidebar-border);
}

/* ============================================================
   BOTTOM NAV (Mobile)
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(15,23,42,0.07);
  box-shadow: 0 -4px 20px rgba(15,23,42,0.05);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; flex: 1; padding: 5px 4px;
  font-size: 10px; font-weight: 600; color: var(--gray-400);
  text-decoration: none; transition: var(--transition);
  border-radius: var(--radius-xs); margin: 2px;
  /* Flex items default to min-width:auto, so a long label (e.g. "Plan
     Requests") stops the item shrinking and pushes the whole bar wider than
     the screen. Allow shrinking and clip the label instead. */
  min-width: 0;
  overflow: hidden;
}
.nav-item > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item svg { width: 21px; height: 21px; stroke-width: 2; transition: var(--transition); }
.nav-item.active { color: var(--primary); background: var(--primary-light); }
.nav-item.active svg { stroke: var(--primary); transform: scale(1.08); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
  border: var(--border);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: var(--border);
  background: var(--white);
}
.card-title  { font-size: 14px; font-weight: 700; color: var(--dark); letter-spacing: -0.2px; }
.card-body   { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-footer {
  padding: 12px 20px;
  border-top: var(--border);
  display: flex; gap: 10px;
  background: var(--gray-50);
}

/* Accent top bar */
.card-accent-top              { border-top: 2.5px solid var(--primary); }
.card-accent-top.success      { border-top-color: var(--success); }
.card-accent-top.warning      { border-top-color: var(--warning); }
.card-accent-top.danger       { border-top-color: var(--danger); }

/* Hero Card — Stripe-style */
.hero-card {
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  padding: 28px 26px 24px;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-purple), 0 1px 0 rgba(255,255,255,0.06) inset;
  border: none;
}
.hero-card::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  top: -100px; right: -80px;
}
.hero-card::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  bottom: -70px; left: 30px;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.8px; opacity: 0.65; font-weight: 700; }
.hero-title { font-size: 26px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -0.75px; }
.hero-sub   { font-size: 13.5px; opacity: 0.75; font-weight: 400; }

/* ============================================================
   STATS GRID — Premium Stripe/Linear style
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: var(--border);
  transition: box-shadow 0.18s ease;
  cursor: default;
  position: relative;
}
/* All stat cards are clean white — the small icon carries the only colour */
.stat:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
  position: relative; z-index: 1;
  border: none;
}
.stat-icon.primary { background: rgba(79,70,229,0.12);  color: var(--primary); }
.stat-icon.success { background: rgba(22,163,74,0.12);  color: var(--success); }
.stat-icon.warning { background: rgba(217,119,6,0.12);  color: var(--warning); }
.stat-icon.danger  { background: rgba(220,38,38,0.12);  color: var(--danger); }
.stat-icon.info    { background: rgba(2,132,199,0.12);  color: var(--info); }
.stat-icon.orange  { background: rgba(217,119,6,0.12);  color: var(--warning); }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -1px; line-height: 1; color: var(--dark); }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 5px; font-weight: 500; }
.stat-trend { font-size: 11.5px; margin-top: 8px; display: flex; align-items: center; gap: 4px; font-weight: 600; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.count-up { transition: all 0.3s; }

/* Mini stats */
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stat {
  flex: 1; min-width: 70px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  border: var(--border);
}
.mini-stat-value { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.mini-stat-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; font-weight: 500; }

/* ============================================================
   LIST ITEMS
   ============================================================ */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: var(--border);
  transition: background 0.12s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--gray-50); }
.list-item:active { background: var(--gray-50); }
.list-item.clickable { cursor: pointer; }
.list-content { flex: 1; min-width: 0; }
.list-title   { font-weight: 600; font-size: 14px; color: var(--dark); letter-spacing: -0.1px; line-height: 1.3; }
.list-sub     { font-size: 12px; color: var(--gray-500); margin-top: 2px; line-height: 1.4; }
.list-end     { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list-icon    { font-size: 20px; flex-shrink: 0; }

/* ============================================================
   TASK ITEMS
   ============================================================ */
.task-list { list-style: none; }
.task-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 15px 20px;
  border-bottom: var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.task-item:hover { background: var(--gray-50); }
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 30px; height: 30px;
  border: 1.5px solid var(--gray-300);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px;
  transition: var(--transition); margin-top: 1px;
  background: var(--white);
}
.task-check.done    { background: var(--gradient-green); border-color: transparent; color: #fff; }
.task-check.issue   { background: var(--gradient-red);   border-color: transparent; color: #fff; }
.task-check.doing   { background: linear-gradient(135deg, #D97706, #F59E0B); border-color: transparent; color: #fff; }
.task-check.skipped { background: var(--gray-200); border-color: transparent; color: var(--gray-500); }
.task-content { flex: 1; min-width: 0; }
.task-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; letter-spacing: -0.1px; color: var(--dark); }
.task-name.done { text-decoration: line-through; color: var(--gray-400); font-weight: 400; }
.task-meta { font-size: 12px; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.task-item.loading { opacity: 0.55; pointer-events: none; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   SHIFT CARD
   ============================================================ */
.shift-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.shift-card.opening  { background: var(--gradient-green);    box-shadow: var(--shadow-sage); }
.shift-card.midshift { background: var(--gradient-orange);   color: #fff; box-shadow: var(--shadow-orange); }
.shift-card.closing  { background: var(--gradient-lavender); box-shadow: var(--shadow-purple); }
.shift-card::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  right: -60px; top: -80px;
}
.shift-card > * { position: relative; z-index: 1; }
.shift-label  { font-size: 10px; text-transform: uppercase; letter-spacing: 1.8px; opacity: 0.7; font-weight: 700; }
.shift-name   { font-size: 24px; font-weight: 800; margin: 7px 0 4px; letter-spacing: -0.6px; }
.shift-time   { font-size: 13px; opacity: 0.85; display: flex; align-items: center; gap: 6px; }
.shift-stats  { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; opacity: 0.85; }
.shift-progress { margin-top: 18px; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bg   { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.9s cubic-bezier(0.4,0,0.2,1); }
.progress-fill.success { background: var(--gradient-green); }
.progress-fill.warning { background: linear-gradient(90deg, #B45309, #D97706); }
.progress-fill.danger  { background: linear-gradient(90deg, #B91C1C, #DC2626); }
.progress-fill.primary { background: var(--gradient); }

/* Circular */
.progress-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-text { position: absolute; font-weight: 700; }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar {
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
  letter-spacing: -0.5px;
}
.avatar.xs  { width: 26px; height: 26px; font-size: 9px; }
.avatar.sm  { width: 34px; height: 34px; font-size: 12px; }
.avatar     { width: 42px; height: 42px; font-size: 15px; }
.avatar.lg  { width: 54px; height: 54px; font-size: 19px; }
.avatar.xl  { width: 68px; height: 68px; font-size: 24px; }
.avatar.xxl { width: 84px; height: 84px; font-size: 30px; }

/* ============================================================
   TABLES — Stripe-quality
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: var(--border); vertical-align: middle; }
th {
  font-size: 11px; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.6px;
  background: var(--gray-50);
  white-space: nowrap;
}
th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }
td { font-size: 13.5px; font-weight: 500; color: var(--gray-700); }
td:first-child { color: var(--dark); font-weight: 600; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(6,12,24,0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.22s, visibility 0.22s;
}
.modal-bg.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-2xl);
}
.modal-bg.show .modal { transform: translateY(0); }
.modal-handle {
  width: 32px; height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-head {
  position: sticky; top: 0;
  background: var(--white);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: var(--border); z-index: 1;
}
.modal-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.modal-close {
  background: var(--gray-100); border: none; width: 30px; height: 30px;
  border-radius: 50%; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: var(--border);
  display: flex; gap: 10px; background: var(--gray-50);
}
.modal-foot .btn { flex: 1; }

/* ============================================================
   ALERT ITEMS (Notifications)
   ============================================================ */
.alert-item {
  padding: 15px 20px; border-bottom: var(--border);
  display: flex; gap: 14px; transition: background 0.12s;
}
.alert-item:hover  { background: var(--gray-50); }
.alert-item.unread { background: var(--purple-light); }
.alert-item.critical { border-left: 3px solid var(--danger); }
.alert-item.high     { border-left: 3px solid var(--warning); }
.alert-item.medium   { border-left: 3px solid var(--primary); }
.alert-item .icon    { font-size: 22px; }
.alert-item .content { flex: 1; }
.alert-item .title   { font-weight: 600; font-size: 13.5px; color: var(--dark); }
.alert-item .msg     { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; line-height: 1.55; }
.alert-item .time    { font-size: 11px; color: var(--gray-400); margin-top: 5px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty { text-align: center; padding: 32px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 12px; display: block; opacity: 0.25; }
.empty h3   { font-size: 15px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; color: var(--dark); }
.empty p    { color: var(--gray-500); font-size: 13px; line-height: 1.6; }

/* ============================================================
   WEEKLY SCHEDULE
   ============================================================ */
.week-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius);
  padding: 13px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow); border: var(--border);
}
.week-title { font-weight: 700; font-size: 14px; letter-spacing: -0.2px; }
.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.week-grid { display: flex; gap: 10px; min-width: max-content; padding: 4px 2px; }
.week-day {
  width: 130px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow); border: var(--border);
  overflow: hidden; flex-shrink: 0;
  transition: var(--transition);
}
.week-day:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.week-day-head { padding: 12px; text-align: center; font-weight: 700; font-size: 13px; }
.week-day-head.today { background: var(--gradient); color: #fff; }
.week-day-head:not(.today) { background: var(--gray-50); color: var(--gray-600); }
.week-day-date { font-size: 22px; font-weight: 800; letter-spacing: -1px; }
.week-day-name { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; }
.week-day-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.week-shift-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-xs);
  padding: 7px 9px; font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  border: 1px solid var(--primary-mid);
}
.week-shift-chip:hover { border-color: var(--primary); transform: scale(1.02); box-shadow: var(--shadow-blue); }
.week-shift-chip.opening  { background: var(--sage-light);    color: var(--sage-darker);   border-color: var(--sage-mid); }
.week-shift-chip.midshift { background: var(--orange-light);  color: var(--orange-dark);   border-color: var(--orange-mid); }
.week-shift-chip.closing  { background: var(--lavender-light);color: var(--lavender-dark); border-color: var(--lavender); }
.week-shift-chip .chip-name { font-weight: 700; }
.week-shift-chip .chip-emps { font-size: 10.5px; opacity: 0.7; margin-top: 2px; }
.week-add-btn {
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius-xs);
  padding: 8px; text-align: center;
  color: var(--gray-400); font-size: 16px;
  cursor: pointer; transition: var(--transition);
}
.week-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ============================================================
   PERFORMANCE SCORE
   ============================================================ */
.score-ring-wrap {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px; padding: 16px;
}
.score-big   { font-size: 36px; font-weight: 800; letter-spacing: -2px; }
.score-label { font-size: 10.5px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; }

/* ============================================================
   QUICK ACTIONS — Apple style
   ============================================================ */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.quick-action {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--spring);
  text-decoration: none;
  color: var(--dark);
  border: var(--border);
  position: relative;
  overflow: hidden;
}
.quick-action:nth-child(1) { background: var(--orange-light); border-color: var(--orange-mid); }
.quick-action:nth-child(2) { background: var(--sage-light);   border-color: var(--sage-mid); }
.quick-action:nth-child(3) { background: var(--yellow-light); border-color: #FAD877; }
.quick-action:nth-child(4) { background: var(--purple-light); border-color: var(--purple-mid); }
.quick-action:nth-child(5) { background: var(--teal-light);   border-color: var(--teal-mid); }
.quick-action:nth-child(6) { background: var(--pink-light);   border-color: var(--pink-mid); }
.quick-action:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-md);
  filter: brightness(0.97);
}
.quick-action .qa-icon  { font-size: 26px; margin-bottom: 8px; display: block; }
.quick-action .qa-label { font-size: 11.5px; font-weight: 700; color: var(--dark); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1   { gap: 8px; }
.gap-2   { gap: 16px; }
.flex-1  { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid-2  { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-3  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12.5px; }
.text-md  { font-size: 15px; }
.text-lg  { font-size: 17px; }
.text-xl  { font-size: 22px; }
.text-2xl { font-size: 28px; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-2  { padding: 16px; }
.p-3  { padding: 24px; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }

.section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  margin: 24px 0 12px;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 4px;
  font-size: 11.5px; font-weight: 600;
  border: var(--border);
}
.chip.primary { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-mid); }
.chip.success { background: #F0FDF4; color: #065F46; border-color: #BBF7D0; }
.chip.warning { background: var(--warning-light); color: var(--warning-dark); border-color: #FDE68A; }
.chip.danger  { background: var(--danger-light);  color: var(--danger-dark);  border-color: #FECACA; }

.sep { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--gray-400); font-size: 12px; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn    { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(6px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse     { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes shimmer   { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pop       { 0% { transform: scale(0.94); opacity: 0; } 60% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }

.fade-in   { animation: fadeIn 0.35s cubic-bezier(0.4,0,0.2,1) both; }
.fade-in-2 { animation: fadeIn 0.35s 0.08s cubic-bezier(0.4,0,0.2,1) both; }
.fade-in-3 { animation: fadeIn 0.35s 0.16s cubic-bezier(0.4,0,0.2,1) both; }
.pop-in    { animation: pop 0.35s cubic-bezier(0.34,1.56,0.64,1) both; }
.skeleton  {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ============================================================
   DESKTOP (≥ 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  .app { flex-direction: row; }
  .sidebar { display: flex; position: sticky; top: 0; height: 100vh; }
  .bottom-nav { display: none; }
  .main { padding: 32px 36px 48px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .modal-handle { display: none; }
  /* Standard modals centre on desktop */
  .modal-bg:not(#profileSheet) { align-items: center; }
  .modal-bg:not(#profileSheet) .modal {
    border-radius: var(--radius-lg);
    transform: scale(0.95) translateY(8px);
  }
  .modal-bg:not(#profileSheet).show .modal { transform: scale(1) translateY(0); }
  /* Profile sheet always stays as bottom sheet */
  #profileSheet { align-items: flex-end !important; }
  #profileSheet .modal { transform: translateY(100%); border-radius: 24px 24px 0 0 !important; }
  #profileSheet.show .modal { transform: translateY(0); }
  .quick-actions { grid-template-columns: repeat(6, 1fr); }
  .toast-container { top: 24px; left: 50%; transform: translateX(-50%); }
  body::before { opacity: 0.10; }
  /* Hide profile avatar on desktop — sidebar handles it */
  #profileAvatarBtn { display: none; }
}

/* ============================================================
   TABLET (≥ 640px)
   ============================================================ */
@media (min-width: 640px) {
  .stats    { grid-template-columns: repeat(4, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .grid-2   { grid-template-columns: 1fr 1fr; }
  .grid-3   { grid-template-columns: 1fr 1fr 1fr; }
}

/* ============================================================
   MOBILE (< 1024px) — app-like feel, touch-first
   ============================================================ */
@media (max-width: 1023px) {
  /* Layout */
  .header        { padding: 0 16px; }
  .main          { padding: 18px 14px 96px; }

  /* Cards */
  .card-body     { padding: 14px; }
  .card-header   { padding: 12px 14px; }
  .card-footer   { padding: 10px 14px; }

  /* Stats */
  .stat          { padding: 14px 12px; }
  .stat-value    { font-size: 24px; }
  .stat-label    { font-size: 11px; }
  .stat-icon     { width: 32px; height: 32px; font-size: 16px; margin-bottom: 6px; }

  /* List items — tighter on mobile */
  .list-item     { padding: 12px 14px; gap: 10px; }
  .list-title    { font-size: 13px; }
  .list-sub      { font-size: 11px; }

  /* Buttons — bigger tap targets */
  .btn-sm        { padding: 8px 12px; font-size: 12px; min-height: 36px; }

  /* Modal — bottom sheet style */
  .modal         { max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

  /* Toast — centred drop-down, always white */
  .toast-container { top: 12px; left: 50%; transform: translateX(-50%); width: calc(100vw - 24px); }

  /* Login box tighter on tablet */
  .login-box     { padding: 28px 20px; }
}

/* ============================================================
   SMALL MOBILE (< 640px) — phone-specific
   ============================================================ */
@media (max-width: 639px) {
  /* Stats always 2 cols on phones */
  .stats         { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Login always full-bleed feel */
  .login-page    { padding: 16px 14px; align-items: flex-start; padding-top: max(48px, env(safe-area-inset-top, 20px)); }
  .login-box     { padding: 26px 18px; border-radius: var(--radius-lg); }
  .login-logo    { margin-bottom: 22px; }
  .login-logo .icon { width: 56px; height: 56px; font-size: 24px; border-radius: 16px; margin-bottom: 12px; }
  .login-logo h1 { font-size: 20px; }
  .login-logo p  { font-size: 12px; margin-top: 4px; }
  .demo-cred-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 10px; }
  .demo-cred-row .email { font-size: 11px; }

  /* Bottom nav */
  .bottom-nav    { padding: 4px 0 max(8px, env(safe-area-inset-bottom)); }
  .nav-item      { font-size: 9px; }
  .nav-item svg  { width: 20px; height: 20px; }

  /* Buttons full-width inside flex col */
  .btn-block     { width: 100%; }
  .btn-lg        { font-size: 14px; padding: 13px 18px; min-height: 50px; }
}

/* ============================================================
   VERY SMALL MOBILE (< 380px)
   ============================================================ */
@media (max-width: 380px) {
  .header-title  { font-size: 13px; }
  .header        { padding: 0 12px; height: 52px; }
  .main          { padding: 12px 12px 92px; }
  .card-body     { padding: 12px; }
  .stat          { padding: 12px 10px; }
  .stat-value    { font-size: 20px; }
  .list-item     { padding: 10px 12px; }
  .toast-container { top: 10px; width: calc(100vw - 20px); }
}

/* ============================================================
   MOBILE ENHANCEMENTS — Touch-first, Thumb-friendly
   ============================================================ */

/* ── Prevent iOS double-tap zoom on buttons ── */
button, a, [role="button"] { touch-action: manipulation; }

/* ── Global tap highlight — use custom ripple instead ── */
* { -webkit-tap-highlight-color: transparent; }

/* ── Smooth inertia scroll on all overflow containers ── */
.shift-switcher-wrap,
[style*="overflow-x:auto"],
[style*="overflow-x: auto"] {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

/* ── iOS safe area fix for bottom sheet modals ── */
.modal-bg .modal {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Sticky sub-header (task progress bar) ──
   Offsets are measured at runtime (see employee/tasks.php) because the header
   and progress card change height when text wraps on narrow phones. The values
   here are only fallbacks for before the script runs. */
:root { --app-head-h: 58px; --task-head-top: 154px; }

.task-progress-sticky {
  position: sticky;
  top: var(--app-head-h);
  z-index: 50;
}

/* Column header bar sits directly below the progress card */
.task-col-head {
  position: sticky;
  top: var(--task-head-top);
  z-index: 40;
}

/* ── Task checklist row ── */
.task-checklist-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .12s;
}
.task-checklist-row:last-child { border-bottom: none; }
.task-checklist-row:active { background: var(--gray-50); }

/* ── YES / NO touch buttons ── */
.task-yes-btn, .task-no-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2.5px solid;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.task-yes-btn { border-color: #22c55e; background: #f0fdf4; color: #16a34a; }
.task-no-btn  { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.task-yes-btn:active { background: #dcfce7; transform: scale(0.88); }
.task-no-btn:active  { background: #fee2e2; transform: scale(0.88); }

/* ── Bottom nav — thumb zone optimisation ── */
.bottom-nav { height: 60px; }
.nav-item {
  min-height: 44px;
  border-radius: 10px;
  position: relative;
}
/* Active pill indicator */
.nav-item.active::before {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px;
  border-radius: 99px;
  background: var(--primary);
}

/* ── Form controls — prevent iOS zoom (need ≥ 16px) ── */
@media (max-width: 1023px) {
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
    border-radius: var(--radius-sm);
  }
  textarea { min-height: 80px; }

  /* ── Larger tap targets for buttons ── */
  .btn     { min-height: 44px; }
  .btn-sm  { min-height: 40px; }
  .btn-lg  { min-height: 52px; }

  /* ── Card padding more breathable ── */
  .modal-body { padding: 18px 16px; }
  .modal-foot { padding: 14px 16px; gap: 10px; }

  /* ── Shift switcher chip — bigger tap area ── */
  .shift-chip {
    padding: 12px 16px;
    border-radius: 14px;
    min-width: 120px;
  }
}

/* ── Extra big YES/NO on phones ── */
@media (max-width: 639px) {
  .task-yes-btn, .task-no-btn { width: 52px; height: 52px; font-size: 22px; }

  /* Checklist header column widths match bigger buttons */
  .task-col-yes, .task-col-no { width: 76px; }

  /* Bottom nav safe area */
  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    height: auto;
    min-height: 60px;
  }

  /* Toast drop from top */
  .toast { font-size: 13px; padding: 11px 14px; border-radius: 12px; }
}

/* ── Swipe-to-close indicator on bottom sheets ── */
.modal-handle {
  width: 36px; height: 4px;
  background: var(--gray-200);
  border-radius: 99px;
  margin: 10px auto 4px;
  cursor: grab;
  flex-shrink: 0;
}

/* ── Pressed state for list items & cards ── */
@media (hover: none) {
  .list-item:active,
  .task-item:active,
  .emp-card:active { background: var(--gray-50); }
  a.list-item:active { opacity: .85; }
}

/* ── Pull-to-refresh visual hint (spinner via CSS) ── */
@keyframes spin { to { transform: rotate(360deg); } }
#pullRefreshIndicator {
  display: none;
  justify-content: center; align-items: center;
  height: 48px;
  color: var(--primary);
  font-size: 22px;
  animation: spin 0.8s linear infinite;
}
#pullRefreshIndicator.active { display: flex; }

/* ── Task Type Picker (admin/store task modals) ──────────── */
.task-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.task-type-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 10px 6px 8px;
  border-radius: 10px;
  border: 2px solid var(--gray-200);
  background: var(--gray-50);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
  font-size: 11px;
  color: var(--gray-600);
  line-height: 1.35;
  min-height: 66px;
  touch-action: manipulation;
  user-select: none;
}
.task-type-opt .tto-icon { font-size: 22px; }
.task-type-opt .tto-name { font-weight: 700; font-size: 12px; color: var(--dark); }
.task-type-opt .tto-desc { font-size: 10px; color: var(--gray-400); }
.task-type-opt.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.task-type-opt.selected .tto-name { color: var(--primary-darker); }
.task-type-opt.selected .tto-desc { color: var(--primary); }
.task-type-opt:active { transform: scale(0.95); }

/* Input-type task row (employee view) */
.input-task-row {
  border-bottom: var(--border);
  padding: 12px 16px;
  transition: background .15s;
}
.input-task-row .input-submit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.input-task-row .unit-badge {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-darker);
  background: var(--primary-light);
  border-radius: 10px;
  padding: 10px 14px;
  flex-shrink: 0;
  line-height: 1;
}
.input-task-row .val-input {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  text-align: right;
  min-height: 52px;
  border-radius: 12px;
}
.input-task-row .issue-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.done-value-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #15803d;
  margin-top: 6px;
}
