/* ═══════════════════════════════════════════════════════════════
   e-Beat System — Web Dashboard CSS
   SHO / DSP / ASP / SP Supervisor Console
═══════════════════════════════════════════════════════════════ */

/* ─── DASHBOARD SCREEN ───────────────────────────────────────── */
.dashboard-screen {
  background: var(--c-bg) !important;
}

.dashboard-layout {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ─── SIDEBAR ───────────────────────────────────────────────── */
.dash-sidebar {
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--t-med), width var(--t-med);
  overflow: hidden;
  z-index: 20;
}

.dash-sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(135deg, rgba(30,58,138,0.3), rgba(15,23,42,0.5));
}
.sidebar-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.sidebar-app-name { font-size: 0.95rem; font-weight: 800; color: var(--c-text); }
.sidebar-role-badge {
  display: inline-block;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--c-gold);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px var(--space-md);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-3);
  transition: all var(--t-fast);
  white-space: nowrap;
  width: 100%;
  text-align: left;
}
.sidebar-nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.sidebar-nav-item.active {
  background: rgba(37,99,235,0.15);
  color: var(--c-accent-light);
  border-left: 3px solid var(--c-accent-light);
}
.sidebar-badge {
  margin-left: auto;
  background: var(--c-danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--c-border);
}
.sidebar-logout {
  width: 100%;
  padding: 10px var(--space-md);
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: var(--r-md);
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  transition: all var(--t-fast);
}
.sidebar-logout:hover { background: rgba(220,38,38,0.2); }

/* ─── MAIN AREA ─────────────────────────────────────────────── */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TOP BAR ───────────────────────────────────────────────── */
.dash-topbar {
  height: 64px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  flex-shrink: 0;
}
.sidebar-toggle {
  font-size: 1.4rem;
  color: var(--c-text-3);
  display: none;
  transition: color var(--t-fast);
}
.sidebar-toggle:hover { color: var(--c-text); }
.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 1rem; font-weight: 700; color: var(--c-text); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.topbar-time { font-size: 0.8rem; color: var(--c-text-4); font-variant-numeric: tabular-nums; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--c-surface-2);
  padding: 6px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  font-size: 0.85rem;
  color: var(--c-text-2);
}
.topbar-avatar { font-size: 1.1rem; }
.topbar-icon-btn { font-size: 1.2rem; position: relative; }

/* ─── NOTIFICATION BELL DROPDOWN ────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
  animation: notifSlide 0.2s ease;
}
@keyframes notifSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.notif-panel.hidden { display: none; }
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-text);
  background: var(--c-surface-2);
}
.notif-view-all {
  font-size: 0.75rem;
  color: var(--c-accent-light);
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--r-full);
  transition: all var(--t-fast);
}
.notif-view-all:hover { background: rgba(59,130,246,0.1); }
.notif-list {
  max-height: 380px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-fast);
  cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--c-surface-2); }
.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.notif-icon-red   { background: rgba(220,38,38,0.15); }
.notif-icon-amber { background: rgba(217,119,6,0.15); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-sub {
  font-size: 0.72rem;
  color: var(--c-text-4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-empty {
  padding: 2rem;
  text-align: center;
  color: var(--c-text-4);
  font-size: 0.85rem;
}

/* ─── CONTENT AREA ──────────────────────────────────────────── */
.dash-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
}

.dash-panel {
  display: none;
  flex-direction: column;
  gap: var(--space-lg);
  flex: 1;
}
.dash-panel.active { display: flex; }

