*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────── */
.header {
  background: #1a5276;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  z-index: 1000;
}
.header h1 { font-size: 1.1rem; font-weight: 600; }
.header .subtitle { font-size: .75rem; opacity: .8; }

/* ── Map ─────────────────────────────────────────────── */
#map { flex: 1; z-index: 0; }

/* ── Sidebar (admin) ─────────────────────────────────── */
.layout { display: flex; flex: 1; overflow: hidden; }
.sidebar {
  width: 320px;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-section { padding: 12px 14px; border-bottom: 1px solid #e2e8f0; }
.sidebar-section h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #718096; margin-bottom: 8px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px; font-size: .875rem; font-weight: 500;
  border: none; cursor: pointer; transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #1a5276; color: white; }
.btn-primary:hover:not(:disabled) { background: #154360; }
.btn-success { background: #27ae60; color: white; }
.btn-success:hover:not(:disabled) { background: #1e8449; }
.btn-danger  { background: #e74c3c; color: white; }
.btn-danger:hover:not(:disabled) { background: #c0392b; }
.btn-warning { background: #f39c12; color: white; }
.btn-warning:hover:not(:disabled) { background: #d68910; }
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-block { width: 100%; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: #4a5568; }
.form-control {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 6px;
  font-size: .875rem; background: white; color: #1a202c;
}
.form-control:focus { outline: none; border-color: #1a5276; box-shadow: 0 0 0 2px rgba(26,82,118,.2); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: white; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px;
}
.card-title { font-weight: 600; font-size: .9rem; }
.card-meta  { font-size: .78rem; color: #718096; margin-top: 2px; }

/* ── Status badges ───────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
}
.badge-online  { background: #c6f6d5; color: #22543d; }
.badge-offline { background: #fed7d7; color: #742a2a; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-accepted { background: #bfdbfe; color: #1e3a8a; }
.badge-done     { background: #d1fae5; color: #065f46; }

/* ── Login page ──────────────────────────────────────── */
.login-wrap {
  max-width: 360px; margin: 80px auto; background: white;
  border-radius: 12px; padding: 32px; box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.login-wrap h2 { margin-bottom: 24px; font-size: 1.3rem; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white; border-radius: 12px; padding: 24px;
  width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Connection banner ───────────────────────────────── */
.conn-banner {
  background: #e74c3c; color: white; text-align: center;
  padding: 6px; font-size: .82rem; font-weight: 600;
  display: none;
}
.conn-banner.visible { display: block; }

/* ── Staff location panel ────────────────────────────── */
.location-panel {
  background: white; border-top: 1px solid #e2e8f0;
  padding: 12px 16px; flex-shrink: 0;
}
.location-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e0; }
.dot.active { background: #27ae60; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ── Request list ────────────────────────────────────── */
.request-item {
  padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 8px; background: white;
}
.request-item.new { border-color: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }
.request-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ── Tab bar ─────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid #e2e8f0; background: white; flex-shrink: 0; }
.tab {
  flex: 1; padding: 10px; font-size: .82rem; font-weight: 600; text-align: center;
  cursor: pointer; color: #718096; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab.active { color: #1a5276; border-bottom-color: #1a5276; }
.tab-panel { display: none; overflow-y: auto; }
.tab-panel.active { display: block; flex: 1; }

/* ── Floating action button (mobile public) ──────────── */
.fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  width: 56px; height: 56px; border-radius: 50%;
  background: #1a5276; color: white; font-size: 1.5rem;
  border: none; box-shadow: 0 4px 12px rgba(0,0,0,.3);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

@media (max-width: 640px) {
  .sidebar { display: none; }
}
