:root {
  --bg: #eef3f7;
  --bg-deep: #dfeaf3;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-glass: rgba(255, 255, 255, .82);
  --border: #d8dee6;
  --border-soft: #e8edf3;
  --text: #17202a;
  --text-strong: #0f172a;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #ccfbf1;
  --accent-ghost: #f0fdfa;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --success: #067647;
  --success-soft: #ecfdf3;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --nav: #101828;
  --nav-2: #17202a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --focus-ring: 0 0 0 .22rem rgba(15, 118, 110, .18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, .13), transparent 34rem),
    radial-gradient(circle at 85% 8%, rgba(59, 130, 246, .10), transparent 30rem),
    linear-gradient(180deg, var(--bg) 0%, #f8fafc 52%, #eef2f7 100%);
  color: var(--text);
  letter-spacing: 0;
  font-family: var(--bs-body-font-family);
  overflow-x: hidden;
}

::selection {
  background: rgba(15, 118, 110, .22);
  color: var(--text-strong);
}

a {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

button,
.btn,
.form-control,
.form-select {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.nav-link:focus-visible,
a:focus-visible,
button:focus-visible {
  box-shadow: var(--focus-ring);
  outline: 0;
}

.app-body {
  position: relative;
}

.app-bg-orb {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(24px);
  opacity: .46;
}

.app-bg-orb-1 {
  top: 86px;
  left: -180px;
  background: radial-gradient(circle, rgba(15, 118, 110, .22), transparent 68%);
}

.app-bg-orb-2 {
  right: -190px;
  bottom: 80px;
  background: radial-gradient(circle, rgba(23, 92, 211, .14), transparent 70%);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-160%);
  padding: 9px 12px;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background:
    linear-gradient(135deg, rgba(16, 24, 40, .98) 0%, rgba(23, 32, 42, .98) 55%, rgba(17, 94, 89, .94) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 32px rgba(15, 23, 42, .20);
}

@supports (backdrop-filter: blur(14px)) {
  .app-navbar {
    background:
      linear-gradient(135deg, rgba(16, 24, 40, .88) 0%, rgba(23, 32, 42, .88) 55%, rgba(17, 94, 89, .82) 100%);
    backdrop-filter: blur(14px);
  }
}

.app-navbar-inner {
  min-height: 66px;
  gap: 14px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

.app-brand:hover,
.app-brand:focus {
  color: #fff;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, .98), rgba(15, 118, 110, .98));
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 8px 22px rgba(15, 118, 110, .28);
}

.brand-mark i {
  font-size: 1.28rem;
  line-height: 1;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.brand-title {
  font-size: 1.08rem;
  font-weight: 900;
}

.brand-subtitle {
  color: rgba(255, 255, 255, .58);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-navbar-toggler {
  border-color: rgba(255, 255, 255, .18);
  border-radius: 12px;
}

.app-navbar-toggler:focus {
  box-shadow: 0 0 0 .18rem rgba(255, 255, 255, .15);
}

.app-navbar .navbar-toggler-icon {
  filter: invert(1) grayscale(1) brightness(2);
}

.app-nav {
  gap: 4px;
  margin-left: 8px;
}

.app-nav-dropdown .dropdown-toggle {
  position: relative;
}

.app-dropdown-menu {
  min-width: 18rem;
  padding: 10px;
}

.app-dropdown-menu .dropdown-header {
  padding-left: 8px;
  padding-right: 8px;
  color: #0f172a;
  font-weight: 800;
}

.app-dropdown-menu .dropdown-item {
  border-radius: 10px;
  padding: 8px 10px;
  white-space: normal;
}

.app-dropdown-menu .dropdown-item:hover,
.app-dropdown-menu .dropdown-item:focus {
  background: rgba(15, 118, 110, .10);
}

.app-navbar .nav-link,
.app-navbar .navbar-text {
  color: rgba(255, 255, 255, .78);
}

.app-navbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: .45rem .72rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
}

.app-navbar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .10);
}

.app-navbar .nav-link:active {
  transform: translateY(1px);
}

.app-nav-icon {
  color: rgba(153, 246, 228, .94);
  font-size: .98rem;
  line-height: 1;
}

.app-user-zone {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: .25rem .62rem;
  color: rgba(255, 255, 255, .86) !important;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 800;
  white-space: nowrap;
}

.user-chip-icon {
  color: rgba(153, 246, 228, .96);
  line-height: 1;
}

.logout-form {
  margin: 0;
}

.app-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-radius: 999px;
  font-weight: 800;
}

.app-main {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 22px 18px;
  min-height: calc(100vh - 126px);
}

.map-page .app-main {
  width: 100%;
  max-width: none;
  padding: 10px;
  min-height: calc(100vh - 112px);
}

.zones-page .app-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 112px);
}

.app-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.app-alert-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 1px;
}

.app-alert-text {
  min-width: 0;
  padding-right: 24px;
}

.app-footer {
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
  padding: 10px 16px 18px;
}

.map-page .app-footer {
  padding: 6px 12px 8px;
}

.app-footer-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .54);
  border: 1px solid rgba(216, 222, 230, .72);
  border-radius: 999px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475467;
  font-weight: 800;
}

.footer-brand i {
  color: var(--accent);
}

.footer-dot {
  width: 5px;
  height: 5px;
  background: var(--muted-soft);
  border-radius: 999px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding: 2px 0;
}

.page-header h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -.03em;
}

.page-header p {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 860px;
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .11);
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  border-radius: 10px;
  font-weight: 750;
}

.btn-sm {
  border-radius: 9px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(15, 118, 110, .20);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0d9488, var(--accent-dark));
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 118, 110, .26);
}

.btn-outline-primary {
  color: var(--accent-dark);
  border-color: rgba(15, 118, 110, .34);
}

