/* ==========================================================================
   LOS SANTOS POLICE DEPARTMENT (LSPD) - COMPREHENSIVE STYLESHEET
   Supports Dynamic Light Mode (Day / وضع النهار) & Dark Mode (Night / وضع الليل)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. THEME DESIGN TOKENS
   -------------------------------------------------------------------------- */

/* Default / Day Mode (Light - وضع النهار) */
:root {
  color-scheme: light;

  /* Surfaces & Glassmorphism Backgrounds */
  --bg: #f4f7fb;
  --bg-gradient: radial-gradient(ellipse at 50% 0%, #dce7f5 0%, transparent 60%), #f4f7fb;
  --sidebar-bg: rgba(255, 255, 255, 0.94);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --panel: rgba(255, 255, 255, 0.95);
  --panel-gradient: linear-gradient(145deg, #ffffff, #f7faff);
  --panel2: #eef4fb;
  --panel-hover: #e3edf8;
  --modal-bg: rgba(255, 255, 255, 0.98);
  --modal-backdrop: rgba(12, 25, 45, 0.65);

  /* Lines & Borders */
  --line: rgba(216, 226, 239, 0.9);
  --line-subtle: rgba(229, 237, 247, 0.7);
  --border-color: rgba(216, 226, 239, 0.9);

  /* Typography Colors */
  --text: #1e293b;
  --text-heading: #091b33;
  --text-color: #1e293b;
  --muted: #607794;
  --muted-color: #607794;

  /* Brand Accents */
  --blue: #1d4ed8;
  --blue-hover: #1e40af;
  --blue-soft: rgba(29, 78, 216, 0.08);
  --blue-glow: rgba(29, 78, 216, 0.25);
  --cyan: #0284c7;
  --gold: #d97706;
  --gold-bg: #fef3c7;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;

  /* Controls & Inputs */
  --input-bg: #ffffff;
  --input-border: #cad7e6;
  --input-text: #0f2744;
  --input-focus: #1d4ed8;

  /* Tables */
  --table-head-bg: #eaf1fb;
  --table-head-text: #1e3a5f;
  --table-border: #dbe5f2;
  --table-row-odd: #f8fafc;
  --table-row-hover: #edf4ff;
  --table-cell-text: #17365f;

  /* Cards & Badges */
  --card-shadow: 0 6px 20px rgba(18, 58, 104, 0.06), 0 1px 3px rgba(18, 58, 104, 0.04);
  --card-shadow-hover: 0 14px 30px rgba(18, 58, 104, 0.12), 0 2px 6px rgba(18, 58, 104, 0.06);
  --topbar-shadow: 0 8px 25px rgba(18, 58, 104, 0.08);
  --tag-bg: #eaf2ff;
  --tag-color: #1d4ed8;
  --tag-border: #c8dcfa;
  --quicklink-bg: #f8fafc;
  --quicklink-border: #d8e3f0;
  --quicklink-text: #17365f;
  --quicklink-hover: #edf5ff;
  --hero-overlay: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 42%, rgba(255, 255, 255, 0.3) 100%);
  --hero-title: #0a2342;
  --hero-text: #334e68;
}

/* Night Mode (Dark - وضع الليل) — Tactical Police MDT Theme */
html.dark-mode {
  color-scheme: dark;

  /* Surfaces & Glassmorphism Backgrounds */
  --bg: #060b14;
  --bg-gradient: radial-gradient(ellipse at 50% -12%, #112340 0%, transparent 60%), radial-gradient(ellipse at 85% 30%, #0c1a30 0%, transparent 45%), #060b14;
  --sidebar-bg: rgba(9, 15, 27, 0.84);
  --topbar-bg: rgba(11, 20, 37, 0.82);
  --panel: rgba(13, 23, 42, 0.72);
  --panel-gradient: linear-gradient(145deg, rgba(19, 34, 61, 0.7), rgba(10, 18, 33, 0.8));
  --panel2: rgba(16, 29, 52, 0.6);
  --panel-hover: rgba(25, 45, 80, 0.75);
  --modal-bg: rgba(13, 23, 42, 0.94);
  --modal-backdrop: rgba(2, 6, 14, 0.85);

  /* Lines & Borders */
  --line: rgba(59, 130, 246, 0.16);
  --line-subtle: rgba(59, 130, 246, 0.09);
  --border-color: rgba(59, 130, 246, 0.16);

  /* Typography Colors */
  --text: #e2e8f0;
  --text-heading: #f8fafc;
  --text-color: #e2e8f0;
  --muted: #94a3b8;
  --muted-color: #94a3b8;

  /* Brand Accents */
  --blue: #3b82f6;
  --blue-hover: #60a5fa;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --blue-glow: 0 0 25px rgba(59, 130, 246, 0.35);
  --cyan: #38bdf8;
  --gold: #fbbf24;
  --gold-bg: rgba(251, 191, 36, 0.14);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.14);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.14);

  /* Controls & Inputs */
  --input-bg: rgba(8, 14, 25, 0.85);
  --input-border: rgba(59, 130, 246, 0.22);
  --input-text: #f8fafc;
  --input-focus: #38bdf8;

  /* Tables */
  --table-head-bg: rgba(16, 30, 56, 0.85);
  --table-head-text: #93c5fd;
  --table-border: rgba(59, 130, 246, 0.12);
  --table-row-odd: rgba(9, 16, 30, 0.45);
  --table-row-hover: rgba(37, 99, 235, 0.16);
  --table-cell-text: #cbd5e1;

  /* Cards & Badges */
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --card-shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(59, 130, 246, 0.25);
  --topbar-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.55);
  --tag-bg: rgba(59, 130, 246, 0.14);
  --tag-color: #60a5fa;
  --tag-border: rgba(59, 130, 246, 0.25);
  --quicklink-bg: rgba(15, 28, 50, 0.6);
  --quicklink-border: rgba(59, 130, 246, 0.18);
  --quicklink-text: #cbd5e1;
  --quicklink-hover: rgba(25, 45, 80, 0.75);
  --hero-overlay: linear-gradient(90deg, rgba(6, 11, 20, 0.96) 0%, rgba(8, 15, 28, 0.88) 45%, rgba(6, 11, 20, 0.4) 100%);
  --hero-title: #f8fafc;
  --hero-text: #94a3b8;
}

