/* Smart City Command Center - Clean White Theme */

/* ===== CSS Variables ===== */
:root {
  --background: #ffffff;
  --background-secondary: #f8fafc;
  --foreground: #1e293b;
  --card: #ffffff;
  --card-hover: #ffffff;
  --card-foreground: #1e293b;
  --primary: #3b82f6;
  --primary-light: #eff6ff;
  --primary-glow: rgba(59, 130, 246, 0.2);
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #475569;
  --muted: #f8fafc;
  --muted-foreground: #64748b;
  --accent: #06b6d4;
  --accent-light: #ecfeff;
  --accent-glow: rgba(6, 182, 212, 0.2);
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --destructive-light: #fef2f2;
  --destructive-glow: rgba(239, 68, 68, 0.2);
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --border-glow: rgba(59, 130, 246, 0.15);
  --input: #ffffff;
  --ring: #3b82f6;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --info: #0ea5e9;
  --info-light: #f0f9ff;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --pink: #ec4899;
  --pink-light: #fdf2f8;
  --orange: #f97316;
  --orange-light: #fff7ed;
  --chart-1: #3b82f6;
  --chart-2: #06b6d4;
  --chart-3: #10b981;
  --chart-4: #f59e0b;
  --chart-5: #8b5cf6;
  --glass: #ffffff;
  --glass-border: #e2e8f0;
  --shadow-color: rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 40px -10px rgba(15, 23, 42, 0.1);
  --gradient-start: #3b82f6;
  --gradient-end: #06b6d4;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #f8fafc;
  color-scheme: light;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #1e293b;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  position: relative;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 0 20px var(--primary-glow);
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
  50% { box-shadow: 0 0 30px var(--primary-glow), 0 0 40px var(--accent-glow); }
}

.logo-text h1 {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--foreground), var(--muted-foreground));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text p {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.time-display {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .time-display {
    display: flex;
  }
}

.time-display svg {
  color: var(--primary);
}

.time-display .date {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.time-display .time {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.live-indicator {
  position: relative;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success-glow);
}

.live-indicator::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: liveRipple 1.5s ease-out infinite;
}

@keyframes liveRipple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search Box */
.search-box {
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .search-box {
    display: block;
  }
}

.search-box input {
  width: 240px;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--foreground);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.search-box input::placeholder {
  color: var(--muted-foreground);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px var(--primary-glow);
}

.search-box svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  width: 16px;
  height: 16px;
}

/* Icon Buttons */
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--card-hover);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-2px);
}

.icon-btn.theme-toggle {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.icon-btn.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px var(--primary-glow);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--destructive);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--destructive-glow);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.user-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: all 0.3s ease;
}

.user-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px var(--primary-glow);
}

/* ===== Main Content ===== */
.main-content {
  padding: 1.5rem;
  padding-bottom: 7rem;
  min-height: calc(100vh - 70px);
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.filter-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-input {
  padding: 0.5rem 0.75rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 0.8125rem;
  transition: all 0.3s ease;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--primary-glow);
}

.filter-btn.secondary {
  background: var(--glass);
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: none;
}

.filter-btn.secondary:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-tag:hover {
  background: var(--destructive);
}

.filter-tag svg {
  width: 12px;
  height: 12px;
}

/* ===== Grid Layouts ===== */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== Cards ===== */
.card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

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

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header-left::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.section-header h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
}

.section-badge {
  padding: 0.25rem 0.625rem;
  background: var(--primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* ===== Stat Cards ===== */
.stat-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Colored Stat Cards */
.stat-card.blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}

.stat-card.blue .stat-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-card.cyan {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-color: #a5f3fc;
}

.stat-card.cyan .stat-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.stat-card.green {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #a7f3d0;
}

.stat-card.green .stat-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card.orange {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fed7aa;
}

.stat-card.orange .stat-icon {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.stat-card.purple {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #ddd6fe;
}

.stat-card.purple .stat-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-card.pink {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: #fbcfe8;
}

.stat-card.pink .stat-icon {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.stat-card.warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}

.stat-card.warning .stat-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card.critical {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fecaca;
}

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

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0.5rem 0;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-value .unit {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-left: 0.25rem;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.stat-change.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.stat-change.down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--destructive);
}

.stat-icon {
  position: relative;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.stat-sparkline {
  margin-top: 1rem;
  height: 40px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.sparkline-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px 2px 0 0;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.sparkline-bar:last-child {
  opacity: 1;
}

/* ===== Alert Items ===== */
.alert-item {
  position: relative;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.alert-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.alert-item:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 20px var(--shadow-color);
}

.alert-item.critical::before {
  background: var(--destructive);
  box-shadow: 0 0 10px var(--destructive-glow);
}

.alert-item.critical {
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-item.warning::before {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning-glow);
}

.alert-item.warning {
  border-color: rgba(245, 158, 11, 0.3);
}

.alert-item.info::before {
  background: var(--info);
  box-shadow: 0 0 10px var(--primary-glow);
}

.alert-item.info {
  border-color: rgba(14, 165, 233, 0.3);
}

.alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.alert-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
}

.alert-badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--destructive);
}

