/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Varitech Webcams - Alpine Light Theme
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-surface: #f1f5f9;
  --bg-input: #f8fafc;

  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --border-focus: #0ea5e9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #0284c7;

  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-glow: rgba(14, 165, 233, 0.08);
  --accent-secondary: #06b6d4;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 4px 20px rgba(14, 165, 233, 0.12);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  --transition: 0.2s ease;
}

/* ── Reset ─────────────────────────────────────────── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Header ────────────────────────────────────────── */

.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover {
  color: var(--text-primary);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
}

.logo-brand {
  font-size: 1.2rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--text-accent);
  background: var(--accent-glow);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ── Main Content ──────────────────────────────────── */

.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Page Hero ─────────────────────────────────────── */

.page-hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #0f172a, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: 1.5rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  font-weight: 500;
}

/* ── Status Bar ────────────────────────────────────── */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0.875rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-item i {
  color: var(--accent);
  font-size: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.stale { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.offline { background: var(--danger); }

/* ── Center Cards (Landing Page) ───────────────────── */

.centers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.center-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.center-card:hover {
  transform: translateY(-4px);
  border-color: #bae6fd;
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.12);
}

.center-card-bg {
  height: 260px;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.center-card-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(14, 165, 233, 0.08), transparent 70%);
}

.center-card-bg img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.center-card-bg .center-icon {
  font-size: 4rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.center-card-body {
  padding: 1.5rem;
}

.center-card-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.center-card-city {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.center-card-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.center-stat {
  display: flex;
  flex-direction: column;
}

.center-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.center-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.center-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.center-card-link:hover {
  color: inherit;
}

.no-cameras-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  color: #d97706;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ── Section Title ─────────────────────────────────── */

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-title i {
  color: var(--accent);
}

/* ── Stats Grid (Center Page) ─────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Camera Grid ───────────────────────────────────── */

.cameras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.camera-card:hover {
  border-color: #bae6fd;
  box-shadow: var(--shadow-md);
}

.camera-card-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.camera-info {
  flex: 1;
  min-width: 0;
}

.camera-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camera-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.camera-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.camera-badge.online {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.camera-badge.stale {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.camera-badge.offline {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Camera Image */

.camera-image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-primary);
  overflow: hidden;
  cursor: pointer;
}

.camera-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.camera-image-wrap:hover img {
  transform: scale(1.03);
}

.camera-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.5));
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.camera-image-wrap:hover .camera-overlay {
  opacity: 1;
}

.camera-overlay-text {
  color: white;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.no-image {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 0.5rem;
}

.no-image i {
  font-size: 2.5rem;
  opacity: 0.3;
}

.no-image span {
  font-size: 0.85rem;
}

/* Camera Footer */

.camera-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.camera-time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.camera-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-muted);
  font-size: 0.7rem;
  opacity: 0.7;
}

/* ── Image Modal ───────────────────────────────────── */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  animation: modalFadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-info {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ── Breadcrumb ────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--text-accent);
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ── Camera Detail Page ────────────────────────────── */

.camera-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.camera-detail-image {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.camera-detail-image img {
  width: 100%;
  display: block;
  cursor: pointer;
}

.camera-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.detail-card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.history-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--accent);
}

.history-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.history-item-time {
  padding: 0.35rem 0.5rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── URL Copy ──────────────────────────────────────── */

.url-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.url-box code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.url-copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
}

.url-copy-btn:hover {
  color: var(--accent);
}

/* ── Footer ────────────────────────────────────────── */

.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text-accent);
}

.footer-sep {
  opacity: 0.3;
  margin: 0 0.5rem;
}

/* ── Loading Spinner ───────────────────────────────── */

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Auto-Refresh Indicator ────────────────────────── */

.refresh-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.refresh-bar i {
  color: var(--accent);
}