/* ─── KPI CARDS ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.kpi-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--t-fast);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--c-border-2); }
.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.kpi-blue { background: rgba(37,99,235,0.15); }
.kpi-green { background: rgba(22,163,74,0.15); }
.kpi-yellow { background: rgba(217,119,6,0.15); }
.kpi-red { background: rgba(220,38,38,0.15); }
.kpi-info { flex: 1; min-width: 0; }
.kpi-val { font-size: 1.8rem; font-weight: 800; color: var(--c-text); line-height: 1; }
.kpi-label { font-size: 0.78rem; color: var(--c-text-3); margin-top: 4px; }
.kpi-trend {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
}
.kpi-trend.up { color: #4ade80; background: rgba(22,163,74,0.15); }
.kpi-trend.down { color: #f87171; background: rgba(220,38,38,0.15); }
.kpi-trend.alert { color: #fbbf24; background: rgba(217,119,6,0.15); }

/* ─── CHARTS ────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.chart-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  border: 1px solid var(--c-border);
}
.chart-card canvas {
  max-height: 220px !important;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.chart-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--c-text); }
.chart-period {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-3);
  font-size: 0.78rem;
  padding: 4px 10px;
}

/* ─── BOTTOM GRID ───────────────────────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.mini-list-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  border: 1px solid var(--c-border);
}
.mini-list-card h3 { font-size: 0.9rem; font-weight: 700; color: var(--c-text); margin-bottom: var(--space-md); }
.mini-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.mini-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--c-border);
}
.mini-list-item:last-child { border-bottom: none; }
.mli-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mli-dot.green { background: var(--c-success-light); }
.mli-dot.yellow { background: #fbbf24; }
.mli-dot.red { background: #f87171; }
.mli-title { display: block; font-size: 0.82rem; color: var(--c-text-2); }
.mli-time { display: block; font-size: 0.72rem; color: var(--c-text-4); margin-top: 1px; }

/* ─── BEAT MONITORING ───────────────────────────────────────── */
.beat-filter-bar {
  display: flex;
  gap: var(--space-md);
}
.dash-search {
  flex: 1;
  padding: 10px 16px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: 0.9rem;
}
.dash-search:focus { outline: none; border-color: var(--c-accent); }
.dash-select {
  padding: 10px 16px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-3);
  font-size: 0.85rem;
  appearance: none;
  min-width: 140px;
}

.beats-table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
}
.beats-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
}
.beats-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-4);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.beats-table td {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--c-text-2);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.beats-table tbody tr { transition: background var(--t-fast); }
.beats-table tbody tr:hover { background: var(--c-surface-2); }
.beats-table tbody tr:last-child td { border-bottom: none; }

.progress-bar {
  height: 20px;
  background: var(--c-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  min-width: 80px;
}
.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
}
.progress-fill.warn { background: var(--grad-danger); }

/* ─── DASH MAP ──────────────────────────────────────────────── */
.dash-map-header { display: flex; justify-content: flex-end; }
.map-controls { display: flex; gap: var(--space-sm); }
.map-ctrl-btn {
  padding: 8px 16px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-3);
  transition: all var(--t-fast);
}
.map-ctrl-btn.active, .map-ctrl-btn:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: white;
}
.dash-map-container {
  flex: 1;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--c-border);
  min-height: 400px;
}