.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-light {
  border-color: var(--border-soft);
}

.dashboard-panel,
.metric,
.ops-sidebar,
.ops-bottom section,
.login-panel {
  background: var(--panel-glass);
  border: 1px solid rgba(216, 222, 230, .88);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@supports (backdrop-filter: blur(12px)) {
  .dashboard-panel,
  .metric,
  .ops-sidebar,
  .ops-bottom section,
  .login-panel {
    backdrop-filter: blur(12px);
  }
}

.dashboard-panel {
  padding: 16px;
}

.dashboard-panel:hover,
.metric:hover,
.ops-bottom section:hover {
  box-shadow: var(--shadow-md);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 900;
  margin: 0;
}

.panel-title h2::before {
  content: "";
  width: 9px;
  height: 22px;
  background: linear-gradient(180deg, var(--accent), #2dd4bf);
  border-radius: 999px;
}

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

.metric {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 15px;
  display: grid;
  gap: 9px;
}

.metric::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  z-index: -1;
  width: 108px;
  height: 108px;
  background: radial-gradient(circle, rgba(15, 118, 110, .13), transparent 66%);
  border-radius: 999px;
}

.metric span {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
}

.metric strong {
  color: var(--text-strong);
  font-size: 2.05rem;
  line-height: 1;
  letter-spacing: -.04em;
}

.metric .metric-text {
  font-size: 1.18rem;
  line-height: 1.22;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) minmax(260px, .9fr) minmax(260px, .9fr);
  gap: 14px;
}

.table {
  --bs-table-bg: transparent;
}

.ops-table {
  margin: 0;
}

.ops-table th {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom-color: var(--border);
}

.ops-table td {
  vertical-align: middle;
  border-bottom-color: #eef2f6;
}

.ops-table tbody tr {
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ops-table tbody tr:hover {
  background: rgba(240, 253, 250, .72);
}

.item-title {
  color: var(--text-strong);
  font-weight: 900;
  text-decoration: none;
}

.item-title:hover {
  color: var(--accent-dark);
}

.item-subtitle {
  color: var(--muted);
  font-size: .84rem;
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  background: #eef2f6;
  color: #334155;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 999px;
}

.status-active {
  color: var(--success);
  background: var(--success-soft);
}

.status-new {
  color: var(--info);
  background: var(--info-soft);
}

.status-suspended {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-completed {
  color: #475467;
  background: #f2f4f7;
}

.status-archived {
  color: #475467;
  background: #f8fafc;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.info-list dd {
  margin: -6px 0 4px;
  line-height: 1.48;
}

.empty-state {
  color: var(--muted);
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, .98), rgba(240, 253, 250, .76));
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.dashboard-form {
  display: grid;
  gap: 14px;
  max-width: 1100px;
}

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

.form-field {
  display: grid;
  gap: 5px;
}

.form-field label,
.ops-form label,
.hq-panel .form-label,
.map-card label {
  margin-bottom: 0;
  color: #475467;
  font-size: .82rem;
  font-weight: 800;
}

.form-control,
.form-select {
  border-color: var(--border);
  border-radius: 10px;
}

.form-control:hover,
.form-select:hover {
  border-color: #c4ccd8;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 118, 110, .55);
}

.form-field .errorlist {
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: .84rem;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login-shell {
  min-height: calc(100vh - 190px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(100%, 430px);
  padding: 24px;
}

.login-panel h1 {
  color: var(--text-strong);
  font-size: 1.45rem;
  margin: 4px 0 18px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.ops-shell {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  height: calc(100vh - 136px);
  gap: 12px;
  align-items: stretch;
}

.map-page .ops-shell {
  height: calc(100vh - 112px);
}

.ops-sidebar {
  padding: 13px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, .52) transparent;
}

.ops-sidebar::-webkit-scrollbar,
.ops-bottom section::-webkit-scrollbar,
.chat-log::-webkit-scrollbar,
.map-search-results::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.ops-sidebar::-webkit-scrollbar-thumb,
.ops-bottom section::-webkit-scrollbar-thumb,
.chat-log::-webkit-scrollbar-thumb,
.map-search-results::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .38);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

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

.compact-tabs {
  gap: 4px;
}

.compact-tabs .nav-link {
  padding: .45rem .48rem;
  color: #475467;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 850;
}

.compact-tabs .nav-link:hover {
  color: var(--accent-dark);
  background: var(--accent-ghost);
}

.compact-tabs .nav-link.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, .18);
}

.ops-tabs-body {
  padding-top: 12px;
}

.ops-form {
  display: grid;
  gap: 7px;
}

.ops-list {
  display: grid;
  gap: 8px;
}

.ops-list-item {
  border: 1px solid #e6ebf1;
  border-radius: var(--radius-md);
  padding: 10px;
  background: linear-gradient(135deg, #fff, var(--panel-soft));
  font-size: .9rem;
  box-shadow: var(--shadow-sm);
}

.ops-list-item:hover {
  border-color: rgba(15, 118, 110, .22);
  box-shadow: var(--shadow-md);
}

.ops-list-item span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  margin-top: 2px;
}

.ops-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 164px;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.ops-main-map-only {
  grid-template-rows: minmax(0, 1fr);
}

.event-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(216, 222, 230, .95);
  border-radius: var(--radius-lg);
  background: #e9eef4;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.passport-map {
  min-height: 68vh;
}

.area-passport-grid {
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  align-items: stretch;
}

