/* =====================================================================
   Sistema de Especialistas CBMMG - Folha de estilos
   Identidade institucional: azul-marinho profundo + bordo de destaque.
   Tipografia: Libre Franklin (display/peso) + Source Sans 3 (corpo) via
   fontes do sistema com fallback robusto, sem dependencia de CDN externa.
   ===================================================================== */

:root {
  /* Cores institucionais */
  --navy-900: #0f1f3d;
  --navy-800: #142a52;
  --navy-700: #1c3766;
  --navy-600: #274a85;
  --bordo:    #8c1c2b;
  --bordo-dark: #6f1421;
  --bordo-light: #b3303f;
  --gold:     #c9a227;

  --gray-50:  #f5f7fa;
  --gray-100: #eef1f6;
  --gray-200: #e1e6ee;
  --gray-300: #cbd3df;
  --gray-400: #9aa6b8;
  --gray-500: #6b7688;
  --gray-700: #3a4253;
  --white:    #ffffff;

  --success: #1f7a4d;
  --success-bg: #e4f4ec;
  --danger: #b3303f;
  --danger-bg: #fbe9eb;
  --warning: #9a6a00;
  --warning-bg: #fcf3dd;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(15, 31, 61, 0.08), 0 1px 2px rgba(15, 31, 61, 0.06);
  --shadow: 0 4px 16px rgba(15, 31, 61, 0.10);
  --shadow-lg: 0 12px 40px rgba(15, 31, 61, 0.18);

  --font-display: 'Libre Franklin', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --header-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--gray-700);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ===================== TELA DE LOGIN ===================== */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(140, 28, 43, 0.25), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(39, 74, 133, 0.5), transparent 55%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700));
  position: relative;
  overflow: hidden;
}
.login-page::before {
  /* textura geometrica sutil */
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 22px);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
  animation: rise .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.brand {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.brand-emblem {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--bordo), var(--bordo-dark));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(140, 28, 43, 0.35);
  border: 3px solid var(--gold);
}
.brand-emblem svg { width: 38px; height: 38px; }
.brand h1 {
  font-family: var(--font-display);
  font-size: 1.18rem; font-weight: 800; letter-spacing: .3px;
  color: var(--navy-900); text-align: center; line-height: 1.25;
}
.brand p { font-size: .82rem; color: var(--gray-500); text-align: center; letter-spacing: .4px; }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px; letter-spacing: .2px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: .95rem; color: var(--gray-700); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-500);
  display: grid;
  place-items: center;
}
.password-toggle:hover {
  background: var(--gray-100);
  color: var(--navy-700);
}
.password-toggle:focus-visible {
  outline: 2px solid rgba(39, 74, 133, 0.3);
  outline-offset: 2px;
}
.password-toggle svg {
  width: 18px;
  height: 18px;
}
.password-toggle svg[hidden] {
  display: none !important;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(39, 74, 133, 0.15);
}
textarea { resize: vertical; min-height: 84px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: none; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .92rem; letter-spacing: .2px;
  transition: transform .08s, filter .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-700); color: var(--white); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-accent { background: var(--bordo); color: var(--white); }
.btn-accent:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-header {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.18);
}
.btn-header:hover {
  background: rgba(255,255,255,0.18);
}
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: .82rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.alert {
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: .85rem;
  margin-bottom: 14px; display: none;
}
.alert.show { display: block; }
.alert-error { background: var(--danger-bg); color: var(--bordo-dark); border: 1px solid #f1c5cb; }

.login-hint {
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--gray-200);
  font-size: .74rem; color: var(--gray-400); text-align: center; line-height: 1.6;
}

/* ===================== APP PRINCIPAL ===================== */
.app { display: none; min-height: 100vh; flex-direction: column; }
.app.show { display: flex; }

.app-header {
  height: var(--header-h);
  background: linear-gradient(100deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; box-shadow: var(--shadow); z-index: 40;
  position: sticky; top: 0;
}
.app-header .logo {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--bordo), var(--bordo-dark));
  border: 2px solid var(--gold);
}
.app-header .logo svg { width: 20px; height: 20px; color: #fff; }
.app-header .titles { line-height: 1.1; }
.app-header .titles strong { font-family: var(--font-display); font-size: 1rem; font-weight: 800; letter-spacing: .3px; }
.app-header .titles span { display: block; font-size: .72rem; color: var(--gray-300); letter-spacing: .5px; }

.nav-tabs { display: flex; gap: 4px; margin-left: 18px; }
.nav-tab {
  background: transparent; color: var(--gray-300); border: none;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s;
}
.nav-tab svg { width: 16px; height: 16px; }
.nav-tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-tab.active { background: var(--bordo); color: #fff; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px;
  background: rgba(255,255,255,0.08); border-radius: 999px; font-size: .82rem;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--gold); color: var(--navy-900);
  display: grid; place-items: center; font-weight: 800; font-size: .82rem;
}
.user-chip .meta { line-height: 1.15; }
.user-chip .meta b { font-weight: 700; }
.user-chip .meta small { display: block; color: var(--gray-300); font-size: .68rem; letter-spacing: .4px; }

