/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --sidebar-bg: #1a2332;
  --sidebar-width: 240px;
  --accent: #0d6efd;
  --accent-green: #198754;
  --header-height: 60px;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
body { background: #f0f2f5; font-family: 'Segoe UI', system-ui, sans-serif; }

#wrapper { min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #c8d0dc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.brand-sub {
  font-size: 0.72rem;
  color: #7a8a9a;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#sidebar .nav-link {
  color: #a0aab8;
  padding: 9px 20px;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

#sidebar .nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.05);
}

#sidebar .nav-link.active {
  color: #ffffff;
  background: rgba(13,110,253,0.15);
  border-left-color: var(--accent);
}

.nav-section {
  padding: 14px 20px 4px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a5568;
  list-style: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.82rem;
}

.user-info { color: #a0aab8; }

/* ── Page content ──────────────────────────────────────────────────────────── */
#page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 28px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-body { padding: 24px 28px; flex: 1; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card { border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card-header { background: #f8f9fa; border-bottom: 1px solid #e2e8f0; font-weight: 600; font-size: 0.875rem; }
.table { font-size: 0.875rem; }
.table thead th { background: #f8f9fa; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; border-bottom: 2px solid #e2e8f0; }

/* ── Camera cards ──────────────────────────────────────────────────────────── */
.camera-card { border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; }

.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.camera-name { font-weight: 600; font-size: 0.9rem; }

.status-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: #e9ecef;
  color: #6b7280;
}

.status-badge.active {
  background: #d1fae5;
  color: #065f46;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.camera-frame-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: #0d1117;
}

.camera-frame {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.camera-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.stat-item { text-align: center; }
.stat-label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; }
.stat-value { display: block; font-size: 1.1rem; font-weight: 700; color: #1a2332; margin-top: 2px; }
.plate-value { font-family: monospace; font-size: 0.9rem; letter-spacing: 0.05em; }

.camera-actions { padding: 12px 16px; }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #1a2332 0%, #2d3f56 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  font-size: 2.5rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 12px;
}

.login-title {
  text-align: center;
  font-weight: 800;
  color: #1a2332;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.btn-login { padding: 10px; font-size: 0.95rem; font-weight: 600; }

.login-footer {
  text-align: center;
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 20px;
  margin-bottom: 0;
}

/* ── Event detail ──────────────────────────────────────────────────────────── */
.detail-list { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 16px; }
.detail-list dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af; display: flex; align-items: center; }
.detail-list dd { margin: 0; font-size: 0.9rem; }

.big-count { font-size: 4rem; font-weight: 800; color: #1a2332; line-height: 1; }
.big-count-label { color: #9ca3af; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* ── Activity badges ───────────────────────────────────────────────────────── */
.activity-badge { font-size: 0.75rem; }
.activity-loading { background: #dbeafe; color: #1d4ed8; }
.activity-unloading { background: #fef3c7; color: #92400e; }
.activity-mixed { background: #f3e8ff; color: #7e22ce; }
.activity-empty { background: #f3f4f6; color: #6b7280; }
.activity-unclear { background: #f3f4f6; color: #6b7280; }

/* ── Admin cards ───────────────────────────────────────────────────────────── */
.admin-card { transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; }
.admin-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

/* ── Pulse dot ─────────────────────────────────────────────────────────────── */
.pulse-dot { animation: pulse 2s infinite; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { width: 200px; }
  .content-body { padding: 16px; }
}
