/* ═══════════════════════════════════════════════════════════════
   e-Beat System — Mobile Screens CSS
   Splash, Login, Officer App Screens
═══════════════════════════════════════════════════════════════ */

/* ─── SPLASH SCREEN ───────────────────────────────────────────── */
.splash-bg {
  width: 100%;
  height: 100dvh;
  background: radial-gradient(ellipse at center, #1e3a8a 0%, #0a0f1e 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.splash-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(37,99,235,0.2);
  animation: ringPulse 3s ease-in-out infinite;
}
.ring-1 { width: 200px; height: 200px; animation-delay: 0s; }
.ring-2 { width: 340px; height: 340px; animation-delay: 0.6s; }
.ring-3 { width: 480px; height: 480px; animation-delay: 1.2s; }
@keyframes ringPulse {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.04); }
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  z-index: 1;
}

.splash-logo {
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  border: 2px solid rgba(245,158,11,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  box-shadow: 0 0 40px rgba(245,158,11,0.2);
  animation: logoPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
.splash-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
@keyframes logoPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.splash-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.6s ease 0.4s both;
}
.splash-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: fadeUp 0.6s ease 0.5s both;
}
.splash-tagline {
  font-size: 0.8rem;
  color: var(--c-text-3);
  letter-spacing: 0.04em;
  animation: fadeUp 0.6s ease 0.6s both;
}

.splash-loader {
  margin-top: var(--space-2xl);
  width: 220px;
  animation: fadeUp 0.6s ease 0.7s both;
}
.loader-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-gold));
  border-radius: var(--r-full);
  transition: width 0.3s ease;
}
.loader-text {
  text-align: center;
  font-size: 0.78rem;
  color: var(--c-text-4);
  margin-top: var(--space-sm);
}

.splash-footer {
  position: absolute;
  bottom: var(--space-lg);
  text-align: center;
  font-size: 0.72rem;
  color: var(--c-text-4);
  line-height: 1.6;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── LOGIN SCREEN ────────────────────────────────────────────── */
.login-bg {
  width: 100%;
  height: 100dvh;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  position: relative;
}
.login-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(37,99,235,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(30,58,138,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.login-container {
  width: 100%;
  max-width: 420px;
  padding: var(--space-xl) var(--space-md);
  z-index: 1;
}
.login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-md);
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  border: 2px solid rgba(245,158,11,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(245,158,11,0.15);
}
.login-logo img { width: 52px; height: 52px; object-fit: contain; }
.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-subtitle { font-size: 0.85rem; color: var(--c-text-3); margin-top: 4px; }

.login-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.role-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}
.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.role-pill {
  flex: 1;
  min-width: 80px;
  padding: 8px 10px;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-align: center;
  transition: all var(--t-fast);
}
.role-pill.active {
  background: var(--c-primary);
  border-color: var(--c-accent-light);
  color: white;
  box-shadow: 0 0 12px rgba(37,99,235,0.4);
}
.role-pill:hover:not(.active) { border-color: var(--c-accent-light); color: var(--c-text); }

/* ─── ROLE DROPDOWN ──────────────────────────────────────────── */
.role-dropdown-wrap {
  position: relative;
  margin-bottom: var(--space-lg);
}
.role-dropdown {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  color: var(--c-text);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.role-dropdown:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}
.role-dropdown option {
  background: #1e2a3a;
  color: var(--c-text);
  font-weight: 500;
}
.role-dropdown optgroup {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text-4);
  letter-spacing: 0.05em;
}
.role-dropdown-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--c-text-3);
  pointer-events: none;
}

.login-form {}

.login-divider {
  text-align: center;
  position: relative;
  margin: var(--space-md) 0;
}
.login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--c-border);
}
.login-divider span {
  background: var(--c-surface);
  padding: 0 var(--space-md);
  font-size: 0.8rem;
  color: var(--c-text-4);
  position: relative;
}

