html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #111827, #1f2937 58%, #7f1d1d);
  box-shadow: 0 .5rem 1.4rem rgba(0,0,0,.18);
}
.dashboard-stat { border: 0; box-shadow: 0 .25rem .8rem rgba(0,0,0,.08); }
.dashboard-stat .stat-label { color: #6c757d; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.dashboard-stat .stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.dashboard-stat.alert-stat { border-left: 5px solid #dc3545; }
.workflow-step { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; }
.workflow-step span { display: inline-flex; flex: 0 0 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: #0d6efd; color: #fff; font-weight: 700; }
@media (max-width: 767.98px) { .dashboard-hero { align-items: flex-start; flex-direction: column; } }

/* D&S Public Safety GIS application shell */
:root {
  --ds-gold: #c99a19;
  --ds-gold-light: #e1b63b;
  --ds-black: #080b0f;
  --ds-sidebar: #0c1015;
  --ds-text: #111827;
  --ds-muted: #6b7280;
  --ds-border: #e5e7eb;
}

.app-shell-body { margin: 0; background: #f7f8fa; color: var(--ds-text); }
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 1035;
  display: flex; flex-direction: column; padding: 20px 12px 16px;
  background: linear-gradient(180deg, #0b0e12, #101318 70%, #080b0e);
  color: #fff; box-shadow: 5px 0 20px rgba(0,0,0,.12); overflow-y: auto;
}
.agency-brand { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #fff; margin-bottom: 24px; text-transform: uppercase; }
.agency-brand:hover { color: #fff; }
.agency-brand img { width: 148px; height: 148px; object-fit: contain; margin-bottom: 10px; }
.agency-name { font-size: 1.02rem; font-weight: 800; letter-spacing: .02em; }
.agency-office { color: #e2b83d; font-size: 1rem; font-weight: 800; letter-spacing: .02em; }
.sidebar-nav { display: grid; gap: 7px; }
.sidebar-link, .sidebar-group > summary {
  min-height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  border-radius: 8px; color: #f8fafc; text-decoration: none; font-size: 1.03rem; font-weight: 600;
  cursor: pointer; list-style: none;
}
.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-link:hover, .sidebar-group > summary:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-link.active { color: #fff; background: linear-gradient(135deg, #b7840f, #d7aa2e); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sidebar-icon { width: 26px; font-size: 1.55rem; line-height: 1; text-align: center; }
.sidebar-chevron { margin-left: auto; font-size: 1.6rem; transition: transform .2s ease; }
.sidebar-group[open] .sidebar-chevron { transform: rotate(90deg); }
.sidebar-subnav { margin: 2px 0 8px 55px; display: grid; gap: 2px; }
.sidebar-subnav a { color: #cbd5e1; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: .92rem; }
.sidebar-subnav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-spacer { flex: 1 1 auto; min-height: 28px; }
.mobile-access-link { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; color: #fff; text-decoration: none; border-top: 1px solid rgba(255,255,255,.2); padding: 18px 12px; }
.mobile-access-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.mobile-access-link small { display: block; color: #e2b83d; font-size: .78rem; margin-top: 2px; }
.mobile-access-icon { font-size: 1.8rem; }
.software-owner { padding: 12px; border-top: 1px solid rgba(255,255,255,.12); color: #9ca3af; font-size: .7rem; line-height: 1.35; }
.software-owner strong { display: block; color: #d1d5db; font-size: .73rem; }
.app-main { min-width: 0; width: calc(100% - 270px); margin-left: 270px; min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar { height: 76px; display: flex; align-items: center; gap: 18px; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--ds-border); box-shadow: 0 2px 8px rgba(0,0,0,.035); }
.sidebar-toggle { border: 0; background: transparent; color: #111; font-size: 1.8rem; line-height: 1; display: none; }
.app-title { color: #111; text-decoration: none; font-weight: 800; font-size: 1.45rem; }
.app-title:hover { color: #111; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-search { border: 1px solid #d1d5db; background: #fff; padding: 7px 16px; border-radius: 7px; color: #374151; }
.app-content { flex: 1 0 auto; padding: 0; }
.app-footer { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 18px 34px; border-top: 1px solid var(--ds-border); color: #6b7280; font-size: .82rem; background: #fff; }
.app-footer a { margin-left: auto; color: #a87909; text-decoration: none; }

.dispatcher-home { max-width: 1160px; margin: 0 auto; padding: 62px 34px 70px; text-align: center; }
.home-intro .welcome-label { display: flex; align-items: center; justify-content: center; gap: 24px; color: #b68410; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; font-size: 1.05rem; }
.home-intro .welcome-label span { width: 150px; height: 1px; background: #d7ae48; }
.home-intro h1 { font-size: clamp(2.3rem, 4vw, 4rem); line-height: 1.08; margin: 18px 0 10px; font-weight: 850; letter-spacing: -.04em; }
.home-intro p { color: #6b7280; font-size: clamp(1.25rem, 2vw, 1.8rem); margin-bottom: 30px; }
.dispatcher-search { max-width: 980px; margin: 0 auto; min-height: 76px; display: grid; grid-template-columns: 54px 1fr 160px; align-items: center; background: #fff; border: 1px solid #dfe3e8; border-radius: 9px; box-shadow: 0 4px 14px rgba(17,24,39,.08); overflow: hidden; }
.dispatcher-search-icon { font-size: 2.25rem; color: #6b7280; }
.dispatcher-search input { width: 100%; height: 100%; min-width: 0; border: 0; outline: 0; font-size: 1.27rem; padding: 0 12px; color: #111827; }
.dispatcher-search button { align-self: stretch; border: 0; background: linear-gradient(135deg, #b8840c, #d6a82b); color: #fff; font-weight: 800; font-size: 1.25rem; }
.dispatcher-search button:hover { background: linear-gradient(135deg, #a87608, #c59720); }
.search-examples { margin: 16px 0 48px; color: #6b7280; font-size: .98rem; }
.quick-access-heading { display: flex; align-items: center; justify-content: center; gap: 28px; color: #b68410; text-transform: uppercase; letter-spacing: .04em; font-size: 1.08rem; margin-bottom: 24px; }
.quick-access-heading span { width: 210px; height: 1px; background: #e0c57e; }
.quick-access-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.quick-access-card { min-height: 264px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 24px; border: 1px solid #e1e4e8; border-radius: 10px; background: #fff; color: #111; text-decoration: none; box-shadow: 0 4px 12px rgba(17,24,39,.055); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.quick-access-card:hover { color: #111; transform: translateY(-3px); border-color: #d4b55c; box-shadow: 0 10px 24px rgba(17,24,39,.11); }
.quick-card-icon { display: flex; align-items: center; justify-content: center; width: 94px; height: 94px; font-size: 4.7rem; line-height: 1; margin-bottom: 18px; font-weight: 900; }
.icon-map { color: #080b0f; transform: rotate(90deg); }
.icon-command { color: #bd171f; text-shadow: 0 -14px 0 #bd171f; }
.icon-facility { color: #080b0f; }
.icon-aed { color: #19883d; }
.quick-access-card strong { font-size: 1.28rem; margin-bottom: 10px; }
.quick-access-card small { color: #6b7280; font-size: .98rem; line-height: 1.5; max-width: 170px; }

@media (max-width: 1100px) {
  .quick-access-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar-open .app-sidebar { transform: translateX(0); }
  .app-main { width: 100%; margin-left: 0; }
  .sidebar-toggle { display: block; }
  .app-topbar { padding: 0 18px; }
  .topbar-search { display: none; }
  .dispatcher-home { padding-top: 42px; }
}
@media (max-width: 650px) {
  .app-title { font-size: 1.1rem; }
  .dispatcher-home { padding: 34px 16px 44px; }
  .home-intro .welcome-label span, .quick-access-heading span { width: 55px; }
  .dispatcher-search { grid-template-columns: 44px 1fr; min-height: 64px; overflow: visible; }
  .dispatcher-search input { font-size: 1rem; }
  .dispatcher-search button { grid-column: 1 / -1; min-height: 52px; border-radius: 0 0 8px 8px; }
  .search-examples { margin-top: 62px; }
  .quick-access-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .quick-access-card { min-height: 190px; padding: 18px 10px; }
  .quick-card-icon { width: 68px; height: 68px; font-size: 3.4rem; margin-bottom: 10px; }
  .quick-access-card strong { font-size: 1rem; }
  .quick-access-card small { font-size: .78rem; }
  .app-footer { padding: 16px 18px; }
  .app-footer a { margin-left: 0; }
}

/* Administration Center - User Management */
.admin-users-page { max-width: 1440px; margin: 0 auto; padding: 38px 34px 60px; }
.admin-page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 26px; }
.admin-page-header h1 { margin: 4px 0 4px; font-weight: 850; letter-spacing: -.025em; }
.admin-page-header p { margin: 0; color: #6b7280; }
.admin-eyebrow { color: #a87909; text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; font-weight: 850; }
.admin-back-link { color: #8a650b; text-decoration: none; font-weight: 700; }
.admin-filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto auto; gap: 10px; margin-bottom: 18px; }
.admin-search-box { position: relative; }
.admin-search-box span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #6b7280; font-size: 1.2rem; }
.admin-search-box input { padding-left: 42px; }
.admin-table-card, .admin-settings-card { background: #fff; border: 1px solid #e1e5ea; border-radius: 12px; box-shadow: 0 6px 20px rgba(17,24,39,.055); overflow: hidden; }
.admin-table-summary { padding: 13px 18px; border-bottom: 1px solid #e5e7eb; color: #6b7280; font-size: .9rem; }
.admin-table-card thead th { background: #f7f8fa; color: #4b5563; text-transform: uppercase; letter-spacing: .045em; font-size: .74rem; padding: 13px 16px; border-bottom: 1px solid #e5e7eb; }
.admin-table-card tbody td { padding: 15px 16px; }
.admin-table-card td small { display: block; color: #6b7280; margin-top: 2px; }
.admin-role-text { color: #374151; font-size: .9rem; }
.admin-action-group { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.admin-action-group form { display: inline; }
.admin-empty-state { padding: 48px !important; text-align: center; color: #6b7280; }
.admin-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.admin-settings-card { padding: 24px; overflow: visible; }
.admin-settings-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.admin-settings-card > p { color: #6b7280; font-size: .9rem; margin-bottom: 20px; }
.admin-check-list { display: grid; gap: 8px; }
.admin-check-list label { display: flex; gap: 9px; align-items: center; border: 1px solid #e5e7eb; border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.admin-check-list label:hover { background: #f9fafb; }
.admin-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-permissions-card { margin-top: 18px; }
.permission-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.permission-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; align-items: center; padding: 9px 11px; border: 1px solid #e5e7eb; border-radius: 8px; }
.permission-row > span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .admin-settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 850px) { .admin-filter-bar { grid-template-columns: 1fr 1fr; } .permission-matrix { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .admin-users-page { padding: 26px 15px 44px; } .admin-filter-bar { grid-template-columns: 1fr; } .admin-check-grid { grid-template-columns: 1fr; } }

/* Version 5 top-bar account control */
.account-menu { display: flex; align-items: center; gap: 9px; }
.account-profile { display: flex; align-items: center; gap: 9px; color: #172033; text-decoration: none; }
.account-profile:hover { color: #1d4f7a; }
.account-avatar { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #102f50, #1d4f7a); color: #fff; font-size: .84rem; font-weight: 850; box-shadow: inset 0 0 0 2px rgba(200,165,75,.55); }
.account-copy { display: flex; flex-direction: column; line-height: 1.1; }
.account-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.account-copy small { margin-top: 3px; color: #6b7280; font-size: .66rem; }
.account-signout { min-height: 34px; padding: 0 10px; border: 1px solid #d5dde6; border-radius: 7px; background: #fff; color: #556173; font-size: .76rem; }
.account-signout:hover { border-color: #b9c5d2; color: #102f50; }
@media (max-width: 700px) { .account-copy, .account-signout { display: none; } }

/* =====================================================================
   VERSION 5 LAYOUT STABILITY FIX — VERSION 4 APPEARANCE
   Keeps the permission-aware Version 5 navigation while restoring the
   dark black/gold Version 4 shell and preventing sidebar/content overlap.
   ===================================================================== */
:root {
  --ds-gold: #c99a19;
  --ds-gold-light: #e1b63b;
  --ds-black: #080b0f;
  --ds-sidebar: #0c1015;
  --ds-text: #111827;
  --ds-muted: #6b7280;
  --ds-border: #e5e7eb;
  --sidebar-width: 270px;
  --topbar-height: 76px;
}

html, body { min-height: 100%; }
body.app-shell-body { margin: 0; margin-bottom: 0; overflow-x: hidden; background: #f7f8fa; color: var(--ds-text); }
.app-shell { min-height: 100vh; display: flex; }

/* Fixed dark Version 4 sidebar */
.app-sidebar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  height: 100vh !important;
  z-index: 1040 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 18px 12px 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: linear-gradient(180deg, #0b0e12 0%, #101318 70%, #080b0e 100%) !important;
  color: #fff !important;
  box-shadow: 5px 0 20px rgba(0,0,0,.16) !important;
}

.sidebar-header { padding: 0 !important; border-bottom: 0 !important; }
.agency-brand {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0 !important;
  width: 100% !important;
  margin: 0 0 20px !important;
  color: #fff !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
}
.agency-brand img {
  width: 132px !important;
  height: 132px !important;
  max-width: 132px !important;
  object-fit: contain !important;
  margin: 0 auto 8px !important;
  filter: none !important;
}
.brand-copy { display: flex !important; flex-direction: column !important; align-items: center !important; width: 100% !important; line-height: 1.2 !important; }
.agency-name { color: #fff !important; font-size: .96rem !important; font-weight: 800 !important; letter-spacing: .03em !important; }
.agency-office { margin-top: 3px !important; color: var(--ds-gold-light) !important; font-size: 1rem !important; font-weight: 800 !important; }
.agency-product { margin-top: 5px !important; color: #cbd5e1 !important; font-size: .72rem !important; letter-spacing: .04em !important; }

.sidebar-nav { display: grid !important; gap: 6px !important; padding: 0 !important; }
.nav-section-label { padding: 9px 12px 4px !important; color: #8ea0b6 !important; font-size: .66rem !important; font-weight: 850 !important; letter-spacing: .13em !important; text-transform: uppercase !important; }
.nav-section-spaced { margin-top: 10px !important; }
.sidebar-link, .sidebar-group > summary {
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  gap: 13px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  color: #f1f5f9 !important;
  background: transparent !important;
  text-decoration: none !important;
  font-size: .98rem !important;
  font-weight: 650 !important;
  cursor: pointer !important;
  list-style: none !important;
}
.sidebar-link:hover, .sidebar-group > summary:hover { color: #fff !important; background: rgba(255,255,255,.07) !important; }
.sidebar-link.active { color: #fff !important; background: linear-gradient(135deg, #b7840f, #d7aa2e) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) !important; }
.sidebar-icon { width: 26px !important; flex: 0 0 26px !important; color: inherit !important; font-size: 1.4rem !important; text-align: center !important; }
.sidebar-chevron { margin-left: auto !important; color: inherit !important; font-size: 1.5rem !important; }
.sidebar-subnav { margin: 2px 0 8px 50px !important; padding: 0 !important; border-left: 0 !important; display: grid !important; gap: 2px !important; }
.sidebar-subnav a { padding: 8px 10px !important; border-radius: 6px !important; color: #cbd5e1 !important; background: transparent !important; text-decoration: none !important; font-size: .88rem !important; }
.sidebar-subnav a:hover, .sidebar-subnav a.active { color: #fff !important; background: rgba(255,255,255,.07) !important; box-shadow: none !important; }
.sidebar-subnav a.active { border-left: 3px solid var(--ds-gold-light) !important; }

.sidebar-spacer { flex: 1 1 auto !important; min-height: 24px !important; }
.mobile-access-link { padding: 16px 12px !important; border-top: 1px solid rgba(255,255,255,.18) !important; color: #fff !important; }
.mobile-access-link small { color: var(--ds-gold-light) !important; }
.software-owner { padding: 11px 12px !important; border-top: 1px solid rgba(255,255,255,.12) !important; color: #9ca3af !important; font-size: .68rem !important; }
.software-owner strong { color: #d1d5db !important; }

/* Keep all page content fully to the right of the sidebar */
.app-main {
  min-width: 0 !important;
  width: calc(100% - 270px) !important;
  margin-left: 270px !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}
.app-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1020 !important;
  min-height: 76px !important;
  padding: 0 30px !important;
  background: #fff !important;
  border-bottom: 1px solid var(--ds-border) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.035) !important;
}
.app-title { color: #111 !important; font-size: 1.35rem !important; font-weight: 800 !important; }
.app-subtitle { color: #6b7280 !important; }
.topbar-search { background: #fff !important; border-color: #d1d5db !important; color: #374151 !important; }
.app-content { flex: 1 0 auto !important; min-width: 0 !important; width: 100% !important; overflow-x: hidden !important; }
.app-footer { background: #fff !important; border-top: 1px solid var(--ds-border) !important; color: #6b7280 !important; }
.app-footer a { color: #a87909 !important; }

/* Version 4 home sizing and spacing */
.dispatcher-home { width: 100% !important; max-width: 1160px !important; margin: 0 auto !important; padding: 54px 34px 66px !important; }
.home-intro h1 { color: #111827 !important; }
.dispatcher-search { width: 100% !important; max-width: 980px !important; }
.quick-access-grid { width: 100% !important; }
.quick-access-card { min-width: 0 !important; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-105%) !important; transition: transform .22s ease !important; }
  .sidebar-open .app-sidebar { transform: translateX(0) !important; }
  .app-main { width: 100% !important; margin-left: 0 !important; }
  .sidebar-toggle { display: inline-grid !important; place-items: center !important; }
  .app-topbar { padding: 0 18px !important; }
}

@media (max-width: 650px) {
  .dispatcher-home { padding: 34px 16px 44px !important; }
}

/* ============================================================
   PUBLIC SAFETY GIS — RESPONSIVE LOGIN EXPERIENCE
   ============================================================ */

.login-shell-body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: #eef2f6;
  color: #172033;
}

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

.login-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(0, 58%);
}

.login-brand-panel {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(28px, 5vh, 64px) clamp(28px, 5vw, 76px);
  color: #fff;
  background:
    radial-gradient(circle at 18% 16%, rgba(224,187,86,.19), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(47,100,148,.28), transparent 36%),
    linear-gradient(145deg, #081b2e 0%, #102f50 52%, #081a2c 100%);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 42px 42px;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: auto;
  text-align: center;
}

.login-agency-logo,
.login-logo-fallback {
  display: block;
  width: clamp(104px, 17vh, 180px);
  height: clamp(104px, 17vh, 180px);
  max-width: 45vw;
  margin: 0 auto clamp(14px, 2.2vh, 24px);
  object-fit: contain;
}

.login-agency-logo {
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.28));
}

.login-logo-fallback {
  display: grid;
  place-items: center;
  border: 3px solid rgba(225,182,59,.7);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #e5ca7b;
  font-size: clamp(2rem, 7vh, 4rem);
  font-weight: 900;
}

.login-agency-label {
  color: #e5ca7b;
  font-size: clamp(.72rem, 1.2vw, .92rem);
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-office-label {
  margin-top: 5px;
  color: #fff;
  font-size: clamp(.9rem, 1.5vw, 1.18rem);
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.login-product-title {
  max-width: 600px;
  margin: clamp(15px, 2.4vh, 25px) auto clamp(10px, 1.6vh, 17px);
  color: #fff;
  font-size: clamp(1.85rem, 3.5vw, 3.5rem);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: -.035em;
}

.login-brand-description {
  max-width: 510px;
  margin: 0 auto;
  color: #c7d4e1;
  font-size: clamp(.9rem, 1.25vw, 1.08rem);
  line-height: 1.6;
}

.login-brand-security {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin: clamp(20px, 4vh, 42px) auto 0;
  padding-top: 17px;
  border-top: 1px solid rgba(255,255,255,.14);
  color: #9eb3c6;
  font-size: .76rem;
  letter-spacing: .035em;
  text-align: center;
}

.login-security-icon { color: #d5ad42; font-size: .72rem; }

.login-form-panel {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 100% 0%, rgba(16,47,80,.08), transparent 32%),
    #f4f6f9;
}

.login-form-panel-inner {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vh, 52px) clamp(18px, 5vw, 72px);
}

.login-page-content {
  width: min(100%, 540px);
  min-width: 0;
  margin: auto;
}

.login-intro {
  margin-bottom: clamp(16px, 2.4vh, 25px);
  text-align: center;
}

.login-welcome-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #9a7111;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-welcome-label span {
  width: clamp(34px, 7vw, 68px);
  height: 1px;
  background: #d6b65b;
}

.login-intro h2 {
  margin: 12px 0 6px;
  color: #142033;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.login-intro p {
  margin: 0;
  color: #667286;
  font-size: clamp(.88rem, 1.2vw, 1rem);
}

.dashboard-login-card {
  width: 100%;
  min-width: 0;
  padding: clamp(20px, 3.5vh, 32px);
  border: 1px solid #dfe5ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15,35,56,.11), 0 3px 10px rgba(15,35,56,.055);
}

.login-card-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: clamp(17px, 2.4vh, 24px);
  padding-bottom: 17px;
  border-bottom: 1px solid #e7ebf0;
}

.login-lock {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #102f50, #1d4f7a);
  color: #e5ca7b;
}

.login-card-heading h3 {
  margin: 0;
  color: #172033;
  font-size: 1.18rem;
  font-weight: 850;
}

.login-card-heading p {
  margin: 4px 0 0;
  color: #697587;
  font-size: .82rem;
  line-height: 1.4;
}

.dashboard-login-form { display: grid; gap: clamp(13px, 2vh, 18px); }

.login-validation-summary {
  display: none;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e5a8ad;
  border-radius: 8px;
  background: #fff3f4;
  color: #8b1e28;
  font-size: .84rem;
}

.login-validation-summary.validation-summary-errors { display: block; }

.login-field { min-width: 0; display: grid; gap: 7px; }
.login-field label { color: #293649; font-size: .82rem; font-weight: 750; }

.login-field input {
  width: 100%;
  min-width: 0;
  height: clamp(46px, 6.2vh, 52px);
  padding: 0 14px;
  border: 1px solid #cfd8e3;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: #172033;
  font-size: .95rem;
}

.login-field input:focus {
  border-color: #1d4f7a;
  box-shadow: 0 0 0 3px rgba(29,79,122,.14);
}

.remember-option {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: #526074;
  font-size: .81rem;
  line-height: 1.35;
  cursor: pointer;
}

.remember-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  accent-color: #b78716;
}

.dashboard-signin-button {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #a9780b, #d2a52d);
  color: #fff;
  font-size: .96rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.login-security-note {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 10px;
  margin-top: clamp(17px, 2.4vh, 23px);
  padding: 13px 14px;
  border: 1px solid #dfe6ed;
  border-radius: 9px;
  background: #f6f8fa;
}

.login-note-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e8eef4;
  color: #1d4f7a;
  font-size: .62rem;
}

.login-security-note strong { display: block; color: #344257; font-size: .78rem; }
.login-security-note span { display: block; margin-top: 2px; color: #727e8f; font-size: .73rem; line-height: 1.4; }

.login-public-registration {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: clamp(14px, 2.2vh, 20px);
  padding: 15px 17px;
  border: 1px solid #dce4eb;
  border-radius: 11px;
  background: rgba(255,255,255,.82);
}

.login-public-registration strong { display: block; color: #283548; font-size: .82rem; }
.login-public-registration span { display: block; margin-top: 3px; color: #707c8d; font-size: .73rem; line-height: 1.4; }

.login-public-registration a {
  white-space: nowrap;
  padding: 9px 12px;
  border: 1px solid #bd9227;
  border-radius: 8px;
  color: #855f08;
  background: #fff;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 800;
}

.login-help { margin: clamp(13px,2vh,18px) 0 0; color: #748092; font-size: .75rem; text-align: center; }

.login-page-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 16px;
  padding: 15px clamp(18px,4vw,42px);
  border-top: 1px solid #dce3ea;
  color: #7b8695;
  background: rgba(255,255,255,.76);
  font-size: .68rem;
  text-align: center;
}

.login-page-footer a { color: #8b650e; text-decoration: none; }

@media (max-width: 720px) {
  .login-shell { display: flex; flex-direction: column; }
  .login-brand-panel { min-height: auto; padding: 22px 18px 20px; }
  .login-brand-content {
    display: grid;
    grid-template-columns: 72px minmax(0,1fr);
    column-gap: 14px;
    align-items: center;
    text-align: left;
  }
  .login-agency-logo,
  .login-logo-fallback {
    grid-row: 1 / span 4;
    width: 72px;
    height: 72px;
    max-width: 72px;
    margin: 0;
  }
  .login-brand-security { display: none; }
  .login-form-panel { min-height: 0; }
  .login-form-panel-inner { place-items: start center; padding: 24px 15px; }
  .login-public-registration { grid-template-columns: 1fr; }
  .login-public-registration a { text-align: center; }
}

/* ============================================================
   OPERATIONAL DASHBOARD
   ============================================================ */

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

.operations-dashboard {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 38px);
  color: #172033;
}

.operations-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 24px;
}

.operations-eyebrow,
.operations-section-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #9a7111;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.operations-header h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.9rem, 3vw, 2.85rem);
  font-weight: 850;
  letter-spacing: -.035em;
}

.operations-header p { margin: 7px 0 0; color: #697587; }

.operations-clock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 13px 17px;
  border: 1px solid #dce3ea;
  border-radius: 11px;
  background: #fff;
}

.operations-clock strong { color: #102f50; font-size: 1.35rem; }
.operations-clock span { margin-top: 3px; color: #6e7989; font-size: .74rem; }

.operations-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.operations-summary-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 19px;
  border: 1px solid #dfe5eb;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(17,32,51,.05);
}

.summary-card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #4e5c70;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.summary-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf0f5;
  color: #102f50;
}

.summary-value {
  margin-top: 15px;
  color: #172033;
  font-size: clamp(2rem,4vw,3rem);
  line-height: 1;
}

.summary-description { margin-top: 7px; color: #657184; font-size: .84rem; }
.operations-summary-card a,
.operations-summary-card small { margin-top: auto; padding-top: 13px; color: #8c660d; font-size: .73rem; text-decoration: none; }

.weather-details { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 11px; color: #596679; font-size: .73rem; }
.weather-summary-card { border-top: 4px solid #d1a52c; }
.alert-summary-card { border-top: 4px solid #b3262e; }

.operations-section { margin-bottom: 25px; }

.operations-section-heading,
.operations-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.operations-section-heading { margin-bottom: 14px; }
.operations-section-heading h2,
.operations-panel-header h2 { margin: 0; color: #172033; font-size: 1.24rem; font-weight: 850; }

.operations-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b596c;
  font-size: .72rem;
}

.operations-live-indicator > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22834a;
  box-shadow: 0 0 0 4px rgba(34,131,74,.12);
}

.unit-agency-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}

.unit-agency-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 12px;
  background: #fff;
}

.unit-agency-column > header {
  padding: 15px 16px;
  border-bottom: 1px solid #e4e9ee;
  background: #f8fafc;
}

.unit-agency-column > header > div { display: flex; align-items: center; gap: 11px; }

.agency-column-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #102f50;
  color: #fff;
}

.unit-agency-column h3 { margin: 0; font-size: 1rem; font-weight: 850; }
.unit-agency-column header span:not(.agency-column-icon) { display: block; margin-top: 2px; color: #738092; font-size: .69rem; }

.police-column .agency-column-icon { background: #244f7b; }
.fire-column .agency-column-icon { background: #a72c30; }
.ems-column .agency-column-icon { background: #237a48; }

.unit-list { display: grid; }

.unit-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid #edf0f3;
}

.unit-row:last-child { border-bottom: 0; }
.unit-identity,
.unit-assignment { min-width: 0; display: flex; flex-direction: column; }

.unit-identity strong,
.unit-assignment strong {
  overflow: hidden;
  color: #263347;
  font-size: .79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-identity span {
  margin-top: 3px;
  overflow: hidden;
  color: #707c8d;
  font-size: .71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-assignment { align-items: flex-end; }

.unit-status {
  display: inline-flex;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.unit-status.available { background: #e6f5eb; color: #176338; }
.unit-status.dispatched,
.unit-status.en-route { background: #fff3d6; color: #805c05; }
.unit-status.on-scene { background: #e6effa; color: #1b5589; }
.unit-status.hospital { background: #eee9fa; color: #5e4490; }
.unit-status.out-of-service { background: #f9e5e7; color: #8c2029; }

.operations-detail-grid {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr);
  gap: 16px;
}

.operations-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dfe5eb;
  border-radius: 13px;
  background: #fff;
}

.operations-panel-header {
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e6eaee;
}

.operations-panel-header a { color: #8b650d; font-size: .75rem; font-weight: 750; text-decoration: none; }

.incident-list { display: grid; }

.incident-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) minmax(170px,auto);
  gap: 12px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid #edf0f3;
}

.incident-row:last-child { border-bottom: 0; }

.incident-priority {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e9eef4;
  color: #344256;
  font-size: .7rem;
  font-weight: 900;
}

.priority-incident .incident-priority { background: #b3262e; color: #fff; }

.incident-primary,
.incident-units { min-width: 0; display: flex; flex-direction: column; }

.incident-primary strong,
.incident-units strong { color: #263347; font-size: .79rem; }

.incident-primary span,
.incident-units span { margin-top: 3px; color: #748092; font-size: .7rem; }

.incident-units { text-align: right; }

.operational-alert-list,
.activity-timeline { display: grid; gap: 10px; }

.operational-alert {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid #e2e7ec;
  border-radius: 9px;
  background: #f8fafc;
}

.operational-alert-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: .74rem;
  font-weight: 900;
}

.warning-alert .operational-alert-icon { background: #fff0cf; color: #805b00; }
.information-alert .operational-alert-icon { background: #e5effa; color: #1e588c; }
.success-alert .operational-alert-icon { background: #e2f3e8; color: #1d683b; }

.operational-alert strong,
.activity-entry strong { display: block; color: #303d50; font-size: .76rem; }

.operational-alert div span,
.activity-entry div span { display: block; margin-top: 3px; color: #727e8f; font-size: .68rem; line-height: 1.4; }

.activity-entry {
  min-width: 0;
  display: grid;
  grid-template-columns: 13px minmax(0,1fr);
  gap: 10px;
  align-items: start;
}

.activity-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #b98a18;
  box-shadow: 0 0 0 4px rgba(185,138,24,.11);
}

.operations-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
}

.operations-quick-actions a {
  min-width: 0;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid #dfe5eb;
  border-radius: 9px;
  color: #283548;
  background: #f9fafc;
  text-align: center;
  text-decoration: none;
}

.operations-quick-actions a:hover { border-color: #c4a24b; background: #fff; }
.operations-quick-actions a > span { color: #a3760d; font-size: 1.35rem; }
.operations-quick-actions strong { overflow-wrap: anywhere; font-size: .72rem; }

@media (max-width: 1250px) {
  .operations-summary-grid,
  .unit-agency-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 850px) {
  .operations-header { align-items: flex-start; flex-direction: column; }
  .operations-clock { align-items: flex-start; }
  .operations-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .operations-dashboard { padding: 17px 12px 30px; }
  .operations-summary-grid,
  .unit-agency-grid { grid-template-columns: 1fr; }
  .incident-row { grid-template-columns: 38px minmax(0,1fr); }
  .incident-units { grid-column: 2; text-align: left; }
}

/* ============================================================
   EMPLOYEE MANAGEMENT
   ============================================================ */

.employee-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.employee-status-available { background: #e4f5e9; color: #17663a; }
.employee-status-assigned { background: #fff1ce; color: #785600; }
.employee-status-active { background: #e4eef9; color: #1c5486; }
.employee-status-warning { background: #f4e9d7; color: #76500a; }
.employee-status-offline { background: #eceff2; color: #596473; }
.employee-status-neutral { background: #edf0f4; color: #526073; }

.admin-filter-bar {
  grid-template-columns:
    minmax(260px, 1fr)
    minmax(150px, 190px)
    minmax(170px, 210px)
    auto
    auto;
}

@media (max-width: 1050px) {
  .admin-filter-bar {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(150px, 190px)
      minmax(170px, 210px);
  }

  .admin-filter-bar .btn { width: 100%; }
}

@media (max-width: 720px) {
  .admin-filter-bar { grid-template-columns: 1fr; }
}
.unit-empty-state {
    padding: 18px 15px;
    color: #7a8492;
    font-size: .76rem;
    text-align: center;
}