.app-body { flex: 1; position: relative; overflow: hidden; }
.view { display: none; height: calc(100vh - var(--header-h)); }
.view.active { display: block; }

/* ===================== MAPA ===================== */
#view-map { display: none; }
#view-map.active { display: flex; }
#map { flex: 1; height: 100%; z-index: 1; }

.map-wrap { position: relative; flex: 1; display: flex; }
.map-searchbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 16px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 10px 24px rgba(15,31,61,0.16);
  backdrop-filter: blur(8px);
}
.map-search-box input {
  min-width: 320px;
}

.side-panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(380px, 90vw);
  background: var(--white); box-shadow: -8px 0 30px rgba(15,31,61,0.15);
  transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  z-index: 30; display: flex; flex-direction: column;
}
.side-panel.open { transform: none; }
.side-panel-head {
  background: linear-gradient(120deg, var(--navy-800), var(--navy-600));
  color: #fff; padding: 18px 20px; position: relative;
}
.side-panel-head .close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border-radius: 8px; border: none; background: rgba(255,255,255,0.15); color: #fff;
  font-size: 1.1rem; line-height: 1; display: grid; place-items: center;
}
.side-panel-head .close:hover { background: rgba(255,255,255,0.28); }
.side-panel-head h2 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 800; padding-right: 32px; }
.side-panel-head .cob { font-size: .8rem; color: var(--gray-300); margin-top: 3px; }
.side-panel-head .count-badge {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 7px;
  background: var(--bordo); padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
}
.side-panel-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--gray-50); }

.mil-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 11px; margin-bottom: 10px;
  cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s;
}
.mil-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--navy-600); }
.mil-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--navy-700); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .95rem; overflow: hidden;
}
.mil-info { flex: 1; min-width: 0; line-height: 1.3; }
.mil-info .rank { font-size: .7rem; font-weight: 700; color: var(--bordo); letter-spacing: .4px; text-transform: uppercase; }
.mil-info .name { font-weight: 700; color: var(--navy-900); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mil-info .sub { font-size: .78rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mil-card .chev { color: var(--gray-400); flex: none; }

.empty-state { text-align: center; color: var(--gray-400); padding: 40px 20px; font-size: .9rem; }
.empty-state svg { width: 42px; height: 42px; opacity: .4; margin-bottom: 10px; }
.search-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: .76rem;
  font-weight: 600;
}
.search-hint {
  margin-top: 10px;
  color: var(--gray-300);
  font-size: .78rem;
  line-height: 1.45;
}

/* ===================== CONFIGURACOES ===================== */
#view-config { overflow-y: auto; padding: 26px; background: var(--gray-50); }
.config-head { max-width: 1100px; margin: 0 auto 22px; }
.config-head h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--navy-900); font-weight: 800; }
.config-head p { color: var(--gray-500); font-size: .9rem; margin-top: 3px; }

.config-tabs { max-width: 1100px; margin: 0 auto 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.config-tab {
  background: var(--white); border: 1.5px solid var(--gray-200); color: var(--gray-700);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .85rem; transition: all .15s;
}
.config-tab:hover { border-color: var(--navy-600); }
.config-tab.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

.panel { max-width: 1100px; margin: 0 auto; display: none; }
.panel.active { display: block; }

.card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50);
}
.card-toolbar h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--navy-900); font-weight: 700; margin-right: auto; }
.search-box { position: relative; }
.search-box input { padding-left: 34px; min-width: 210px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--gray-400); }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gray-500); padding: 12px 16px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: .9rem; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .3px;
}
.tag-on { background: var(--success-bg); color: var(--success); }
.tag-off { background: var(--gray-100); color: var(--gray-500); }
.tag-info { background: rgba(39, 74, 133, 0.12); color: var(--navy-700); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--gray-200);
  background: var(--white); display: grid; place-items: center; color: var(--gray-500); transition: all .12s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--navy-700); border-color: var(--navy-600); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* avatar miniatura na tabela de militares */
.tbl-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--navy-700); color:#fff; display:grid; place-items:center; font-weight:700; font-size:.75rem; overflow:hidden; }