/* ─── LOGIN INFO BOX ─────────────────────────────────────────── */
.login-info-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(37,99,235,0.08);
  border-radius: var(--r-md);
  border: 1px solid rgba(37,99,235,0.25);
  font-size: 0.82rem;
  color: var(--c-accent-light);
  font-family: var(--font-hindi);
}
.login-info-icon { font-size: 1rem; flex-shrink: 0; }

/* ─── PASSWORD INPUT ─────────────────────────────────────────── */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrap .form-input {
  width: 100%;
  padding-right: 44px;
}
.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  font-size: 1rem;
  color: var(--c-text-4);
  transition: color var(--t-fast);
  flex-shrink: 0;
}
.pwd-toggle-btn:hover { color: var(--c-text); }

.login-contact-hint {
  text-align: center;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.78rem;
  color: var(--c-text-4);
  line-height: 1.7;
  font-family: var(--font-hindi);
}

/* ─── MOBILE APP SHELL ──────────────────────────────────────── */
.mobile-app {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  overflow: hidden;
}

.app-header {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}
.menu-btn, .back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--c-text-3);
  font-weight: 500;
  transition: color var(--t-fast);
}
.menu-btn { font-size: 1.4rem; }
.back-btn:hover, .menu-btn:hover { color: var(--c-text); }
.notif-btn, .header-action-btn {
  font-size: 1.2rem;
  position: relative;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--c-danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-danger);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.app-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  padding-bottom: calc(var(--bottom-nav-h) + var(--space-md));
  overscroll-behavior: contain;
}

/* ─── GREETING CARD ──────────────────────────────────────────── */
.greeting-card {
  background: var(--grad-primary);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.greeting-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.greeting-sub { font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.greeting-name { font-size: 1.2rem; font-weight: 800; color: white; margin: 2px 0 8px; }
.greeting-meta { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.meta-badge {
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.9);
}
.status-active { background: rgba(22,163,74,0.3) !important; color: #4ade80 !important; }
.avatar-circle {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 2px solid rgba(255,255,255,0.2);
}

/* ─── PATROL CONTROLS ────────────────────────────────────────── */
.patrol-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.patrol-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--c-border);
  transition: all var(--t-fast);
}
.start-btn {
  background: linear-gradient(135deg, rgba(22,163,74,0.15), rgba(22,163,74,0.05));
  border-color: rgba(22,163,74,0.3);
}
.start-btn:hover { background: linear-gradient(135deg, rgba(22,163,74,0.3), rgba(22,163,74,0.1)); }
.end-btn {
  background: linear-gradient(135deg, rgba(220,38,38,0.12), rgba(220,38,38,0.04));
  border-color: rgba(220,38,38,0.25);
}
.end-btn:hover { background: linear-gradient(135deg, rgba(220,38,38,0.25), rgba(220,38,38,0.1)); }
.patrol-btn-icon { font-size: 1.3rem; }
.patrol-btn-label { display: block; font-size: 0.9rem; font-weight: 700; color: var(--c-text); }
.patrol-btn-sub { display: block; font-size: 0.72rem; color: var(--c-text-4); }

/* ─── SUMMARY GRID ───────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.summary-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-md) var(--space-sm);
  border: 1px solid var(--c-border);
  text-align: center;
}
.alert-card { border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.05); }
.summary-icon { font-size: 1.5rem; margin-bottom: 4px; }
.summary-value { font-size: 1rem; font-weight: 800; color: var(--c-text); }
.alert-value { color: var(--c-danger); }
.summary-label { font-size: 0.68rem; color: var(--c-text-3); margin: 2px 0 6px; }
.summary-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  overflow: hidden;
}
.summary-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--r-full);
}

/* ─── QUICK ACTIONS ──────────────────────────────────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.action-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-md) var(--space-sm);
  border: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--t-fast);
}
.action-card:hover {
  background: var(--c-surface-2);
  border-color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.action-card:active { transform: translateY(0); }
.emergency-action { border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.05); }
.emergency-action:hover { border-color: var(--c-danger); background: rgba(220,38,38,0.1); }
.action-icon { font-size: 1.4rem; }
.action-label { font-size: 0.68rem; font-weight: 600; color: var(--c-text-2); text-align: center; }

/* ─── ACTIVITY LIST ──────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--c-border);
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-dot.green { background: var(--c-success-light); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.activity-dot.yellow { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.5); }
.activity-dot.red { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.5); }
.activity-info { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.activity-title { font-size: 0.82rem; color: var(--c-text-2); }
.activity-time { font-size: 0.75rem; color: var(--c-text-4); flex-shrink: 0; }

/* ─── BOTTOM NAV ─────────────────────────────────────────────── */
.bottom-nav {
  height: var(--bottom-nav-h);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  padding: 0 var(--space-xs);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: var(--r-lg);
  transition: all var(--t-fast);
  flex: 1;
}
.nav-icon { font-size: 1.3rem; }
.nav-label { font-size: 0.6rem; font-weight: 600; color: var(--c-text-4); transition: color var(--t-fast); }
.nav-item.active .nav-label, .nav-item:hover .nav-label { color: var(--c-accent-light); }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 4px rgba(59,130,246,0.8)); }

