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

/* ==========================================
   1. DESIGN SYSTEM TOKENS & RESET
   ========================================== */
:root {
  /* Colors - Sleek Obsidian Dark Theme */
  --bg-main: #090d16;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(26, 36, 57, 0.85);
  --bg-sidebar: #0f172a;
  --bg-input: rgba(15, 23, 42, 0.6);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-active: rgba(6, 182, 212, 0.5);
  
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* Brand Accents */
  --color-primary: #06b6d4;      /* Electric Cyan */
  --color-primary-rgb: 6, 182, 212;
  --color-secondary: #f97316;    /* Extreme Orange */
  --color-secondary-rgb: 249, 115, 22;
  --color-success: #10b981;      /* Vibrant Green */
  --color-warning: #eab308;      /* Warm Yellow */
  --color-danger: #ef4444;       /* Coral Red */
  --color-info: #3b82f6;         /* Royal Blue */

  /* Fonts */
  --font-headings: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Border Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 15px rgba(6, 182, 212, 0.35);
  --shadow-glow-orange: 0 0 15px rgba(249, 115, 22, 0.35);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 600;
  letter-spacing: -0.02em;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  outline: none;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  filter: brightness(1.2);
}

/* ==========================================
   2. DEVELOPER / ROLE SWITCHER PANEL
   ========================================== */
.dev-panel {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.dev-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
}

.dev-logo span {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dev-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dev-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dev-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dev-select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow-cyan);
}

/* ==========================================
   3. APP CONTAINER & VIEWPORT FRAMING
   ========================================== */
.app-container {
  min-height: calc(100vh - 57px);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Mobile Frame Emulator for Athlete/Coach Views (Cleaned up to be a normal centered column on desktop and full screen on mobile) */
.mobile-emulator {
  width: 100%;
  max-width: 540px; /* Clean reading width for desktop, no phone mockup shell */
  min-height: 100vh;
  background: #0f1624;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Hide notch completely */
.mobile-emulator::before {
  display: none !important;
}

/* Content wrapper that behaves like a mobile body */
.mobile-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 16px 16px 80px 16px; /* standard padding, no notch space */
  scrollbar-width: none;
}
.mobile-content::-webkit-scrollbar {
  display: none;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 768px) {
  .app-container {
    padding: 0 !important;
    min-height: 100vh !important;
  }
  .mobile-emulator {
    max-width: 100% !important;
    min-height: 100vh !important;
  }
  .mobile-content {
    padding: 16px 12px 80px 12px !important;
  }
  .toast-container {
    bottom: 80px !important;
  }
}

/* Desktop View (Pengurus Kota) resets */
.desktop-view {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.desktop-content {
  min-width: 0; /* Prevents grid items from overflowing */
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================
   4. LAYOUT COMPONENTS & VIEW TRANSITIONS
   ========================================== */
.view-section {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   5. SHARED PREMIUM UI COMPONENTS
   ========================================== */

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(6, 182, 212, 0.25);
  transform: translateY(-2px);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition-normal);
}

.glass-card.accent-cyan::before {
  background: var(--color-primary);
}

.glass-card.accent-orange::before {
  background: var(--color-secondary);
}

.glass-card.accent-green::before {
  background: var(--color-success);
}

/* Headers */
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  color: var(--color-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #0891b2);
  color: #000;
  box-shadow: var(--shadow-glow-cyan);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary), #ea580c);
  color: #fff;
  box-shadow: var(--shadow-glow-orange);
}
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-orange {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-secondary);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.badge-green {
  background: rgba(16, 189, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 189, 129, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow-cyan);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Make date/time picker icons white on dark background */
input[type="date"].form-control,
input[type="time"].form-control {
  color-scheme: dark;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity var(--transition-fast);
}

input[type="date"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="time"].form-control::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ==========================================
   6. MOBILE VIEWPORT (ATLET & PELATIH) SPECIFICS
   ========================================== */

/* Mobile Header */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #000;
  border: 2px solid var(--bg-main);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.mobile-header-actions {
  display: flex;
  gap: 12px;
  color: var(--text-secondary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
}

.pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--color-secondary);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow-orange);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

/* Athlete Welcome Card */
.welcome-section {
  margin-bottom: 20px;
}

.welcome-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.welcome-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stats Progress Rings Grid */
.mobile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px;
}

.progress-ring-container {
  position: relative;
  width: 70px;
  height: 70px;
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 6;
}