.area-passport-share {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.area-passport-qr-wrap {
  flex: 0 0 auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.area-passport-qr {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
}

.area-passport-meta {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  font-size: .92rem;
}

.zones-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  align-items: stretch;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.zones-map {
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

.zones-table-wrap {
  overflow: auto;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}

.zones-list-panel,
.zones-map-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.zones-list-panel .mb-3,
.zones-list-panel .panel-title,
.zones-map-panel .panel-title {
  flex: 0 0 auto;
}

.zones-table {
  margin-bottom: 0;
}

.zones-table th,
.zones-table td {
  white-space: nowrap;
}

.zones-table td[data-label="Зона"] {
  min-width: 180px;
}

.zones-table td[data-label="Группа"] {
  min-width: 220px;
}

.zones-table td[data-label="Действия"] {
  min-width: 220px;
}

.area-passport-print-note {
  display: none;
}

.ops-bottom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ops-bottom section {
  padding: 11px;
  overflow: auto;
}

.ops-bottom h2 {
  color: var(--text-strong);
  font-size: .95rem;
  font-weight: 900;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ops-bottom h2 span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.mini-table {
  display: grid;
  gap: 5px;
  font-size: .84rem;
}

.mini-table div {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 8px;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 4px;
}

.empty-mini {
  color: var(--muted);
  margin: 0;
  font-size: .84rem;
}

.map-card {
  display: grid;
  gap: 7px;
  min-width: 250px;
  font-size: .86rem;
}

.map-card-title {
  color: var(--text-strong);
  font-weight: 900;
  font-size: .98rem;
}

.map-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.leaflet-popup-content {
  margin: 10px 12px;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}

.leaflet-popup-tip {
  box-shadow: 0 12px 22px rgba(15, 23, 42, .14);
}

.leaflet-control-zoom a {
  color: var(--text-strong) !important;
}

.map-search-control {
  width: min(340px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  overflow: hidden;
}

.map-search-input {
  width: 100%;
  height: 40px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  padding: 0 11px;
  outline: 0;
  font-size: 14px;
  font-weight: 650;
}

.map-search-input:focus {
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .16);
}

.map-search-results {
  display: none;
  max-height: 260px;
  overflow: auto;
}

.map-search-results.is-open {
  display: block;
}

.map-search-results button {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
  text-align: left;
}

.map-search-results button:hover {
  background: #f8fafc;
}

.map-search-results span,
.map-search-empty {
  color: var(--muted);
  font-size: .78rem;
}

.map-search-empty {
  padding: 10px;
}

.map-symbol-marker-wrap {
  background: transparent;
  border: 0;
}

.map-symbol-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--marker-color, #0d6efd);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .36);
  transform: rotate(-45deg);
  position: relative;
  z-index: 1;
}

.map-symbol-marker::after {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  background: color-mix(in srgb, var(--marker-color, #0d6efd) 24%, transparent);
  border-radius: 999px;
  opacity: .72;
}

.map-symbol-marker svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transform: rotate(45deg);
}

.map-text-marker-wrap {
  background: transparent;
  border: 0;
}

.map-text-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--marker-color, #0d6efd);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
  text-shadow:
    0 1px 0 #fff,
    1px 0 0 #fff,
    0 -1px 0 #fff,
    -1px 0 0 #fff,
    0 2px 5px rgba(0, 0, 0, .28);
  white-space: nowrap;
}

.map-text-marker svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
}

.map-image-marker-wrap {
  background: transparent;
  border: 0;
}

.map-image-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.map-image-marker img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}

.map-image-marker span {
  color: #17202a;
  font-size: 13px;
  font-weight: 950;
  text-shadow:
    0 1px 0 #fff,
    1px 0 0 #fff,
    0 -1px 0 #fff,
    -1px 0 0 #fff,
    0 2px 5px rgba(0, 0, 0, .22);
}

.map-object-label {
  pointer-events: none;
  padding: 3px 7px;
  color: #111827;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(17, 24, 39, .18);
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.map-city-label {
  pointer-events: none;
  padding: 3px 7px;
  color: #7c2d12;
  background: rgba(255, 247, 237, .95);
  border: 1px solid rgba(249, 115, 22, .35);
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.city-popup {
  display: grid;
  gap: 8px;
  min-width: 240px;
}

.city-popup-title {
  color: var(--text-strong);
  font-weight: 900;
  font-size: .98rem;
}

.city-popup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.city-popup-table th,
.city-popup-table td {
  padding: 4px 0;
  border-top: 1px solid #eef2f6;
  vertical-align: top;
}

.city-popup-table th {
  width: 42%;
  color: var(--muted);
  font-weight: 900;
  padding-right: 10px;
}

.legend {
  font-size: .9rem;
  display: grid;
  gap: 7px;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  margin-right: 7px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .20);
}

.chat-log {
  min-height: 360px;
  max-height: 60vh;
  overflow: auto;
}

.chat-item {
  padding: 9px 0;
  border-bottom: 1px solid #eef2f6;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.print-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.print-sheet {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  min-height: 90vh;
  box-shadow: var(--shadow-sm);
}

.print-map {
  height: 72vh;
  margin: 12px 0;
  border: 1px solid #555;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.badge {
  font-weight: 850;
  letter-spacing: .01em;
}

.card,
.modal-content,
.dropdown-menu {
  border-color: var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.dropdown-item {
  border-radius: 8px;
}

.dropdown-menu {
  padding: 8px;
}

@media (max-width: 1100px) {
  .app-navbar-inner {
    min-height: 62px;
  }

  .app-nav {
    margin-left: 0;
    padding-top: 10px;
  }

  .app-navbar .nav-link {
    width: 100%;
    border-radius: 12px;
  }

  .app-user-zone {
    align-items: stretch;
    padding-top: 10px;
  }

  .logout-form,
  .app-logout-btn,
  .user-chip {
    width: 100%;
  }

  .app-logout-btn,
  .user-chip {
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .zones-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .zones-page .app-main {
    min-height: auto;
  }

  .zones-table-wrap {
    max-height: 52vh;
  }

  .zones-map {
    min-height: 56vh;
  }

  .area-passport-grid {
    grid-template-columns: 1fr;
  }

  .ops-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-page .ops-shell {
    height: auto;
  }

  .ops-main {
    grid-template-rows: 70vh auto;
  }

  .ops-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(20, 184, 166, .12), transparent 24rem),
      linear-gradient(180deg, var(--bg) 0%, #f8fafc 100%);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }

  .brand-subtitle {
    display: none;
  }

  .app-main {
    padding: 14px 12px;
  }

  .map-page .app-main {
    padding: 8px;
  }

  .zones-page .app-main {
    gap: 10px;
  }

  .zones-grid {
    gap: 10px;
  }

  .page-header {
    display: grid;
    gap: 12px;
  }

  .page-header .btn,
  .btn-row .btn,
  .form-actions .btn,
  .chat-form .btn {
    width: 100%;
  }

  .btn-row,
  .form-actions {
    width: 100%;
  }

  .kpi-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .dashboard-panel,
  .metric,
  .ops-sidebar,
  .ops-bottom section,
  .login-panel {
    border-radius: var(--radius-md);
  }

  .ops-table thead {
    display: none;
  }

  .ops-table tbody,
  .ops-table tr,
  .ops-table td {
    display: block;
    width: 100%;
  }

  .ops-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .ops-table td {
    border: 0;
    padding: 6px 0;
  }

  .ops-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .ops-table td.text-end {
    text-align: left !important;
  }

  .ops-table .btn-group {
    display: grid;
    width: 100%;
    gap: 6px;
  }

  .ops-table .btn-group .btn {
    border-radius: 9px !important;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .app-footer-inner {
    border-radius: var(--radius-md);
  }

  .footer-dot {
    display: none;
  }

  .zones-table-wrap {
    max-height: 46vh;
  }

  .zones-map {
    min-height: 48vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  body {
    background: #fff !important;
    color: #000;
  }

  .navbar,
  .print-toolbar,
  .app-footer,
  .app-bg-orb,
  .skip-link,
  .btn-row,
  .area-passport-print-note {
    display: none !important;
  }

  main,
  .app-main {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }

  .print-sheet {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .page-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 8mm;
    margin-bottom: 4mm;
  }

  .page-header h1 {
    font-size: 18pt;
    line-height: 1.05;
  }

  .page-header p,
  .eyebrow,
  .panel-subtitle,
  .info-list dt,
  .info-list dd,
  .ops-list,
  .small,
  .text-muted {
    color: #000 !important;
  }

  .dashboard-grid.area-passport-grid {
    grid-template-columns: 78mm 1fr;
    gap: 6mm;
    align-items: start;
  }

  .dashboard-panel {
    break-inside: avoid;
    border: 1px solid #d0d0d0;
    box-shadow: none;
    padding: 4.5mm;
  }

  .area-passport-grid .dashboard-panel:first-child {
    min-height: 0;
  }

  .area-passport-meta {
    font-size: 8.5pt;
    gap: 3mm;
  }

  .area-passport-share {
    gap: 4mm;
  }

  .area-passport-qr-wrap {
    padding: 3mm;
    box-shadow: none;
  }

  .area-passport-qr {
    width: 40mm;
    height: 40mm;
  }

  .passport-map,
  .event-map {
    height: 170mm !important;
    border: 1px solid #888;
  }

  .ops-list-item {
    break-inside: avoid;
  }
}

.chat-page-header .page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--accent);
}

.chat-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.chat-panel-title {
  margin-bottom: 0;
}

.panel-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}

.ops-chat-log {
  min-height: 420px;
  max-height: min(62vh, 680px);
  padding: 12px;
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, .07), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.ops-chat-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f6;
}

.ops-chat-item:first-child {
  padding-top: 0;
}

.ops-chat-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
}

.chat-message {
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.chat-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.chat-sender {
  color: var(--text-strong);
  font-size: .92rem;
  font-weight: 900;
}

.chat-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.chat-text {
  color: var(--text);
  font-size: .94rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.chat-empty-state {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
}

.empty-state-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 16px;
  font-size: 1.35rem;
}

.chat-empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ops-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 0;
}

.chat-input-wrap {
  position: relative;
  min-width: 0;
}

.chat-input-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 2;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.chat-input {
  min-height: 44px;
  padding-left: 38px;
  font-weight: 650;
}

.chat-send-btn {
  min-height: 44px;
  padding-inline: 18px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .ops-chat-log {
    min-height: 360px;
    max-height: 58vh;
    padding: 10px;
    border-radius: var(--radius-md);
  }

  .ops-chat-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }

  .chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .chat-message-header {
    display: grid;
    gap: 2px;
  }

  .ops-chat-form {
    grid-template-columns: 1fr;
  }

  .chat-send-btn {
    width: 100%;
  }

  .chat-empty-state {
    min-height: 220px;
    display: grid;
    justify-items: center;
    text-align: center;
  }
}