.nav-center-btn {
  background: var(--grad-danger);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  padding: 0;
  flex: 0 0 52px;
  box-shadow: var(--shadow-red);
  margin-top: -8px;
}
.nav-center-btn .nav-label { color: rgba(255,255,255,0.8); }
.sos-icon { font-size: 1.6rem; }

/* ─── PATROL MAP ────────────────────────────────────────────── */
.map-container {
  flex: 1;
  width: 100%;
  min-height: 300px;      /* Google Maps needs explicit height */
  height: 100%;
  position: relative;
}
/* Google Maps branding fix for dark mode */
.map-container .gm-style { background: #0f172a !important; }

.map-legend {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.76rem;
  color: var(--c-text-3);
  flex-shrink: 0;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.blue { background: #3b82f6; }
.legend-dot.red { background: var(--c-danger); }
.legend-dot.yellow { background: #fbbf24; }
.legend-dot.green { background: var(--c-success-light); }
.map-stats-bar {
  display: flex;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}
.map-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm);
  border-right: 1px solid var(--c-border);
}
.map-stat:last-child { border-right: none; }
.mstat-val { font-size: 1rem; font-weight: 700; color: var(--c-text); }
.mstat-lbl { font-size: 0.68rem; color: var(--c-text-4); }
.patrol-actions {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
  overflow-x: auto;
}
.patrol-actions .btn { flex-shrink: 0; font-size: 0.78rem; padding: 10px 14px; }

/* ─── ENTRY FORM ─────────────────────────────────────────────── */
.entry-form {
  padding-bottom: var(--space-2xl);
}

/* ─── SUSPECT TYPE GRID ──────────────────────────────────────── */
.suspect-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--c-surface-2);
  border-radius: var(--r-lg);
  border: 2px solid var(--c-border);
  cursor: pointer;
  transition: all var(--t-fast);
}
.type-card input { display: none; }
.type-card:has(input:checked) {
  border-color: var(--c-danger);
  background: rgba(220,38,38,0.1);
  box-shadow: 0 0 12px rgba(220,38,38,0.2);
}
.type-icon { font-size: 1.5rem; }
.type-label { font-size: 0.78rem; font-weight: 600; color: var(--c-text-2); text-align: center; }

