* { box-sizing: border-box; }

:root {
  --ocupado: #e05659;
  --disponible: #4caf7d;
  --pasillo: #c9cdd3;
  --fuel: #f2b134;
  --no-comercial: #9b7fd4;
  --reparacion: #e2793f;
  --ink: #1f2937;
  --bg: #f4f6f8;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ---- Pantalla de acceso (portón de entrada a toda la app) ---- */
.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,0.08), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(242,177,52,0.12), transparent 45%),
    linear-gradient(160deg, #0c2233 0%, #123a54 55%, #1a5075 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 20px 50px rgba(6, 20, 32, 0.35);
  text-align: center;
}
.login-logo {
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto 22px;
  display: block;
}
.login-card h1 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  color: #10344f;
  line-height: 1.3;
}
.login-sub {
  margin: 0 0 24px;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-form input {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d7dce2;
  font-size: 0.95rem;
  text-align: center;
}
.login-form input:focus {
  outline: none;
  border-color: #1a5075;
  box-shadow: 0 0 0 3px rgba(26, 80, 117, 0.15);
}
.login-btn {
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  background: #10344f;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.login-btn:hover { background: #164a6e; }
.login-btn:disabled { opacity: 0.6; cursor: default; }
.login-msg {
  min-height: 1.2em;
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: #1a5075;
}
.login-msg.error { color: #b91c1c; }
.login-msg.ok { color: #1a7a3c; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #10344f;
  color: #fff;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar h1 { font-size: 1.2rem; margin: 0; }

.controls-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  padding: 4px;
  border-radius: 8px;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: #cfe0ef;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}
.toggle-btn.active { background: #fff; color: #10344f; font-weight: 600; }

.hidden { display: none !important; }

#search, #sectionFilter {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
}

#search { width: 260px; }
#sectionFilter { width: 170px; cursor: pointer; }

.dashboard {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  flex-wrap: wrap;
}

.stat {
  background: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  min-width: 130px;
}

.stat .num { font-size: 1.4rem; font-weight: 700; }
.stat .lbl { font-size: 0.75rem; color: #6b7280; text-transform: uppercase; }

/* Acciones de Admin (descargar Excel/PDF, cerrar sesión) — se pintan en
   esta misma barra, no dentro del panel Admin, para que estén a mano
   desde cualquier pestaña mientras haya sesión iniciada. */
.dash-admin-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  flex-wrap: wrap;
}
.dash-action-btn {
  background: #10344f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.dash-action-btn:hover { background: #164a6e; }

/* Barra "descargar Excel/PDF" propia de cada pestaña (Dashboard,
   Optimización) — cada una exporta solo lo que esa pestaña muestra. */
.section-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-toolbar-actions {
  display: flex;
  gap: 14px;
  flex: 0 0 auto;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid #e2e5e9;
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  transition: opacity 0.1s ease, border-color 0.1s ease;
}
.legend-item:not(.active) { opacity: 0.4; }
.legend-item.active { border-color: #b9c1cb; }

.legend-hint { font-size: 0.75rem; color: #6b7280; }

.zoom-wrap { display: flex; gap: 4px; margin-left: auto; }
.zoom-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid #e2e5e9;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.zoom-btn:hover { background: #eef1f4; }

.swatch {
  width: 14px; height: 14px; border-radius: 3px; display: inline-block;
}
.swatch.ocupado { background: var(--ocupado); }
.swatch.disponible { background: var(--disponible); }
.swatch.pasillo { background: var(--pasillo); }
.swatch.fuel { background: var(--fuel); }
.swatch.no-comercial { background: var(--no-comercial); }
.swatch.reparacion { background: var(--reparacion); }

.map-wrap {
  overflow: auto;
  padding: 10px 20px 40px;
}

.grid {
  --cell: 34px;
  display: grid;
  gap: 3px;
  width: max-content;
}

.cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 4px;
  font-size: calc(var(--cell) * 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  overflow: hidden;
  white-space: nowrap;
}

.cell:hover {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.cell.ocupado { background: var(--ocupado); }
.cell.disponible { background: var(--disponible); color: #123; }
.cell.pasillo { background: var(--pasillo); color: #444; }
.cell.fuel { background: var(--fuel); color: #432; }
.cell.no-comercial { background: var(--no-comercial); }
.cell.reparacion { background: var(--reparacion); }

.cell.match { outline: 2px solid #1a73e8; }
.cell.dim { opacity: 0.25; }

.label {
  font-size: 14px;
  font-weight: 700;
  color: #10344f;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}
.overlay.hidden { display: none; }

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 22px 26px;
  width: 460px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.slip-list {
  margin: 14px 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #eef1f4;
  border-radius: 8px;
}

.slip-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-bottom: 1px solid #f4f6f8;
  flex-wrap: wrap;
}
.slip-row:last-child { border-bottom: none; }
.slip-row:hover { background: #f8f9fa; }

.slip-code {
  font-weight: 700;
  color: #10344f;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
.slip-code .swatch { width: 9px; height: 9px; border-radius: 2px; }

.slip-yate {
  flex: 1 1 90px;
  font-weight: 600;
  color: #333;
}

.slip-metrics {
  flex: 1 1 100%;
  color: #6b7280;
  font-size: 0.76rem;
}

@media (min-width: 460px) {
  .slip-metrics { flex: 0 0 auto; margin-left: auto; text-align: right; }
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #6b7280;
}

.panel h2 { margin-top: 0; color: #10344f; }

.panel-body dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
}
.panel-body dt { font-weight: 600; color: #6b7280; font-size: 0.82rem; }
.panel-body dd { margin: 0; font-size: 0.9rem; }

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}
.status-badge.ocupado { background: var(--ocupado); }
.status-badge.disponible { background: var(--disponible); }
.status-badge.pasillo { background: var(--pasillo); color: #333; }
.status-badge.fuel { background: var(--fuel); color: #432; }
.status-badge.no-comercial { background: var(--no-comercial); }
.status-badge.reparacion { background: var(--reparacion); }

.overview-wrap {
  padding: 10px 20px 40px;
}

.overview-hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 12px;
}

.overview-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

#overviewImg {
  width: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.overview-markers {
  position: absolute;
  inset: 0;
}

.section-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: transform 0.1s ease;
  pointer-events: auto;
}
.section-marker:hover { transform: translate(-50%, -50%) scale(1.18); z-index: 5; }

.section-fullscreen {
  position: fixed;
  inset: 0;
  background: #10344f;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.section-fullscreen.hidden { display: none; }

.sf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #0b263c;
  color: #fff;
  flex: 0 0 auto;
}
.sf-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sf-title h2 { margin: 0; font-size: 1.2rem; }
.sf-stats { font-size: 0.85rem; color: #b9c9d8; }

.sf-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.sf-close:hover { background: rgba(255,255,255,0.25); }

.sf-grid-wrap {
  position: relative;
  flex: 1 1 auto;
  overflow: auto;
  background: #eef2f5;
  padding: 48px;
}

.sf-grid { display: inline-grid; }

.sf-card {
  align-self: center;
  justify-self: center;
  width: 176px;
  background: rgba(255, 246, 200, 0.97);
  border: 1.5px solid #d9a441;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 600;
  color: #3a2c00;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.sf-card:hover { background: #fff2b3; z-index: 2; box-shadow: 0 4px 10px rgba(0,0,0,0.4); }
.sf-card.is-vacant { background: rgba(224,233,238,0.97); border-color: #9fb3c0; color: #2c4152; }
/* Después de .is-vacant a propósito, para ganarle en las propiedades que
   se repiten (mismo peso de especificidad, gana la que está más abajo). */
.sf-card-no-comercial.is-vacant { background: rgba(155,127,212,0.18); border-color: var(--no-comercial); color: #4a3a7a; }
.sf-card-reparacion.is-vacant { background: rgba(226,121,63,0.18); border-color: var(--reparacion); color: #7a3d16; }

.sf-card .sf-slip {
  display: block;
  font-weight: 800;
  font-size: 16px;
  color: #10344f;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  margin-bottom: 4px;
  padding-bottom: 3px;
}
.sf-card .sf-yate { display: block; font-weight: 800; white-space: normal; }
.sf-card .sf-owner { display: block; font-weight: 500; font-size: 12px; opacity: 0.85; white-space: normal; }
.sf-card .sf-metric { display: block; font-size: 13px; font-weight: 600; }
.sf-card .sf-metric b { font-weight: 800; }
.sf-card .sf-metric.sf-uso-low { color: #b91c1c; }
.sf-card .sf-metric.sf-uso-low b { color: #b91c1c; }

.section-summary p {
  margin: 4px 0 14px;
  font-size: 0.85rem;
  color: #6b7280;
}

.section-summary .stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-summary .stat-row .stat {
  min-width: 90px;
  padding: 8px 12px;
}

.section-summary .goto-btn {
  background: #10344f;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}
.section-summary .goto-btn:hover { background: #164a6e; }

.dashboard-view {
  padding: 10px 20px 40px;
}

.top-scope {
  font-size: 0.82rem;
  color: #10344f;
  background: #eef3f8;
  border: 1px solid #d7e3ee;
  border-radius: 6px;
  padding: 6px 20px;
  margin: 0 20px 10px;
  display: inline-block;
}
.top-scope:empty { display: none; }

.dashboard-scope {
  font-size: 0.85rem;
  color: #10344f;
  background: #eef3f8;
  border: 1px solid #d7e3ee;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 16px;
  display: inline-block;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  height: 320px;
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #10344f;
}

.chart-card canvas {
  flex: 1;
  min-height: 0;
}

.table-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.table-card h3 { margin: 0 0 10px; font-size: 0.9rem; color: #10344f; }

.table-scroll { overflow-x: auto; }

#sectionTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#sectionTable th, #sectionTable td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #eef1f4;
  white-space: nowrap;
}

#sectionTable th:first-child, #sectionTable td:first-child { text-align: left; font-weight: 600; }
#sectionTable thead th { color: #6b7280; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
#sectionTable tbody tr:hover { background: #f4f6f8; }

@media (max-width: 640px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card { height: 280px; }
}

.admin-view { padding: 20px; }

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.admin-user { font-size: 0.85rem; color: #10344f; font-weight: 600; }
.admin-toolbar input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d7dce2;
  font-size: 0.9rem;
}
.admin-hint { font-size: 0.8rem; color: #6b7280; margin: 0 0 12px; }

/* Área usada solo para "Descargar PDF" (Admin/Dashboard/Optimización): se
   llena justo antes de window.print() y se oculta en pantalla; @media print
   oculta todo lo demás para que solo se imprima esto. Tiene que ser hermano
   directo de <body> (fuera de #appShell) — si quedara adentro de un
   contenedor oculto, display:block acá no lo puede "revivir": un padre con
   display:none apaga a todos sus hijos sin excepción, sin importar el
   display que cada uno tenga puesto. */
#adminPrintArea { display: none; }
#adminPrintArea h2 { margin: 0 0 4px; }
#adminPrintArea p { margin: 0 0 12px; font-size: 0.85rem; color: #4b5a67; }
#adminPrintArea table { width: 100%; border-collapse: collapse; font-size: 10px; }
#adminPrintArea th, #adminPrintArea td { border: 1px solid #9aa5af; padding: 4px 6px; text-align: left; }
#adminPrintArea th { background: #eef1ec; }
#adminPrintArea .print-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
#adminPrintArea .print-chart { width: 100%; height: auto; border: 1px solid #d7dce2; }
@media print {
  #loginGate, #appShell { display: none !important; }
  #adminPrintArea { display: block !important; }
}

.optimization-view { padding: 10px 20px 40px; }
.optimization-hint { font-size: 0.85rem; color: #4b5a67; max-width: 900px; margin: 0 0 16px; line-height: 1.5; }

.opt-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.opt-stat {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 5px solid #9fb3c0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.opt-stat-num { font-size: 1.8rem; font-weight: 800; color: #10344f; }
.opt-stat-label { font-size: 0.78rem; color: #5c6b78; line-height: 1.3; }
.opt-stat-danger { border-left-color: #b91c1c; }
.opt-stat-danger .opt-stat-num { color: #b91c1c; }
.opt-stat-warn { border-left-color: #b8860b; }
.opt-stat-warn .opt-stat-num { color: #b8860b; }

.opt-section h3 { margin: 0 0 12px; font-size: 0.95rem; color: #10344f; }

.opt-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.opt-empty { color: #6b7280; font-size: 0.9rem; }

.opt-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-top: 4px solid #9fb3c0;
}
.opt-card-sobrecapacidad { border-top-color: #b91c1c; }
.opt-card-desaprovechado { border-top-color: #b8860b; }

.opt-card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
  color: #fff;
  background: #9fb3c0;
}
.opt-card-sobrecapacidad .opt-card-badge { background: #b91c1c; }
.opt-card-desaprovechado .opt-card-badge { background: #b8860b; }

.opt-card-yate { font-weight: 800; font-size: 1.02rem; color: #10344f; }
.opt-card-owner { font-size: 0.8rem; color: #6b7280; margin-bottom: 12px; }

.opt-card-move {
  display: flex;
  align-items: center;
  gap: 10px;
}
.opt-card-slip {
  flex: 1 1 0;
  min-width: 0;
  background: #f4f7f9;
  border: 1px solid #e1e8ee;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.opt-card-slip:hover { background: #e9eff4; }
.opt-card-slip-code { display: block; font-weight: 800; color: #10344f; font-size: 0.95rem; }
.opt-card-slip-sub { display: block; font-size: 0.75rem; color: #6b7280; margin-top: 2px; }

@media (max-width: 900px) {
  .opt-summary { grid-template-columns: repeat(2, 1fr); }
}

#adminTable {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.85rem;
}
#adminTable th, #adminTable td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f4;
  text-align: left;
}
#adminTable thead th { color: #6b7280; font-size: 0.78rem; text-transform: uppercase; background: #f8f9fa; }
#adminTable tbody tr:hover { background: #f4f6f8; }
#adminTable .edit-btn {
  background: #10344f; color: #fff; border: none; padding: 5px 12px;
  border-radius: 5px; cursor: pointer; font-size: 0.8rem;
}

.admin-users-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e1e8ee; }
.admin-users-section h3 { margin: 0 0 6px; font-size: 1rem; color: #10344f; }
.admin-users-section-standalone { margin-top: 0; padding-top: 0; border-top: none; max-width: 700px; }

.admin-users-add { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-users-add input, .admin-users-add select {
  padding: 7px 10px; border-radius: 6px; border: 1px solid #d7dce2; font-size: 0.88rem;
}
.admin-users-add input { flex: 1 1 auto; min-width: 200px; }

#adminUsersTable {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.85rem;
}
#adminUsersTable th, #adminUsersTable td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f4;
  text-align: left;
}
#adminUsersTable thead th { color: #6b7280; font-size: 0.78rem; text-transform: uppercase; background: #f8f9fa; }
#adminUsersTable tbody tr:hover { background: #f4f6f8; }
#adminUsersTable .edit-btn {
  background: #b91c1c; color: #fff; border: none; padding: 5px 12px;
  border-radius: 5px; cursor: pointer; font-size: 0.8rem;
}

.edit-form dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; align-items: center; }
.edit-form dt { font-weight: 600; color: #6b7280; font-size: 0.82rem; }
.edit-form input, .edit-form select {
  width: 100%; padding: 7px 10px; border-radius: 6px; border: 1px solid #d7dce2; font-size: 0.88rem;
}
.edit-form-actions { margin-top: 16px; display: flex; gap: 8px; }
.edit-form-actions .goto-btn { background: #10344f; }
.edit-form-actions .cancel-btn { background: #e5e7eb; color: #333; border: none; padding: 9px 16px; border-radius: 6px; cursor: pointer; }
.edit-form-msg { font-size: 0.82rem; margin-top: 8px; min-height: 1.2em; }
.edit-form-msg.error { color: #c0392b; }
.edit-form-msg.ok { color: #1a8a4a; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .controls-wrap { flex-direction: column; }
  #search, #sectionFilter { width: 100%; }
  .legend { gap: 8px; }
  .zoom-wrap { margin-left: 0; }
  .dashboard { gap: 8px; }
  .stat { min-width: 45%; flex: 1; }
  .view-toggle { width: 100%; }
  .toggle-btn { flex: 1; }
  .section-marker { width: 30px; height: 30px; font-size: 0.7rem; }
}
