/**
 * apps/shift-management/style.css
 * Shifts Tracker — Purple light / Green dark
 * Requires ../../shared/css/variables.css
 */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Purple accent — light mode */
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-dark: #5b21b6;
  --accent-glow: rgba(124,58,237,0.3);

  /* Shift identity colors */
  --shift-usama: #7c3aed;
  --shift-usama-bg: rgba(124,58,237,0.10);
  --shift-dana: #0891b2;
  --shift-dana-bg: rgba(8,145,178,0.10);
  --shift-dawan: #059669;
  --shift-dawan-bg: rgba(5,150,105,0.10);

  /* Light mode tokens (user-provided palette) */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-tertiary: #f8f9fa;
  --bg-elevated: #f3f0ff;
  --bg-input: #ffffff;

  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;

  --border-color: #e0e0e0;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 72px;
}

.hidden { display: none !important; }
.mt-20 { margin-top: 20px; }

/* ═══════════════════════════════════════════════
   LOGIN SCREEN — Purple gradient (light)
═══════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 35%, #2d1b69 70%, #5b21b6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 260px; height: 260px;
  background: rgba(124,58,237,0.12);
  border-radius: 50%;
  pointer-events: none;
}
.login-screen::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

.login-home-btn {
  position: fixed;
  top: 18px; left: 18px;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.login-home-btn:hover { background: rgba(255,255,255,0.20); color: white; }

.login-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  color: white;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}
.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: white;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(124,58,237,0.4);
}
.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 0.85rem; opacity: 0.6; margin-bottom: 28px; font-weight: 300; }

.login-card .form-group { margin-bottom: 16px; text-align: left; }
.login-card label { display: block; font-size: 0.8rem; font-weight: 500; opacity: 0.75; margin-bottom: 6px; }
.login-card select,
.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: white;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.login-card select:focus,
.login-card input:focus {
  border-color: rgba(124,58,237,0.6);
  background: rgba(255,255,255,0.12);
}
.login-card select option { background: #1a1a2e; color: white; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; font-size: 14px; padding: 4px;
  transition: color 0.2s;
}
.pw-toggle:hover { color: rgba(255,255,255,0.8); }

.login-error {
  background: rgba(244,67,54,0.15);
  border: 1px solid rgba(244,67,54,0.25);
  color: #ff8a80;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  margin-bottom: 14px;
  text-align: left;
}
.login-hint { font-size: 0.72rem; opacity: 0.35; margin-top: 18px; line-height: 1.5; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-green { background: linear-gradient(135deg, #4caf50, #2e7d32); color: white; box-shadow: 0 4px 14px rgba(76,175,80,0.3); }
.btn-green:hover { transform: translateY(-1px); }
.btn-red { background: linear-gradient(135deg, #f44336, #c62828); color: white; box-shadow: 0 4px 14px rgba(244,67,54,0.25); }
.btn-red:hover { transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   APP HEADER — Purple gradient (light)
═══════════════════════════════════════════════ */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-home-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.header-home-btn:hover { background: rgba(255,255,255,0.2); color: white; }

.header-center { display: flex; flex-direction: column; align-items: center; }
.header-title { color: white; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 7px; }
.header-user-badge {
  font-size: 0.7rem; padding: 1px 9px;
  border-radius: 20px; color: white;
  font-weight: 500; margin-top: 1px;
}
.header-right { display: flex; align-items: center; gap: 6px; }
.notif-btn, .logout-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: none; border-radius: 50%;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  position: relative;
  transition: background 0.2s;
}
.notif-btn:hover, .logout-btn:hover { background: rgba(255,255,255,0.2); color: white; }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  background: #f44336; color: white;
  font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ═══════════════════════════════════════════════
   BOTTOM NAV