.progress-ring-fill {
  fill: none;
  stroke-linecap: round;
  stroke-width: 6;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Quick Actions Strip */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

/* Announcement Ticker */
.announcement-ticker {
  background: rgba(249, 115, 22, 0.08);
  border: 1px dashed rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.ticker-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ticker-content {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.ticker-item {
  display: none;
  animation: slideIn 0.3s ease;
}

.ticker-item.active {
  display: block;
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Leaderboard Widget */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.leaderboard-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-number {
  width: 24px;
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
}

.rank-1 .rank-number { color: #ffd700; text-shadow: 0 0 6px rgba(255, 215, 0, 0.5); }
.rank-2 .rank-number { color: #c0c0c0; }
.rank-3 .rank-number { color: #cd7f32; }

.leaderboard-name {
  font-weight: 500;
  font-size: 0.85rem;
}

.leaderboard-score {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: 64px;
  background: rgba(15, 22, 36, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  color: var(--color-primary);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

/* ==========================================
   7. DESKTOP VIEWPORT (PENGURUS KOTA) SPECIFICS
   ========================================== */

/* Desktop Sidebar Nav */
.desktop-sidebar {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 30px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 77px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
}

.sidebar-title span {
  color: var(--color-primary);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.sidebar-menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition-fast);
}

.sidebar-menu-item.active a, .sidebar-menu-item a:hover {
  background: rgba(6, 182, 212, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(6, 182, 212, 0.15);
}

/* Dashboard Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.metric-value {
  font-size: 1.85rem;
  font-family: var(--font-headings);
  font-weight: 800;
  color: var(--text-main);
}

.metric-trend {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--color-success); }
.trend-down { color: var(--color-danger); }

/* Grid for Talent Map and Selection Engine */
.desktop-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

/* Sub-district (Kecamatan) Ranks/Bars */
.talent-map-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.talent-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.talent-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.talent-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.talent-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), #0891b2);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Recommendations List */
.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.rec-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(6, 182, 212, 0.2);
}

.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.rec-title-group {
  display: flex;
  flex-direction: column;
}

.rec-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.rec-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rec-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
}

.rec-metric-item {
  display: flex;
  flex-direction: column;
}

.rec-metric-val {
  font-weight: 700;
  color: var(--text-main);
}

/* Chart Container & Placeholders */
.chart-container {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid var(--border-color);
  border-left: 2px solid var(--border-color);
  position: relative;
  margin-top: 16px;
}

.chart-bar {
  flex: 1;
  margin: 0 8px;
  background: linear-gradient(to top, var(--color-primary), rgba(6, 182, 212, 0.2));
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  position: relative;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  justify-content: center;
}

.chart-bar:hover {
  background: linear-gradient(to top, var(--color-secondary), rgba(249, 115, 22, 0.2));
  transform: scaleY(1.02);
}

.chart-tooltip {
  position: absolute;
  bottom: 100%;
  background: #1e293b;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-5px);
  transition: var(--transition-fast);
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.chart-bar:hover .chart-tooltip {
  opacity: 1;
  transform: translateY(-8px);
}

.chart-label {
  position: absolute;
  top: calc(100% + 6px);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================
   8. MISCELLANEOUS COMPONENT STYLES
   ========================================== */

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th, .table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.table tbody tr {
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Event List Card */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-item {
  display: flex;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  align-items: center;
}

.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
  text-align: center;
}

.event-day {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.event-month {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.event-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modal Overlay & Modal Window */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 480px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-window {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-main);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border-left: 4px solid var(--color-primary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  min-width: 280px;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideInRight var(--transition-fast) forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-warning { border-left-color: var(--color-warning); }
.toast.toast-danger { border-left-color: var(--color-danger); }

.toast-message {
  font-size: 0.82rem;
  font-weight: 500;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

/* Inventory List Grid */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.inventory-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.inventory-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.inventory-count {
  font-family: var(--font-headings);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
}

.inventory-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
}

/* ==========================================
   QUICK DATE SELECTOR (Segment Controller)
   ========================================== */
.quick-date-selector {
  display: flex;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 10px;
}

.date-pill {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.date-pill svg {
  flex-shrink: 0;
}

.date-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.date-pill.active {
  background: linear-gradient(135deg, var(--color-primary), #0891b2);
  color: #000;
  font-weight: 700;
  box-shadow: var(--shadow-glow-cyan);
}

.date-pill.active svg {
  stroke: #000;
}

.quick-date-calendar-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}

.quick-date-calendar-wrap.open {
  max-height: 80px;
  opacity: 1;
}

/* Toggle Switch styling */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
  background-color: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.4);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(24px);
  background-color: var(--color-primary);
}

/* ==========================================
   9. RESPONSIVE DESIGN FOR DESKTOP VIEWS
   ========================================== */

/* Tablet & Mobile Landscape Viewports (<= 992px) */
@media (max-width: 992px) {
  .desktop-view {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .desktop-sidebar {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 540px !important;
    height: 64px !important;
    background: rgba(15, 22, 36, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: none !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 0 !important;
  }

  /* Hide the title, logo, and footer on tablet/mobile */
  .desktop-sidebar > div {
    display: none !important;
  }

  .sidebar-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .sidebar-menu-item {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .sidebar-menu-item a {
    font-size: 0 !important; /* Hide text */
    padding: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
  }

  .sidebar-menu-item a svg {
    margin: 0 !important;
    width: 20px;
    height: 20px;
    flex-shrink: 0 !important;
  }

  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .desktop-grid-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .desktop-content {
    padding-bottom: 80px !important; /* Bottom padding so content is not hidden by bottom navbar */
  }
}

/* Mobile Portrait Viewports (<= 768px) */
@media (max-width: 768px) {
  .dev-panel {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    text-align: center;
  }

  .dev-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Smaller Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .metrics-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .desktop-sidebar {
    padding: 6px 4px !important;
  }

  .sidebar-menu-item a {
    width: 38px !important;
    height: 38px !important;
    padding: 8px !important;
  }

  .sidebar-menu-item a svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
  }
}
