/* ==========================================================================
   FEAST.ART STUDIO EATERY — ENHANCED BRAND STYLING SUITE
   Rich Artisanal Warmth, Gold Accents, Executive Controls & Mobile Polish
   ========================================================================== */

:root {
  --bg-primary: #faf7f2;
  --bg-surface: #ffffff;
  --bg-subtle: #f4efe6;
  --border-color: #e5ded3;
  --border-subtle: #eee9e0;
  
  --text-main: #1c1917;
  --text-muted: #78716c;
  --text-light: #a8a29e;
  
  --brand-gold: #b45309;
  --brand-gold-hover: #92400e;
  --brand-gold-light: #fef3c7;
  --brand-gold-text: #92400e;
  --brand-amber: #d97706;
  
  --brand-dark: #1c1917;
  --brand-dark-surface: #292524;
  
  --color-success: #15803d;
  --color-success-bg: #dcfce7;
  --color-danger: #b91c1c;
  --color-danger-bg: #fee2e2;
  --color-info: #0369a1;
  --color-info-bg: #e0f2fe;

  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 4px 10px -1px rgba(28, 25, 23, 0.08), 0 2px 4px -1px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(28, 25, 23, 0.12), 0 4px 8px -2px rgba(28, 25, 23, 0.04);
  --shadow-xl: 0 20px 30px -6px rgba(28, 25, 23, 0.15), 0 8px 12px -4px rgba(28, 25, 23, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* -------------------------------------------------------------
   THEME PALETTE: DARK MODE (MANUAL & SYSTEM DEVICE ADAPTIVE)
   ------------------------------------------------------------- */
[data-theme="dark"],
:root[data-theme="dark"] {
  --bg-primary: #12100e;
  --bg-surface: #1c1917;
  --bg-subtle: #292524;
  --border-color: #38332e;
  --border-subtle: #2d2825;
  
  --text-main: #f5f0ea;
  --text-muted: #a8a29e;
  --text-light: #78716c;
  
  --brand-gold: #f59e0b;
  --brand-gold-hover: #fbbf24;
  --brand-gold-light: #2d2416;
  --brand-gold-text: #fcd34d;
  --brand-amber: #f59e0b;
  
  --brand-dark: #0c0a09;
  --brand-dark-surface: #1c1917;
  
  --color-success: #22c55e;
  --color-success-bg: #14301d;
  --color-danger: #ef4444;
  --color-danger-bg: #3b1717;
  --color-info: #38bdf8;
  --color-info-bg: #122838;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #12100e;
    --bg-surface: #1c1917;
    --bg-subtle: #292524;
    --border-color: #38332e;
    --border-subtle: #2d2825;
    
    --text-main: #f5f0ea;
    --text-muted: #a8a29e;
    --text-light: #78716c;
    
    --brand-gold: #f59e0b;
    --brand-gold-hover: #fbbf24;
    --brand-gold-light: #2d2416;
    --brand-gold-text: #fcd34d;
    --brand-amber: #f59e0b;
    
    --brand-dark: #0c0a09;
    --brand-dark-surface: #1c1917;
    
    --color-success: #22c55e;
    --color-success-bg: #14301d;
    --color-danger: #ef4444;
    --color-danger-bg: #3b1717;
    --color-info: #38bdf8;
    --color-info-bg: #122838;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
   GLOBAL HEADER (FEAST.ART LUXURY DARK + GOLD TRIM)
   ------------------------------------------------------------- */
.header, .admin-header {
  background: linear-gradient(180deg, #1c1917 0%, #292524 100%);
  color: #ffffff;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2.5px solid var(--brand-gold);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 3px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  object-fit: contain;
}

/* Real-Time Live Roster Banner in Header */
.header-live-roster-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.live-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hdr-label {
  color: #fbbf24;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.hdr-stat {
  font-weight: 750;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.hdr-stat-on { background: #14532d; color: #86efac; border: 1px solid #166534; }
.hdr-stat-out { background: #0c4a6e; color: #7dd3fc; border: 1px solid #0369a1; }
.hdr-stat-off { color: #a8a29e; }

.header-clock-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.82rem;
  color: #d6d3d1;
}

.live-time {
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Header Current Page Indicator Pill */
.btn-header-page-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  text-decoration: none;
}
.btn-header-page-pill:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  transform: translateY(-1px);
}
.btn-header-page-pill .page-pill-caret {
  font-size: 0.72rem;
  color: #f59e0b;
  margin-left: 1px;
}

/* Header Theme Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #f5f5f4 !important;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}
.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #f59e0b !important;
  color: #f59e0b !important;
  transform: translateY(-1px);
}

/* Drawer Theme Selector */
.drawer-theme-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 0.75rem 1.25rem 1.25rem;
}
.drawer-theme-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.theme-segmented-group {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
}
.theme-seg-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.theme-seg-btn:hover {
  color: var(--brand-gold);
}
.theme-seg-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

/* -------------------------------------------------------------
   MODERN FLOATING SEGMENTED CAPSULE NAVBAR (DESKTOP)
   ------------------------------------------------------------- */
.admin-navbar-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}
.admin-navbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 6px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.admin-navbar::-webkit-scrollbar {
  display: none;
}
.tab-btn {
  padding: 0.5rem 1.05rem;
  font-weight: 650;
  font-size: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border-radius: var(--radius-full);
}
.tab-btn:hover {
  color: var(--brand-gold);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}
.tab-btn.active {
  color: #ffffff !important;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
}

/* On mobile (< 920px), hide the bulky tab bar so mobile is 100% clean, and use the Hamburger Drawer */
@media (max-width: 920px) {
  .admin-navbar-wrapper,
  .admin-navbar {
    display: none !important;
  }
}

/* -------------------------------------------------------------
   PAGE LAYOUT & CONTAINERS
   ------------------------------------------------------------- */
.main-container, .admin-page-container {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.page-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--border-color);
}

.page-title-box h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-actions-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------
   CARDS & SECTIONS
   ------------------------------------------------------------- */
.card, .admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover, .admin-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d6cdc1;
}

.card-title, .admin-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* -------------------------------------------------------------
   PROMINENT DAILY EMAIL CARD
   ------------------------------------------------------------- */
.admin-email-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffdfa 100%);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.08);
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.admin-email-card:hover {
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.14);
  border-color: #f59e0b;
}