/* ─── REPORTS ───────────────────────────────────────────────── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.report-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--t-fast);
}
.report-card:hover { border-color: var(--c-accent); transform: translateY(-2px); }
.report-icon { font-size: 2rem; }
.report-info { flex: 1; }
.report-info h3 { font-size: 0.95rem; font-weight: 700; color: var(--c-text); }
.report-info p { font-size: 0.78rem; color: var(--c-text-3); margin-top: 3px; }
.report-actions { display: flex; gap: var(--space-sm); flex-shrink: 0; }
.report-chart-card { margin-top: var(--space-sm); }

/* ─── OFFICERS ──────────────────────────────────────────────── */
.officers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}
.officer-profile-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-xl) var(--space-lg);
  border: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--t-fast);
}
.officer-profile-card:hover { border-color: var(--c-accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.opc-avatar { font-size: 3rem; margin-bottom: var(--space-sm); }
.opc-name { font-size: 1rem; font-weight: 700; color: var(--c-text); }
.opc-badge { font-size: 0.75rem; color: var(--c-text-4); margin: 3px 0; }
.opc-beat {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-accent-light);
  background: rgba(37,99,235,0.1);
  padding: 4px 12px;
  border-radius: var(--r-full);
  margin-bottom: var(--space-sm);
}
.opc-status { font-size: 0.8rem; font-weight: 600; margin-bottom: var(--space-md); }
.active-status { color: var(--c-success-light); }
.sos-status { color: #f87171; }
.opc-actions { display: flex; gap: var(--space-sm); width: 100%; }
.opc-actions .btn { flex: 1; justify-content: center; }

/* ─── ALERTS PANEL ──────────────────────────────────────────── */
.alerts-list { display: flex; flex-direction: column; gap: var(--space-md); }
.alert-detail-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  border: 1px solid var(--c-border);
}
.sos-alert { border-color: rgba(220,38,38,0.4); background: rgba(220,38,38,0.04); }
.suspicious-alert { border-color: rgba(217,119,6,0.3); background: rgba(217,119,6,0.03); }
.adc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.adc-type { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em; }
.adc-type.sos { color: #f87171; }
.adc-type.suspicious { color: #fbbf24; }
.adc-time { font-size: 0.78rem; color: var(--c-text-4); }
.adc-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-lg); }
.adc-body p { font-size: 0.875rem; color: var(--c-text-2); }
.adc-footer { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .officers-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .dash-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; }
  .dash-content { padding: var(--space-md); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .topbar-time { display: none; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-val { font-size: 1.4rem; }
  .officers-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   SYSTEM ADMIN PANEL CSS
═══════════════════════════════════════════════════════════════ */
.admin-layout {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background: var(--c-bg);
}

/* ─── ADMIN SIDEBAR ─────────────────────────────────────────── */
.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0d0d1a 0%, #0a0a14 100%);
  border-right: 1px solid rgba(139,92,246,0.2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--t-med);
  z-index: 20;
}
.admin-sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid rgba(139,92,246,0.2);
  background: rgba(139,92,246,0.08);
}
.admin-logo-wrap {
  width: 44px;
  height: 44px;
  background: rgba(139,92,246,0.2);
  border-radius: 50%;
  border: 2px solid rgba(139,92,246,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.admin-app-name { font-size: 0.95rem; font-weight: 800; color: #e2c4ff; }
.admin-role-badge {
  display: inline-block;
  background: rgba(139,92,246,0.2);
  border: 1px solid rgba(139,92,246,0.4);
  color: #c084fc;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 11px var(--space-md);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(200,180,255,0.6);
  transition: all var(--t-fast);
  width: 100%;
  text-align: left;
}
.admin-nav-item:hover { background: rgba(139,92,246,0.1); color: #e2c4ff; }
.admin-nav-item.active {
  background: rgba(139,92,246,0.2);
  color: #c084fc;
  border-left: 3px solid #9333ea;
}
.admin-sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(139,92,246,0.2);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.admin-system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(200,180,255,0.5);
}
.status-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: blink 2s ease-in-out infinite;
}
.admin-logout-btn {
  width: 100%;
  padding: 9px var(--space-md);
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: var(--r-md);
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  transition: all var(--t-fast);
}
.admin-logout-btn:hover { background: rgba(220,38,38,0.2); }

/* ─── ADMIN MAIN ────────────────────────────────────────────── */
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── ADMIN TOPBAR ──────────────────────────────────────────── */
.admin-topbar {
  height: 64px;
  background: var(--c-surface);
  border-bottom: 1px solid rgba(139,92,246,0.2);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  flex-shrink: 0;
}
.admin-menu-toggle {
  font-size: 1.4rem;
  color: #c084fc;
  display: none;
  transition: color var(--t-fast);
}
.admin-topbar-title { flex: 1; }
.admin-topbar-title h1 { font-size: 1rem; font-weight: 700; color: var(--c-text); }
.admin-topbar-right { display: flex; align-items: center; gap: var(--space-md); }
.admin-topbar-time { font-size: 0.8rem; color: var(--c-text-4); font-variant-numeric: tabular-nums; }
.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.3);
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  color: #c084fc;
}
.admin-avatar { font-size: 1.1rem; }

/* ─── ADMIN CONTENT ─────────────────────────────────────────── */
.admin-content { flex: 1; overflow-y: auto; padding: var(--space-xl); }
.admin-panel { display: none; flex-direction: column; gap: var(--space-lg); }
.admin-panel.active { display: flex; }
.admin-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

/* ─── ADMIN KPI CARDS ───────────────────────────────────────── */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.admin-kpi-card {
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--t-fast);
}
.admin-kpi-card:hover { transform: translateY(-2px); }
.akpi-blue  { background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.2); }
.akpi-green { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.2); }
.akpi-gold  { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }
.akpi-red   { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.2); }
.akpi-icon { font-size: 1.8rem; flex-shrink: 0; }
.akpi-info { flex: 1; }
.akpi-val { font-size: 1.8rem; font-weight: 800; color: var(--c-text); line-height: 1; }
.akpi-label { font-size: 0.75rem; color: var(--c-text-3); margin-top: 4px; }
.akpi-trend {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: rgba(139,92,246,0.15);
  color: #c084fc;
}