/* --------------------------------------------------------------------------
   2. CORE BASE & RESET
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg-gradient);
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

/* Custom Sleek Tactical Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

button, a, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.code, code, pre, .stat-value, .badge-num, .analytics-bar-value, .crumb, .statuspill, .tag {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

.app {
  display: grid;
  grid-template-columns: 255px 1fr;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   3. SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */
.sidebar {
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 18px;
  border-bottom: 1px solid var(--line-subtle);
  margin-bottom: 10px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.35));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-logo {
  transform: scale(1.06) rotate(-2deg);
}

.brandtext {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brandtext b {
  font-size: 0.95rem;
  line-height: 1.15;
  letter-spacing: 0.5px;
  color: var(--text-heading);
}

.brandtext small {
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.8px;
  font-weight: 750;
}

.navtitle {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 800;
  padding: 18px 12px 6px;
  text-transform: uppercase;
}

.nav button {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  text-align: left;
  padding: 10.5px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 550;
  margin: 3px 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav button span {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.nav button .label {
  font-style: normal;
}

.nav button:hover {
  background: var(--panel-hover);
  border-color: var(--line);
  color: var(--text-heading);
  transform: translateX(3px);
}

.nav button.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-color: var(--line);
  border-left: 3px solid var(--blue);
  color: var(--cyan);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
  font-weight: 700;
}

.sidebottom {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.online {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-heading);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
  animation: pulseBeacon 2.2s infinite ease-in-out;
}

@keyframes pulseBeacon {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px var(--green);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.9);
    box-shadow: 0 0 4px var(--green);
  }
}

.sidebottom p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 6px 0 0;
}

/* --------------------------------------------------------------------------
   4. MAIN CONTENT & TOPBAR
   -------------------------------------------------------------------------- */
.main {
  min-width: 0;
  padding: 16px 28px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 18px;
  position: sticky;
  top: 14px;
  z-index: 40;
  box-shadow: var(--topbar-shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.crumb {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
}

.crumb b {
  color: var(--cyan);
}

.topactions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.statuspill {
  border: 1px solid var(--green);
  background: var(--green-bg);
  color: var(--green);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.discord {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  border: 1px solid rgba(165, 180, 252, 0.35);
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.32);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.discord:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(88, 101, 242, 0.48);
  filter: brightness(1.06);
}

#darkModeToggle {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
}

#darkModeToggle:hover {
  transform: rotate(25deg) scale(1.08);
}

/* --------------------------------------------------------------------------
   5. HERO BANNER
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    var(--hero-overlay),
    url("hero-banner.jpg")
      center center / cover no-repeat;
  margin-bottom: 22px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 11, 22, 0.2), transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.12), transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 38px 40px;
  max-width: 720px;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  font-weight: 750;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.hero h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.05;
  margin: 14px 0 12px;
  letter-spacing: -0.02em;
  font-weight: 850;
  color: var(--hero-title);
}

html.dark-mode .hero h1 {
  background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1 em {
  font-style: normal;
  color: var(--blue);
  -webkit-text-fill-color: var(--cyan);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.hero p {
  color: var(--hero-text);
  font-size: 14px;
  line-height: 1.65;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary,
.secondary {
  border-radius: 9px;
  padding: 11px 18px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
  filter: brightness(1.06);
}

.primary:active {
  transform: translateY(0);
}

.secondary {
  background: var(--panel2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  color: var(--text-heading);
}

.secondary:hover {
  border-color: var(--blue);
  color: var(--cyan);
  background: var(--panel-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.secondary:active {
  transform: translateY(0);
}

.secondary.sm {
  padding: 6px 11px;
  font-size: 11px;
  border-radius: 7px;
}

/* --------------------------------------------------------------------------
   6. STATS & GRIDS
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat,
.card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              background-color 0.25s ease;
}

.stat {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stat:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat:hover {
  transform: translateY(-2.5px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: var(--card-shadow-hover);
}

.stat:hover:before {
  opacity: 1;
}

.stat:hover .staticon {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.staticon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--cyan);
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.8px;
  font-weight: 750;
  text-transform: uppercase;
}

.stat strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 750;
  display: block;
  margin-top: 4px;
  color: var(--text-heading);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  gap: 18px;
}

.card {
  padding: 19px;
  margin-bottom: 18px;
}

.cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.cardhead h2 {
  font-size: 14px;
  letter-spacing: 0.4px;
  margin: 0;
  color: var(--text-heading);
}

.cardhead a,
.linkbtn {
  color: var(--blue);
  font-size: 11px;
  background: none;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.linkbtn:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. ANNOUNCEMENTS & QUICK LINKS
   -------------------------------------------------------------------------- */
.announcement {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.announcement:first-of-type {
  border-top: 0;
}

.announcement > div:not(.ann-icon):not(.tag) {
  flex: 1;
  min-width: 0;
}

.ann-icon {
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  border-radius: 9px;
  background: var(--blue-soft);
  display: grid;
  place-items: center;
  color: var(--blue);
}

.announcement b {
  font-size: 12px;
  color: var(--text-heading);
}

.announcement p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  margin: 5px 0 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   7.1 LATEST BULLETIN ANNOUNCEMENTS (MODERN CARDS)
   ────────────────────────────────────────────────────────────────────────── */
#latestAnnouncementsContainer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.ann-bulletin-card {
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 4px solid var(--blue);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.ann-bulletin-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

/* Category Accent Borders & Background Tints */
.ann-bulletin-card[data-tag="URGENT"] {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, var(--panel2) 40%);
}

.ann-bulletin-card[data-tag="RECRUITMENT"] {
  border-left-color: #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, var(--panel2) 40%);
}

.ann-bulletin-card[data-tag="INTERNAL"] {
  border-left-color: #818cf8;
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.08) 0%, var(--panel2) 40%);
}

