/* ============================================================
   HMP THORNRIDGE — OFFICIAL SYSTEM THEME
   His Majesty's Prison & Probation Service — Thornridge Estate
   ============================================================ */



:root {
  --navy:        #0b1f3d;
  --navy-deep:   #071429;
  --navy-mid:    #12284e;
  --navy-soft:   #1a3563;
  --crown-gold:  #c8932a;
  --crown-light: #e8b84b;
  --crown-pale:  #fdf3e1;
  --bg-page:     #eef0f4;
  --bg-white:    #ffffff;
  --bg-panel:    #f7f8fa;
  --bg-stripe:   #f1f3f7;
  --text-primary:   #0d1b2a;
  --text-secondary: #4a5568;
  --text-muted:     #718096;
  --border:      #d0d7e2;
  --border-soft: #e4e8ef;
  --col-max:      #b91c1c;
  --col-max-bg:   #fef2f2;
  --col-genpop:   #92400e;
  --col-genpop-bg:#fffbeb;
  --col-pretrial: #1e40af;
  --col-pretrial-bg:#eff6ff;
  --col-medical:  #065f46;
  --col-medical-bg:#ecfdf5;
  --col-death:    #374151;
  --col-death-bg: #f9fafb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.08), 0 10px 10px rgba(0,0,0,0.04);
  --radius:    6px;
  --radius-lg: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-page) !important;
  color: var(--text-primary) !important;
  min-height: 100vh;
  line-height: 1.6;
}

/* Classification Banner */
.classification-banner {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.5);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.3rem 1rem;
  border-bottom: 1px solid rgba(200,147,42,0.3);
}
.classification-banner span { color: var(--crown-gold); font-weight: 500; }

/* Official Header */
.official-header {
  background: var(--navy);
  border-bottom: 4px solid var(--crown-gold);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.official-header .header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}
.hmp-crest { flex-shrink: 0; width: 50px; height: 50px; }
.header-identity { flex: 1; min-width: 0; }
.header-service-line {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crown-gold);
  display: block;
  line-height: 1.2;
}
.header-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  text-decoration: none;
  display: block;
}
.header-title:hover { color: var(--crown-light); text-decoration: none; }
.header-subtitle {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  display: block;
  margin-top: 0.1rem;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.header-guard-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
  font-family: 'IBM Plex Mono', monospace;
}
.header-guard-tag strong { color: #fff; }

/* Official Nav */
.official-nav { background: var(--navy-mid); border-bottom: 1px solid rgba(255,255,255,0.07); }
.official-nav .nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: stretch;
}
.official-nav .nav-item-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.official-nav .nav-item-link:hover { color: #fff; background: rgba(255,255,255,0.05); border-bottom-color: rgba(200,147,42,0.4); text-decoration: none; }
.official-nav .nav-item-link.active,
.official-nav .nav-item-link.nav-cta { color: #fff; border-bottom-color: var(--crown-gold); }
.official-nav .nav-item-link.nav-cta { color: var(--crown-light); font-weight: 600; }
.official-nav .nav-spacer { flex: 1; }

/* Page Layout */
.page-wrapper { max-width: 1400px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.page-header { margin-bottom: 1.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.page-header .page-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crown-gold);
  font-weight: 500;
  margin-bottom: 0.2rem;
  display: block;
}
.page-header h1, .page-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}
.page-header .page-desc { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.3rem; margin-bottom: 0; }

/* Cards */
.card, .panel-card, .form-card, .report-card, .info-panel,
.profile-card, .profile-summary, .stat-card, .action-card, .list-card, .hero-card {
  background: var(--bg-white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  color: var(--text-primary) !important;
  overflow: hidden;
}
.card .card-header {
  background: var(--bg-panel) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}
.card .card-body { color: var(--text-primary); }
.card:hover { border-color: rgba(11,31,61,0.25) !important; }

.stat-card { position: relative; }
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--crown-gold);
}
.stat-card .stat-value {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Tables */
.table-shell, .table-wrap {
  background: var(--bg-white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}
.table { margin-bottom: 0; color: var(--text-primary) !important; font-size: 0.875rem; }
.table thead th {
  background: var(--navy) !important;
  color: rgba(255,255,255,0.9) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none !important;
  padding: 0.85rem 1rem;
  white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--border-soft); transition: background 0.1s; }
.table tbody tr:hover { background: var(--bg-stripe) !important; }
.table tbody td { padding: 0.75rem 1rem; vertical-align: middle; border-color: var(--border-soft) !important; color: var(--text-primary); }
.table-striped tbody tr:nth-of-type(odd) { background-color: var(--bg-stripe) !important; }

/* Forms */
.form-control, .form-select, textarea.form-control {
  background: var(--bg-white) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
  font-size: 0.9rem !important;
}
.form-control::placeholder, textarea.form-control::placeholder { color: var(--text-muted) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--navy-soft) !important;
  box-shadow: 0 0 0 3px rgba(11,31,61,0.12) !important;
  background: var(--bg-white) !important;
  color: var(--text-primary) !important;
}
.form-label, label { color: var(--text-primary) !important; font-weight: 600 !important; font-size: 0.875rem !important; }
.form-text, .helper-text { color: var(--text-secondary) !important; font-size: 0.8rem !important; }