/* ─── QUICK CONTROLS ────────────────────────────────────────── */
.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}
.admin-quick-card {
  background: var(--c-surface);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--r-xl);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--t-fast);
  cursor: pointer;
}
.admin-quick-card:hover {
  background: rgba(139,92,246,0.1);
  border-color: #9333ea;
  transform: translateY(-2px);
}
.admin-danger-card { border-color: rgba(220,38,38,0.3) !important; }
.admin-danger-card:hover { background: rgba(220,38,38,0.1) !important; border-color: var(--c-danger) !important; }
.aqc-icon { font-size: 1.6rem; }
.aqc-label { font-size: 0.78rem; font-weight: 600; color: var(--c-text-2); }

/* ─── SYSTEM HEALTH ─────────────────────────────────────────── */
.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}
.admin-health-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--space-md);
}
.health-label { font-size: 0.78rem; color: var(--c-text-3); margin-bottom: 8px; font-weight: 600; }
.health-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 6px;
}
.health-bar { height: 100%; border-radius: var(--r-full); transition: width 1s ease; }
.health-val { font-size: 0.72rem; color: var(--c-text-4); }

/* ─── ADMIN BAR ─────────────────────────────────────────────── */
.admin-actions-bar {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-md);
}
.admin-search-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: 0.9rem;
}
.admin-search-input:focus { outline: none; border-color: #9333ea; }

/* ─── ADMIN TABLE ───────────────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
}
.admin-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-4);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.admin-table td {
  padding: 12px 14px;
  font-size: 0.83rem;
  color: var(--c-text-2);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: rgba(139,92,246,0.04); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-row-highlight { background: rgba(139,92,246,0.06) !important; }

/* Role Chips */
.role-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.chip-field   { background: rgba(37,99,235,0.15); color: #93c5fd; }
.chip-super   { background: rgba(245,158,11,0.15); color: var(--c-gold); }
.chip-sp      { background: rgba(239,68,68,0.15); color: #fca5a5; }
.chip-admin   { background: rgba(139,92,246,0.2); color: #c084fc; border: 1px solid rgba(139,92,246,0.4); }

/* Status Chips */
.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.green-chip  { background: rgba(22,163,74,0.15); color: #4ade80; }
.yellow-chip { background: rgba(245,158,11,0.15); color: #fbbf24; }
.red-chip    { background: rgba(220,38,38,0.15); color: #f87171; }

.icon-btn-sm {
  padding: 4px 8px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  transition: all var(--t-fast);
  cursor: pointer;
}
.icon-btn-sm:hover { background: var(--c-border); }

/* ─── AUDIT LOG ─────────────────────────────────────────────── */
.admin-log-list { display: flex; flex-direction: column; gap: 1px; }
.admin-log-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-fast);
}
.admin-log-item:hover { background: var(--c-surface-2); }
.log-time { font-size: 0.75rem; color: var(--c-text-4); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 56px; }
.log-badge {
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.log-info    { background: rgba(37,99,235,0.15); color: #93c5fd; }
.log-success { background: rgba(22,163,74,0.15); color: #4ade80; }
.log-warn    { background: rgba(245,158,11,0.15); color: #fbbf24; }
.log-danger  { background: rgba(220,38,38,0.15); color: #f87171; }
.log-msg { font-size: 0.82rem; color: var(--c-text-2); }

/* ─── BACKUP CARDS ──────────────────────────────────────────── */
.admin-backup-grid { display: flex; flex-direction: column; gap: var(--space-md); }
.admin-backup-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  transition: all var(--t-fast);
}
.admin-backup-card:hover { border-color: #9333ea; }
.backup-icon { font-size: 2rem; flex-shrink: 0; }
.backup-info { flex: 1; }
.backup-title { font-size: 0.95rem; font-weight: 700; color: var(--c-text); }
.backup-sub { font-size: 0.78rem; color: var(--c-text-3); margin-top: 3px; }

/* ─── SETTINGS ──────────────────────────────────────────────── */
.admin-settings-list { display: flex; flex-direction: column; gap: 1px; }
.admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.setting-title { font-size: 0.92rem; font-weight: 600; color: var(--c-text); }
.setting-sub { font-size: 0.78rem; color: var(--c-text-3); margin-top: 2px; }
.admin-select {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-size: 0.82rem;
  padding: 6px 12px;
}
.admin-toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.admin-toggle-switch input { opacity: 0; width: 0; height: 0; }
.admin-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  transition: all var(--t-fast);
  cursor: pointer;
}
.admin-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t-fast);
}
.admin-toggle-switch input:checked + .admin-toggle-slider { background: #9333ea; border-color: #7c3aed; }
.admin-toggle-switch input:checked + .admin-toggle-slider::before { transform: translateX(22px); }

/* ─── ADMIN RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-quick-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .admin-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .admin-menu-toggle { display: flex; }
  .admin-content { padding: var(--space-md); }
  .admin-kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-topbar-time { display: none; }
}
@media (max-width: 480px) {
  .admin-kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-quick-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-health-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN MODALS (Add User / Edit User)
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity var(--t-fast);
}
.modal-overlay.hidden {
  display: none;
}
.modal-box {
  background: #12121e;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139,92,246,0.1);
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-height: 90dvh;
  overflow-y: auto;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.06);
  border-radius: 20px 20px 0 0;
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2c4ff;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--c-text-3);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  cursor: pointer;
}
.modal-close:hover { background: rgba(220, 38, 38, 0.2); color: #f87171; border-color: rgba(220,38,38,0.3); }

.modal-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mform-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .mform-row { grid-template-columns: 1fr; }
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--c-border);
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   JURISDICTION / BEAT / VILLAGE MODULE CSS
═══════════════════════════════════════════════════════════════ */

/* ─── Admin nav divider ─────────────────────────────────────── */
.admin-nav-divider {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(139,92,246,0.4);
  padding: 12px var(--space-md) 4px;
  text-transform: uppercase;
}

/* ─── Jurisdiction sub-tabs ─────────────────────────────────── */
.juri-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 4px;
  width: fit-content;
  margin-bottom: var(--space-lg);
}
.juri-tab {
  padding: 8px 18px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-3);
  transition: all var(--t-fast);
  cursor: pointer;
  border: none;
  background: transparent;
}
.juri-tab:hover { background: rgba(255,255,255,.06); color: var(--c-text); }
.juri-tab.active { background: #9333ea; color: white; }

.juri-pane { display: none; }
.juri-pane.active { display: block; }

/* ─── Beat Accordion Cards ──────────────────────────────────── */
.beats-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.beats-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 3rem;
  color: var(--c-text-4);
  text-align: center;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-xl);
}
.no-beats-msg {
  text-align: center;
  color: var(--c-text-4);
  padding: 2rem;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-xl);
  font-size: 0.9rem;
}

.beat-card {
  background: var(--c-surface);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.beat-card:hover { border-color: rgba(139,92,246,0.4); }

.beat-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  user-select: none;
  background: rgba(139,92,246,0.04);
  flex-wrap: wrap;
}
.beat-card-header:hover { background: rgba(139,92,246,0.08); }
.beat-header-left { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }
.beat-number-badge {
  font-size: 0.88rem;
  font-weight: 800;
  color: #c084fc;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.3);
  padding: 4px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.beat-area-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-2);
}
.beat-header-meta {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  flex-wrap: wrap;
}
.beat-meta-item {
  font-size: 0.78rem;
  color: var(--c-text-3);
  white-space: nowrap;
}
.beat-header-actions { display: flex; gap: 4px; }
.beat-toggle-icon {
  font-size: 0.75rem;
  color: var(--c-text-4);
  margin-left: auto;
  transition: transform var(--t-fast);
}

.beat-card-body {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(139,92,246,0.15);
}
.beat-unassigned-bar {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--r-md);
  padding: 8px 14px;
  font-size: 0.8rem;
  color: #fbbf24;
  margin-bottom: var(--space-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ─── Sub Beat Rows ─────────────────────────────────────────── */
.subbeats-list { display: flex; flex-direction: column; gap: 6px; }
.subbeat-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.subbeat-row:hover { background: rgba(255,255,255,.06); }
.subbeat-info { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.subbeat-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(37,99,235,0.12);
  padding: 3px 10px;
  border-radius: var(--r-full);
}
.subbeat-officer { font-size: 0.8rem; color: var(--c-text-2); }
.subbeat-vil-count { font-size: 0.75rem; color: var(--c-text-4); }
.subbeat-vil-list { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; margin-top: 4px; }
.subbeat-empty { font-size: 0.8rem; color: var(--c-text-4); padding: 8px 0; }

/* ─── Village pills ─────────────────────────────────────────── */
.vil-pill {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(22,163,74,0.1);
  border: 1px solid rgba(22,163,74,0.2);
  color: #4ade80;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ─── Village multiselect checkbox ──────────────────────────── */
.village-multiselect {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--c-surface-2);
}
.vil-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--c-text-2);
  transition: background var(--t-fast);
}
.vil-checkbox-item:hover { background: rgba(139,92,246,0.1); }
.vil-checkbox-item input[type=checkbox] { accent-color: #9333ea; width: 14px; height: 14px; flex-shrink: 0; }
.vil-select-empty { font-size: 0.8rem; color: var(--c-text-4); padding: 8px; text-align: center; }
.vil-assigned-other { opacity: 0.5; cursor: not-allowed; }
.vil-assigned-other input[type=checkbox] { cursor: not-allowed; }

/* ── Beat Book Detail Screen ────────────────────────────────── */
.bbd-list { display: flex; flex-direction: column; gap: 8px; }
.bbd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  transition: background var(--t-fast);
}
.bbd-row:hover { background: rgba(139,92,246,0.05); }
.bbd-idx {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-text-4);
  min-width: 22px;
  text-align: center;
  background: rgba(139,92,246,0.1);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bbd-info { flex: 1; }
.bbd-name { font-size: 0.88rem; font-weight: 600; color: var(--c-text); }
.bbd-sub  { font-size: 0.75rem; color: var(--c-text-3); margin-top: 2px; }
.bbd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--c-text-3);
  border: 2px dashed var(--c-border);
  border-radius: var(--r-xl);
}