.ann-bulletin-card[data-tag="EVENT"] {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, var(--panel2) 40%);
}

.ann-bulletin-card[data-tag="NOTICE"] {
  border-left-color: #38bdf8;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.06) 0%, var(--panel2) 40%);
}

.ann-bulletin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ann-bulletin-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ann-bulletin-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.ann-bulletin-card[data-tag="URGENT"] .ann-bulletin-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.ann-bulletin-card[data-tag="RECRUITMENT"] .ann-bulletin-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.ann-bulletin-card[data-tag="INTERNAL"] .ann-bulletin-icon {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
}

.ann-bulletin-card[data-tag="EVENT"] .ann-bulletin-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.ann-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--tag-color);
}

.ann-tag-urgent {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
}

.ann-tag-recruitment {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #10b981 !important;
}

.ann-tag-internal {
  background: rgba(129, 140, 248, 0.15) !important;
  border-color: rgba(129, 140, 248, 0.4) !important;
  color: #818cf8 !important;
}

.ann-tag-event {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
}

.ann-tag-notice {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.ann-bulletin-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.ann-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.ann-meta-item i {
  font-size: 10px;
  opacity: 0.8;
}

.ann-bulletin-body {
  width: 100%;
}

.ann-bulletin-title {
  margin: 0 0 6px 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.4;
  word-break: break-word;
}

.ann-bulletin-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-line;
  opacity: 0.92;
}

/* Empty State */
.ann-empty-state {
  text-align: center;
  padding: 30px 18px;
  background: var(--panel2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.ann-empty-icon {
  font-size: 24px;
  color: var(--blue);
  margin-bottom: 8px;
  opacity: 0.85;
}

.ann-empty-state b {
  display: block;
  font-size: 13.5px;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.ann-empty-state p {
  font-size: 11.5px;
  margin: 0;
  color: var(--muted);
}

.tag {
  font-size: 10px;
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 700;
}

.quicklinks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quicklinks button {
  background: var(--quicklink-bg);
  border: 1px solid var(--quicklink-border);
  color: var(--quicklink-text);
  text-align: left;
  padding: 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.quicklinks button:hover {
  border-color: var(--blue);
  background: var(--quicklink-hover);
  color: var(--blue);
}

.quicklinks span {
  display: block;
  font-size: 18px;
  margin-bottom: 9px;
  color: var(--blue);
}

.rankrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rankicon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 9px;
  background: var(--gold-bg);
  font-size: 14px;
}

.rankrow b {
  font-size: 12px;
  color: var(--text-heading);
}

.rankrow small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.rankrow .tag {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   UPCOMING TRAINING & CALENDAR EVENTS (MODERN REDESIGN)
   -------------------------------------------------------------------------- */
.lspd-events-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.lspd-event-card {
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 4px solid var(--blue);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.lspd-event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

/* Division-specific Left Accent Borders and subtle gradient tints */
.lspd-event-card[data-division="Training Division"] {
  border-left-color: #38bdf8;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.07) 0%, var(--panel2) 40%);
}
.lspd-event-card[data-division="Patrol"] {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.07) 0%, var(--panel2) 40%);
}
.lspd-event-card[data-division="SWAT"] {
  border-left-color: #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.07) 0%, var(--panel2) 40%);
}
.lspd-event-card[data-division="Traffic"] {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.07) 0%, var(--panel2) 40%);
}
.lspd-event-card[data-division="Detective Bureau"] {
  border-left-color: #a855f7;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.07) 0%, var(--panel2) 40%);
}

.lspd-event-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* Calendar Date Badge */
.lspd-event-datebox {
  width: 52px;
  height: 56px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.lspd-event-datebox .event-month {
  width: 100%;
  padding: 3px 0;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: var(--blue-soft);
  color: var(--blue);
}

html.dark-mode .lspd-event-datebox .event-month {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.lspd-event-datebox .event-day {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
  margin-top: 5px;
}

/* Event Content Details */
.lspd-event-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.lspd-event-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.2px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lspd-event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Chips */
.lspd-event-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.lspd-event-chip.division {
  font-weight: 700;
}

.lspd-event-card[data-division="Training Division"] .lspd-event-chip.division {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}
.lspd-event-card[data-division="Patrol"] .lspd-event-chip.division {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.1);
}
.lspd-event-card[data-division="SWAT"] .lspd-event-chip.division {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.1);
}
.lspd-event-card[data-division="Traffic"] .lspd-event-chip.division {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.1);
}
.lspd-event-card[data-division="Detective Bureau"] .lspd-event-chip.division {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.35);
  background: rgba(168, 85, 247, 0.1);
}

.lspd-event-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Status Badge with Live Glow Dot */
.lspd-event-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

html.dark-mode .lspd-event-status {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.lspd-event-status .event-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* Admin Event Delete Button */
.lspd-event-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lspd-event-delete-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.38);
  transform: translateY(-1px);
}

.lspd-event-delete-btn:active {
  transform: translateY(0);
}

.lspd-events-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.lspd-events-empty i {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.45;
  display: block;
}

@media (max-width: 680px) {
  .lspd-event-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 14px;
  }
  .lspd-event-actions {
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
}


/* --------------------------------------------------------------------------
   8. FORMS & INPUTS
   -------------------------------------------------------------------------- */
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 11px;
  color: var(--text-heading);
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.report-filters input,
.report-filters select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  border-radius: 8px;
  padding: 11px 13px;
  font: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.report-filters input:focus,
.report-filters select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15);
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 17px;
}

/* --------------------------------------------------------------------------
   9. TABLES
   -------------------------------------------------------------------------- */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  color: var(--table-cell-text);
}

th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-subtle);
}

th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 750;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  color: var(--table-cell-text);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) {
  background: var(--table-row-odd);
}

tbody tr {
  transition: background-color 0.18s ease;
}

tbody tr:hover {
  background: var(--table-row-hover);
}

.pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--green-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-weight: 750;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ──────────────────────────────────────────────────────────────────────────
   9.1 HIGH COMMAND ACTIVITY LOG & AUDIT TRAILS
   ────────────────────────────────────────────────────────────────────────── */