/* Buttons */
.btn { border-radius: var(--radius) !important; font-weight: 600 !important; font-size: 0.85rem !important; transition: all 0.15s; box-shadow: none !important; }
.btn-primary, .btn-info { background: var(--navy) !important; border-color: var(--navy) !important; color: #fff !important; }
.btn-primary:hover, .btn-info:hover { background: var(--navy-soft) !important; border-color: var(--navy-soft) !important; color: #fff !important; }
.btn-outline-primary, .btn-outline-info { background: transparent !important; border-color: var(--navy) !important; color: var(--navy) !important; }
.btn-outline-primary:hover, .btn-outline-info:hover { background: var(--navy) !important; color: #fff !important; }
.btn-outline-secondary { background: transparent !important; border-color: var(--border) !important; color: var(--text-secondary) !important; }
.btn-outline-secondary:hover { background: var(--bg-stripe) !important; color: var(--text-primary) !important; }
.btn-outline-light { background: transparent !important; border-color: rgba(255,255,255,0.3) !important; color: rgba(255,255,255,0.85) !important; }
.btn-outline-light:hover { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
.btn-danger { background: var(--col-max) !important; border-color: var(--col-max) !important; color: #fff !important; }
.btn-success { background: #166534 !important; border-color: #166534 !important; color: #fff !important; }
.btn-warning { background: #d97706 !important; border-color: #d97706 !important; color: #fff !important; }
.btn-secondary { background: #4b5563 !important; border-color: #4b5563 !important; color: #fff !important; }

/* Badges */
.badge {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3em 0.65em !important;
  border-radius: 4px !important;
}
.badge.bg-danger { background: var(--col-max) !important; color: #fff !important; }
.badge.bg-warning { background: #d97706 !important; color: #fff !important; }
.badge.bg-warning.text-dark { color: #fff !important; }
.badge.bg-primary { background: var(--navy) !important; color: #fff !important; }
.badge.bg-info { background: #0369a1 !important; color: #fff !important; }
.badge.bg-info.text-dark { color: #fff !important; }
.badge.bg-success { background: #166534 !important; color: #fff !important; }
.badge.bg-secondary { background: #4b5563 !important; color: #fff !important; }
.badge.bg-dark { background: #1f2937 !important; color: #fff !important; }
.badge.bg-light { background: #f3f4f6 !important; color: #1f2937 !important; }
.badge.bg-light.text-dark { color: #1f2937 !important; }

/* Alerts */
.alert {
  background: var(--bg-white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  border-left-width: 4px !important;
  padding: 0.85rem 1.1rem !important;
  font-size: 0.875rem;
}
.alert-danger  { border-left-color: var(--col-max) !important; background: var(--col-max-bg) !important; color: #7f1d1d !important; }
.alert-success { border-left-color: #166534 !important; background: #f0fdf4 !important; color: #14532d !important; }
.alert-warning { border-left-color: #d97706 !important; background: #fffbeb !important; color: #78350f !important; }
.alert-info    { border-left-color: #0369a1 !important; background: #eff6ff !important; color: #1e3a5f !important; }

/* Modals */
.modal-content {
  background: var(--bg-white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text-primary) !important;
  overflow: visible !important;
}
.modal-header {
  background: var(--navy) !important;
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 1rem 1.25rem !important;
}
.modal-header .modal-title { color: #fff !important; font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; }
.modal-header .btn-close { filter: invert(1) brightness(2); }
.modal-footer { background: var(--bg-panel) !important; border-top: 1px solid var(--border) !important; }

/* Bootstrap navbar overrides */
.navbar, .navbar.bg-dark, .navbar.navbar-dark, .navbar.navbar-dark.bg-dark {
  background: var(--navy) !important;
  border-bottom: 4px solid var(--crown-gold) !important;
  backdrop-filter: none !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
}
.navbar-brand {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #fff !important;
}

/* Login */
.login-container {
  max-width: 480px;
  margin: 6vh auto;
  background: var(--bg-white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
  padding: 0 !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-family: 'Source Serif 4', Georgia, serif; color: var(--navy) !important; }
a { color: var(--navy-soft); }
a:hover { color: var(--navy); }

/* Text utilities */
.text-info { color: #0369a1 !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.muted { color: var(--text-muted) !important; }
.text-navy { color: var(--navy) !important; }
.text-gold { color: var(--crown-gold) !important; }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 0.85em; letter-spacing: 0.04em; }
.inmate-number-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--navy);
  color: var(--crown-gold);
  padding: 0.18em 0.5em;
  border-radius: 3px;
}

/* Official footer */
.official-footer {
  background: var(--navy-deep);
  border-top: 3px solid var(--crown-gold);
  padding: 1.25rem 1.5rem;
  margin-top: 3rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.72rem;
  text-align: center;
  letter-spacing: 0.04em;
}
.official-footer strong { color: rgba(255,255,255,0.65); }
.official-footer .footer-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: rgba(200,147,42,0.4);
  margin-top: 0.3rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-subtitle, .header-service-line { display: none; }
  .official-header .header-inner { padding: 0.6rem 1rem; }
  .page-wrapper { padding: 1rem 0.75rem 2rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: #c0c8d8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0aabf; }

/* Nav dropdown — fully escape any overflow context */
.official-nav {
  overflow: visible;
  position: relative;
  z-index: 1020;
}
.official-nav .nav-inner {
  position: relative;
}
.official-nav .dropdown {
  position: static;
}
.official-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  z-index: 9999;
  margin-top: 3px;
  min-width: 180px;
}

/* ============================================================
   PAGE-SPECIFIC STRUCTURAL CLASSES
   (originally inline per-page, now centralised)
   ============================================================ */

/* Inmate image in tables */
.inmate-img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

/* Pill / chip tags */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--bg-panel);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  gap: 0.35rem;
  text-decoration: none;
}
.pill:hover { background: var(--bg-stripe); color: var(--text-primary); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* Hero sections */
.hero-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(11,31,61,0.08);
  color: var(--navy);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* Section structure */
.section-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-shell { margin-top: 1.5rem; }

/* Filter / toolbar grids */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.9rem;
}
.filter-span-4 { grid-column: span 4; }
.filter-span-3 { grid-column: span 3; }
.filter-span-2 { grid-column: span 2; }

@media (max-width: 991px) {
  .filter-span-4, .filter-span-3, .filter-span-2 { grid-column: span 6; }
}
@media (max-width: 575px) {
  .filter-span-4, .filter-span-3, .filter-span-2 { grid-column: span 12; }
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(150px, .7fr)) auto;
  gap: 0.9rem;
  align-items: end;
}
.report-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(160px, .6fr)) auto;
  gap: 0.9rem;
  align-items: end;
}
.trial-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(150px, .55fr)) auto;
  gap: 0.9rem;
  align-items: end;
}
.search-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 200px auto;
  gap: 0.8rem;
}

@media (max-width: 768px) {
  .toolbar, .report-toolbar, .trial-toolbar { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
}

/* Stat cards (dashboard / roster) */
.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.stat-value {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 0.2rem;
}
.stat-meta { color: var(--text-secondary); font-size: 0.82rem; margin-top: 0.2rem; }
.stat-icon { font-size: 1.25rem; color: var(--crown-gold); opacity: 0.9; }
.stat-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.stat-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-decoration: none;
  transition: background 0.15s;
}
.stat-link:hover { background: var(--bg-stripe); color: var(--navy); }

/* Empty states */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-large { padding: 2rem; text-align: center; color: var(--text-muted); }

/* Name links in tables */
.name-link {
  color: var(--navy-soft);
  text-decoration: none;
  font-weight: 600;
}
.name-link:hover { color: var(--navy); text-decoration: underline; }

/* Detail / profile layouts */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.detail-card { height: 100%; }
.detail-card--full { grid-column: 1 / -1; }
.detail-card--wide { grid-column: span 2; }
.detail-list { display: grid; gap: 0.5rem; }
.detail-row {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  gap: 0.75rem;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.detail-value { line-height: 1.5; color: var(--text-primary); }
.detail-meta { display: block; margin-top: 0.4rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; }

.label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Profile layouts */
.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.profile-actions-inline { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.info-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.record-layout {
  display: grid;
  grid-template-columns: minmax(280px,360px) minmax(0,1fr);
  gap: 1.25rem;
}
.manage-layout {
  display: grid;
  grid-template-columns: minmax(300px,360px) minmax(0,1fr);
  gap: 1.25rem;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}
.span-2 { grid-column: span 2; }
.sticky-panel { position: sticky; top: 92px; }

@media (max-width: 768px) {
  .detail-grid, .info-split, .summary-grid { grid-template-columns: 1fr; }
  .profile-details-grid { grid-template-columns: 1fr 1fr; }
  .record-layout, .manage-layout { grid-template-columns: 1fr; }
}

/* Mugshot frame */
.mugshot-frame {
  display: flex;
  justify-content: center;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

/* Security cards (cells page) */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}
.security-card {
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid var(--border);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.security-label { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.15rem; }
.security-count { font-size: 1.3rem; font-weight: 700; color: var(--navy); line-height: 1.1; margin-bottom: 0.4rem; }
.security-meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.76rem; color: var(--text-muted); }
.security-link { text-decoration: none; transition: border-color 0.15s; }
.security-link:hover { border-color: var(--navy) !important; }

/* Cell pill */
.cell-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Progress bars */
.progress-shell {
  background: var(--bg-stripe);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #166534, var(--crown-gold));
  border-radius: 999px;
}
.mini-progress-shell {
  background: var(--bg-stripe);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #166534, var(--crown-gold));
  border-radius: 999px;
}

/* Wanted board */
.wanted-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.wanted-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.wanted-image {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center top;
  background: var(--bg-stripe);
  flex-shrink: 0;
}
.wanted-label { letter-spacing: 0.08em; text-transform: uppercase; color: var(--crown-gold); font-size: 0.78rem; font-weight: 600; }
.wanted-row { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; gap: 1rem; align-items: center; }
.wanted-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-stripe);
}
@media (max-width: 768px) {
  .wanted-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Former inmates */
.former-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.former-card {
  display: grid;
  grid-template-columns: 80px minmax(0,1fr);
  gap: 1rem;
  align-items: start;
}
.former-thumb {
  width: 80px;
  height: 100px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg-stripe);
  border: 1px solid var(--border);
}

/* Timeline */
.timeline-feed { display: grid; gap: 1rem; }
.timeline-row { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.timeline-marker {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,31,61,0.07);
  border: 1px solid var(--border);
  color: var(--navy);
  flex-shrink: 0;
}
.timeline-preview-item { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start; }
.timeline-preview-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,31,61,0.07);
  border: 1px solid var(--border);
  color: var(--navy);
}
.log-item { border-top: 1px solid var(--border-soft); padding-top: 0.85rem; margin-top: 0.85rem; }

/* Reports / disciplines */
.report-grid { display: flex; flex-direction: column; gap: 1rem; }
.trial-grid { display: flex; flex-direction: column; gap: 1rem; }
.action-grid-list { display: flex; flex-direction: column; gap: 1rem; }
.report-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.report-summary { color: var(--text-secondary); line-height: 1.65; }
.status-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Gallery (blog post images) */
.gallery-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gallery-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
}
.gallery-button img { transition: transform 0.18s ease; }
.gallery-button:hover img { transform: scale(1.02); }

/* Action icons */
.action-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(11,31,61,0.07);
  color: var(--navy);
}

/* Metric compact */
.metric-compact { font-size: 1rem; line-height: 1.4; }

/* Small muted helper */
.small-muted { color: var(--text-muted) !important; font-size: 0.85rem; }
.muted { color: var(--text-muted) !important; }


/* ============================================================
   COMPREHENSIVE PAGE-SPECIFIC CLASSES (light + dark mode)
   ============================================================ */

/* ── btn-outline-light fix for light backgrounds ── */
.btn-outline-light {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}
.btn-outline-light:hover {
  background: var(--bg-stripe) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
/* Preserve white outline in dark header/nav */
.official-header .btn-outline-light,
.official-nav .btn-outline-light {
  border-color: rgba(255,255,255,0.3) !important;
  color: rgba(255,255,255,0.85) !important;
}
.official-header .btn-outline-light:hover,
.official-nav .btn-outline-light:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

/* ── Page hero / profile hero ── */
.page-hero, .profile-hero {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--crown-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.page-hero h1, .profile-hero h1 { color: var(--navy); }

/* ── Profile layout ── */
.profile-layout {
  display: grid;
  grid-template-columns: 260px minmax(0,1fr);
  gap: 1.25rem;
  align-items: start;
}
.profile-stack { display: flex; flex-direction: column; gap: 1rem; }
.profile-sticky { position: sticky; top: 90px; }
.profile-identity { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-mugshot {
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  display: block;
}
.identity-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.quick-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.quick-metric {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.metric-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.2rem; }
.metric-value { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.5rem; font-weight: 700; color: var(--navy); line-height: 1; }
.metric-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }
.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.metric-card .metric-value { font-size: 1.8rem; }
.action-grid { display: flex; flex-direction: column; gap: 0.5rem; }
@media (max-width: 992px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sticky { position: static; }
}

/* ── Edit/Form layouts ── */
.edit-layout, .discipline-layout, .report-form-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0,1fr);
  gap: 1.5rem;
  align-items: start;
}
.content-stack { display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 992px) {
  .edit-layout, .discipline-layout, .report-form-layout { grid-template-columns: 1fr; }
}

/* ── Report layouts ── */
.report-view-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0,1fr);
  gap: 1.25rem;
  align-items: start;
}
.report-head { margin-bottom: 0.5rem; }
.report-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.report-body { line-height: 1.75; color: var(--text-primary); font-size: 0.95rem; }
@media (max-width: 992px) {
  .report-view-layout { grid-template-columns: 1fr; }
}

/* ── Trial layout ── */
.trial-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0,1fr);
  gap: 1.25rem;
  align-items: start;
}
.trial-body { line-height: 1.75; }
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}
@media (max-width: 992px) {
  .trial-layout { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr; }
}

/* ── Detail rows / labels ── */
.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  display: block;
}
.detail-row .label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.detail-list { display: grid; gap: 0.5rem; }

/* ── Dashboard / admin cards ── */
.dashboard-card, .action-card {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color 0.18s, transform 0.18s;
}
.action-card:hover { transform: translateY(-2px); color: inherit; border-color: var(--navy) !important; }
.card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  background: rgba(11,31,61,0.07);
  color: var(--navy);
}
.card-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crown-gold);
  display: block;
  margin-bottom: 0.2rem;
}
.card-title-strong { font-family: 'Source Serif 4', Georgia, serif; font-size: 1rem; font-weight: 700; color: var(--navy); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.card-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.75rem; }
.card-meta-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; color: var(--text-secondary); flex-wrap: wrap; }

/* ── Cell management ── */
.cell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.cell-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cell-card:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.cell-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
}
.cell-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
.cell-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.section-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.15rem; }
.occupancy-track {
  background: var(--bg-stripe);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.occupancy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--crown-gold));
  border-radius: 999px;
  transition: width 0.3s;
}
.occupant-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.empty-panel {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.key-value-list { display: grid; gap: 0.4rem; }
.kv-item { display: grid; grid-template-columns: 140px 1fr; gap: 0.5rem; font-size: 0.875rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border-soft); }
.kv-label { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.kv-value { color: var(--text-primary); }
.filter-grid-modern { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }

/* ── Timeline ── */
.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: 1.25rem;
  align-items: start;
}
.timeline-sticky { position: sticky; top: 90px; }
.timeline-item {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.timeline-detail { font-size: 0.875rem; color: var(--text-primary); }
.timeline-copy { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; line-height: 1.5; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-pills .btn { border-radius: 999px !important; font-size: 0.78rem; padding: 0.3rem 0.75rem; }
@media (max-width: 992px) {
  .timeline-layout { grid-template-columns: 1fr; }
  .timeline-sticky { position: static; }
}

/* ── Wanted board ── */
.wanted-edit-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0,1fr);
  gap: 1.5rem;
  align-items: start;
}
.wanted-preview {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 768px) {
  .wanted-edit-layout { grid-template-columns: 1fr; }
}