/* ═══════════════════════════════════════════════════════════════
   VILLAGE PROFILE MODULE
═══════════════════════════════════════════════════════════════ */

/* ── Profile Modal Box ──────────────────────────────────────── */
.vp-modal-box {
  max-width: 680px;
  max-height: 92dvh;
  overflow-y: auto;
}

/* ── Profile Tabs ───────────────────────────────────────────── */
.vp-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 16px 0;
  background: rgba(139,92,246,0.04);
  border-bottom: 1px solid rgba(139,92,246,0.18);
}
.vp-tabs::-webkit-scrollbar { display: none; }
.vp-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-3);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.vp-tab:hover { color: var(--c-text); }
.vp-tab.active {
  color: #c084fc;
  border-bottom-color: #9333ea;
}

/* ── Profile Panes ──────────────────────────────────────────── */
.vp-form { display: flex; flex-direction: column; }
.vp-pane { display: none; padding: 1.25rem 1.5rem; flex-direction: column; gap: 1rem; }
.vp-pane.active { display: flex; }

/* ── Toggle Row (checkboxes) ────────────────────────────────── */
.vp-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.vp-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--c-text-2);
  cursor: pointer;
  padding: 8px 14px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.vp-toggle-label:hover { border-color: #9333ea; background: rgba(139,92,246,0.08); }
.vp-toggle-label input[type=checkbox] { accent-color: #9333ea; width: 15px; height: 15px; }
.vp-sensitive-flag { border-color: rgba(245,158,11,0.3); }
.vp-sensitive-flag:has(input:checked) {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.5);
  color: #fbbf24;
}
.vp-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

/* ── My Villages Grid ───────────────────────────────────────── */
.my-villages-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vp-village-card {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--t-fast);
}
.vp-village-card.green-border  { border-color: rgba(34,197,94,0.35); }
.vp-village-card.yellow-border { border-color: rgba(234,179,8,0.35); }
.vp-village-card.red-border    { border-color: rgba(239,68,68,0.3); }