.activity-row-deleted {
  background: rgba(239, 68, 68, 0.08) !important;
  border-left: 3px solid #ef4444;
}

.activity-row-deleted:hover {
  background: rgba(239, 68, 68, 0.14) !important;
}

.act-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.act-badge-deleted {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.act-badge-created {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.act-badge-rank {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.act-badge-updated {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.act-badge-default {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
}

.act-details-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  line-height: 1.5;
}

.act-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--panel2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text);
}

.act-chip-case {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-weight: 700;
  font-family: 'Courier Prime', monospace;
}

.act-chip-status {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.act-chip-alert {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
  font-weight: 600;
}


.pill.gold {
  background: var(--gold-bg);
  color: var(--gold);
}

.pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   10. MODALS & OVERLAYS
   -------------------------------------------------------------------------- */
.modalback,
.lspd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}

.modal,
.lspd-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: var(--modal-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.modal .cardhead {
  position: sticky;
  top: -24px;
  background: var(--modal-bg);
  padding: 10px 0;
  z-index: 2;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 18px;
  border-radius: 10px;
  color: var(--text-heading);
  font-size: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 10000;
}

/* --------------------------------------------------------------------------
   11. REPORT REGISTRATION FILTERS
   -------------------------------------------------------------------------- */
.report-filters {
  display: grid;
  grid-template-columns: minmax(200px, 1.7fr) repeat(2, minmax(135px, 1fr)) repeat(2, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin: 8px 0 4px;
}

.report-date-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
}

.report-date-filter input {
  min-width: 0;
}

.report-filter-count {
  margin: 10px 0 12px;
  font-size: 11px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   12. PAGES, FOOTER & UTILITIES
   -------------------------------------------------------------------------- */
@keyframes pageFadeIn {
  0% {
    opacity: 0;
    transform: translateY(7px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: pageFadeIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
}

.page-title {
  margin: 6px 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.page-desc {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 22px;
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding: 20px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.footer-signature {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 20px;
  margin: 2px auto 0;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(10, 35, 66, 0.04);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  transition: all 0.25s ease;
  user-select: text;
}

.footer-signature:hover {
  border-color: rgba(180, 83, 9, 0.35);
  box-shadow: 0 4px 14px rgba(10, 35, 66, 0.08);
}

html.dark-mode .footer-signature {
  background: #0d1726;
  border-color: #1b2f48;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

html.dark-mode .footer-signature:hover {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 12px rgba(251, 191, 36, 0.12);
}

.sig-prefix {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

.sig-connector {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--muted);
  opacity: 0.85;
  padding: 0 1px;
}

.sig-name {
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: all 0.2s ease;
  cursor: default;
}

.sig-yamada {
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 12px;
  color: #0a2342;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(10, 35, 66, 0.04);
  border-bottom: 2px solid #b45309;
}

html.dark-mode .sig-yamada {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: #fbbf24;
}

.sig-yamada:hover {
  color: #b45309;
  background: rgba(180, 83, 9, 0.08);
  transform: translateY(-1px);
}

html.dark-mode .sig-yamada:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
  transform: translateY(-1px);
}

.sig-kech {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #0a2342;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(10, 35, 66, 0.04);
  border-bottom: 2px solid #b45309;
  font-family: inherit;
}

html.dark-mode .sig-kech {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: #fbbf24;
}

.sig-kech:hover {
  color: #b45309;
  background: rgba(180, 83, 9, 0.08);
  transform: translateY(-1px);
}

html.dark-mode .sig-kech:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
  transform: translateY(-1px);
}

.main {
  padding-top: 10px !important;
}

.main > .topbar {
  margin-bottom: 10px !important;
}

.main > .page:not(#page-home) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .report-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .report-filters #reportSearch {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 76px 1fr;
  }
  .sidebar {
    padding: 17px 8px;
  }
  .brand {
    justify-content: center;
    padding: 0 0 20px;
  }
  .brandtext,
  .navtitle,
  .nav button .label,
  .sidebottom {
    display: none;
  }
  .nav button {
    justify-content: center;
    padding: 12px 4px;
  }
  .nav button span {
    font-size: 18px;
  }
  .main {
    padding: 16px;
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .report-filters {
    grid-template-columns: 1fr 1fr;
  }
  .report-filters #reportSearch {
    grid-column: 1 / -1;
  }
  .report-date-filter {
    flex-direction: column;
    align-items: stretch;
  }
  #resetReportFilters {
    width: 100%;
  }
  .modalback {
    padding: 8px;
  }
  .modal {
    max-height: calc(100vh - 16px);
    padding: 16px;
  }
  .modal .formgrid {
    grid-template-columns: 1fr;
  }
  .modal .field.full {
    grid-column: auto;
  }
  .topactions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 12px;
  }
  .quicklinks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    display: flex;
    align-items: center;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .brand {
    padding: 0;
    margin-right: auto;
  }
  .brandtext {
    display: block;
  }
  .nav {
    display: flex;
    gap: 3px;
  }
  .navtitle {
    display: none;
  }
  .nav button {
    width: 39px;
    height: 39px;
    margin: 0;
    padding: 0;
    justify-content: center;
  }
  .nav button .label {
    display: none;
  }
  .sidebottom {
    display: none;
  }
  .main {
    padding: 12px;
  }
  .statuspill {
    display: none;
  }
  .hero-content {
    padding: 24px 18px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .footer {
    flex-direction: column;
    gap: 14px;
  }
  .footer-meta {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }
  .footer-signature {
    width: 100%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 11px;
    gap: 6px 8px;
  }
}

/* --------------------------------------------------------------------------
   14. REPORT POINTS & LEADERBOARD RECOGNITION
   -------------------------------------------------------------------------- */
.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--gold);
  background: var(--gold-bg);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

.tag.gold {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.leaderboard-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.9rem;
}

.leaderboard-rank.gold {
  background: var(--gold-bg);
  border: 1px solid rgba(234, 179, 8, 0.4);
}

/* ==========================================================================
   LSPD OFFICIAL REPORT — ATTACHED EVIDENCE MEDIA & PRINT STYLES
   ========================================================================== */
.attached-evidence-media {
  margin-top: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 4px;
}

.evidence-subsection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #0c2340;
  margin-bottom: 10px;
}

.evidence-subsection-title {
  font-size: 8pt;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0c2340;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.evidence-summary-badge {
  font-size: 7pt;
  font-weight: 700;
  color: #0c2340;
  background: #edf2f7;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.evidence-subgroup {
  margin-top: 10px;
}

.evidence-subgroup-title {
  font-size: 7.2pt;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.evidence-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evidence-image-item {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 5px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  page-break-inside: avoid;
}

.evidence-image-thumb-wrap {
  width: 100%;
  height: 160px;
  max-height: 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.evidence-image-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.evidence-img-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #64748b;
  font-size: 7.5pt;
  text-align: center;
  background: #f1f5f9;
  padding: 10px;
}

.evidence-img-fallback i {
  font-size: 16pt;
  margin-bottom: 4px;
  color: #94a3b8;
}

.evidence-image-meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 7pt;
  line-height: 1.3;
  flex-wrap: wrap;
}

.evidence-item-tag {
  font-weight: 800;
  color: #0c2340;
  background: #edf2f7;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 6.5pt;
  letter-spacing: 0.4px;
}

.evidence-caption-text {
  color: #334155;
  font-weight: 500;
  word-break: break-word;
}

.evidence-video-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evidence-video-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 4px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.evidence-video-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #0c2340;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11pt;
  flex-shrink: 0;
  margin-top: 1px;
}

.evidence-video-content {
  flex: 1;
  min-width: 0;
}

.evidence-video-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.evidence-video-num {
  font-size: 6.5pt;
  font-weight: 800;
  color: #0c2340;
  background: #edf2f7;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.4px;
}

.evidence-video-title {
  font-size: 8pt;
  font-weight: 700;
  color: #0f172a;
}

.evidence-video-provider {
  font-size: 6.5pt;
  background: #e2e8f0;
  color: #475569;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.evidence-video-url-box {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.evidence-video-link {
  font-family: 'Courier Prime', monospace, monospace;
  font-size: 7.5pt;
  color: #0b57d0;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media screen and (max-width: 600px) {
  .evidence-image-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .attached-evidence-media {
    background: #ffffff !important;
    color: #111111 !important;
    box-shadow: none !important;
    border: 1px solid #94a3b8 !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
  .evidence-subsection-header {
    border-bottom: 1.5px solid #0c2340 !important;
  }
  .evidence-subsection-title {
    color: #0c2340 !important;
  }
  .evidence-summary-badge {
    background: #f1f5f9 !important;
    color: #111111 !important;
    border: 1px solid #cbd5e1 !important;
  }
  .evidence-image-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
  .evidence-image-item {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 1px solid #94a3b8 !important;
    background: #ffffff !important;
    padding: 5px !important;
  }
  .evidence-image-thumb-wrap {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
  }
  .evidence-image-thumb-wrap img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 180px !important;
    object-fit: contain !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .evidence-img-fallback {
    background: #f8fafc !important;
    color: #475569 !important;
  }
  .evidence-video-item {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    border: 1px solid #94a3b8 !important;
    background: #ffffff !important;
  }
  .evidence-video-icon {
    background: #0c2340 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .evidence-video-link {
    color: #0c2340 !important;
    text-decoration: underline !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
  .evidence-print-only {
    display: block !important;
  }
  .evidence-screen-only,
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   OFFICER DIRECT DISPATCH & SECURE MESSAGING STYLES
   ========================================================================== */

.officer-comms-card {
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.officer-comms-card .cardhead {
  margin-bottom: 0 !important;
}

.lspd-comms-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 132, 199, 0.12);
  color: var(--cyan, #0284c7);
  font-size: 1.15rem;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.lspd-messenger-wrap {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 640px;
  max-height: 80vh;
  min-height: 480px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  position: relative;
}

@media (max-width: 860px) {
  .lspd-messenger-wrap {
    grid-template-columns: 1fr;
    height: 600px;
    max-height: 85vh;
    min-height: 460px;
  }

  .lspd-messenger-wrap.mobile-chat-open .lspd-messenger-sidebar {
    display: none !important;
  }

  .lspd-messenger-wrap.mobile-chat-open .lspd-messenger-main {
    display: flex !important;
  }

  .lspd-messenger-wrap:not(.mobile-chat-open) .lspd-messenger-sidebar {
    display: flex !important;
  }

  .lspd-messenger-wrap:not(.mobile-chat-open) .lspd-messenger-main {
    display: none !important;
  }

  .lspd-chat-back-btn {
    display: inline-flex !important;
  }
}

@media (min-width: 861px) {
  .lspd-messenger-sidebar {
    display: flex !important;
  }
  .lspd-messenger-main {
    display: flex !important;
  }
  .lspd-chat-back-btn {
    display: none !important;
  }
}

/* Sidebar */
.lspd-messenger-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--panel2);
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.lspd-search-box {
  position: relative;
  margin: 12px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.lspd-search-box i {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.lspd-search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.lspd-search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15);
}

.lspd-conversations-list {
  flex: 1 1 0px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 12px 8px;
}

.lspd-msg-loading {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Conversation list items */
.lspd-conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  position: relative;
  background: var(--panel);
}

.lspd-conversation-item:hover {
  background: var(--panel-hover);
  border-color: var(--line);
  transform: translateY(-1px);
}

.lspd-conversation-item.active {
  background: var(--blue-soft);
  border-color: rgba(11, 87, 208, 0.35);
  box-shadow: 0 2px 8px rgba(11, 87, 208, 0.12);
}

.lspd-convo-avatar-box {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.lspd-convo-avatar-box img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.lspd-convo-presence-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--panel);
}

.lspd-convo-presence-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.lspd-convo-presence-dot.idle { background: #f59e0b; }
.lspd-convo-presence-dot.dnd { background: #ef4444; }
.lspd-convo-presence-dot.offline { background: #94a3b8; }

.lspd-convo-details {
  flex: 1;
  min-width: 0;
}

.lspd-convo-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}

.lspd-convo-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lspd-convo-time {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.lspd-convo-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.lspd-convo-snippet {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lspd-unread-badge {
  background: var(--blue);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 8px rgba(11, 87, 208, 0.5); }
  100% { transform: scale(1); }
}

/* Chat Main View */
.lspd-messenger-main {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  position: relative;
}

.lspd-chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  height: 100%;
  text-align: center;
  color: var(--muted);
}

.lspd-chat-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--cyan, #0284c7);
  margin-bottom: 16px;
}

.lspd-chat-empty-state h3 {
  color: var(--text-heading);
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.lspd-chat-empty-state p {
  max-width: 440px;
  margin: 0 0 20px 0;
  line-height: 1.5;
  font-size: 0.92rem;
}

.lspd-chat-active-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  position: relative;
}

/* Active chat header - PERMANENTLY PINNED AT TOP */
.lspd-active-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.lspd-chat-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.lspd-active-officer-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lspd-chat-avatar-wrap {
  width: 46px;
  height: 46px;
  position: relative;
  flex-shrink: 0;
}

.lspd-chat-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.lspd-badge-callsign {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(2, 132, 199, 0.12);
  color: var(--cyan, #0284c7);
  border: 1px solid rgba(2, 132, 199, 0.3);
  letter-spacing: 0.5px;
}

/* Messages Stream Area - ONLY THIS ELEMENT SCROLLS */
.lspd-messages-stream {
  flex: 1 1 0px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.lspd-messages-stream::-webkit-scrollbar {
  width: 6px;
}

.lspd-messages-stream::-webkit-scrollbar-track {
  background: transparent;
}

.lspd-messages-stream::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.lspd-messages-stream::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.lspd-scroll-bottom-btn {
  position: absolute;
  bottom: 110px;
  right: 20px;
  background: var(--panel2);
  color: var(--cyan, #0284c7);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.lspd-scroll-bottom-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lspd-scroll-bottom-btn:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(11, 87, 208, 0.4);
}

.lspd-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  position: relative;
}

.lspd-date-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.lspd-date-divider span {
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* Message Rows & Bubbles */
.lspd-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 82%;
  animation: fadeInMsg 0.18s ease-out;
}

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

.lspd-msg-row.outgoing {
  margin-left: auto;
  flex-direction: row-reverse;
}

.lspd-msg-row.incoming {
  margin-right: auto;
}

.lspd-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  position: relative;
  line-height: 1.5;
  font-size: 0.92rem;
  word-break: break-word;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lspd-msg-row.outgoing .lspd-msg-bubble {
  background: linear-gradient(135deg, #0b57d0 0%, #0284c7 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

html.dark-mode .lspd-msg-row.outgoing .lspd-msg-bubble {
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  color: #ffffff;
}

.lspd-msg-row.incoming .lspd-msg-bubble {
  background: var(--panel);
  color: var(--text);
  border-bottom-left-radius: 3px;
  border: 1px solid var(--line);
}

.lspd-msg-author {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan, #0284c7);
}

.lspd-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.7rem;
  margin-top: 6px;
  opacity: 0.82;
}

.lspd-msg-row.outgoing .lspd-msg-meta {
  color: rgba(255, 255, 255, 0.88);
}

.lspd-msg-row.incoming .lspd-msg-meta {
  color: var(--muted);
}

.lspd-read-icon {
  font-size: 0.72rem;
}

.lspd-read-icon.read {
  color: #38bdf8;
}

/* Quick Tactical Chips - Pinned rigidly above input */
.lspd-quick-chips-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--panel2);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
  flex: 0 0 auto;
  flex-shrink: 0;
  z-index: 5;
}

.lspd-quick-chips-strip::-webkit-scrollbar {
  height: 4px;
}

.lspd-quick-chips-strip .chip-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.lspd-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lspd-chip:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(11, 87, 208, 0.35);
  transform: translateY(-1px);
}

/* Input Form Row - Pinned rigidly to the bottom */
.lspd-chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.lspd-chat-input-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.lspd-chat-input-wrapper textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-family: inherit;
  font-size: 0.92rem;
  resize: none;
  height: 44px;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
  overflow-y: auto;
}

.lspd-chat-input-wrapper textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15);
}

.lspd-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  background: linear-gradient(135deg, #0b57d0 0%, #0284c7 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 87, 208, 0.25);
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.lspd-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 87, 208, 0.35);
}

.lspd-send-btn:active {
  transform: translateY(0);
}

/* Search Modal Results */
.lspd-officer-search-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lspd-officer-search-card:hover {
  background: var(--panel-hover);
  border-color: var(--blue);
  transform: translateX(3px);
}

.lspd-officer-search-card .officer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lspd-officer-search-card img {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
}

/* ==========================================================================
   OFFICER PROFILE PICTURE CUSTOMIZATION (COMPACT & HARMONIOUS)
   ========================================================================== */
.profile-avatar-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  flex: 0 0 76px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

.profile-avatar-wrap .officer-avatar.is-large {
  display: block;
  width: 76px;
  height: 76px;
  position: relative;
  border-radius: 50%;
}

.profile-avatar-wrap .officer-avatar.is-large img,
.profile-avatar-wrap .officer-avatar.is-large .avatar-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(14, 165, 233, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.profile-avatar-wrap:hover .officer-avatar.is-large img,
.profile-avatar-wrap:hover .officer-avatar.is-large .avatar-initials {
  filter: brightness(0.85);
  border-color: var(--cyan, #0284c7);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.45);
}

.profile-avatar-wrap .officer-avatar .presence-dot {
  bottom: 2px;
  left: 3px;
  right: auto;
  z-index: 4;
}

.profile-avatar-wrap .avatar-camera-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid var(--panel, #091322);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  z-index: 5;
  pointer-events: none;
}

.profile-avatar-wrap:hover .avatar-camera-badge {
  transform: scale(1.15);
  background: #0ea5e9;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.6);
}

.profile-avatar-wrap .profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(3, 7, 18, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.profile-avatar-wrap:hover .profile-avatar-overlay {
  opacity: 1;
}

/* Compact tag button matching other tags in the badges row */
.tag-btn-photo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: rgba(14, 165, 233, 0.12);
  color: var(--cyan, #0284c7);
  border: 1px solid rgba(14, 165, 233, 0.3);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  line-height: normal;
}

.tag-btn-photo:hover {
  background: rgba(14, 165, 233, 0.24);
  border-color: var(--cyan, #0284c7);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Avatar Modal Components - Compact & Harmonious */
.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
}

.avatar-preview-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 2px solid var(--cyan, #0284c7);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.25);
  overflow: visible;
  flex-shrink: 0;
}

.avatar-preview-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-preview-ring .presence-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--panel);
}

.avatar-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.avatar-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan, #0284c7);
  letter-spacing: 0.5px;
}

.avatar-preview-text {
  font-size: 0.8rem;
  color: var(--muted);
}

.avatar-tabs-header {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.avatar-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.avatar-tab.active {
  background: rgba(14, 165, 233, 0.14);
  color: var(--cyan, #0284c7);
  border-color: rgba(14, 165, 233, 0.35);
}

.avatar-tab:hover:not(.active) {
  background: var(--panel2);
  color: var(--text);
}

.avatar-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  border: 2px dashed rgba(14, 165, 233, 0.35);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.03);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.avatar-dropzone:hover,
.avatar-dropzone.drag-active {
  border-color: var(--cyan, #0284c7);
  background: rgba(14, 165, 233, 0.08);
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.14);
  color: var(--cyan, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.avatar-reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   DEPARTMENT DIVISIONS & SPECIALIZED UNITS (MODERN & DYNAMIC)
   ========================================================================== */
.divisions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.division-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.division-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--div-color, var(--blue));
  transition: height 0.2s ease;
}

.division-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.division-card:hover::before {
  height: 5px;
}

.division-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.division-icon-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(14, 165, 233, 0.1);
  color: var(--div-color, var(--cyan));
  border: 1px solid rgba(14, 165, 233, 0.2);
  transition: transform 0.2s ease;
}

.division-card:hover .division-icon-wrap {
  transform: scale(1.08);
}

.division-alias-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--line);
  color: var(--muted);
}

