body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  margin: 0;
  min-height: 100vh;
}

#app { min-height: 100vh; }

/* Login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.login-box h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.login-box p { color: #94a3b8; margin: 0 0 1.5rem; font-size: 0.875rem; }
.login-box input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.login-box button {
  width: 100%;
  padding: 0.625rem;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
}
.login-box button:hover { background: #2563eb; }
.login-error { color: #f87171; font-size: 0.8rem; margin-bottom: 0.75rem; display: none; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #1e293b;
  border-right: 1px solid #334155;
  padding: 1rem 0;
  flex-shrink: 0;
}
.sidebar h2 {
  padding: 0 1rem;
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  letter-spacing: 0.025em;
}
.sidebar a {
  display: block;
  padding: 0.5rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}
.sidebar a:hover { color: #e2e8f0; background: #334155; }
.sidebar a.active { color: #3b82f6; border-left-color: #3b82f6; background: rgba(59,130,246,0.1); }
.sidebar .logout {
  margin-top: 2rem;
  color: #f87171;
}
.main { flex: 1; padding: 1.5rem; overflow-x: hidden; }

/* Cards */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h3 { margin: 0 0 1rem; font-size: 1rem; }

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
}
.stat-card .label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.stat-card .value.green { color: #4ade80; }
.stat-card .value.red { color: #f87171; }
.stat-card .value.blue { color: #60a5fa; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 0.625rem; border-bottom: 1px solid #334155; color: #94a3b8; font-weight: 500; }
td { padding: 0.625rem; border-bottom: 1px solid #1e293b; }
tr:hover td { background: rgba(51,65,85,0.3); }

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-outline { background: transparent; border: 1px solid #475569; color: #e2e8f0; }
.btn-outline:hover { background: #334155; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: #94a3b8; margin-bottom: 0.3rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.875rem;
  box-sizing: border-box;
}
.form-group textarea { min-height: 80px; resize: vertical; }

/* Badge */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-green { background: rgba(74,222,128,0.15); color: #4ade80; }
.badge-red { background: rgba(248,113,113,0.15); color: #f87171; }
.badge-blue { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-yellow { background: rgba(250,204,21,0.15); color: #facc15; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h3 { margin: 0 0 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* Snapshot */
.snapshot-container { text-align: center; }
.snapshot-container img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #334155;
}

/* Face grid */
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.face-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #334155;
}
.face-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.face-thumb .delete-face {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239,68,68,0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toggle */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute;
  inset: 0;
  background: #475569;
  border-radius: 24px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .slider { background: #3b82f6; }
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* Event thumbnails */
.event-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #334155;
  cursor: pointer;
  transition: transform 0.15s;
}
.event-thumb:hover { transform: scale(1.5); z-index: 10; position: relative; }

/* Event image modal */
.event-image-modal {
  text-align: center;
  max-width: 90vw;
}
.event-image-modal img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 8px;
  border: 1px solid #334155;
}

/* Pin button active state */
.btn-pin-active {
  background: rgba(250,204,21,0.15);
  color: #facc15;
  border: 1px solid rgba(250,204,21,0.3);
}
.btn-pin-active:hover { background: rgba(250,204,21,0.25); }

/* Recently detected people */
.recent-people { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.recent-person {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  cursor: default;
  min-width: 80px;
}
.recent-person-name { font-size: 0.8rem; font-weight: 500; }
.hover-preview {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  z-index: 50;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #475569;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.hover-preview img { display: block; max-width: 320px; max-height: 240px; }
.recent-person:hover .hover-preview { display: block; }

/* Responsive */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #334155; padding: 0.5rem; display: flex; gap: 0; flex-wrap: wrap; align-items: center; }
  .sidebar h2 { margin: 0 1rem 0 0; }
  .sidebar a { border-left: none; padding: 0.4rem 0.75rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