.incident-detail-header .page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--accent);
}

.incident-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.metric-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .16);
  border-radius: 12px;
  font-size: 1.05rem;
}

.metric-caption {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}

.metric-status .metric-icon {
  color: var(--info);
  background: var(--info-soft);
  border-color: rgba(23, 92, 211, .14);
}

.metric-terrain .metric-icon {
  color: var(--accent-dark);
  background: var(--accent-ghost);
}

.metric-missing .metric-icon {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, .14);
}

.metric-groups .metric-icon {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(6, 118, 71, .14);
}

.incident-detail-grid {
  grid-template-columns: minmax(320px, 1.08fr) minmax(280px, .95fr) minmax(280px, .95fr);
  align-items: start;
}

.incident-organizations-panel {
  grid-column: 1 / -1;
}

.panel-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}

.incident-info-list {
  gap: 0;
}

.info-row {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.info-row:first-child {
  padding-top: 0;
}

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

.info-row dt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.info-row dt i {
  color: var(--accent);
  font-size: .95rem;
}

.info-row dd {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.incident-card-list {
  gap: 10px;
}

.incident-list-item {
  padding: 11px;
}

.list-item-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.list-item-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
}

.assignment-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
}

.organization-icon {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 8px 18px rgba(124, 58, 237, .15);
}