/* ─── QR SCANNER ─────────────────────────────────────────────── */
.qr-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
}
.qr-scanner-card {
  width: 100%;
  max-width: 300px;
}
.qr-viewfinder {
  aspect-ratio: 1;
  background: #000;
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--c-accent-light);
  border-style: solid;
}
.qr-corner.tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.qr-corner.tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.qr-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.qr-corner.br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.qr-scan-line {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-accent-light), transparent);
  animation: scanLine 2s ease-in-out infinite;
}
@keyframes scanLine {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}
.qr-hint {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  text-align: center;
  position: absolute;
  bottom: var(--space-md);
}
.qr-result-card {
  width: 100%;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  border: 1px solid rgba(22,163,74,0.3);
  text-align: center;
}
.qr-success-icon {
  width: 60px;
  height: 60px;
  background: rgba(22,163,74,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--c-success-light);
  margin: 0 auto var(--space-md);
  border: 2px solid rgba(22,163,74,0.4);
}
.qr-result-card h3 { color: var(--c-success-light); margin-bottom: var(--space-md); }
.qr-details { text-align: left; margin-bottom: var(--space-lg); }
.qr-detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--c-border); }
.qr-detail-label { font-size: 0.8rem; color: var(--c-text-3); }
.qr-detail-val { font-size: 0.85rem; font-weight: 600; color: var(--c-text); }
.status-ok { color: var(--c-success-light) !important; }
.qr-manual-entry { font-size: 0.82rem; color: var(--c-text-3); text-align: center; }

/* ─── BEAT BOOK ──────────────────────────────────────────────── */
.search-bar-container { margin-bottom: var(--space-md); }
.search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  color: var(--c-text);
  font-size: 0.9rem;
}
.search-input:focus { outline: none; border-color: var(--c-accent); }

.beat-book-sections { display: flex; flex-direction: column; gap: var(--space-sm); }
.book-section-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  border: 1px solid var(--c-border);
  width: 100%;
  transition: all var(--t-fast);
  text-align: left;
}
.book-section-card:hover { background: var(--c-surface-2); border-color: var(--c-accent); transform: translateX(3px); }
.map-card:hover { border-color: var(--c-success-light); }
.bs-icon { font-size: 1.5rem; }
.bs-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.bs-title { font-size: 0.95rem; font-weight: 600; color: var(--c-text); }
.bs-count { font-size: 0.78rem; color: var(--c-text-3); }
.bs-arrow { font-size: 1.4rem; color: var(--c-text-4); }

/* ─── COMMUNITY ──────────────────────────────────────────────── */
.community-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.comm-stat-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-lg) var(--space-md);
  border: 1px solid var(--c-border);
  text-align: center;
}
.comm-stat-icon { font-size: 1.8rem; margin-bottom: var(--space-sm); }
.comm-stat-val { font-size: 1.8rem; font-weight: 800; color: var(--c-text); }
.comm-stat-label { font-size: 0.78rem; color: var(--c-text-3); margin-top: 4px; }

.community-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.comm-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
  transition: all var(--t-fast);
}
.comm-action-btn:hover { background: var(--c-accent); border-color: var(--c-accent); }
.comm-action-btn.alert-btn:hover { background: var(--c-danger); border-color: var(--c-danger); }

.filter-select {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-3);
  font-size: 0.8rem;
  padding: 4px 8px;
}