.division-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 2px;
}

.division-motto {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.4;
}

.division-summary {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.division-roster-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.division-officer-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-heading);
}

.division-avatar-stack {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
}

.division-avatar-stack .officer-avatar {
  margin-left: -8px;
  border: 2px solid var(--panel);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.division-equipment-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.division-equipment-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--line);
}

.division-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.division-card.is-standby {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, var(--panel) 100%);
}

.division-card.is-standby::before {
  background: #ef4444;
  opacity: 0.75;
}

.division-admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.75);
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.3px;
}

.division-admin-toggle:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.division-admin-toggle.is-active {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.division-admin-toggle.is-inactive {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.division-standby-banner {
  margin-top: 12px;
  margin-bottom: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.73rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.division-filter-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.18s ease;
}

.division-filter-btn:hover {
  background: var(--panel2);
  color: var(--text);
}

.division-filter-btn.active {
  background: rgba(14, 165, 233, 0.15);
  color: var(--cyan, #0284c7);
  border-color: rgba(14, 165, 233, 0.35);
}

/* Division Modal Custom Styling */
.division-modal-banner {
  position: relative;
  padding: 24px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--banner-bg, linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(15, 23, 42, 0.8) 100%));
}

.division-modal-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.division-modal-icon-badge {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.division-alias-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.division-modal-close {
  background: rgba(0, 0, 0, 0.3) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px;
}

.division-info-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
}

.division-info-box small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-transform: uppercase;
}