/* ── Danger card ── */
.danger-card {
  border: 1px solid rgba(185, 28, 28, 0.3) !important;
  background: rgba(185, 28, 28, 0.04) !important;
}

/* ── Release item ── */
.release-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.release-item:last-child { border-bottom: none; }

/* ── Security / status preview ── */
.security-preview, .status-preview {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

/* ── Grid span utilities ── */
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

/* ── Summary card ── */
.summary-card {
  padding: 0.85rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Blog image modal ── */
.blog-image-modal .modal-body {
  padding: 0;
  background: #000;
}
.blog-image-modal .modal-body img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

/* ── Post hero / body ── */
.post-hero {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.post-body { line-height: 1.75; font-size: 0.95rem; }
.post-body p { margin: 0 0 1.1rem; }

/* ── text-info fix ── */
.text-info { color: #0369a1 !important; }
.text-info a { color: #0369a1; }

/* ── Stat card accent var fix ── */
.stat-card::before { background: var(--accent, var(--crown-gold)); }

/* ============================================================
   DARK MODE
   ============================================================ */

[data-bs-theme="dark"] {
  --bg-page:     #0d1014;
  --bg-white:    #171b22;
  --bg-panel:    #1c2129;
  --bg-stripe:   #12161d;
  --text-primary:   #e9edf3;
  --text-secondary: #97a3b6;
  --text-muted:     #6b7a90;
  --border:      #2a313d;
  --border-soft: #1e2530;
  --crown-gold:  #e8b84b;
  --crown-light: #f5cc6a;
  --navy:        #7db8e8;
  --navy-soft:   #60a5d4;
}
/* Keep header/nav backgrounds dark regardless of --navy override */
[data-bs-theme="dark"] .official-header { background: #0b1f3d !important; }
[data-bs-theme="dark"] .hmp-guard-nav   { background: #12284e !important; }
[data-bs-theme="dark"] .official-footer { background: #071429 !important; }
[data-bs-theme="dark"] .table thead th  { background: #0b1f3d !important; }
[data-bs-theme="dark"] .modal-header    { background: #0b1f3d !important; }
[data-bs-theme="dark"] .card .card-header { background: #12161d !important; }

[data-bs-theme="dark"] body {
  background: linear-gradient(180deg, #0d1014 0%, #0f1115 100%) !important;
  color: #e9edf3 !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
  color: #e9edf3 !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .panel-card,
[data-bs-theme="dark"] .form-card,
[data-bs-theme="dark"] .table-shell,
[data-bs-theme="dark"] .table-wrap {
  background: rgba(28,33,41,0.96) !important;
  border-color: #2a313d !important;
}

[data-bs-theme="dark"] .card .card-header {
  background: rgba(20,24,31,0.96) !important;
  border-color: #2a313d !important;
  color: #e9edf3 !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: rgba(11,15,21,0.72) !important;
  border-color: #303846 !important;
  color: #edf2f8 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: rgba(78,192,246,0.75) !important;
  box-shadow: 0 0 0 0.2rem rgba(78,192,246,0.14) !important;
}

[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] label {
  color: #d9e0ea !important;
}

[data-bs-theme="dark"] .table thead th {
  background: #0d1014 !important;
  color: rgba(255,255,255,0.85) !important;
}
[data-bs-theme="dark"] .table tbody td { color: #e0e6f0; border-color: #2a313d !important; }
[data-bs-theme="dark"] .table tbody tr:hover { background: #1c2129 !important; }

[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .btn-info {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-info {
  border-color: #60a5fa !important;
  color: #60a5fa !important;
}
[data-bs-theme="dark"] .btn-outline-light {
  border-color: rgba(255,255,255,0.3) !important;
  color: rgba(255,255,255,0.85) !important;
}
[data-bs-theme="dark"] .btn-outline-light:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  border-color: #4b5563 !important;
  color: #9ca3af !important;
}

[data-bs-theme="dark"] .alert {
  background: rgba(28,33,41,0.96) !important;
  border-color: #2a313d !important;
  color: #e0e6f0 !important;
}
[data-bs-theme="dark"] .alert-danger { background: rgba(185,28,28,0.2) !important; color: #fca5a5 !important; border-left-color: #ef4444 !important; }
[data-bs-theme="dark"] .alert-success { background: rgba(22,101,52,0.2) !important; color: #86efac !important; border-left-color: #22c55e !important; }
[data-bs-theme="dark"] .alert-warning { background: rgba(161,98,7,0.2) !important; color: #fcd34d !important; border-left-color: #f59e0b !important; }
[data-bs-theme="dark"] .alert-info { background: rgba(3,105,161,0.2) !important; color: #7dd3fc !important; border-left-color: #0ea5e9 !important; }

[data-bs-theme="dark"] .modal-content { background: #171b22 !important; border-color: #2a313d !important; color: #e9edf3 !important; }
[data-bs-theme="dark"] .modal-footer { background: #12161d !important; border-color: #2a313d !important; }

[data-bs-theme="dark"] .page-hero,
[data-bs-theme="dark"] .profile-hero {
  background: rgba(28,33,41,0.96);
  border-color: #2a313d;
  border-left-color: var(--crown-gold);
}

[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .cell-card,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .quick-metric,
[data-bs-theme="dark"] .summary-card,
[data-bs-theme="dark"] .security-preview,
[data-bs-theme="dark"] .status-preview {
  background: rgba(28,33,41,0.96) !important;
  border-color: #2a313d !important;
  color: #e9edf3;
}

[data-bs-theme="dark"] .pill,
[data-bs-theme="dark"] .chip,
[data-bs-theme="dark"] .cell-pill,
[data-bs-theme="dark"] .stat-link {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  color: #d7deea;
}

[data-bs-theme="dark"] .occupancy-track,
[data-bs-theme="dark"] .progress-shell,
[data-bs-theme="dark"] .mini-progress-shell {
  background: rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .wanted-card,
[data-bs-theme="dark"] .wanted-preview {
  background: rgba(28,33,41,0.96);
  border-color: #2a313d;
}

[data-bs-theme="dark"] .timeline-item,
[data-bs-theme="dark"] .detail-row,
[data-bs-theme="dark"] .kv-item,
[data-bs-theme="dark"] .release-item,
[data-bs-theme="dark"] .log-item {
  border-color: #2a313d;
}

[data-bs-theme="dark"] .timeline-marker,
[data-bs-theme="dark"] .timeline-preview-icon,
[data-bs-theme="dark"] .action-icon,
[data-bs-theme="dark"] .card-icon {
  background: rgba(78,192,246,0.12);
  border-color: rgba(78,192,246,0.2);
  color: #9edbff;
}

[data-bs-theme="dark"] .empty-panel,
[data-bs-theme="dark"] .empty-state,
[data-bs-theme="dark"] .occupant-card {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
  color: #97a3b6;
}

[data-bs-theme="dark"] .name-link { color: #83d7ff; }
[data-bs-theme="dark"] .name-link:hover { color: #aee4ff; }

[data-bs-theme="dark"] .inmate-number-tag {
  background: rgba(255,255,255,0.08);
  color: var(--crown-gold);
}

[data-bs-theme="dark"] .page-header { border-color: #2a313d; }
[data-bs-theme="dark"] .page-header h1 { color: #e9edf3 !important; }
[data-bs-theme="dark"] .page-kicker { color: var(--crown-gold); }

[data-bs-theme="dark"] .section-title { color: #e9edf3; }
[data-bs-theme="dark"] .section-head { border-color: #2a313d; }

[data-bs-theme="dark"] .text-info { color: #7dd3fc !important; }
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .muted { color: #97a3b6 !important; }

[data-bs-theme="dark"] .badge.bg-primary { background: #2563eb !important; }
[data-bs-theme="dark"] .badge.bg-secondary { background: #374151 !important; }

[data-bs-theme="dark"] .danger-card {
  border-color: rgba(239,68,68,0.3) !important;
  background: rgba(239,68,68,0.08) !important;
}

[data-bs-theme="dark"] a { color: #7dd3fc; }
[data-bs-theme="dark"] a:hover { color: #bae6fd; }

[data-bs-theme="dark"] .official-footer { background: #050a12; }

/* Dark mode toggle button */
.dark-mode-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.8);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}
.dark-mode-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.dark-mode-toggle .icon-moon { display: inline; }
.dark-mode-toggle .icon-sun  { display: none; }
[data-bs-theme="dark"] .dark-mode-toggle .icon-moon { display: none; }
[data-bs-theme="dark"] .dark-mode-toggle .icon-sun  { display: inline; }

.dashboard-card { padding: 1.25rem; }
.metric-card { padding: 1rem 1.1rem; }
.quick-metric { padding: 0.75rem 0.85rem; }
.security-card { padding: 0.85rem 1rem; }
.wanted-card > *:not(.wanted-image) { padding: 0 0.85rem; }
.wanted-card > *:not(.wanted-image):last-child { padding-bottom: 0.85rem; }
.wanted-card > *:not(.wanted-image):nth-child(2) { padding-top: 0.75rem; }
.summary-card { padding: 1rem 1.1rem; }
.occupant-card { padding: 0.6rem 0.85rem; }
.page-hero, .profile-hero { padding: 1.5rem; }
.empty-panel { padding: 2rem 1.5rem; }



/* ── Guard nav (Bootstrap navbar styled to match official header) ── */
.hmp-guard-nav {
  background: var(--navy-mid) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 !important;
  z-index: 1019;
}
.hmp-guard-nav .nav-link {
  color: rgba(255,255,255,0.7) !important;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.7rem 1rem !important;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.hmp-guard-nav .nav-link:hover,
.hmp-guard-nav .nav-link:focus {
  color: #fff !important;
  border-bottom-color: rgba(200,147,42,0.4);
}
.hmp-guard-nav .nav-link.active,
.hmp-guard-nav .nav-link.show {
  color: #fff !important;
  border-bottom-color: var(--crown-gold);
}
.hmp-guard-nav .dropdown-menu {
  background: rgba(7,20,41,0.97) !important;
  border-radius: 6px !important;
  border: none !important;
  min-width: 190px;
  padding: 0.4rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
}
.hmp-guard-nav .dropdown-item {
  color: rgba(255,255,255,0.8) !important;
  font-size: 0.83rem;
  padding: 0.5rem 1.1rem;
}
.hmp-guard-nav .dropdown-item:hover,
.hmp-guard-nav .dropdown-item:focus {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}
.hmp-guard-nav .dropdown-item.active {
  background: rgba(200,147,42,0.2) !important;
  color: var(--crown-light) !important;
}
.hmp-guard-nav .dropdown-item i {
  color: var(--crown-gold);
  width: 16px;
}
.hmp-guard-nav .dropdown-divider {
  border-color: rgba(255,255,255,0.1);
  margin: 0.25rem 0;
}
.hmp-guard-nav .navbar-toggler-icon {
  filter: invert(1);
}
[data-bs-theme="dark"] .hmp-guard-nav {
  background: #0a1322 !important;
  border-color: rgba(255,255,255,0.05);
}

/* ═══ DEFINITIVE PANEL PADDING ═══ */
/* stat-card: left strip + internal padding */
.stat-card  { padding: 1.1rem 1.1rem 1.1rem 1.4rem !important; }
.panel-card { padding: 1.25rem !important; }
.list-card  { padding: 1.25rem !important; }
.action-card{ padding: 1.1rem 1.25rem !important; }
.hero-card  { padding: 1.5rem !important; }

/* card-body for cards using Bootstrap's structure */
.card > .card-body { padding: 1.25rem; }

/* metric, quick-metric, security, cell */
.metric-card   { padding: 1rem 1.1rem !important; }
.quick-metric  { padding: 0.65rem 0.85rem !important; }
.security-card { padding: 0.85rem 1rem !important; }
.dashboard-card{ padding: 1.25rem !important; }

/* utility panels */
.summary-card { padding: 1rem 1.1rem !important; }
.empty-panel  { padding: 2rem 1.5rem !important; }
.occupant-card{ padding: 0.55rem 0.85rem !important; }
.page-hero, .profile-hero { padding: 1.5rem !important; }

/* wanted card body padding */
.wanted-card > *:not(.wanted-image) { padding-left: 0.85rem; padding-right: 0.85rem; }
.wanted-card > *:not(.wanted-image):nth-child(2) { padding-top: 0.75rem; }
.wanted-card > *:not(.wanted-image):last-child { padding-bottom: 0.85rem; }

/* detail rows */
.detail-card { padding: 0.5rem 0; border-bottom: 1px solid var(--border-soft); }
.detail-card:last-child { border-bottom: none; }
.profile-details-grid .detail-card {
  padding: 0.65rem 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

/* dark mode detail-card */
[data-bs-theme="dark"] .profile-details-grid .detail-card {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}

/* Fix nav dropdown not causing body scroll */
.hmp-guard-nav .dropdown-menu {
  position: absolute !important;
}
.hmp-guard-nav .navbar-collapse {
  overflow: visible !important;
}
.hmp-guard-nav .navbar-nav {
  margin-left: auto !important;
  margin-right: auto !important;
}