.member-list { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-sm); }
.member-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  border: 1px solid var(--c-border);
}
.member-avatar { font-size: 2rem; }
.member-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.member-name { font-size: 0.9rem; font-weight: 700; color: var(--c-text); }
.member-role {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 700;
  width: fit-content;
}
.badge-mitra { background: rgba(37,99,235,0.2); color: #93c5fd; }
.badge-clg { background: rgba(22,163,74,0.2); color: #4ade80; }
.member-phone { font-size: 0.75rem; color: var(--c-text-4); }
.member-actions { display: flex; gap: var(--space-sm); }
.icon-btn {
  width: 36px;
  height: 36px;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--c-accent); }

/* ─── EMERGENCY SCREEN ───────────────────────────────────────── */
.emergency-screen {
  background: radial-gradient(ellipse at center, #1a0505 0%, #0a0f1e 70%);
}
.emergency-header {
  background: rgba(220,38,38,0.1) !important;
  border-bottom-color: rgba(220,38,38,0.2) !important;
}
.emergency-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  padding-top: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

.sos-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}
.sos-ripples {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sos-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(220,38,38,0.1);
  animation: sosRipple 2s ease-out infinite;
}
.sos-ripple.r1 { width: 100px; height: 100px; animation-delay: 0s; }
.sos-ripple.r2 { width: 140px; height: 140px; animation-delay: 0.4s; }
.sos-ripple.r3 { width: 180px; height: 180px; animation-delay: 0.8s; }
@keyframes sosRipple {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(1); opacity: 0; }
}
.sos-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--grad-danger);
  border: 3px solid rgba(220,38,38,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-red), inset 0 0 30px rgba(0,0,0,0.3);
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
}
.sos-btn:active { transform: scale(0.96); box-shadow: 0 0 60px rgba(220,38,38,0.8); }
.sos-btn.holding { border-color: white; }
.sos-icon { font-size: 2.5rem; }
.sos-label { font-size: 0.65rem; font-weight: 800; color: white; letter-spacing: 0.1em; }
.sos-progress {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgba(255,255,255,0.3) 0%, transparent 0%);
  transition: background 0.1s linear;
}
.sos-instruction { font-size: 0.82rem; color: rgba(255,255,255,0.5); text-align: center; }
.sos-status { text-align: center; }
.sos-sent {
  display: inline-block;
  background: rgba(22,163,74,0.2);
  border: 1px solid rgba(22,163,74,0.4);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--r-full);
  font-weight: 700;
  color: var(--c-success-light);
  font-size: 1rem;
}

.alert-recipients {
  width: 100%;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  border: 1px solid rgba(220,38,38,0.2);
}
.alert-recipients h3 { font-size: 0.85rem; font-weight: 700; color: var(--c-text-2); margin-bottom: var(--space-md); }
.recipient-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.recipient-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
}
.rec-icon { font-size: 1.2rem; }
.rec-name { flex: 1; font-size: 0.85rem; color: var(--c-text-2); }
.rec-status { font-size: 0.9rem; }

.location-share-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.25);
  border-radius: var(--r-xl);
  padding: var(--space-md) var(--space-lg);
}
.location-share-card strong { font-size: 0.9rem; color: var(--c-text); }
.location-share-card p { font-size: 0.78rem; color: var(--c-text-3); margin-top: 2px; }
.loc-anim {
  color: var(--c-success-light);
  font-size: 1.2rem;
  animation: locPulse 1.2s ease-in-out infinite;
}
@keyframes locPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* ─── SUSPECT DATABASE SCREEN ──────────────────────────────────── */
.sdb-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--c-border);
  margin-bottom: var(--space-sm);
}
.sdb-stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.sdb-stat-icon { font-size: 1.1rem; }
.sdb-stat-val  { font-size: 0.85rem; font-weight: 700; color: var(--c-text-2); }

.sdb-search-wrap { margin-bottom: var(--space-md); }

.sdb-list { display: flex; flex-direction: column; gap: var(--space-sm); padding-bottom: var(--space-2xl); }

.sdb-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  border: 1px solid var(--c-border);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  animation: fadeUp 0.22s ease both;
}
.sdb-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow-md); }

.sdb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}
.sdb-idx {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-text-4);
  letter-spacing: 0.05em;
}
.sdb-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sdb-badge-criminal   { background: rgba(220,38,38,0.15);  color: #f87171; border: 1px solid rgba(220,38,38,0.3); }
.sdb-badge-suspicious { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.sdb-badge-normal     { background: rgba(22,163,74,0.12);  color: #4ade80; border: 1px solid rgba(22,163,74,0.3); }

.sdb-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 6px;
}
.sdb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.78rem;
  color: var(--c-text-3);
  margin-bottom: 6px;
}
.sdb-remarks {
  font-size: 0.8rem;
  color: var(--c-text-2);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  padding: 6px 10px;
  margin-bottom: 8px;
  border-left: 3px solid var(--c-accent);
}
.sdb-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--c-text-4);
  border-top: 1px solid var(--c-border);
  padding-top: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 4px;
}