.list-item-copy {
  min-width: 0;
}

.list-item-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.25;
}

.list-item-copy div {
  margin-top: 2px;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.35;
}

.list-item-copy span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  margin-top: 4px;
}

.list-status-dot {
  color: var(--success);
  font-size: .42rem;
}

.organization-list-item .list-item-copy {
  display: grid;
  gap: 2px;
}

.organization-list-item .list-item-copy span i {
  color: var(--accent);
  font-size: .86rem;
}

.incident-empty-state {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 116px;
}

.empty-state-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 16px;
  font-size: 1.35rem;
}

.incident-empty-state strong {
  color: var(--text-strong);
  font-weight: 900;
}

.incident-empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .incident-detail-grid {
    grid-template-columns: 1fr;
  }

  .incident-organizations-panel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .incident-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .incident-detail-actions .btn {
    width: 100%;
  }

  .panel-title {
    align-items: flex-start;
  }

  .panel-badge {
    width: fit-content;
  }

  .list-item-main {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
  }

  .list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .incident-empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
  }
}

.incident-detail-header .page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--accent);
}

.incident-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.incident-hero-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, .14), transparent 28rem),
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .88));
  border: 1px solid rgba(216, 222, 230, .92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.incident-hero-card::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(15, 118, 110, .16), transparent 68%);
  border-radius: 999px;
  pointer-events: none;
}

.incident-hero-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.incident-hero-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(15, 118, 110, .22);
  font-size: 1.45rem;
}

.incident-hero-kicker {
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.incident-hero-card h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.14rem, 1.7vw, 1.45rem);
  font-weight: 950;
  letter-spacing: -.025em;
}

.incident-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.incident-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  color: #475467;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.incident-hero-meta i {
  color: var(--accent);
}

.incident-hero-status {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.metric-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .16);
  border-radius: 12px;
  font-size: 1.05rem;
}

.metric-caption {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}

.metric-status .metric-icon {
  color: var(--info);
  background: var(--info-soft);
  border-color: rgba(23, 92, 211, .14);
}

.metric-terrain .metric-icon {
  color: var(--accent-dark);
  background: var(--accent-ghost);
}

.metric-missing .metric-icon {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, .14);
}

.metric-groups .metric-icon {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(6, 118, 71, .14);
}

.incident-detail-grid {
  grid-template-columns: minmax(320px, 1.08fr) minmax(280px, .95fr) minmax(280px, .95fr);
  align-items: start;
}

.incident-organizations-panel {
  grid-column: 1 / -1;
}

.panel-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}

.incident-info-list {
  gap: 0;
}

.info-row {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.info-row:first-child {
  padding-top: 0;
}

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

.info-row dt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.info-row dt i {
  color: var(--accent);
  font-size: .95rem;
}

.info-row dd {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.incident-card-list {
  gap: 10px;
}

.incident-list-item {
  padding: 11px;
}

.list-item-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.list-item-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
}

.assignment-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .16);
}

.organization-icon {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 8px 18px rgba(124, 58, 237, .15);
}

.list-item-copy {
  min-width: 0;
}

.list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-item-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.25;
}

.list-item-copy div {
  margin-top: 2px;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.35;
}

.list-item-copy span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  margin-top: 4px;
}

.mini-status-chip {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  margin-top: 0 !important;
  padding: 2px 7px;
  color: var(--success) !important;
  background: var(--success-soft);
  border: 1px solid rgba(6, 118, 71, .12);
  border-radius: 999px;
  font-size: .72rem !important;
  font-weight: 900;
  white-space: nowrap;
}

.organization-card-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.organization-list-item .list-item-copy {
  display: grid;
  gap: 4px;
}

.organization-meta-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  margin-top: 6px !important;
}

.organization-meta-grid span {
  margin-top: 0;
}

.organization-list-item .list-item-copy span i {
  color: var(--accent);
  font-size: .86rem;
}

.incident-empty-state {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 116px;
}

.empty-state-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 16px;
  font-size: 1.35rem;
}

.incident-empty-state strong {
  color: var(--text-strong);
  font-weight: 900;
}

.incident-empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .incident-detail-grid {
    grid-template-columns: 1fr;
  }

  .incident-organizations-panel {
    grid-column: auto;
  }

  .organization-card-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .incident-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .incident-detail-actions .btn {
    width: 100%;
  }

  .incident-hero-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .incident-hero-main {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
  }

  .incident-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    font-size: 1.15rem;
  }

  .incident-hero-meta {
    display: grid;
  }

  .incident-hero-status {
    width: fit-content;
  }

  .panel-title {
    align-items: flex-start;
  }

  .panel-badge {
    width: fit-content;
  }

  .list-item-main {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
  }

  .list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .list-item-head {
    display: grid;
    justify-items: start;
  }

  .organization-meta-grid {
    grid-template-columns: 1fr;
  }

  .incident-empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
  }
}

.incident-form-header .page-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: var(--accent);
}

.form-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 12px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.incident-form {
  max-width: 1180px;
}

.incident-form-panel {
  position: relative;
  overflow: hidden;
}

.incident-form-panel::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 190px;
  height: 190px;
  background: radial-gradient(circle, rgba(15, 118, 110, .09), transparent 68%);
  border-radius: 999px;
  pointer-events: none;
}

.incident-form-grid {
  position: relative;
  z-index: 1;
}