.admin-email-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--brand-gold), var(--brand-amber));
}

.admin-email-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-email-card-info {
  flex: 1;
  min-width: 260px;
}

.admin-email-card-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 280px;
  max-width: 520px;
  flex-wrap: wrap;
}

.admin-quick-email-input {
  font-size: 0.92rem;
  padding: 0.65rem 1rem;
  flex: 1;
  min-width: 200px;
}

.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 750;
}

/* -------------------------------------------------------------
   DASHBOARD 2-COLUMN LAYOUT & SIDEBAR
   ------------------------------------------------------------- */
/* -------------------------------------------------------------
   IN-PAGE QUICK-SURF SUB-NAVBAR (FLOOR DASHBOARD)
   ------------------------------------------------------------- */
.dashboard-quick-nav {
  position: sticky;
  top: 60px;
  z-index: 95;
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 4px;
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .dashboard-quick-nav {
  background: rgba(28, 25, 23, 0.95);
  border-bottom-color: #38332e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dashboard-quick-nav-track {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dashboard-quick-nav-track::-webkit-scrollbar {
  display: none;
}

.quick-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quick-nav-pill:hover {
  background: #fffbeb;
  border-color: var(--brand-gold);
  color: #92400e;
  transform: translateY(-1px);
}

[data-theme="dark"] .quick-nav-pill:hover {
  background: #2d2416;
  border-color: #78350f;
  color: #fcd34d;
}

.quick-nav-pill.active {
  background: var(--brand-gold);
  border-color: var(--brand-gold-hover);
  color: #1c1917;
  font-weight: 850;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .quick-nav-pill.active {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #12100e;
}

.dashboard-section {
  scroll-margin-top: 130px;
}

.dashboard-side-menu-item {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-surface);
  transition: all 0.2s ease;
}

.dashboard-side-menu-item:hover {
  background: var(--bg-surface);
  border-color: var(--brand-amber);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

[data-theme="dark"] .dashboard-side-menu-item {
  background: #24201d;
  border-color: #38332e;
}

[data-theme="dark"] .dashboard-side-menu-item-header {
  color: #f5f0ea;
}

[data-theme="dark"] .command-hub-card {
  background: #24201d !important;
  border-color: #38332e !important;
}

[data-theme="dark"] .command-hub-card strong {
  color: #f5f0ea !important;
}

.dashboard-side-menu-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  font-size: 0.92rem;
  color: var(--brand-dark);
}

.dashboard-side-menu-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.dashboard-side-menu-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* -------------------------------------------------------------
   KPI STATS GRID
   ------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
}