/* ─── ONLINE / OFFLINE INDICATOR ────────────────────────────────── */
.connectivity-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.conn-online  { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.7); animation: connPulse 2s ease-in-out infinite; }
.conn-offline { background: #f87171; box-shadow: 0 0 4px rgba(248,113,113,0.5); }
@keyframes connPulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.conn-online-label  { color: #4ade80; }
.conn-offline-label { color: #f87171; }
.conn-label { color: var(--c-text-3); }

/* ─── VILLAGE TAG IN DB CARDS ────────────────────────────────────── */
.sdb-village-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

/* ─── DETAIL ROW (in House/Suspect detail modals) ────────────────── */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-lbl {
  font-size: 0.78rem;
  color: var(--c-text-4);
  flex-shrink: 0;
  min-width: 90px;
}
.detail-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  text-align: right;
  word-break: break-word;
}

/* ─── SMALL ICON BUTTON (delete in DB cards) ─────────────────────── */
.icon-btn-sm {
  width: 28px;
  height: 28px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.icon-btn-sm:hover { background: rgba(248,113,113,0.25); border-color: rgba(248,113,113,0.5); }

/* ─── CLICKABLE SUMMARY CARD HOVER ──────────────────────────────── */
#visits-summary-card:hover {
  border-color: rgba(59,130,246,0.5);
  background: rgba(59,130,246,0.08);
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
  transition: all 0.2s ease;
}
#visits-summary-card:active { transform: scale(0.98); }

/* ─── BTN FULL WIDTH ─────────────────────────────────────────────── */
.btn-full { width: 100%; }

/* ─── DB FILTER TABS (Today / Week / Month / All) ───────────────── */
.db-filter-tab {
  color: white !important;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.db-filter-tab:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.3);
}
.db-filter-tab.active {
  background: var(--c-accent, #3b82f6);
  border-color: var(--c-accent, #3b82f6);
  color: white !important;
  box-shadow: 0 0 10px rgba(59,130,246,0.4);
}

/* ─── NOTIFICATION PANEL ─────────────────────────────────────────── */
.notif-panel {
  position: absolute;
  top: var(--header-h, 56px);
  right: 0;
  left: 0;
  z-index: 200;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.22s ease;
}
@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.notif-panel.hidden { display: none; }

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-text);
  background: var(--c-surface-2);
  flex-shrink: 0;
}
.notif-panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s ease;
  cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-icon.red   { background: rgba(220,38,38,0.15); }
.notif-icon.amber { background: rgba(245,158,11,0.15); }
.notif-icon.blue  { background: rgba(59,130,246,0.15); }
.notif-icon.green { background: rgba(22,163,74,0.15); }
.notif-content { flex: 1; }
.notif-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 2px;
}
.notif-sub {
  font-size: 0.75rem;
  color: var(--c-text-4);
  line-height: 1.4;
}
.notif-time {
  font-size: 0.68rem;
  color: var(--c-text-4);
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-empty {
  text-align: center;
  padding: 24px;
  color: var(--c-text-4);
  font-size: 0.85rem;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--c-danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-badge[data-count="0"] { display: none; }

/* ─── BEAT BOOK VILLAGE-WISE GROUPS ─────────────────────────────── */
.bbd-village-group {
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.bbd-village-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(167,139,250,0.1);
  border-bottom: 1px solid var(--c-border);
}
.bbd-vil-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #a78bfa;
}
.bbd-vil-count {
  font-size: 0.75rem;
  color: var(--c-text-4);
}
.bbd-village-body .bbd-row {
  border-radius: 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bbd-village-body .bbd-row:last-child { border-bottom: none; }
.bbd-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text-3);
  padding: 8px 4px;
  margin-bottom: 6px;
}