.vp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vp-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}
.vp-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.green-badge  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.yellow-badge { background: rgba(234,179,8,0.15);  color: #facc15; }
.red-badge    { background: rgba(239,68,68,0.12);  color: #f87171; }

.vp-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--c-text-3);
}

.vp-completion-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-full);
  overflow: hidden;
}
.vp-completion-fill { height: 100%; border-radius: var(--r-full); transition: width 0.6s ease; }
.green-fill  { background: #22c55e; }
.yellow-fill { background: #eab308; }
.red-fill    { background: #ef4444; }

.vp-update-btn {
  width: 100%;
  margin-top: 2px;
  font-size: 0.85rem;
}

.vp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--c-text-3);
  border: 2px dashed var(--c-border);
  border-radius: var(--r-xl);
}
.vil-loading {
  text-align: center;
  color: var(--c-text-4);
  padding: 2rem;
  font-size: 0.9rem;
}


/* ─── CSV Upload ─────────────────────────────────────────────── */
.csv-drop-zone {
  border: 2px dashed rgba(139,92,246,0.3);
  border-radius: var(--r-xl);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: rgba(139,92,246,0.03);
  margin: var(--space-md) 0;
}
.csv-drop-zone.csv-drag-over {
  border-color: #9333ea;
  background: rgba(139,92,246,0.1);
}
.csv-drop-icon { font-size: 2.5rem; margin-bottom: 8px; }
.csv-drop-text { font-size: 0.9rem; color: var(--c-text-2); font-weight: 600; margin: 0; }
.csv-drop-hint { font-size: 0.75rem; color: var(--c-text-4); margin: 6px 0 0; }
.csv-drop-hint code { background: rgba(139,92,246,0.15); padding: 2px 6px; border-radius: 4px; color: #c084fc; }

.csv-sample-hint {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.78rem;
  color: var(--c-text-3);
  line-height: 1.7;
}
.csv-sample-hint code { font-family: monospace; color: #a3e635; }

.csv-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-2);
}
.csv-error-badge {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--r-full);
  max-width: 55%;
  text-align: right;
}