.alert-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.alert-badge.info {
  background: rgba(14, 165, 233, 0.15);
  color: var(--info);
}

.alert-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.alert-message {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.alert-location {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ===== Module Cards ===== */
.module-card {
  position: relative;
  display: block;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.module-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary);
}

/* Colored Module Cards */
.module-card.blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}

.module-card.cyan {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-color: #a5f3fc;
}

.module-card.green {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #a7f3d0;
}

.module-card.orange {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fed7aa;
}

.module-card.purple {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #ddd6fe;
}

.module-card.pink {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: #fbcfe8;
}

.module-card.yellow {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border-color: #fef08a;
}

.module-card.red {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fecaca;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.module-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.module-title .icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.module-title h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  animation: statusRipple 2s ease-out infinite;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 10px var(--success-glow);
}

.status-dot.online::after {
  border: 2px solid var(--success);
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning-glow);
}

.status-dot.warning::after {
  border: 2px solid var(--warning);
}

.status-dot.offline {
  background: var(--destructive);
  box-shadow: 0 0 10px var(--destructive-glow);
}

.status-dot.offline::after {
  border: 2px solid var(--destructive);
}

@keyframes statusRipple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.status-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.module-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.module-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.8125rem;
}

.module-stat-label {
  color: var(--muted-foreground);
}

.module-stat-value {
  font-weight: 600;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.module-stat-value.highlight {
  color: var(--primary);
}

/* ===== Data Tables ===== */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.data-table th.center { text-align: center; }
.data-table th.right { text-align: right; }

.data-table th.sortable {
  cursor: pointer;
  transition: color 0.3s ease;
}

.data-table th.sortable:hover {
  color: var(--primary);
}

.data-table th.sortable::after {
  content: '';
  display: inline-block;
  margin-left: 0.5rem;
  border: 4px solid transparent;
  border-top-color: currentColor;
  vertical-align: middle;
  opacity: 0.3;
}

.data-table th.sortable.asc::after {
  border-top-color: transparent;
  border-bottom-color: var(--primary);
  opacity: 1;
}

.data-table th.sortable.desc::after {
  border-top-color: var(--primary);
  opacity: 1;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  transition: background-color 0.3s ease;
}

.data-table td.center { text-align: center; }
.data-table td.right { text-align: right; }

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: all 0.3s ease;
}

.data-table tbody tr:hover td {
  background: var(--muted);
}

.data-table tbody tr:hover {
  box-shadow: inset 4px 0 0 var(--primary);
}

/* ===== Status Badges ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.status-badge.success::before {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-badge.warning::before {
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--destructive);
}

.status-badge.error::before {
  background: var(--destructive);
  box-shadow: 0 0 6px var(--destructive);
}

.status-badge.info {
  background: rgba(14, 165, 233, 0.15);
  color: var(--info);
}

.status-badge.info::before {
  background: var(--info);
  box-shadow: 0 0 6px var(--info);
}

.status-badge.default {
  background: var(--muted);
  color: var(--muted-foreground);
}

.status-badge.default::before {
  background: var(--muted-foreground);
}

/* ===== Charts ===== */
.chart-container {
  position: relative;
  height: 200px;
  background: var(--muted);
  border-radius: 12px;
  overflow: hidden;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 140px;
  padding: 1rem 0.5rem 0;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 6px 6px 0 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent);
}

.bar:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px var(--primary-glow);
}

.bar-label {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* ===== Progress Bars ===== */
.progress-bar {
  height: 8px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-fill.primary {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.progress-fill.success {
  background: var(--success);
}

.progress-fill.warning {
  background: var(--warning);
}

.progress-fill.danger {
  background: var(--destructive);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 0.75rem 1rem;
  z-index: 100;
  box-shadow: 0 -4px 30px var(--shadow-color);
  transition: transform 0.3s ease;
}

.bottom-nav.collapsed {
  transform: translateY(calc(100% - 48px));
}

.nav-toggle {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-toggle:hover {
  color: var(--primary);
  background: var(--card-hover);
}

.nav-items {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding: 0.25rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.nav-items::-webkit-scrollbar {
  height: 4px;
}

.nav-items::-webkit-scrollbar-track {
  background: transparent;
}

.nav-items::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.875rem;
  min-width: 76px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.nav-item span {
  font-size: 0.625rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--border);
}

.nav-item:hover svg {
  transform: scale(1.1);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.nav-item.active svg {
  transform: scale(1.15);
}

/* ===== Utility Classes ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.ml-auto { margin-left: auto; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted-foreground); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--destructive); }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease forwards;
}

/* ===== Print Styles ===== */
@media print {
  .header, .bottom-nav, .filter-bar { display: none; }
  .main-content { padding: 0; }
  .card, .stat-card, .module-card { 
    backdrop-filter: none; 
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