/* 4 Distinct Vibrant KPI Color Themes */
.stat-card:nth-child(1) {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border: 2px solid #86efac;
}
.stat-card:nth-child(1):hover {
  border-color: #22c55e;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}
.stat-card:nth-child(1)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.stat-card:nth-child(2) {
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
  border: 2px solid #7dd3fc;
}
.stat-card:nth-child(2):hover {
  border-color: #0284c7;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.22);
}
.stat-card:nth-child(2)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

.stat-card:nth-child(3) {
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 100%);
  border: 2px solid #d8b4fe;
}
.stat-card:nth-child(3):hover {
  border-color: #9333ea;
  box-shadow: 0 10px 24px rgba(147, 51, 234, 0.22);
}
.stat-card:nth-child(3)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #c084fc, #7e22ce);
}

.stat-card:nth-child(4) {
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
  border: 2px solid #fcd34d;
}
.stat-card:nth-child(4):hover {
  border-color: #d97706;
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.22);
}
.stat-card:nth-child(4)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

.stat-card-title {
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
}

.stat-card-value {
  font-size: 2.3rem;
  font-weight: 900;
  margin: 0.35rem 0;
  display: block;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

/* -------------------------------------------------------------
   TABLES (PAPER REPLICA & REGISTRY STYLES)
   ------------------------------------------------------------- */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: #ffffff;
}