/* ─── Village pagination ────────────────────────────────────── */
.vil-pagination {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: 0.82rem;
  color: var(--c-text-3);
}

/* ─── Link button ───────────────────────────────────────────── */
.link-btn {
  background: none;
  border: none;
  color: #c084fc;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color var(--t-fast);
}
.link-btn:hover { color: #e879f9; }

/* ─── form-select style ─────────────────────────────────────── */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ─── Form hint text ────────────────────────────────────────── */
.form-hint {
  display: block;
  font-size: 0.72rem;
  color: rgba(139,92,246,0.7);
  margin-top: 4px;
}

/* ─── Auto-fill read-only posting display ───────────────────── */
.posting-readonly {
  cursor: not-allowed;
  opacity: 0.75;
  background: rgba(139,92,246,0.06) !important;
  border-color: rgba(139,92,246,0.2) !important;
  color: #c084fc;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(139,92,246,0.2);
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   OFFICER SIDE DRAWER (mobile menu)
═══════════════════════════════════════════════════════════════ */
.officer-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 78%;
  max-width: 300px;
  height: 100%;
  background: linear-gradient(170deg, #1a1035 0%, #12001f 100%);
  border-right: 1px solid rgba(139,92,246,0.25);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-110%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 32px rgba(0,0,0,0.5);
}
.officer-drawer.open { transform: translateX(0); }
.officer-drawer.hidden { display: none; }

.officer-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1199;
  backdrop-filter: blur(2px);
}
.officer-drawer-overlay.hidden { display: none; }

/* Drawer header / profile */
.drawer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 20px 20px;
  background: rgba(139,92,246,0.12);
  border-bottom: 1px solid rgba(139,92,246,0.18);
}
.drawer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(139,92,246,0.2);
  border: 2px solid rgba(139,92,246,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.drawer-info { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.drawer-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f3f0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.drawer-badge, .drawer-station {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

/* Drawer nav */
.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  flex: 1;
}
.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 20px;
  background: transparent;
  border: none;
  text-align: left;
  color: rgba(255,255,255,0.8);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, padding-left 0.18s;
  border-radius: 0;
}
.drawer-nav-item:hover {
  background: rgba(139,92,246,0.12);
  color: #e9d5ff;
  padding-left: 26px;
}
.drawer-nav-icon {
  width: 26px;
  font-size: 1.05rem;
  text-align: center;
  flex-shrink: 0;
}
.drawer-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 6px 16px;
}
.drawer-logout {
  margin-top: auto;
  color: #fca5a5 !important;
}
.drawer-logout:hover {
  background: rgba(239,68,68,0.12) !important;
  color: #f87171 !important;
}