═══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), #4caf50);
  opacity: 0.8;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  background: none; border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 0.7rem;
  padding: 8px 0;
  transition: color 0.2s;
  position: relative;
}
.nav-btn i { font-size: 18px; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active::after {
  content: '';
  position: absolute; bottom: 0;
  width: 20px; height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}
.nav-btn:hover { color: var(--accent-light); }

/* ═══════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════ */
.app { padding-top: 60px; }
.main-content { min-height: calc(100vh - 60px - 64px); background: var(--bg-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; background: var(--bg-primary); }
.panel-inner { padding: 16px; max-width: 680px; margin: 0 auto; }

/* ═══════════════════════════════════════════════
   SECTION TITLES
═══════════════════════════════════════════════ */
.section-title {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-header .section-title { margin-bottom: 0; }

/* ═══════════════════════════════════════════════
   WELCOME BANNER — Purple (light)
═══════════════════════════════════════════════ */
.welcome-banner {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  border-radius: 18px;
  padding: 22px 20px;
  color: white;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(124,58,237,0.25);
}
.welcome-banner::after {
  content: '';
  position: absolute; top: -25px; right: -25px;
  width: 100px; height: 100px;
  background: rgba(124,58,237,0.2);
  border-radius: 50%;
}
.welcome-banner::before {
  content: '';
  position: absolute; bottom: -15px; left: 30%;
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.welcome-banner h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; position: relative; z-index: 1; }
.welcome-banner p { font-size: 0.82rem; opacity: 0.75; font-weight: 300; position: relative; z-index: 1; }
.shift-chip {
  display: inline-block; padding: 3px 12px;
  border-radius: 20px; font-size: 0.75rem;
  font-weight: 600; margin-top: 8px; color: white;
  position: relative; z-index: 1;
}

/* ═══════════════════════════════════════════════
   DASHBOARD CARDS
═══════════════════════════════════════════════ */
.dash-grid { display: flex; flex-direction: column; gap: 10px; }
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--card-accent, var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}
.dash-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}
.dash-card:hover::before { opacity: 1; }

.dash-card[data-type="materials"] { --card-accent: #7c3aed; }
.dash-card[data-type="queues"] { --card-accent: #2196f3; }
.dash-card[data-type="purple"] { --card-accent: #7c3aed; }
.dash-card[data-type="green"] { --card-accent: #4caf50; }
.dash-card[data-type="orange"] { --card-accent: #ff9800; }
.dash-card[data-type="red"] { --card-accent: #f44336; }

.dash-card-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: white;
}
.dash-card-icon.purple { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.dash-card-icon.green { background: linear-gradient(135deg, #4caf50, #2e7d32); }
.dash-card-icon.orange { background: linear-gradient(135deg, #ff9800, #e65100); }
.dash-card-icon.red { background: linear-gradient(135deg, #f44336, #c62828); }

.dash-card-body { flex: 1; }
.dash-card-body h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; color: var(--text-primary); }
.dash-card-body p { font-size: 0.78rem; color: var(--text-secondary); }
.dash-card-arrow { color: var(--text-tertiary); font-size: 13px; }

/* ═══════════════════════════════════════════════
   MATERIAL CARDS
═══════════════════════════════════════════════ */
.mat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.mat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--card-accent, transparent) 0%, transparent 50%);
  opacity: 0.3;
  pointer-events: none;
}
.mat-card.status-confirming { border-color: #ff9800; --card-accent: rgba(255,152,0,0.06); }
.mat-card.status-low-stock { border-color: #f44336; --card-accent: rgba(244,67,54,0.06); }
.mat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.mat-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.mat-card-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.mat-card-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

.status-badge {
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.badge-waiting { background: rgba(76,175,80,0.12); color: #2e7d32; }
.badge-confirming { background: rgba(255,152,0,0.12); color: #e65100; }
.badge-oot { background: rgba(244,67,54,0.12); color: #c62828; }

.mat-due-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--bg-tertiary);
  font-size: 0.83rem;
}
.mat-due-row strong { font-weight: 600; }
.due-arrow { color: var(--text-tertiary); font-size: 12px; }

.mat-confirmations { margin-bottom: 12px; }
.confirm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.confirm-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.74rem; font-weight: 500;
}
.chip-done { background: rgba(76,175,80,0.12); color: #2e7d32; }
.chip-pending { background: rgba(255,152,0,0.10); color: #e65100; }

.mat-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.shift-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.tag-usama { background: var(--shift-usama-bg); color: var(--shift-usama); }
.tag-dana { background: var(--shift-dana-bg); color: var(--shift-dana); }
.tag-dawan { background: var(--shift-dawan-bg); color: var(--shift-dawan); }

.mat-history { margin-top: 10px; }
.history-toggle {
  background: none; border: none;
  color: var(--text-tertiary);
  font-size: 0.78rem; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  padding: 4px 0;
}
.history-toggle:hover { color: var(--accent); }
.history-list { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.history-item {
  font-size: 0.76rem; color: var(--text-secondary);
  padding: 6px 10px; background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex; align-items: center; gap: 8px;
}

/* ═══════════════════════════════════════════════
   QUEUE CARDS
═══════════════════════════════════════════════ */
.queue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.queue-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--queue-accent, var(--accent)) 0%, transparent 100%);
  opacity: 0.6;
}
.queue-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.queue-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.queue-card-title { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.queue-current {
  font-size: 0.8rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.current-highlight { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════
   QUEUE DETAIL (inside modal)
═══════════════════════════════════════════════ */
.queue-member-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.queue-member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}
.queue-member.current {
  background: rgba(124,58,237,0.08);
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}
.member-order {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-secondary); flex-shrink: 0;
}
.queue-member.current .member-order { background: var(--accent); color: white; }
.member-name { flex: 1; font-size: 0.88rem; font-weight: 500; }
.member-you { font-size: 0.7rem; color: var(--accent); font-weight: 600; }
.current-badge {
  background: var(--accent); color: white;
  font-size: 0.7rem; padding: 2px 8px;
  border-radius: 10px; font-weight: 600;
}
.pending-badge {
  background: rgba(255,152,0,0.12); color: #e65100;
  font-size: 0.7rem; padding: 2px 8px;
  border-radius: 10px; font-weight: 600;
}
.queue-manage-section { margin-top: 14px; border-top: 1px solid var(--border-color); padding-top: 14px; }
.queue-manage-section h4 { font-size: 0.83rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.queue-member-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg-tertiary); margin-bottom: 6px;
}
.queue-member-row span { flex: 1; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════
   DRAG-TO-REORDER MEMBER LIST (Add Queue modal)
═══════════════════════════════════════════════ */
.drag-member-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}
.drag-member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  position: relative;
}
.drag-member:active { cursor: grabbing; }
.drag-member:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.drag-handle {
  color: var(--text-tertiary);
  font-size: 14px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.drag-member-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}
.drag-member-order {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Drag states */
.drag-member.dragging {
  opacity: 0.4;
  border-style: dashed;
}
.drag-member.drag-over-top {
  border-top: 2px solid var(--accent);
  margin-top: -1px;
}
.drag-member.drag-over-bottom {
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}

/* Touch drag clone */
.drag-clone {
  border-radius: 10px;
  background: var(--bg-card) !important;
  border: 2px solid var(--accent) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18) !important;
  pointer-events: none;
  z-index: 10000;
}

/* ═══════════════════════════════════════════════
   NOTIFICATIONS
═══════════════════════════════════════════════ */
.notif-item {
  display: flex; gap: 12px;
  padding: 14px; border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.notif-item::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--notif-accent, var(--accent));
  opacity: 0.4;
}
.notif-item.unread {
  border-color: var(--accent);
  background: rgba(124,58,237,0.03);
  --notif-accent: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}
.notif-item.unread::before { opacity: 1; }
.notif-item.info { --notif-accent: #2196f3; }
.notif-item.warning { --notif-accent: #ff9800; }
.notif-item.success { --notif-accent: #4caf50; }
.notif-item.alert { --notif-accent: #f44336; }
.notif-item.error { --notif-accent: #f44336; }
.notif-icon.error { background: rgba(244,67,54,0.10); color: #c62828; }

.notif-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.notif-icon.info { background: rgba(33,150,243,0.10); color: #1976d2; }
.notif-icon.warning { background: rgba(255,152,0,0.10); color: #e65100; }
.notif-icon.success { background: rgba(76,175,80,0.10); color: #2e7d32; }
.notif-icon.alert { background: rgba(244,67,54,0.10); color: #c62828; }

.notif-body { flex: 1; }
.notif-msg { font-size: 0.83rem; color: var(--text-primary); line-height: 1.45; }
.notif-time { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 3px; }
.notif-unread-dot {
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ── Turn attention badge (dashboard) ── */
.turn-attention {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(124,58,237,0.05));
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  border: 1px solid rgba(124,58,237,0.25);
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.2); }
  50% { box-shadow: 0 0 10px 3px rgba(124,58,237,0.15); }
}

.status-confirming-text {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255,152,0,0.10);
  color: #e65100;
  font-weight: 600;
  font-size: 0.78rem;
  border: 1px solid rgba(255,152,0,0.20);
}

/* ── Error notification type ── */
.notif-item.error { --notif-accent: #f44336; }
.notif-icon.error { background: rgba(244,67,54,0.10); color: #c62828; }

/* ── Stacked modal footer (queue confirm/reject) ── */
.modal-footer-stacked {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
}
.modal-footer-stacked .footer-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════ */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative; overflow: hidden;
}
.settings-card::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  opacity: 0.5;
}
.settings-card h3 {
  font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; color: var(--text-primary);
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; font-size: 0.88rem;
}
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #b0b0b0; border-radius: 13px;
  cursor: pointer; transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: white;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.msg-box {
  padding: 10px 14px; border-radius: 10px;
  font-size: 0.83rem; margin-bottom: 12px;
}
.msg-box.success { background: rgba(76,175,80,0.10); color: #2e7d32; border: 1px solid rgba(76,175,80,0.2); }
.msg-box.error { background: rgba(244,67,54,0.10); color: #c62828; border: 1px solid rgba(244,67,54,0.2); }

/* ═══════════════════════════════════════════════
   ADMIN
═══════════════════════════════════════════════ */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative; overflow: hidden;
}
.admin-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  opacity: 0.6;
}
.admin-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.admin-section-header h3 {
  font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}
.admin-user-row, .admin-mat-row, .admin-queue-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-tertiary); margin-bottom: 8px;
  font-size: 0.83rem;
}
.admin-user-row .name, .admin-mat-row .name { flex: 1; font-weight: 500; }
.admin-user-row .meta, .admin-mat-row .meta { color: var(--text-secondary); font-size: 0.76rem; }

.admin-user-pw {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}
.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-pw-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "Poppins", sans-serif;
  font-size: 0.72rem;
}
.admin-pw-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124,58,237,0.05);
}

.delete-btn {
  background: none; border: none;
  color: var(--text-tertiary);
  cursor: pointer; font-size: 14px;
  padding: 4px; border-radius: 6px;
  transition: color 0.2s;
}
.delete-btn:hover { color: #f44336; }

/* ═══════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
  width: 100%; padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-size: 0.88rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   MODALS — shared overlay
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 480px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  animation: slideUp 0.25s ease;
}
@media (min-width: 480px) {
  .modal { border-radius: 20px; max-width: 480px; max-height: 80vh; animation: fadeIn 0.2s ease; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.modal-close {
  background: none; border: none;
  color: var(--text-tertiary);
  cursor: pointer; font-size: 16px;
  padding: 4px; border-radius: 6px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 18px 20px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
}

/* ═══════════════════════════════════════════════
   CONFIRM DIALOG — separate overlay (z-index above modals)
═══════════════════════════════════════════════ */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.confirm-modal {
  border-radius: 20px !important;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
  animation: fadeIn 0.15s ease;
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 16px;
  margin-bottom: 16px;
}
.empty-state i {
  font-size: 40px; margin-bottom: 12px;
  opacity: 0.35; display: block;
  color: var(--accent);
}
.empty-state p { font-size: 0.9rem; }
.empty-state small { font-size: 0.78rem; opacity: 0.7; }

/* ═══════════════════════════════════════════════
   UPCOMING TURNS
═══════════════════════════════════════════════ */
.upcoming-turns { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.turn-chip {
  padding: 3px 9px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 600;
  border: 1px solid currentColor; opacity: 0.75;
}
.turn-chip.current { opacity: 1; }
.turn-chip.compensation { border-style: dashed; }

.prep-sub-label {
  font-size: 0.73rem; color: var(--text-tertiary);
  margin-bottom: 6px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════
   INFO BOX
═══════════════════════════════════════════════ */
.info-box {
  background: rgba(124,58,237,0.05);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Divider */
hr { border: none; border-top: 1px solid var(--border-color); margin: 14px 0; }

/* Spinner */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   DARK MODE — Purple accent, user-provided dark tokens
═══════════════════════════════════════════════════════════ */
.dark-mode {
  /* Purple accent — same as light mode */
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-dark: #5b21b6;
  --accent-glow: rgba(124,58,237,0.3);

  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-card: #1e1e1e;
  --bg-tertiary: #2d2d2d;
  --bg-elevated: #333333;
  --bg-input: #383838;

  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-tertiary: #808080;
  --border-color: #404040;
}

/* Login — purple gradient in dark */
.dark-mode .login-screen {
  background: linear-gradient(160deg, #0f0f1a 0%, #161628 35%, #2d1b69 70%, #5b21b6 100%);
}
.dark-mode .login-logo {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 8px 32px rgba(124,58,237,0.4);
}
.dark-mode .login-card select:focus,
.dark-mode .login-card input:focus {
  border-color: rgba(124,58,237,0.6);
}
.dark-mode .login-card select option { background: #1a1a2e; }

/* Header — purple gradient in dark */
.dark-mode .app-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 100%);
}

/* Welcome banner — purple in dark */
.dark-mode .welcome-banner {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  box-shadow: 0 6px 20px rgba(124,58,237,0.25);
}
.dark-mode .welcome-banner::after {
  background: rgba(124,58,237,0.2);
}

/* Bottom nav */
.dark-mode .bottom-nav {
  background: #1e1e1e;
  border-top-color: #404040;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

/* Form inputs */
.dark-mode .form-group input[type="text"],
.dark-mode .form-group input[type="password"],
.dark-mode .form-group input[type="number"],
.dark-mode .form-group select {
  background: var(--bg-input);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
.dark-mode .form-group select option {
  background: #2d2d2d; color: #e0e0e0;
}

/* Toggle */
.dark-mode .toggle-slider { background: #555555; }
.dark-mode .toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.dark-mode .toggle-slider::before { box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* Message boxes */
.dark-mode .msg-box.success { background: rgba(76,175,80,0.12); border-color: rgba(76,175,80,0.25); color: #81c784; }
.dark-mode .msg-box.error { background: rgba(244,67,54,0.12); border-color: rgba(244,67,54,0.25); color: #ef9a9a; }

/* Status badges */
.dark-mode .badge-waiting { background: rgba(124,58,237,0.15); color: #a78bfa; }
.dark-mode .badge-confirming { background: rgba(255,152,0,0.15); color: #ffb74d; }
.dark-mode .badge-oot { background: rgba(244,67,54,0.15); color: #ef9a9a; }
.dark-mode .chip-done { background: rgba(124,58,237,0.15); color: #a78bfa; }
.dark-mode .chip-pending { background: rgba(255,152,0,0.12); color: #ffb74d; }

/* Cards — inherit dark tokens */
.dark-mode .dash-card,
.dark-mode .mat-card,
.dark-mode .queue-card,
.dark-mode .settings-card,
.dark-mode .admin-section {
  background: var(--bg-card);
  border-color: var(--border-color);
}
.dark-mode .notif-item {
  background: var(--bg-card);
  border-color: var(--border-color);
}
.dark-mode .notif-item.unread {
  background: rgba(124,58,237,0.05);
  border-color: #7c3aed;
}

/* Rows */
.dark-mode .history-item,
.dark-mode .queue-member-row,
.dark-mode .queue-member,
.dark-mode .admin-user-row,
.dark-mode .admin-mat-row,
.dark-mode .admin-queue-row,
.dark-mode .mat-due-row {
  background: var(--bg-tertiary);
}
.dark-mode .queue-member.current {
  background: rgba(124,58,237,0.1);
  border-color: #7c3aed;
}

.dark-mode .admin-user-pw {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
}
.dark-mode .admin-pw-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124,58,237,0.08);
}

/* Member order */
.dark-mode .member-order { background: var(--bg-elevated); }
.dark-mode .queue-member.current .member-order { background: var(--accent); }

/* Modals */
.dark-mode .modal { background: var(--bg-card); }
.dark-mode .modal-header { border-bottom-color: var(--border-color); }
.dark-mode .modal-footer { border-top-color: var(--border-color); }

/* Confirm modal */
.dark-mode .confirm-modal {
  background: #2d2d2d;
}
.dark-mode .confirm-modal .modal-header { border-bottom-color: #404040; }
.dark-mode .confirm-modal .modal-footer { border-top-color: #404040; }

/* Info box */
.dark-mode .info-box {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.2);
}

/* Empty state */
.dark-mode .empty-state {
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* Delete button */
.dark-mode .delete-btn:hover { color: #ef5350; }

/* Hub dark toggle */
.dark-mode .hub-dark-toggle {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #e0e0e0;
}
.dark-mode .hub-dark-toggle:hover { background: rgba(255,255,255,0.15); }

/* Error notification */
.dark-mode .notif-icon.error { background: rgba(244,67,54,0.15); color: #ef9a9a; }

/* Turn attention in dark mode — purple pulse */
.dark-mode .turn-attention {
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(124,58,237,0.06));
  color: var(--accent);
  border-color: rgba(124,58,237,0.30);
  animation-name: pulse-glow-dark;
}
@keyframes pulse-glow-dark {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.2); }
  50% { box-shadow: 0 0 10px 3px rgba(124,58,237,0.15); }
}

.dark-mode .status-confirming-text {
  background: rgba(255,152,0,0.12);
  color: #ffb74d;
  border-color: rgba(255,152,0,0.25);
}

/* Drag members in dark */
.dark-mode .drag-member {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}
.dark-mode .drag-member:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.dark-mode .drag-member-order {
  background: var(--accent);
}
.dark-mode .drag-clone {
  background: #2d2d2d !important;
  border-color: var(--accent) !important;
}