/* ===================== MODAIS ===================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 31, 61, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column; animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal.wide { max-width: 680px; }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200); background: var(--gray-50);
}
.modal-head h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--navy-900); font-weight: 700; }
.modal-head .close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--gray-100); color: var(--gray-500); font-size: 1.2rem; line-height: 1; display: grid; place-items: center;
}
.modal-head .close:hover { background: var(--gray-200); color: var(--navy-900); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--gray-200); background: var(--gray-50); }

/* Modal de detalhe do militar */
.detail-hero {
  display: flex; align-items: center; gap: 18px; padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--gray-200);
}
.detail-hero .photo {
  width: 92px; height: 92px; border-radius: 16px; object-fit: cover; flex: none;
  background: var(--navy-700); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 1.7rem; overflow: hidden; border: 3px solid var(--gold);
}
.detail-hero .rank-pill {
  display: inline-block; background: var(--bordo); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 3px 11px; border-radius: 999px; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 6px;
}
.detail-hero h2 { font-family: var(--font-display); color: var(--navy-900); font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.detail-hero .bm { color: var(--gray-500); font-size: .85rem; margin-top: 3px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.detail-item .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-400); font-weight: 700; margin-bottom: 2px; }
.detail-item .val { font-size: .95rem; color: var(--navy-900); font-weight: 600; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item.full .val { font-weight: 500; color: var(--gray-700); line-height: 1.5; }
.activity-checklist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.activity-checklist li {
  position: relative;
  padding-left: 32px;
  min-height: 22px;
}
.activity-checklist li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
}

/* Formulario */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.req { color: var(--bordo); }

.photo-uploader { display: flex; align-items: center; gap: 16px; }
.photo-preview {
  width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex: none;
  background: var(--gray-100); border: 2px dashed var(--gray-300);
  display: grid; place-items: center; color: var(--gray-400); overflow: hidden;
}
.photo-preview svg { width: 30px; height: 30px; }

.field-error { color: var(--danger); font-size: .76rem; margin-top: 4px; display: none; }
.field-error.show { display: block; }
.field-note { color: var(--gray-500); font-size: .76rem; margin-top: 6px; line-height: 1.45; }

/* ===================== TOASTS ===================== */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 340px; padding: 13px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .88rem; color: #fff; font-weight: 600;
  display: flex; align-items: center; gap: 10px; animation: slideIn .25s; background: var(--navy-700);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.fade-out { animation: slideOut .3s forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(40px); } }

/* ===================== LOADING ===================== */
.loader-overlay {
  position: absolute; inset: 0; background: rgba(245,247,250,0.7); z-index: 50;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(1px);
}
.loader-overlay.show { display: flex; }
.spinner {
  width: 42px; height: 42px; border: 4px solid var(--gray-300);
  border-top-color: var(--bordo); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Leaflet marker label */
.quartel-marker {
  width: 42px;
  height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.quartel-pin {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(155deg, #c83a45, var(--bordo-dark));
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(140, 28, 43, 0.32), 0 4px 10px rgba(15, 31, 61, 0.16);
}
.quartel-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: linear-gradient(155deg, #c83a45, var(--bordo-dark));
  border-right: 2px solid rgba(255, 255, 255, 0.96);
  border-bottom: 2px solid rgba(255, 255, 255, 0.96);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 4px 0;
  z-index: -1;
}
.quartel-pin svg {
  position: relative;
  width: 22px;
  height: 22px;
}

/* ===================== RÓTULOS DOS COBs ===================== */
.cob-label {
  background: none !important;
  border: none !important;
  pointer-events: none;
}
.cob-label span {
  display: inline-block;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid currentColor;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(2px);
}

/* ===================== RESPONSIVO ===================== */
@media (max-width: 760px) {
  .app-header { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .nav-tabs { order: 3; width: 100%; margin-left: 0; }
  .nav-tab { flex: 1; justify-content: center; }
  .header-right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .user-chip .meta { display: none; }
  .view { height: auto; min-height: calc(100vh - 120px); }
  .map-searchbar {
    top: 12px;
    left: 12px;
    right: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .map-search-box,
  .map-search-box input {
    width: 100%;
    min-width: 0;
  }
  #map { min-height: 60vh; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .config-head h2 { font-size: 1.25rem; }
  thead { display: none; }
  .responsive-table tbody td { display: flex; justify-content: space-between; padding: 8px 16px; }
  .responsive-table tbody td::before { content: attr(data-label); font-weight: 700; color: var(--gray-500); font-size: .76rem; }
  .responsive-table tbody tr { display: block; border-bottom: 8px solid var(--gray-50); }
  .row-actions { justify-content: flex-end; }
}