/* ═══════════════════════════════════════════════════════════════
   HIERARCHY REPORT STYLES (DSP/ASP/SP)
═══════════════════════════════════════════════════════════════ */
.hier-report {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.hier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
  gap: 1rem;
}
.hier-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--c-text);
  margin: 0;
}
.hier-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}
.hier-kpi {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: border-color var(--t-fast);
}
.hier-kpi:hover  { border-color: rgba(139,92,246,0.4); }
.hier-kpi-val {
  font-size: 1.8rem;
  font-weight: 900;
  color: #c084fc;
  line-height: 1;
}
.hier-kpi-lbl {
  font-size: 0.72rem;
  color: var(--c-text-4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hier-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hier-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text-2);
  margin: 0;
}

/* ─── Officer card status styles ────────────────────────────── */
.inactive-status {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
}
.active-status {
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 600;
}
.sos-status {
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 700;
  animation: pulse 1.5s infinite;
}

/* KPI grid — allow 6 columns on wide screens */
@media (min-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 900px) {
  .hier-kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .hier-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .hier-header { flex-direction: column; }
}

/* ─── Print styles ──────────────────────────────────────────── */
@media print {
  .dash-sidebar, .dash-topbar, .sidebar-nav, .adc-footer,
  .btn, button, .sidebar-footer { display: none !important; }
  .dash-main { margin: 0 !important; }
  .hier-report { color: #000; }
  .beats-table { color: #000; border: 1px solid #ccc; }
  .beats-table th { background: #f5f5f5; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL — MOBILE RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .admin-kpi-grid  { grid-template-columns: repeat(2, 1fr); }
  .admin-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Sidebar: slide in/out on mobile */
  .admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: none;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.6);
  }

  /* Overlay backdrop when sidebar open */
  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
  }
  .admin-sidebar-overlay.visible { display: block; }

  /* Show hamburger toggle on mobile */
  .admin-menu-toggle { display: flex !important; }

  /* Reduce topbar padding */
  .admin-topbar { padding: 0 var(--space-md); gap: var(--space-sm); }
  .admin-topbar-time { display: none; }

  /* Content area */
  .admin-content { padding: var(--space-md) var(--space-sm); }

  /* KPI grids */
  .admin-kpi-grid   { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
  .admin-quick-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }

  /* KPI font sizes */
  .akpi-val { font-size: 1.4rem; }
  .akpi-icon { font-size: 1.4rem; }

  /* Tables: horizontal scroll */
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { min-width: 600px; }

  /* Forms */
  .mform-row { flex-direction: column; }

  /* Modal boxes full width */
  .modal-box { width: 95vw !important; max-width: 95vw !important; margin: 1rem auto; max-height: 90dvh; overflow-y: auto; }

  /* Action bars wrap */
  .admin-actions-bar { flex-wrap: wrap; gap: var(--space-sm); }
  .admin-actions-bar .btn { width: 100%; justify-content: center; }
  .admin-search-input { width: 100%; }

  /* Jurisdiction tabs */
  .juri-tabs { overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }

  /* Beat container */
  .beat-filter-bar { flex-direction: column; }
}

@media (max-width: 480px) {
  .admin-kpi-grid   { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .akpi-val { font-size: 1.2rem; }
  .akpi-card { padding: var(--space-md); }
  .admin-quick-card { padding: var(--space-md) var(--space-sm); }
  .admin-quick-card .aqc-label { font-size: 0.7rem; }

  /* Topbar user badge — hide name on very small */
  .topbar-user span:not(.topbar-avatar) { display: none; }
  .admin-topbar-user span:last-child { display: none; }

  /* Roles matrix — scroll */
  .roles-matrix-wrap { overflow-x: auto; }
}


/* ── Officer Detail Modal Styles ──────────────── */
.od-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--c-border);
  background: transparent;
  color: var(--c-text-3);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.od-tab:hover { border-color: var(--c-accent); color: var(--c-accent); }
.od-tab.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}
.od-kpi {
  background: var(--c-surface-2);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.od-kpi-val { font-size: 1.6rem; font-weight: 800; color: var(--c-text-1); line-height: 1; }
.od-kpi-lbl { font-size: 0.72rem; color: var(--c-text-4); margin-top: 4px; }