.paper-register, .registry-table, .feast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.paper-register th, .registry-table th, .feast-table th {
  background: linear-gradient(180deg, #26221f 0%, #171513 100%);
  color: #fde68a;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.95rem 1rem;
  border-bottom: 3px solid #d97706;
  white-space: nowrap;
}

.paper-register td, .registry-table td, .feast-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.paper-register tr:nth-child(even), .registry-table tr:nth-child(even), .feast-table tr:nth-child(even) {
  background: #fbf9f5;
}

.paper-register tr:hover, .registry-table tr:hover, .feast-table tr:hover {
  background: #fffbeb !important;
}

/* Biometric Thumbnails */
.mini-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.mini-thumb:hover {
  transform: scale(1.15);
  border-color: var(--brand-amber);
}

.sig-thumb {
  height: 28px;
  max-width: 90px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

/* -------------------------------------------------------------
   BUTTONS (RICH GOLD, ARTISANAL, CLEAN)
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 750;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border-color: #b45309;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.3);
  font-weight: 800;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45);
}

.btn-outline {
  background: #ffffff;
  color: #78350f;
  border: 1.5px solid #d97706;
  font-weight: 750;
}

.btn-outline:hover {
  background: #fffbeb;
  color: #92400e;
  border-color: #b45309;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  font-weight: 800;
}

.btn-success:hover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #dc2626 100%);
  color: #ffffff;
  border-color: #b91c1c;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
  font-weight: 800;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #fb7185 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.45);
}

.btn-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border-color: #0369a1;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
  font-weight: 800;
}

.btn-info:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}

.btn-sm { padding: 0.42rem 0.82rem; font-size: 0.82rem; }
.btn-xs { padding: 0.28rem 0.6rem; font-size: 0.76rem; border-radius: 6px; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------
   BADGES & PILLS
   ------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 9px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-success { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #14532d; border: 1.5px solid #4ade80; box-shadow: 0 1px 4px rgba(34, 197, 94, 0.15); }
.badge-info { background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); color: #075985; border: 1.5px solid #38bdf8; box-shadow: 0 1px 4px rgba(2, 132, 199, 0.15); }
.badge-danger { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; border: 1.5px solid #f87171; box-shadow: 0 1px 4px rgba(220, 38, 38, 0.15); }
.badge-warning { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; border: 1.5px solid #fbbf24; box-shadow: 0 1px 4px rgba(217, 119, 6, 0.15); }
.badge-purple { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); color: #6b21a8; border: 1.5px solid #c084fc; box-shadow: 0 1px 4px rgba(147, 51, 234, 0.15); }
.badge-neutral { background: #f5f5f4; color: #57534e; border: 1.5px solid #d6d3d1; }

/* -------------------------------------------------------------
   FORMS & CONTROLS
   ------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 750;
  color: #292524;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* -------------------------------------------------------------
   MODALS (INSTALL APP & LIGHTBOX)
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box, .modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 540px;
  width: 100%;
  padding: 1.5rem;
  border: 1.5px solid var(--border-color);
  animation: slideUp 0.25s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

/* -------------------------------------------------------------
   TOAST NOTIFICATIONS
   ------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast-msg {
  background: #1c1917;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  transition: all 0.25s ease;
  border-left: 4px solid var(--brand-amber);
}

.toast-success { border-left-color: #22c55e; }
.toast-error { border-left-color: #ef4444; }
.toast-info { border-left-color: #38bdf8; }

/* -------------------------------------------------------------
   EXECUTIVE CELL PHONE & MOBILE RESPONSIVE ENGINE (< 768px)
   ------------------------------------------------------------- */
@media (max-width: 768px) {
  /* 1. Header & Brand Bar */
  .header, .admin-header {
    padding: 0.55rem 0.75rem !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }

  .header > div:first-child {
    gap: 6px !important;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .btn-hamburger-menu {
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
    gap: 0 !important;
    flex-shrink: 0;
    min-height: 38px;
    min-width: 38px;
    justify-content: center;
  }

  .btn-hamburger-menu .hamburger-label {
    display: none !important; /* Icon-only gives room for logo & page indicator */
  }

  .brand-logo-img {
    height: 32px !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    flex-shrink: 0;
  }

  .btn-header-page-pill {
    padding: 4px 8px !important;
    font-size: 0.76rem !important;
    max-width: 125px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-shrink: 1;
  }

  .btn-header-page-pill span:nth-child(2) {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block;
    max-width: 80px;
  }

  .header-live-roster-pill {
    display: none !important;
  }

  .header-clock-box {
    display: none !important; /* Phones already display time in the status bar */
  }

  /* Header actions on cell phones: Keep theme toggle & primary action, collapse duplicate links to drawer */
  .header-actions {
    gap: 5px !important;
    flex-shrink: 0;
  }

  /* Hide duplicate 'Install App' and 'Kiosk View' buttons from header on mobile (already inside burger menu) */
  .header-actions .btn:not(.btn-theme-toggle):not(.btn-danger):not(#btnAdminPortal) {
    display: none !important;
  }

  .btn-theme-toggle {
    padding: 5px 8px !important;
    font-size: 0.85rem !important;
    min-height: 36px;
  }

  .btn-theme-toggle .hide-xs {
    display: none !important;
  }

  .header-actions .btn-danger,
  .header-actions #btnAdminPortal {
    padding: 5px 9px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    min-height: 36px;
  }

  /* 2. Page Container & Layout */
  .main-container, .admin-page-container {
    padding: 0.85rem 0.65rem !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* 3. Typography & Titles */
  .page-title-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    margin-bottom: 1.15rem !important;
    padding-bottom: 0.75rem !important;
  }

  .page-title-box h1 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
    gap: 8px !important;
  }

  .page-title-box p {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
  }

  .page-actions-box {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .page-actions-box > div {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .page-actions-box .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
  }

  /* 4. Form Controls & Anti-iOS Zoom (16px prevents viewport scale jump) */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  select,
  textarea,
  .form-control,
  .staff-search-input {
    font-size: 16px !important;
    min-height: 44px !important;
    border-radius: var(--radius-sm) !important;
    box-sizing: border-box;
  }

  .form-label {
    font-size: 0.88rem !important;
    margin-bottom: 0.35rem !important;
  }

  .form-group {
    margin-bottom: 1rem !important;
  }

  /* 5. Cards & Section Padding */
  .card, .admin-card, .paper-sheet-card {
    padding: 1rem 0.75rem !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 1.15rem !important;
  }

  .card-title, .admin-card-title {
    font-size: 1.1rem !important;
  }

  /* 6. Dashboard KPI Grid (Compact 2x2 for mobile overview) */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 1.15rem !important;
  }

  .stat-card {
    padding: 0.85rem 0.65rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .stat-card-title {
    font-size: 0.7rem !important;
    letter-spacing: 0.4px !important;
  }

  .stat-card-value {
    font-size: 1.6rem !important;
    margin: 0.15rem 0 !important;
  }

  .stat-card-sub {
    font-size: 0.72rem !important;
  }

  /* 7. Quick Email Card Mobile Optimization */
  .admin-email-card {
    padding: 1rem 0.85rem !important;
  }

  .admin-email-card-content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .admin-email-card-form {
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .admin-email-card-form .btn {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* 8. Table & Paper Register Mobile Touch Experience */
  .table-responsive {
    border-radius: var(--radius-sm) !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative;
    margin-bottom: 0.5rem;
  }

  .table-responsive::after {
    content: "👉 Swipe horizontally to view full register sheet →";
    display: block;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-gold);
    padding: 6px 10px;
    background: var(--bg-subtle);
    border-top: 1px dashed var(--border-color);
  }

  .paper-register th, .registry-table th, .feast-table th {
    padding: 0.65rem 0.6rem !important;
    font-size: 0.76rem !important;
  }

  .paper-register td, .registry-table td, .feast-table td {
    padding: 0.65rem 0.6rem !important;
    font-size: 0.8rem !important;
  }

  .mini-thumb {
    width: 32px !important;
    height: 32px !important;
  }

  .sig-thumb {
    height: 24px !important;
    max-width: 70px !important;
  }

  /* 9. Settings Sub-Tabs Mobile Pill Scroller */
  .settings-nav-tabs {
    gap: 6px !important;
    padding-bottom: 6px !important;
    margin-bottom: 1.15rem !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .settings-nav-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .settings-tab-btn {
    padding: 0.48rem 0.85rem !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-full) !important;
  }

  /* 10. Modals: Ergonomic Mobile Sheets */
  .modal-overlay {
    padding: 0.5rem !important;
    align-items: flex-end !important;
  }

  .modal-box, .modal-card, .lightbox-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 1.25rem 0.95rem !important;
    box-sizing: border-box;
  }

  .modal-header {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
  }

  .modal-title {
    font-size: 1.05rem !important;
  }

  .modal-close-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.6rem !important;
  }

  /* 11. Archive Filter Bar on Mobile */
  .archive-controls-bar {
    padding: 0.85rem 0.75rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .date-filter-group {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .date-filter-group input,
  .date-filter-group select,
  .date-filter-group button {
    width: 100% !important;
    margin-left: 0 !important;
    min-height: 44px !important;
  }

  .selection-action-bar {
    padding: 0.75rem 0.85rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .selection-action-bar button {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* 12. Vault Gallery Grid on Mobile (2 Columns) */
  .vault-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .vault-card-media {
    height: 140px !important;
  }

  .vault-card-body {
    padding: 0.75rem 0.65rem !important;
  }

  /* 13. Date & Week Clusters on Cell Phones */
  .date-selector-cluster {
    display: grid !important;
    grid-template-columns: auto 1fr auto auto !important;
    gap: 4px !important;
    width: 100% !important;
    align-items: center !important;
  }

  .date-selector-cluster input[type="date"] {
    width: 100% !important;
    text-align: center !important;
    padding: 0.35rem 0.5rem !important;
  }

  .date-selector-cluster .btn {
    min-height: 40px !important;
    padding: 0.35rem 0.65rem !important;
  }

  .week-selector-cluster {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .week-selector-cluster > div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  .week-selector-cluster input[type="date"] {
    width: 60% !important;
  }

  .week-selector-cluster button {
    width: 100% !important;
    min-height: 42px !important;
  }

  /* 14. Archive Presets Row */
  .archive-presets-row {
    display: flex !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .archive-presets-row span {
    display: none !important;
  }

  .archive-presets-row .btn {
    flex: 1 !important;
    min-height: 38px !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
  }

  /* 15. Vault Filter Bar */
  .vault-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0.85rem 0.75rem !important;
    gap: 10px !important;
  }

  .vault-filter-bar > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .vault-filter-bar select {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* 16. Database Audit Report on Cell Phones */
  .report-container {
    padding: 1.15rem 0.85rem !important;
    margin: 0.75rem auto !important;
    border-radius: var(--radius-md) !important;
  }

  .report-header {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .metrics-summary-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* 17. Safe area bottom padding for iOS home indicator */
  body {
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
}

/* Extra Compact Phones (< 400px e.g. iPhone SE) */
@media (max-width: 400px) {
  .btn-header-page-pill {
    max-width: 105px !important;
  }

  .btn-header-page-pill span:nth-child(2) {
    max-width: 65px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .stat-card-value {
    font-size: 1.45rem !important;
  }
}

/* -------------------------------------------------------------
   HAMBURGER NAVIGATION BUTTON & SLIDE-OUT DRAWER
   ------------------------------------------------------------- */
.btn-hamburger-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 13px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-hamburger-menu:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--brand-gold);
  transform: translateY(-1px);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 17px;
  height: 13px;
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #f59e0b;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.nav-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-drawer-overlay.active {
  display: block;
  opacity: 1;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #ffffff;
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.3);
  z-index: 100000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-drawer-overlay.active .nav-drawer {
  transform: translateX(0);
}

.nav-drawer-header {
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--brand-gold);
  color: #ffffff;
}

.btn-close-drawer {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-close-drawer:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
}

.nav-drawer-body {
  padding: 1rem 0.85rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-drawer-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
  padding: 10px 12px 4px 12px;
}

.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.nav-drawer-link:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateX(4px);
}

.nav-drawer-link.active {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  font-weight: 750;
}

.nav-drawer-link .nav-icon {
  font-size: 1.35rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.nav-drawer-link .nav-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nav-drawer-link .nav-info strong {
  font-size: 0.88rem;
  color: #0f172a;
}

.nav-drawer-link .nav-info small {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 1px;
}

.nav-drawer-link.active .nav-info strong {
  color: #b45309;
}

.nav-drawer-link .nav-badge {
  font-size: 0.7rem;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  flex-shrink: 0;
}

.nav-drawer-link .nav-arrow {
  color: #94a3b8;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.nav-drawer-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 8px 12px;
}

/* -------------------------------------------------------------
   COMPREHENSIVE DARK THEME COMPONENT OVERRIDES
   ------------------------------------------------------------- */
[data-theme="dark"] .nav-drawer {
  background: #1c1917;
  color: #f5f0ea;
  border-right: 1px solid #38332e;
}

[data-theme="dark"] .nav-drawer-link {
  color: #d6d3d1;
}

[data-theme="dark"] .nav-drawer-link:hover {
  background: #292524;
  border-color: #38332e;
}

[data-theme="dark"] .nav-drawer-link.active {
  background: #2d2416;
  border-color: #78350f;
  color: #fcd34d;
}

[data-theme="dark"] .nav-drawer-link .nav-info strong {
  color: #f5f0ea;
}

[data-theme="dark"] .nav-drawer-link .nav-info small {
  color: #a8a29e;
}

[data-theme="dark"] .nav-drawer-divider {
  background: #2d2825;
}

[data-theme="dark"] .nav-drawer-section-title {
  color: #78716c;
}

[data-theme="dark"] .modal-box,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .lightbox-content {
  background: #1c1917;
  color: #f5f0ea;
  border-color: #38332e;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #2d2825;
}

[data-theme="dark"] .modal-title {
  color: #f5f0ea;
}

[data-theme="dark"] .modal-close-btn {
  color: #a8a29e;
}

[data-theme="dark"] .modal-close-btn:hover {
  color: #ffffff;
}

[data-theme="dark"] .form-control {
  background: #292524;
  color: #f5f0ea;
  border-color: #38332e;
}

[data-theme="dark"] .form-control:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .form-label {
  color: #e7dfd5;
}

[data-theme="dark"] .form-hint {
  color: #a8a29e;
}

[data-theme="dark"] .table-responsive {
  background: #1c1917;
  border-color: #38332e;
}

[data-theme="dark"] .paper-sheet-card {
  background: #1c1917 !important;
  border-color: #38332e !important;
}

[data-theme="dark"] .paper-register td,
[data-theme="dark"] .registry-table td,
[data-theme="dark"] .feast-table td {
  border-bottom-color: #2d2825;
  color: #f5f0ea;
}

[data-theme="dark"] .paper-register tr:nth-child(even),
[data-theme="dark"] .registry-table tr:nth-child(even),
[data-theme="dark"] .feast-table tr:nth-child(even) {
  background: #24201d;
}

[data-theme="dark"] .paper-register tr:hover,
[data-theme="dark"] .registry-table tr:hover,
[data-theme="dark"] .feast-table tr:hover {
  background: #2d2416 !important;
}

[data-theme="dark"] .dashboard-docs-sidebar {
  background: #1c1917;
  border-color: #38332e;
}

[data-theme="dark"] .dashboard-side-menu-item {
  background: #24201d;
  border-color: #38332e;
}

[data-theme="dark"] .dashboard-side-menu-item:hover {
  background: #2d2416;
  border-color: #78350f;
}

[data-theme="dark"] .admin-email-card {
  background: linear-gradient(135deg, #1c1917 0%, #24201d 100%);
  border-color: #78350f;
}

[data-theme="dark"] .subtab-bar {
  background: #292524;
  border-color: #38332e;
}

[data-theme="dark"] .subtab-btn {
  color: #a8a29e;
}

[data-theme="dark"] .subtab-btn:hover {
  color: #f59e0b;
  background: #38332e;
}

[data-theme="dark"] .subtab-btn.active {
  background: #1c1917;
  color: #fcd34d;
}

[data-theme="dark"] .report-container {
  background: #1c1917;
  color: #f5f0ea;
  border-color: #38332e;
}

[data-theme="dark"] .metric-box {
  background: #292524;
  border-color: #38332e;
}

[data-theme="dark"] .metric-box-val {
  color: #f5f0ea;
}

[data-theme="dark"] .btn-outline {
  background: #292524;
  color: #fcd34d;
  border-color: #78350f;
}

[data-theme="dark"] .btn-outline:hover {
  background: #38332e;
  color: #fbbf24;
  border-color: #f59e0b;
}

[data-theme="dark"] .badge-neutral {
  background: #292524;
  color: #d6d3d1;
  border-color: #38332e;
}

[data-theme="dark"] .live-radar-box,
[data-theme="dark"] .settings-map-box {
  border-color: #38332e;
}

/* Universal Dark Theme Legibility Guard for Inline Styled Elements */
[data-theme="dark"] [style*="color: #1c1917"],
[data-theme="dark"] [style*="color:#1c1917"],
[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#0f172a"],
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#1e293b"] {
  color: #f5f0ea !important;
}

[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#334155"],
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"] {
  color: #d6d3d1 !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [style*="color: #1c1917"],
  :root:not([data-theme="light"]) [style*="color:#1c1917"],
  :root:not([data-theme="light"]) [style*="color: #0f172a"],
  :root:not([data-theme="light"]) [style*="color:#0f172a"],
  :root:not([data-theme="light"]) [style*="color: #1e293b"],
  :root:not([data-theme="light"]) [style*="color:#1e293b"] {
    color: #f5f0ea !important;
  }

  :root:not([data-theme="light"]) [style*="color: #334155"],
  :root:not([data-theme="light"]) [style*="color:#334155"],
  :root:not([data-theme="light"]) [style*="color: #475569"],
  :root:not([data-theme="light"]) [style*="color:#475569"],
  :root:not([data-theme="light"]) [style*="color: #64748b"],
  :root:not([data-theme="light"]) [style*="color:#64748b"] {
    color: #d6d3d1 !important;
  }
}