.form-label-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: .82rem;
  font-weight: 850;
}

.form-label-row i {
  color: var(--accent);
  font-size: .94rem;
}

.form-label-row label {
  margin: 0;
}

.form-field-featured {
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(240, 253, 250, .86), rgba(248, 250, 252, .92));
  border: 1px solid rgba(15, 118, 110, .12);
  border-radius: var(--radius-md);
}

.incident-form .form-control,
.incident-form .form-select,
.incident-form textarea,
.incident-form input,
.incident-form select {
  min-height: 42px;
}

.incident-form textarea {
  min-height: 104px;
  resize: vertical;
}

.incident-form .form-field {
  align-content: start;
}

.incident-form .errorlist {
  margin-top: 2px;
  padding: 8px 10px 8px 28px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(180, 35, 24, .14);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 750;
}

.incident-form-actions {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  width: fit-content;
  padding: 10px;
  margin-top: 2px;
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(216, 222, 230, .88);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
}

@supports (backdrop-filter: blur(12px)) {
  .incident-form-actions {
    backdrop-filter: blur(12px);
  }
}

.incident-form-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding-inline: 15px;
}

@media (max-width: 760px) {
  .form-mode-badge {
    width: fit-content;
  }

  .incident-form-panel {
    border-radius: var(--radius-md);
  }

  .form-field-featured {
    padding: 10px;
  }

  .incident-form-actions {
    position: static;
    display: grid;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .incident-form-actions .btn {
    width: 100%;
  }
}

/* UX refresh: compact operational interface for laptop screens. */
:root {
  --bg: #f3f6f8;
  --bg-deep: #e7edf2;
  --panel: #ffffff;
  --panel-soft: #f8fafb;
  --panel-glass: #ffffff;
  --border: #d6dde5;
  --border-soft: #e7ebf0;
  --text: #1f2933;
  --text-strong: #111827;
  --muted: #667085;
  --muted-soft: #98a2b3;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #d9f6f1;
  --accent-ghost: #f1fbf9;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 20px rgba(16, 24, 40, .08);
  --shadow-lg: 0 14px 32px rgba(16, 24, 40, .12);
}

body {
  background: linear-gradient(180deg, #f6f8fa 0%, #edf2f6 100%);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

.app-bg-orb {
  display: none;
}

.app-navbar {
  background: #16212c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 8px 20px rgba(16, 24, 40, .16);
}

@supports (backdrop-filter: blur(14px)) {
  .app-navbar {
    background: rgba(22, 33, 44, .96);
  }
}

.app-navbar-inner {
  min-height: 54px;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 8px;
  box-shadow: none;
}

.brand-title {
  font-size: .98rem;
  font-weight: 650;
}

.brand-subtitle {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .03em;
}

.app-navbar .nav-link,
.user-chip,
.app-logout-btn {
  min-height: 32px;
  border-radius: 8px;
  font-weight: 500;
}

.app-main {
  width: min(100%, 1440px);
  padding: 16px;
  min-height: calc(100vh - 104px);
}

.map-page .app-main {
  padding: 8px;
  min-height: calc(100vh - 82px);
}

.app-footer {
  padding: 6px 12px 10px;
  font-size: .78rem;
}

.app-footer-inner {
  padding: 6px 10px;
  border-radius: 8px;
}

.page-header {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.page-header h1 {
  font-size: clamp(1.25rem, 1.6vw, 1.65rem);
  font-weight: 650;
  letter-spacing: 0;
}

.page-header p {
  margin-top: 4px;
  max-width: 760px;
  font-size: .9rem;
  line-height: 1.45;
}

.eyebrow {
  margin-bottom: 3px;
  color: #2563eb;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .04em;
}

.eyebrow::before {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.btn-row {
  gap: 6px;
}

.btn {
  --bs-btn-padding-y: .4rem;
  --bs-btn-padding-x: .68rem;
  border-radius: 7px;
  font-weight: 500;
  line-height: 1.25;
}

.btn-sm {
  --bs-btn-padding-y: .28rem;
  --bs-btn-padding-x: .5rem;
  border-radius: 6px;
  font-size: .8rem;
}

.btn-primary,
.btn-success {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.btn-primary:hover,
.btn-success:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: none;
  box-shadow: none;
}

.btn-outline-primary {
  color: var(--accent-dark);
  border-color: #9ccdc6;
}

.dashboard-panel,
.metric,
.content-card,
.ops-sidebar,
.ops-bottom section,
.login-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dashboard-panel,
.content-card {
  padding: 14px;
}

.dashboard-panel:hover,
.metric:hover,
.ops-bottom section:hover,
.ops-list-item:hover {
  box-shadow: var(--shadow-sm);
}

.panel-title {
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title h2,
.content-card h2,
.ops-bottom h2,
.hq-panel h2 {
  color: var(--text-strong);
  font-size: .96rem;
  font-weight: 650;
  line-height: 1.25;
}

.panel-title h2::before {
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 3px;
}

.panel-subtitle {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.panel-badge,
.status-pill,
.mini-status-chip,
.terrain-chip,
.date-chip,
.form-mode-badge {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 500;
  box-shadow: none;
}

.status-pill {
  gap: 6px;
}

.status-pill::before {
  width: 7px;
  height: 7px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  gap: 7px;
  min-height: 116px;
  padding: 12px;
  overflow: hidden;
}

.metric::after,
.incident-hero-card::after,
.incident-form-panel::after {
  display: none;
}

.metric span {
  font-size: .78rem;
  font-weight: 500;
}

.metric strong {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: 0;
}

.metric .metric-text {
  font-size: 1rem;
  line-height: 1.25;
}

.metric-icon,
.list-item-icon,
.empty-state-icon,
.incident-hero-icon,
.chat-avatar {
  border-radius: 8px;
  box-shadow: none;
}

.metric-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  font-size: .95rem;
}

.metric-caption {
  font-size: .76rem;
  line-height: 1.3;
}

.table-responsive,
.zones-table-wrap {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.table {
  margin-bottom: 0;
}

.ops-table th,
.zones-table th,
.table-sm th {
  padding: 8px 10px;
  color: #475467;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.ops-table td,
.zones-table td,
.table-sm td {
  padding: 8px 10px;
  border-bottom-color: var(--border-soft);
  color: var(--text);
}

.ops-table tbody tr:hover,
.zones-table tbody tr:hover {
  background: #f6fbfa;
}

.item-title,
.list-item-copy strong,
.ops-list-item > strong,
.mini-table strong,
.incident-empty-state strong {
  font-weight: 650;
}

.item-subtitle,
.ops-list-item span,
.list-item-copy span,
.small,
small {
  font-weight: 400;
}

.incident-title-cell {
  gap: 9px;
}

.incident-icon,
.list-item-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
}

.form-grid {
  gap: 10px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-field,
.ops-form {
  gap: 5px;
}

.form-field label,
.ops-form label,
.hq-panel .form-label,
.map-card label,
.form-label-row {
  color: #475467;
  font-size: .78rem;
  font-weight: 500;
}

.form-control,
.form-select {
  min-height: 36px;
  border-color: #cfd7df;
  border-radius: 7px;
  font-size: .88rem;
}

.form-control-sm,
.form-select-sm {
  min-height: 32px;
  padding-top: .28rem;
  padding-bottom: .28rem;
  font-size: .82rem;
}

textarea.form-control,
.incident-form textarea {
  line-height: 1.4;
}

.form-control::placeholder {
  color: #98a2b3;
}

.form-field-featured,
.quick-code-preview,
.empty-state {
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.quick-code-preview,
.empty-state {
  padding: 10px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.wide-card {
  min-width: 0;
}

.inline-form {
  display: inline;
}

.unit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ops-shell {
  grid-template-columns: 330px minmax(0, 1fr);
  height: calc(100vh - 84px);
  gap: 8px;
}

.map-page .ops-shell {
  height: calc(100vh - 82px);
}

.ops-sidebar {
  padding: 10px;
  border-radius: 10px;
}

.ops-title {
  display: grid;
  gap: 8px;
}

.ops-title h1 {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
}

.compact-tabs {
  gap: 3px;
  padding: 3px;
  background: #f2f5f7;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.compact-tabs .nav-link {
  min-height: 30px;
  padding: .32rem .38rem;
  border: 0;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 500;
}

.compact-tabs .nav-link.active {
  color: var(--accent-dark);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.ops-tabs-body {
  padding-top: 9px;
}

.hq-panel {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.ops-list {
  gap: 7px;
}

.ops-list-item {
  padding: 9px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-left: 3px solid #d6dde5;
  border-radius: 8px;
  box-shadow: none;
}

.unit-row,
.incident-units-panel .ops-list-item {
  border-left-color: #2563eb;
}

.incident-assignments-panel .ops-list-item {
  border-left-color: #0f766e;
}

.organization-list-item,
.incident-organizations-panel .ops-list-item {
  border-left-color: #7c3aed;
}

.ops-main {
  grid-template-rows: minmax(0, 1fr) 132px;
  gap: 8px;
}

.event-map {
  border-radius: 10px;
  border-color: var(--border);
}

.ops-bottom {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ops-bottom section {
  padding: 9px;
  border-radius: 10px;
}

.ops-bottom h2 {
  margin-bottom: 6px;
}

.ops-bottom h2 span {
  font-size: .78rem;
  font-weight: 500;
}

.mini-table {
  gap: 0;
  font-size: .8rem;
}

.mini-table div {
  grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-soft);
}

.mini-table span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-search-control {
  max-width: min(360px, calc(100vw - 48px));
}

.map-search-input {
  min-height: 34px;
  border-radius: 8px;
  font-size: .86rem;
}

.leaflet-control-layers,
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.map-card {
  gap: 6px;
  min-width: 230px;
  font-size: .82rem;
}

.map-card-title,
.city-popup-title {
  font-weight: 650;
}

.area-passport-meta {
  gap: 8px;
}

.area-passport-meta div,
.info-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.area-passport-meta strong,
.info-list dt {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 500;
}

.info-list dd,
.area-passport-meta div {
  color: var(--text);
  line-height: 1.4;
}

.area-passport-qr-wrap {
  border-radius: 8px;
  box-shadow: none;
}

.zones-grid {
  grid-template-columns: minmax(520px, 1.08fr) minmax(360px, .92fr);
  gap: 10px;
}

.zones-page .app-main {
  gap: 10px;
  min-height: calc(100vh - 82px);
}

.zones-table input,
.zones-table select {
  min-width: 120px;
}

.zones-table .btn-group {
  gap: 4px;
}

.zones-table .btn-group > .btn {
  border-radius: 6px !important;
}

.incident-hero-card {
  margin-bottom: 12px;
  padding: 14px;
  background: #fff;
  border-radius: 10px;
}

.incident-hero-main {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.incident-hero-icon {
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
}

.incident-hero-kicker {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.incident-hero-card h2 {
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: 0;
}

.incident-hero-meta {
  gap: 6px;
  margin-top: 8px;
}

.incident-hero-meta span {
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 400;
}

.incident-detail-grid {
  grid-template-columns: minmax(300px, 1.08fr) minmax(260px, .96fr) minmax(260px, .96fr);
  gap: 10px;
}

.incident-form {
  gap: 10px;
  max-width: 1080px;
}

.incident-form .form-control,
.incident-form .form-select,
.incident-form textarea,
.incident-form input,
.incident-form select {
  min-height: 38px;
}

.incident-form textarea {
  min-height: 86px;
}

.incident-form-actions {
  bottom: 8px;
  padding: 8px;
  border-radius: 10px;
}

.chat-message,
.ops-chat-log {
  border-radius: 8px;
}

@media (max-width: 1280px) {
  .app-main {
    padding: 12px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 96px;
  }

  .dashboard-grid,
  .incident-detail-grid {
    gap: 10px;
  }

  .ops-shell {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .ops-main {
    grid-template-rows: minmax(0, 1fr) 118px;
  }

  .ops-bottom section {
    padding: 8px;
  }

  .zones-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .zones-map {
    min-height: 340px;
  }
}

@media (max-width: 980px) {
  .page-header {
    display: grid;
  }

  .btn-row {
    justify-content: flex-start;
  }

  .content-grid,
  .dashboard-grid,
  .incident-detail-grid,
  .area-passport-grid {
    grid-template-columns: 1fr;
  }

  .ops-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-page .ops-shell {
    height: auto;
  }

  .ops-sidebar {
    max-height: none;
  }

  .ops-main {
    grid-template-rows: minmax(460px, 58vh) auto;
  }

  .ops-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .app-main,
  .map-page .app-main {
    padding: 8px;
  }

  .kpi-grid,
  .form-grid,
  .organization-card-list {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .dashboard-panel,
  .content-card {
    padding: 10px;
  }

  .table-responsive,
  .zones-table-wrap {
    border: 0;
    border-radius: 0;
  }

  .ops-table thead,
  .zones-table thead {
    display: none;
  }

  .ops-table tr,
  .zones-table tr {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
  }

  .ops-table td,
  .zones-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 8px;
    padding: 0;
    border: 0;
    text-align: left !important;
  }

  .ops-table td[data-label]::before,
  .zones-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 500;
  }

  .ops-table td:not([data-label]),
  .zones-table td:not([data-label]) {
    grid-template-columns: 1fr;
  }

  .btn-group,
  .incident-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .btn-group > .btn {
    border-radius: 6px !important;
  }
}

/* Adaptive operator navigation and map tools. */
.app-primary-nav {
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.app-navbar .nav-command {
  min-height: 34px;
  padding: .38rem .58rem;
  border-radius: 7px;
  white-space: nowrap;
}

.app-navbar .nav-command.active {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .18);
}

.app-navbar .nav-command-accent {
  color: #dffcf7;
  background: rgba(15, 118, 110, .28);
  border-color: rgba(94, 234, 212, .22);
}

.app-navbar .nav-command-accent:hover {
  background: rgba(15, 118, 110, .42);
}

.app-footer a {
  color: var(--accent-dark);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.map-tools-control {
  display: grid;
  gap: 6px;
  width: 238px;
  padding: 8px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.map-tools-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}

.map-coord-input {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd7df;
  border-radius: 7px;
  font-size: .82rem;
}

.map-tool-btn {
  min-height: 32px;
  padding: 4px 8px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid #cfd7df;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 500;
}

.map-tool-btn:hover,
.map-tool-btn.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.map-tool-wide {
  width: 100%;
}

.map-tool-status {
  min-height: 24px;
  padding: 5px 7px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  font-size: .76rem;
  line-height: 1.25;
}

.map-measuring {
  cursor: crosshair;
}

@media (max-width: 1180px) {
  .app-navbar .nav-command-wide {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .app-primary-nav {
    align-items: stretch;
    gap: 4px;
    padding: 10px 0;
  }

  .app-navbar .nav-command,
  .app-navbar .nav-command-wide {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }

  .app-user-zone {
    align-items: stretch;
    padding-bottom: 8px;
  }
}

@media (max-width: 760px) {
  .map-tools-control {
    width: min(238px, calc(100vw - 32px));
  }
}

/* Assignment wizard on the incident map. */
.ops-wizard-sidebar {
  padding: 10px;
}

.assignment-wizard {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.wizard-header,
.wizard-step,
.wizard-current-unit,
.wizard-status,
.wizard-unit-picker {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.wizard-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 650;
}

.wizard-step-counter {
  align-self: start;
  padding: 3px 7px;
  color: var(--accent-dark);
  background: var(--accent-ghost);
  border: 1px solid rgba(15, 118, 110, .16);
  border-radius: 7px;
  font-size: .76rem;
}

.wizard-step {
  display: grid;
  gap: 10px;
  padding: 10px;
  opacity: .86;
}

.wizard-step.is-active {
  border-color: rgba(15, 118, 110, .34);
  box-shadow: inset 3px 0 0 var(--accent);
  opacity: 1;
}

.wizard-step-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.wizard-step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 650;
}

.wizard-step h3,
.wizard-draw-panel h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: .92rem;
  font-weight: 650;
}

.wizard-step p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}

.wizard-form {
  gap: 6px;
}

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

.wizard-check {
  margin-top: 2px;
}

.wizard-current-unit {
  display: grid;
  gap: 2px;
  padding: 9px;
  background: #f8fafc;
}

.wizard-current-unit strong {
  color: var(--text-strong);
  font-weight: 650;
}

.wizard-current-unit span {
  color: var(--muted);
  font-size: .8rem;
}

.wizard-unit-picker {
  display: grid;
  gap: 5px;
  padding: 9px;
  background: #f8fafc;
}

.wizard-or {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
}

.wizard-or::before,
.wizard-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border-soft);
}

.wizard-draw-panel {
  margin: 0;
}

.wizard-status {
  padding: 8px 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: .82rem;
}

.wizard-status[data-tone="success"] {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(6, 118, 71, .18);
}

.wizard-status[data-tone="danger"] {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, .18);
}

@media (max-width: 760px) {
  .wizard-grid-2 {
    grid-template-columns: 1fr;
  }
}