.division-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.division-equipment-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.division-roster-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.division-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  transition: background 0.18s ease;
}

.division-roster-row:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.25);
}

.page-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────────────────────────
   DIVISION TRANSFER & ASSIGNMENT SYSTEM STYLES
   ───────────────────────────────────────────────────────────── */

.transfer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.transfer-status-badge.pending {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.12);
}

.transfer-status-badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.transfer-status-badge.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.div-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}

.div-tag-badge.patrol { border-color: rgba(59, 130, 246, 0.4); color: #3b82f6; }
.div-tag-badge.traffic { border-color: rgba(245, 158, 11, 0.4); color: #f59e0b; }
.div-tag-badge.air { border-color: rgba(14, 165, 233, 0.4); color: #0ea5e9; }
.div-tag-badge.detective { border-color: rgba(168, 85, 247, 0.4); color: #a855f7; }
.div-tag-badge.swat { border-color: rgba(16, 185, 129, 0.4); color: #10b981; }
.div-tag-badge.training { border-color: rgba(244, 63, 94, 0.4); color: #f43f5e; }

.transfer-flow-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.transfer-flow-arrow {
  color: var(--muted);
  font-size: 0.7rem;
}

.btn-transfer-approve {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-transfer-approve:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.btn-transfer-reject {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-transfer-reject:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.division-target-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.division-target-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.division-target-option:hover {
  border-color: rgba(14, 165, 233, 0.4);
  background: rgba(14, 165, 233, 0.05);
}

.division-target-option.selected {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.2);
}

.division-target-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.division-target-option .opt-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.division-target-option .opt-info {
  display: flex;
  flex-direction: column;
}

.division-target-option .opt-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.division-target-option .opt-type {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
}

.transfer-reason-preview {
  max-width: 260px;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   APPLICATION REVIEW QUEUE CARDS REDESIGN
   -------------------------------------------------------------------------- */
.recruitment-apps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.applicant-review-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  padding: 16px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.applicant-review-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

.applicant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.applicant-id-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.applicant-id-badge .app-id {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-heading);
  background: rgba(59, 130, 246, 0.12);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  letter-spacing: 0.5px;
}

.applicant-id-badge .app-date {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.applicant-status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.applicant-status-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.applicant-status-tag.status-accepted {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.applicant-status-tag.status-rejected {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.applicant-status-tag.status-interview {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.applicant-status-tag.status-review {
  background: var(--blue-soft);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.applicant-status-select {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.applicant-status-select:focus {
  border-color: var(--blue);
}

.applicant-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.applicant-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.applicant-info-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.applicant-info-val {
  font-size: 0.94rem;
  color: var(--text);
}

.discord-id-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
  padding: 2px 7px;
  border-radius: 5px;
  margin-top: 4px;
  display: inline-block;
  border: 1px solid var(--line);
}

.applicant-motivation-box,
.applicant-section-box {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.applicant-section-box.staff-notes-box {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-left: 3px solid var(--blue);
}

.applicant-motivation-title,
.applicant-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.7px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.applicant-motivation-content,
.applicant-section-content {
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  text-align: start;
  unicode-bidi: plaintext;
  max-height: none !important;
  overflow: visible !important;
}

.discord-id-code.clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.discord-id-code.clickable:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--cyan);
  border-color: rgba(59, 130, 246, 0.4);
}

.app-filter-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.app-filter-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.app-filter-btn.active {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 5px;
  display: inline-block;
}

.status-dot.dot-review { background: var(--cyan); }
.status-dot.dot-interview { background: var(--gold); }
.status-dot.dot-accepted { background: var(--green); }
.status-dot.dot-rejected { background: var(--red); }

.applicant-delete-btn {
  background: var(--red-bg, rgba(248, 113, 113, 0.15));
  color: var(--red, #f87171);
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  line-height: 1;
}

.applicant-delete-btn:hover {
  background: var(--red, #dc2626);
  color: #ffffff;
  border-color: var(--red, #dc2626);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}

/* ──────────────────────────────────────────────────────────────────────────
   13. SKELETON SCREENS & SHIMMER LOADING SYSTEM
   ────────────────────────────────────────────────────────────────────────── */
@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  display: inline-block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(59, 130, 246, 0.15) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.8s infinite linear;
}

html:not(.dark-mode) .skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(29, 78, 216, 0.12) 50%,
    rgba(0, 0, 0, 0.04) 75%
  );
  background-size: 200% 100%;
}

.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.skeleton-row td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* ──────────────────────────────────────────────────────────────────────────
   14. TACTICAL MODULES: PENAL CODE, 10-CODES & BOLO
   ────────────────────────────────────────────────────────────────────────── */
.penal-hud {
  position: sticky;
  top: 76px;
  z-index: 35;
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.45);
}

.penal-hud-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: center;
}

.penal-stat-box {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--line-subtle);
}

.penal-stat-label {
  font-size: 11px;
  letter-spacing: 0.8px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
}

.penal-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-heading);
  margin-top: 4px;
}

.penal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
  flex-wrap: wrap;
}

.charges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.charge-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.charge-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.charge-card.selected {
  border-color: var(--blue);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.12), var(--panel));
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

.charge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.charge-title {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--text-heading);
  line-height: 1.35;
}

.charge-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.charge-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.charge-chip-fine {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.charge-chip-time {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.charge-chip-bail {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.charge-chip-nobail {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 10-Codes Guide */
.tencodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.tencode-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tencode-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  background: var(--panel-hover);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.tencode-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
  color: var(--cyan);
  background: var(--blue-soft);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.tencode-meaning {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  margin-left: 14px;
}

/* BOLO Board */
.bolo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.bolo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.bolo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.bolo-card.threat-extreme {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.18);
}

.bolo-card.threat-high {
  border-color: rgba(245, 158, 11, 0.4);
}

.bolo-badge-extreme {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.bolo-item-row {
  margin: 6px 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.bolo-item-row b {
  color: var(--text-heading);
}


/* ==========================================================================
   MOBILE & TABLET RESPONSIVE DESIGN SYSTEM (الهواتف الذكية والأجهزة اللوحية)
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 9px;
  background: var(--blue-soft);
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
  background: var(--blue);
  color: #ffffff;
  transform: scale(1.05);
}

.sidebar-close-btn {
  display: none;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
  font-size: 15px;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  margin-left: auto;
  line-height: 1;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 992px) {
  .app {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -300px !important;
    width: min(290px, 86vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 10000 !important;
    box-shadow: none !important;
    transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s ease !important;
  }

  .sidebar.mobile-open {
    left: 0 !important;
    box-shadow: 16px 0 60px rgba(0, 0, 0, 0.8) !important;
  }

  .sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .main {
    padding: 10px 14px 40px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  .topbar {
    position: sticky !important;
    top: 8px !important;
    padding: 10px 14px !important;
    margin-bottom: 14px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .crumb {
    font-size: 0.78rem !important;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topactions {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
  }

  .topactions .statuspill {
    font-size: 0.68rem !important;
    padding: 4px 8px !important;
  }

  .hero {
    grid-template-columns: 1fr !important;
    padding: 24px 18px !important;
    min-height: auto !important;
    border-radius: 14px !important;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 7.5vw, 2.6rem) !important;
    line-height: 1.15 !important;
  }

  .hero p {
    font-size: 0.9rem !important;
    max-width: 100% !important;
  }

  .hero-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .hero-buttons button {
    flex: 1 1 auto !important;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stat {
    padding: 12px !important;
  }

  .stat strong {
    font-size: 1.25rem !important;
  }

  .grid,
  .analytics-grid,
  .divisions-grid,
  .quickactions-grid,
  .bolo-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .card {
    padding: 14px !important;
    border-radius: 13px !important;
  }

  .cardhead {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .cardhead button {
    width: 100% !important;
  }

  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }

  .lspd-modal {
    width: min(94vw, 500px) !important;
    max-width: 94vw !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    padding: 16px !important;
    margin: 8px !important;
    border-radius: 13px !important;
  }
}

@media (max-width: 540px) {
  .stats {
    grid-template-columns: 1fr !important;
  }

  .topbar {
    padding: 8px 10px !important;
  }

  .topactions #lspdAuthStatus,
  .topactions .statuspill:first-child {
    display: none !important;
  }

  .hero-buttons button {
    width: 100% !important;
  }

  .profile-head {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .profile-facts {
    grid-template-columns: 1fr !important;
  }
}
