/* =========================================================
   Admin Dashboard & Analytics Styling — Light / White Theme
   IIITDM Kurnool Campus Transit & Usage Portal
   ========================================================= */

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* White Theme Color Palette */
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-input: #ffffff;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-highlight: #bfdbfe;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --primary-blue: #2563eb;
  --primary-blue-dark: #1d4ed8;
  --primary-indigo: #4f46e5;
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #7c3aed;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   Authentication Overlay (Light Theme)
   ========================================================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #e2e8f0 0%, #cbd5e1 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  text-align: center;
  animation: authCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.auth-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-form {
  text-align: left;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.password-input-wrap input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.15s;
}

.btn-toggle-pwd:hover {
  color: var(--text-primary);
}

.hint-text {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.hint-text code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-blue);
  font-weight: 600;
}

.auth-error-msg {
  display: none;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 18px;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-secondary-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 18px;
  transition: color 0.15s;
}

.btn-secondary-link:hover {
  color: var(--text-primary);
}

/* =========================================================
   Admin Layout & Sidebar (Light Theme)
   ========================================================= */
.admin-app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs);
}

.sidebar-brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  background: #ffffff;
}

.brand-logo-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.brand-titles h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-titles span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-close-sidebar {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: auto;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.nav-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.nav-item:hover i {
  color: var(--primary-blue);
}

.nav-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
}

.nav-item.active i {
  color: #2563eb;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
}

.sidebar-ext-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s;
}

.sidebar-ext-link:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-sm);
  color: #e11d48;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: #ffe4e6;
  color: #be123c;
}

/* =========================================================
   Topbar Header & Date Filter (Light Theme)
   ========================================================= */
.admin-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background-color: var(--bg-main);
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-mobile-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

.topbar-page-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.topbar-page-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Date Filter Box (Clean White) */
.date-filter-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 5px 10px;
  border-radius: var(--radius-md);
}

.date-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-blue);
  white-space: nowrap;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-picker-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.date-picker-input:focus {
  border-color: var(--primary-blue);
}

.quick-date-pills {
  display: flex;
  gap: 4px;
}

.date-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.date-pill:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.date-pill.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #ffffff;
  font-weight: 700;
}

.btn-topbar-refresh {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s;
}

.btn-topbar-refresh:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #94a3b8;
}

/* =========================================================
   Content Container & Panes
   ========================================================= */
.admin-content-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 48px;
  background: var(--bg-main);
}

.tab-pane {
  display: none;
  animation: tabFadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Date Status Banner */
.date-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.banner-text {
  font-size: 0.9rem;
  color: #1e3a8a;
}

.banner-text strong {
  color: #0f172a;
}

.fleet-pill {
  font-size: 0.82rem;
  color: #334155;
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
}

.fleet-pill strong {
  color: #1d4ed8;
}

/* Section Cards (Pure White) */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

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

.header-titles {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.bus-icon { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.web-icon { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.stats-icon { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.log-icon { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

.header-titles h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-titles p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* Status Badges */
.status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge.active,
.status-badge.Active {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.status-badge.completed,
.status-badge.Completed {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.status-badge.not-started,
.status-badge[data-status="Not Started"] {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.status-badge.offline,
.status-badge.Offline {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.info-pill {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  transition: all 0.15s;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* =========================================================
   Metrics Grid & Metric Cards (Light Theme)
   ========================================================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.metric-card.highlight-card {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.metric-card.highlight-card:hover {
  background: #e0f2fe;
}

.metric-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-purple { background: #f5f3ff; color: #7c3aed; }
.icon-emerald { background: #ecfdf5; color: #059669; }
.icon-amber { background: #fffbeb; color: #d97706; }
.icon-cyan { background: #ecfeff; color: #0284c7; }
.icon-rose { background: #fff1f2; color: #e11d48; }
.icon-indigo { background: #e0e7ff; color: #4338ca; }

.metric-body {
  flex: 1;
  min-width: 0;
}

.metric-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.metric-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-value.text-xl {
  font-size: 1.85rem;
  color: #1d4ed8;
}

.metric-value-sm {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.metric-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================
   Hourly Chart Styling (Light Theme)
   ========================================================= */
.chart-box-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
}

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

.chart-title-group h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-title-group span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 4px;
}

.normal-dot { background: #3b82f6; }
.peak-dot { background: #f59e0b; }

.hourly-chart-wrapper {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-top: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.hourly-chart-wrapper.full-chart {
  height: 240px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.chart-bar-wrap {
  width: 100%;
  max-width: 24px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  transition: height 0.3s ease, background 0.2s, transform 0.15s;
  min-height: 4px;
}

.chart-col:hover .chart-bar {
  filter: brightness(1.15);
  transform: scaleY(1.03);
}

.chart-bar.is-peak {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.chart-col-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.chart-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.chart-col:hover .chart-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* =========================================================
   Daily Logs Table & Bus Metadata Banner (Light Theme)
   ========================================================= */
.bus-meta-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-item strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th {
  padding: 12px 14px;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e2e8f0;
  background: #f8fafc;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
}

.admin-table tbody tr {
  transition: background 0.15s;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.admin-table td strong {
  color: var(--text-primary);
}

/* =========================================================
   Website Analytics Specifics & Breakdown
   ========================================================= */
.analytics-notice-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
}

.notice-icon {
  font-size: 1.3rem;
  color: #2563eb;
}

.notice-text {
  font-size: 0.86rem;
  color: #1e3a8a;
}

.notice-text strong {
  color: #0f172a;
}

.notice-text code {
  background: #dbeafe;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1d4ed8;
  font-weight: 700;
}

.date-indicator {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 4px 10px;
  border-radius: 6px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.breakdown-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
}

.breakdown-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.breakdown-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.breakdown-count-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breakdown-count {
  font-size: 0.88rem;
  font-weight: 800;
  color: #2563eb;
}

.insights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insights-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.text-emerald { color: #059669; }
.text-blue { color: #2563eb; }

/* =========================================================
   Admin Modals (Light Theme)
   ========================================================= */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.admin-modal-card {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap i {
  color: #2563eb;
  font-size: 1.1rem;
}

.modal-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

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

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
  background: #ffffff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-readonly {
  background: #f1f5f9 !important;
  color: #0369a1 !important;
  font-weight: 700;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #94a3b8;
}

/* =========================================================
   Mobile Responsiveness
   ========================================================= */
@media (max-width: 992px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 90;
  }

  .admin-backdrop.active {
    display: block;
  }

  .btn-close-sidebar {
    display: block;
  }

  .btn-mobile-menu {
    display: block;
  }

  .admin-topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }

  .date-filter-box {
    flex: 1;
  }

  .admin-content-container {
    padding: 16px;
  }

  .date-status-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