/* ── Empty State ───────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ── Animations ────────────────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.5s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }
.fade-in:nth-child(6) { animation-delay: 0.3s; }
.fade-in:nth-child(7) { animation-delay: 0.35s; }
.fade-in:nth-child(8) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 768px) {
  .header-inner {
    padding: 0 1rem;
  }

  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    flex-direction: column;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .mobile-toggle {
    display: block;
  }

  .main {
    padding: 1.5rem 1rem 3rem;
  }

  .page-hero {
    padding: 2rem 0.5rem 1.5rem;
  }

  .centers-grid {
    grid-template-columns: 1fr;
  }

  .cameras-grid {
    grid-template-columns: 1fr;
  }

  .status-bar {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .refresh-bar {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    justify-content: center;
  }
}

@media (min-width: 1200px) {
  .camera-detail {
    grid-template-columns: 2fr 1fr;
  }
}

/* ── Admin Styles (same file) ──────────────────────── */

.admin-layout {
  min-height: 100vh;
  background: var(--bg-primary);
}

.admin-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-center-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-center-select label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.admin-center-select select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.admin-btn-primary {
  background: var(--accent);
  color: white;
}

.admin-btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}

.admin-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.admin-btn-danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

.admin-btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.admin-btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.admin-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.admin-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-stat-value.success { color: var(--success); }
.admin-stat-value.warning { color: var(--warning); }
.admin-stat-value.danger { color: var(--danger); }

/* Admin Camera Cards */

.admin-cameras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.25rem;
}

.admin-camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.admin-camera-card.disabled {
  opacity: 0.6;
  border-left: 3px solid var(--danger);
}

.admin-camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.admin-camera-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-accent);
}

.admin-camera-form {
  padding: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Toggle Switch */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.toggle-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 26px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

.save-btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.save-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.save-btn.success {
  background: var(--success);
}

.save-btn.error {
  background: var(--danger);
}

.admin-camera-status {
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Login Page */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 1rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  font-size: 1.5rem;
}

.login-logo h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-error {
  background: #fef2f2;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #dc2626;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.login-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Add Camera Modal */

.add-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.add-modal-overlay.active {
  display: flex;
}

.add-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  margin: 1rem;
}

.add-modal h3 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.add-modal-actions .admin-btn {
  flex: 1;
  justify-content: center;
  padding: 0.7rem;
}

/* ── 404 Page ──────────────────────────────────────── */

.page-404 {
  text-align: center;
  padding: 6rem 2rem;
}

.page-404 h1 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--text-muted);
  opacity: 0.3;
}

.page-404 h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.page-404 a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-top: 1rem;
}

.page-404 a:hover {
  background: var(--accent-hover);
  color: white;
}

/* ── Download Button ───────────────────────────────── */

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem;
  margin-top: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.download-btn:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
}

/* ── Disclaimer ───────────────────────────────────── */

.disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.disclaimer-box i {
  color: var(--warning);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Press Page ───────────────────────────────────── */

.prensa-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.prensa-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #0f172a, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prensa-hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.prensa-section {
  margin-bottom: 2.5rem;
}

.prensa-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.prensa-section h2 i {
  color: var(--accent);
}

.prensa-cameras {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.prensa-camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.prensa-camera-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.prensa-camera-body {
  padding: 1rem 1.25rem;
}

.prensa-camera-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.prensa-camera-body .url-box {
  margin-top: 0.5rem;
}

.prensa-camera-body .url-box code {
  font-size: 0.7rem;
}

.prensa-camera-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.prensa-camera-actions a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}

.prensa-btn-download {
  background: var(--accent);
  color: white;
}

.prensa-btn-download:hover {
  background: var(--accent-hover);
  color: white;
}

.prensa-btn-detail {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.prensa-btn-detail:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.prensa-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.prensa-info-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prensa-info-card h3 i {
  color: var(--accent);
}

.prensa-info-card p, .prensa-info-card li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.prensa-info-card ul {
  list-style: none;
  padding: 0;
}

.prensa-info-card li::before {
  content: '→ ';
  color: var(--accent);
  font-weight: 600;
}

.prensa-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .prensa-cameras {
    grid-template-columns: 1fr;
  }
  .prensa-info-grid {
    grid-template-columns: 1fr;
  }
  .prensa-camera-actions {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .admin-cameras-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .admin-header-left {
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
