:root {
  --bg: #f2f7f6;
  --surface: #ffffff;
  --surface-2: #eaf4f1;
  --surface-3: #f7fbfa;
  --text: #18252f;
  --muted: #5d7282;
  --border: #d4e2de;
  --green: #00796b;
  --teal: #0f766e;
  --teal-dark: #0b4f49;
  --blue: #2563eb;
  --sky: #0ea5e9;
  --success: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --gold: #d7a936;
  --shadow: 0 18px 42px rgba(12, 63, 58, .08);
  --radius: 8px;
}

[data-theme="dark"] {
  --bg: #0d1f1f;
  --surface: #132827;
  --surface-2: #173331;
  --surface-3: #102422;
  --text: #e7f2ef;
  --muted: #a7c4bd;
  --border: #28534d;
  --shadow: 0 16px 38px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, .045) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, .045) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #073f38 0%, #092f31 100%);
  color: #e9fffb;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, .12);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.brand-mark {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #f7fffd;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(12, 63, 58, .12);
}

.brand-mark img {
  width: 44px;
  max-width: 44px;
  height: 44px;
  max-height: 44px;
  object-fit: contain;
  display: block;
}

.brand strong { display: block; font-size: 20px; line-height: 1; }
.brand small { display: block; color: #a7d7ce; margin-top: 5px; }

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #d8f4ef;
  min-height: 44px;
  font-weight: 650;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #9ce7dc;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, .13);
  color: #fff;
}

.nav-item.active .nav-icon { color: var(--gold); }

.sidebar-showcase,
.sidebar-note {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.sidebar-showcase img {
  width: 100%;
  height: 116px;
  display: block;
  object-fit: cover;
}

.sidebar-showcase div,
.sidebar-note {
  padding: 13px;
  display: grid;
  gap: 6px;
}

.sidebar-showcase span,
.sidebar-note span {
  color: #b7d9d2;
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-note { margin-top: auto; }

.main { min-width: 0; }

.topbar {
  min-height: 72px;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.search {
  min-width: 320px;
  width: min(640px, 50vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(12, 63, 58, .04);
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.content { padding: 24px; }

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(240px, 360px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
}

.page-header-copy,
.page-actions,
.page-hero-media {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.page-header-copy {
  padding: 22px;
  display: grid;
  align-content: center;
}

.page-header h1 {
  margin: 2px 0 8px;
  font-size: 30px;
  line-height: 1.15;
  color: var(--teal-dark);
}

.page-header p { margin: 0; color: var(--muted); max-width: 820px; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
}

.page-actions {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-hero-media {
  position: relative;
  overflow: hidden;
  margin: 0;
  min-height: 156px;
  height: 156px;
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.page-hero-media figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(5, 39, 36, .84);
  color: #fff;
  display: grid;
  gap: 3px;
}

.page-hero-media span { color: #cde7df; font-size: 12px; line-height: 1.25; }

.button,
.icon-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
}

.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.secondary { background: #e8f7f3; color: var(--teal-dark); border-color: #b9d9d2; }
.button.ghost { background: transparent; color: var(--muted); }
.button.full { width: 100%; }
.icon-button { width: 42px; padding: 0; }

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.insight-strip article {
  min-height: 132px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(4, 48, 44, .92), rgba(4, 48, 44, .38)),
    var(--strip-image) center / cover;
  color: #fff;
  display: grid;
  align-content: end;
  gap: 6px;
  box-shadow: var(--shadow);
}

.insight-strip span { color: #beece2; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.insight-strip strong { font-size: 17px; line-height: 1.2; max-width: 340px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-grid.compact { grid-template-columns: repeat(3, minmax(140px, 1fr)); margin: 0; }

.kpi-card {
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.kpi-card span { color: var(--muted); font-size: 13px; font-weight: 750; }
.kpi-card strong { font-size: 34px; line-height: 1; color: var(--teal-dark); }
.kpi-card small { color: var(--muted); }
.kpi-card.attention strong { color: var(--red); }
.kpi-card.warning strong { color: var(--amber); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

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

.panel-title h2 { margin: 0; font-size: 17px; color: var(--teal-dark); }
.panel-title a { color: var(--blue); font-weight: 750; }

.map-summary { min-height: 420px; }

.mini-map {
  height: 310px;
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: #eaf5f1;
}

.mini-map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-map-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15,118,110,.18) 1px, transparent 1px),
    linear-gradient(rgba(15,118,110,.18) 1px, transparent 1px),
    rgba(235, 248, 245, .18);
  background-size: 36px 36px;
}

.map-pin {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .22);
}

.map-pin.p1 { left: 22%; top: 34%; }
.map-pin.p2 { left: 64%; top: 58%; background: var(--red); box-shadow: 0 0 0 4px rgba(220, 38, 38, .18); }
.map-pin.p3 { left: 48%; top: 36%; background: var(--sky); box-shadow: 0 0 0 4px rgba(14, 165, 233, .18); }

.measurement-ruler {
  position: absolute;
  left: 42%;
  top: 51%;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--teal-dark);
  font-weight: 800;
}

.legend-row { display: flex; gap: 14px; margin-top: 12px; color: var(--muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--success); }
.dot.alert { background: var(--red); }
.dot.field { background: var(--sky); }

.status-bars,
.issue-list,
.timeline { display: grid; gap: 10px; }

.bar-line {
  display: grid;
  grid-template-columns: 116px 1fr 34px;
  gap: 10px;
  align-items: center;
}

.bar-line span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.bar-line div { height: 10px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bar-line i { display: block; height: 100%; background: var(--green); }

.issue-item {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}

.issue-item span { color: var(--muted); }

.media-card,
.field-card.image-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
}

.media-card img,
.field-card.image-card img {
  width: 100%;
  height: 188px;
  object-fit: cover;
  display: block;
}

.media-card div,
.field-card.image-card div {
  padding: 14px;
  display: grid;
  gap: 5px;
}

.media-card span,
.field-card span { color: var(--muted); line-height: 1.35; }

.map-workbench {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  min-height: calc(100vh - 260px);
}

.tool-rail { display: flex; flex-direction: column; gap: 8px; }
.tool-rail button {
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tool-rail button.active,
.tool-rail button:hover { background: #dff5ef; border-color: var(--green); }

.cad-map {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cad-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #0c3f3a;
  color: #e9fffb;
  font-size: 13px;
  flex-wrap: wrap;
}

#territory-map {
  width: 100%;
  height: auto;
  aspect-ratio: 660 / 705;
  min-height: 0;
  display: block;
  background: #0c3f3a;
}
.map-road { fill: none; stroke: #d9c9a2; stroke-width: 30; stroke-linecap: round; opacity: .86; }
.map-water { fill: none; stroke: rgba(14, 165, 233, .34); stroke-width: 34; stroke-linecap: round; }
.parcel-polygon {
  fill: rgba(255, 255, 255, .20);
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 5;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .32));
}
.parcel-polygon.oficial { fill: rgba(22, 163, 74, .26); stroke: #ffffff; }
.parcel-polygon.rascunho { fill: rgba(245, 158, 11, .28); stroke: #f6c453; }
.parcel-polygon.estimada { fill: rgba(14, 165, 233, .26); stroke: #38bdf8; }
.parcel-polygon.em-revisao { fill: rgba(220, 38, 38, .22); stroke: #ef4444; }
.parcel-polygon.selected { stroke: var(--red); stroke-width: 7; fill: rgba(220, 38, 38, .18); }
#territory-map text {
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(5, 45, 42, .78);
  stroke-width: 7px;
  font-weight: 900;
  font-size: 28px;
  text-anchor: middle;
}
.measure-line { stroke: var(--red); stroke-width: 5; stroke-dasharray: 11 8; vector-effect: non-scaling-stroke; }
.measure-label {
  fill: #fff !important;
  paint-order: stroke;
  stroke: rgba(5, 45, 42, .8);
  stroke-width: 6px;
  font-size: 24px !important;
}

.context-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.context-panel h2 { margin-top: 0; color: var(--teal-dark); }
.context-panel h3 { margin-bottom: 8px; color: var(--teal-dark); }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 750; }

.table-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chip,
.mini-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.chip.active { background: var(--green); color: #fff; border-color: var(--green); }

.table-search {
  margin-left: auto;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
}

.data-table,
.compact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td,
.compact-table th,
.compact-table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.data-table th,
.compact-table th {
  background: #0f665d;
  color: #fff;
  position: sticky;
  top: 72px;
  z-index: 2;
  overflow-wrap: normal;
  word-break: normal;
}

.data-table tr:nth-child(even),
.compact-table tr:nth-child(even) { background: var(--surface-2); }
.table-panel { overflow-x: auto; }
.table-panel th { position: static; }
.operational-table { min-width: 780px; table-layout: fixed; }
.operational-table th,
.operational-table td { overflow-wrap: break-word; }

.score {
  position: relative;
  height: 22px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}

.score i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--amber), var(--success)); }
.score span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 800; color: var(--text); }

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e5f3f0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.rascunho,
.badge.media,
.badge.média,
.badge.atencao,
.badge.atenção { background: #fff7e6; color: #9a5d00; }
.badge.estimada,
.badge.em-campo { background: #e7f5ff; color: #075985; }
.badge.em-revisao,
.badge.crítica,
.badge.critica,
.badge.pendente { background: #fee2e2; color: #991b1b; }
.badge.oficial,
.badge.concluido,
.badge.concluído,
.badge.encerrado,
.badge.no-prazo,
.badge.regular { background: #e8f8ed; color: #166534; }

.badge.aberto,
.badge.em-triagem,
.badge.em-análise,
.badge.encaminhado { background: #e7f5ff; color: #075985; }
.badge.aguardando-documentos,
.badge.vence-em-breve { background: #fff7e6; color: #9a5d00; }
.badge.indeferido,
.badge.cancelado,
.badge.atrasado { background: #fee2e2; color: #991b1b; }

.badge.parcial,
.badge.pacote-offline { background: #e7f5ff; color: #075985; }
.badge.sincronizado { background: #e8f8ed; color: #166534; }
.badge.aguardando-sincronizacao,
.badge.aguardando-sincronizaÃ§Ã£o { background: #fff7e6; color: #9a5d00; }
.badge.com-inconsistencia,
.badge.com-inconsistÃªncia,
.badge.inconsistente { background: #fee2e2; color: #991b1b; }

.field-grid {
  display: grid;
  grid-template-columns: minmax(290px, .55fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.field-board { display: grid; gap: 12px; }
.field-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px; display: grid; gap: 6px; background: var(--surface-2); }

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.lane {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  min-height: 360px;
  box-shadow: var(--shadow);
}

.lane h2 { margin: 0 0 12px; font-size: 16px; color: var(--teal-dark); }

.process-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  background: var(--surface-2);
}

.process-card span,
.process-card small { color: var(--muted); }

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.report-grid .wide { grid-column: 1 / -1; }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text);
}

.checklist span {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--success);
  margin-top: 2px;
  flex: 0 0 18px;
}

.timeline-item {
  border-left: 3px solid var(--green);
  padding: 0 0 12px 12px;
  display: grid;
  gap: 4px;
}

.timeline-item span,
.timeline-item small { color: var(--muted); }
.empty { color: var(--muted); margin: 0; }

.form-panel { max-width: 980px; }
.form-panel-wide { max-width: 1180px; }
.entity-form,
.quick-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }

.form-section {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}

.form-section legend {
  padding: 0 8px;
  color: var(--teal-dark);
  font-weight: 800;
}

.entity-form label,
.quick-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 750;
}

.entity-form input,
.entity-form select,
.entity-form textarea,
.quick-form input,
.quick-form select,
.quick-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 11px 12px;
}

.quick-form textarea { resize: vertical; }
.form-help { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.entity-form textarea { resize: vertical; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.detail-grid .wide { grid-column: 1 / -1; }
.kv.detail { grid-template-columns: 150px 1fr; }
.parcel-preview svg { width: 100%; min-height: 260px; border: 1px solid var(--border); border-radius: 8px; }
.parcel-preview circle { fill: var(--red); }
.parcel-preview text { fill: var(--red); font-weight: 800; }

.flash {
  padding: 12px;
  border-radius: 8px;
  background: #e8f8ed;
  color: #166534;
  border: 1px solid #bbebc9;
}

.flash.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.muted { color: var(--muted); }

.inline-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.inline-search .table-search { margin-left: 0; flex: 1; max-width: 440px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.table-subline { display: block; margin-top: 4px; color: var(--muted); line-height: 1.3; }
.text-link { color: var(--blue); font-weight: 750; }

.address-block {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

.address-block strong { color: var(--text); font-size: 17px; }

.record-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.record-summary > div {
  min-height: 76px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.record-summary span { color: var(--muted); font-size: 12px; }
.record-summary strong { font-size: 17px; color: var(--teal-dark); }
.record-summary small { font-size: 11px; font-weight: 800; }
.summary-danger strong { color: var(--red) !important; }
.summary-warning strong { color: #9a5d00 !important; }

.attendance-toolbar { justify-content: space-between; align-items: flex-end; }
.status-filter-row { display: flex; gap: 7px; flex-wrap: wrap; }
.attendance-toolbar .inline-search { flex: 0 1 480px; }
.attendance-table { min-width: 1060px; font-size: 14px; }
.attendance-table .badge { white-space: normal; text-align: center; line-height: 1.15; }
.deadline-atrasado { color: var(--red) !important; font-weight: 800; }
.deadline-vence-em-breve { color: #9a5d00 !important; font-weight: 800; }
.deadline-no-prazo { color: var(--success) !important; font-weight: 800; }
.deadline-encerrado { color: var(--muted) !important; font-weight: 800; }

.attendance-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .45fr);
  gap: 18px;
  align-items: start;
}

.attendance-main,
.attendance-side { display: grid; gap: 18px; }
.attendance-side { position: sticky; top: 92px; }
.record-subject { margin: 2px 0 8px; color: var(--teal-dark); }
.record-description { margin: 0; color: var(--muted); line-height: 1.55; }

.linked-records {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.linked-records a {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.linked-records span,
.linked-records small { color: var(--muted); }
.linked-records span { font-size: 12px; }

.requirement-list { display: grid; gap: 8px; }
.requirement-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-3); }
.requirement-item > span { display: grid; gap: 3px; }
.requirement-item small { color: var(--muted); }
.requirement-toggle { width: 32px; height: 32px; border: 2px solid var(--border); border-radius: 6px; background: var(--surface); color: #fff; cursor: pointer; font-weight: 900; }
.requirement-item.received { background: #effaf3; }
.requirement-item.received .requirement-toggle { background: var(--success); border-color: var(--success); }

.protocol-timeline { display: grid; }
.protocol-timeline article { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 16px; }
.protocol-timeline article:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 15px; bottom: 0; width: 2px; background: var(--border); }
.protocol-timeline article > i { width: 14px; height: 14px; border-radius: 50%; background: var(--green); margin-top: 3px; z-index: 1; }
.protocol-timeline article > div { display: grid; gap: 5px; }
.protocol-timeline article span,
.protocol-timeline article small { color: var(--muted); line-height: 1.35; }

.receipt-page { background: #edf5f3; padding: 30px; }
.protocol-receipt { width: min(850px, 100%); margin: 0 auto; background: #fff; border: 1px solid #cbded9; box-shadow: var(--shadow); padding: 34px; color: #18252f; }
.protocol-receipt header { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 2px solid #0f766e; padding-bottom: 18px; }
.protocol-receipt header img { width: 110px; height: 110px; object-fit: contain; }
.protocol-receipt header div { display: grid; gap: 6px; text-align: right; }
.protocol-receipt header strong { font-size: 19px; color: #0b4f49; }
.protocol-receipt header span { color: #5d7282; }
.receipt-number { text-align: center; display: grid; gap: 6px; padding: 24px 0; }
.receipt-number span { color: #5d7282; text-transform: uppercase; font-size: 12px; font-weight: 800; }
.receipt-number strong { font-size: 32px; color: #0b4f49; }
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #d4e2de; }
.receipt-grid > div { display: grid; gap: 5px; padding: 14px; border-bottom: 1px solid #d4e2de; }
.receipt-grid > div:nth-child(odd) { border-right: 1px solid #d4e2de; }
.receipt-grid span,
.receipt-grid small { color: #5d7282; }
.receipt-grid span { font-size: 12px; }
.receipt-note { margin-top: 20px; padding: 15px; background: #eef7f5; border-left: 4px solid #00796b; }
.receipt-note p { margin: 7px 0 0; color: #334155; line-height: 1.5; }
.protocol-receipt footer { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 12px; border-top: 1px solid #d4e2de; color: #5d7282; font-size: 12px; }
.receipt-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

.document-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr);
  gap: 18px;
  align-items: start;
}

.document-form {
  padding: 16px;
  border-left: 1px solid var(--border);
}

.search-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
}

.search-summary strong { color: var(--text); }
.search-results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.search-group { padding: 0; overflow: hidden; }
.search-group .panel-title { padding: 14px 16px; margin: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.search-group .panel-title span { min-width: 28px; height: 28px; padding: 5px; border-radius: 999px; background: var(--green); color: #fff; text-align: center; }

.search-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.search-result:hover { background: var(--surface-2); }
.search-result > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.search-result small { color: var(--muted); overflow-wrap: anywhere; }
.result-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #dff5ef; color: var(--teal-dark); font-size: 11px; font-weight: 900; }
.search-group .empty { padding: 14px 16px; }
.empty-search { min-height: 160px; display: grid; place-content: center; text-align: center; gap: 8px; }
.empty-search span { color: var(--muted); }

.login-page {
  min-height: 100vh;
  background: #062d2b;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 54px;
}

.login-bg,
.login-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-bg { object-fit: cover; }
.login-overlay { background: linear-gradient(90deg, rgba(5, 47, 43, .92), rgba(5, 47, 43, .55) 48%, rgba(5, 47, 43, .22)); }

.login-copy {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 790px;
}

.login-logo {
  display: block;
  width: min(290px, 62vw);
  height: auto;
  margin: 0 0 32px;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, .22));
}

.login-copy h1 {
  margin: 10px 0 14px;
  font-size: 56px;
  line-height: 1;
  max-width: 760px;
}

.login-copy p { color: #d7ebe5; font-size: 18px; line-height: 1.45; max-width: 690px; }

.login-feature-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.login-feature-row span {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .1);
  color: #e9fffb;
  font-weight: 800;
}

.login-card {
  align-self: center;
  margin: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .22);
  padding: 28px;
  display: grid;
  gap: 18px;
}

.login-brand strong { display: block; font-size: 24px; color: var(--teal-dark); }
.login-brand span { color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 7px; color: var(--text); font-weight: 750; }
.login-card input { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface-2); color: var(--text); }

/* Fase 3: bancada técnica territorial */
.technical-summary { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.technical-list-panel { padding: 0; overflow: hidden; }
.technical-toolbar { padding: 15px 16px; margin: 0; align-items: flex-end; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.technical-toolbar > div:first-child { display: grid; gap: 4px; }
.technical-toolbar > div:first-child span { color: var(--muted); font-size: 13px; }
.filter-chip { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; }
.filter-chip:hover,
.filter-chip.active { border-color: var(--green); background: #e6f6f1; color: var(--teal-dark); }
.technical-table { min-width: 1180px; }
.button.compact { min-height: 34px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.awaiting-technical { margin-top: 18px; }
.technical-queue { display: grid; gap: 8px; }
.technical-queue article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-3); }
.technical-queue article > div { display: grid; gap: 4px; }
.technical-queue article span,
.technical-queue article small { color: var(--muted); font-size: 12px; }

.technical-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 16px; }
.technical-head h1 { margin: 5px 0; font-size: 30px; color: var(--teal-dark); letter-spacing: 0; }
.technical-head p { margin: 0; color: var(--muted); }
.technical-head .eyebrow { color: var(--green); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.technical-work-summary { grid-template-columns: repeat(5, minmax(140px, 1fr)); }

.technical-workbench {
  display: grid;
  grid-template-columns: 74px minmax(560px, 1fr) 360px;
  min-height: 720px;
  border: 1px solid #244a48;
  border-radius: 8px;
  overflow: hidden;
  background: #082f2c;
  box-shadow: var(--shadow);
}

.cad-toolbox { display: flex; flex-direction: column; gap: 5px; padding: 10px 7px; background: #052826; border-right: 1px solid #28514d; }
.cad-toolbox button { min-height: 66px; display: grid; place-items: center; gap: 3px; padding: 7px 3px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #afd3cd; cursor: pointer; }
.cad-toolbox button:hover,
.cad-toolbox button.active { border-color: #4cc3b1; background: #164a46; color: #fff; }
.cad-toolbox svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cad-toolbox span { font-size: 10px; font-weight: 750; }

.technical-canvas-panel { min-width: 0; display: grid; grid-template-rows: 38px minmax(0, 1fr); background: #0b3b37; }
.cad-statusbar { display: grid; grid-template-columns: 1.1fr .6fr 1fr 1.2fr; gap: 8px; align-items: center; padding: 0 12px; border-bottom: 1px solid #2b5a55; color: #d5ece8; font-size: 11px; }
.cad-statusbar span:not(:first-child) { border-left: 1px solid #2b5a55; padding-left: 10px; }
.technical-map-stage { position: relative; min-height: 650px; overflow: hidden; background: #102d2b; touch-action: none; user-select: none; }
.technical-map-stage > img,
.technical-map-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.technical-map-stage > img { object-fit: cover; filter: saturate(.92) contrast(1.04); }
.technical-map-stage > svg { z-index: 1; }
.technical-map-stage [data-parcel-shape] { fill: rgba(15, 118, 110, .22); stroke: #f8fafc; stroke-width: 4; vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.technical-map-stage [data-vertex-shapes] circle { fill: #f8fafc; stroke: #dc2626; stroke-width: 4; vector-effect: non-scaling-stroke; cursor: default; }
.technical-workbench.editing-vertices [data-vertex-shapes] circle { fill: #fbbf24; cursor: grab; }
.technical-map-stage [data-vertex-shapes] text { fill: #fff; stroke: #092f2c; stroke-width: 4; paint-order: stroke; font-size: 14px; font-weight: 900; }
.technical-layer { stroke-width: 3; vector-effect: non-scaling-stroke; }
.technical-layer.layer-verde { fill: rgba(16, 185, 129, .2); stroke: #34d399; }
.technical-layer.layer-azul { fill: rgba(14, 165, 233, .2); stroke: #38bdf8; }
.technical-layer.layer-amarelo { fill: rgba(245, 158, 11, .2); stroke: #fbbf24; }
.technical-layer.layer-vermelho { fill: rgba(220, 38, 38, .18); stroke: #f87171; }
.saved-measurement line,
.preview-measurement line { stroke: #fbbf24; stroke-width: 4; stroke-dasharray: 10 6; vector-effect: non-scaling-stroke; }
.saved-measurement circle,
.preview-measurement circle { fill: #fbbf24; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.saved-measurement text,
.preview-measurement text { fill: #fff; stroke: #092f2c; stroke-width: 5; paint-order: stroke; font-size: 14px; font-weight: 900; text-anchor: middle; }
.map-hint { position: absolute; z-index: 2; left: 14px; bottom: 14px; max-width: calc(100% - 28px); padding: 9px 11px; border: 1px solid rgba(255,255,255,.24); border-radius: 6px; background: rgba(5, 40, 38, .9); color: #e9fffb; font-size: 12px; }

.technical-inspector { min-width: 0; background: var(--surface); border-left: 1px solid #244a48; color: var(--text); }
.inspector-tabs { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 39px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.inspector-tabs button { padding: 8px 4px; border: 0; border-right: 1px solid var(--border); border-bottom: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 850; }
.inspector-tabs button.active { border-bottom-color: var(--green); color: var(--teal-dark); background: var(--surface); }
.inspector-pane { display: none; max-height: 680px; overflow-y: auto; padding: 14px; }
.inspector-pane.active { display: block; }
.inspector-pane .quick-form { gap: 12px; }
.inspector-pane .quick-form label { gap: 5px; font-size: 12px; }
.inspector-pane .quick-form input,
.inspector-pane .quick-form select,
.inspector-pane .quick-form textarea { padding: 9px 10px; font-size: 13px; }
.inspector-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inspector-add-form { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.inspector-add-form h3,
.inspector-pane h3 { margin: 0; color: var(--teal-dark); font-size: 15px; }
.layer-stack,
.measurement-stack { display: grid; gap: 7px; }
.layer-stack article { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-3); }
.layer-stack article > div { display: grid; gap: 3px; }
.layer-stack small,
.measurement-stack small { color: var(--muted); font-size: 10px; }
.layer-swatch { width: 10px; height: 34px; border-radius: 3px; background: var(--green); }
.layer-swatch.layer-azul { background: #0ea5e9; }
.layer-swatch.layer-amarelo { background: #f59e0b; }
.layer-swatch.layer-vermelho { background: #dc2626; }
.visibility-button { padding: 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 10px; cursor: pointer; }
.visibility-button.visible { border-color: #81cbbd; color: var(--teal-dark); }
.measurement-stack article { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px; border-bottom: 1px solid var(--border); }
.measurement-stack article > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #dff5ef; color: var(--teal-dark); font-size: 10px; font-weight: 900; }
.measurement-stack article > div { display: grid; gap: 3px; }
.measurement-stack b { white-space: nowrap; color: var(--teal-dark); font-size: 12px; }
.inspection-linked { display: grid; gap: 5px; margin-bottom: 16px; padding: 12px; border-left: 4px solid var(--green); background: var(--surface-3); }
.inspection-linked span,
.inspection-linked small { color: var(--muted); font-size: 12px; }

/* Fase 4: operação de campo */
.field-kpis { margin-bottom: 18px; }
.field-table { min-width: 1180px; }
.field-score { min-width: 120px; max-width: 180px; }
.field-head { align-items: center; }
.field-status-text {
  font-size: 23px !important;
  line-height: 1.1 !important;
  overflow-wrap: anywhere;
}
.field-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}
.field-map-card,
.field-close-panel { display: grid; gap: 14px; }
.field-map-preview {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0c3f3a;
}
.field-map-preview img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: block;
  object-fit: cover;
}
.field-map-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
}
.field-map-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--red);
  box-shadow: 0 0 0 8px rgba(220, 38, 38, .22);
  z-index: 2;
}
.field-map-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 12px;
  border-radius: 8px;
  background: rgba(5, 39, 36, .88);
  color: #fff;
  display: grid;
  gap: 4px;
}
.field-map-caption span { color: #cde7df; font-size: 12px; }
.field-action-form { padding-top: 12px; border-top: 1px solid var(--border); }
.field-checklist-panel,
.field-evidence-panel,
.field-close-panel { min-width: 0; }
.field-checklist { display: grid; gap: 9px; }
.field-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}
.field-check.done {
  background: #effaf3;
  border-color: #bbebc9;
}
.field-check > div { display: grid; gap: 4px; min-width: 0; }
.field-check span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.field-check form {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}
.field-check select,
.field-check input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 10px;
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.evidence-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}
.evidence-card > span {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #dff5ef;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}
.evidence-card small { color: var(--muted); line-height: 1.35; }
.evidence-card a { color: var(--blue); font-weight: 800; }
.evidence-form { padding-top: 14px; border-top: 1px solid var(--border); }
.field-notes {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}
.field-notes pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: inherit;
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .page-header { grid-template-columns: minmax(0, 1fr) auto; }
  .page-hero-media { grid-column: 1 / -1; min-height: 180px; height: 180px; }
  .technical-workbench { grid-template-columns: 66px minmax(520px, 1fr) 330px; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .dashboard-grid,
  .field-grid,
  .report-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .map-workbench { grid-template-columns: 54px minmax(0, 1fr); }
  .context-panel { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .record-summary { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .document-layout { grid-template-columns: 1fr; }
  .document-form { border-left: 0; border-top: 1px solid var(--border); }
  .attendance-detail-grid { grid-template-columns: 1fr; }
  .attendance-side { position: static; grid-template-columns: 1fr 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 54vh; }
  .login-card { width: min(520px, calc(100% - 40px)); justify-self: center; }
  .technical-summary,
  .technical-work-summary { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .technical-workbench { grid-template-columns: 64px minmax(0, 1fr); }
  .technical-inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #244a48; }
  .inspector-pane { max-height: none; }
  .field-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 14px; gap: 8px; min-width: 0; max-width: 100vw; overflow-x: hidden; }
  .brand { min-height: 44px; }
  .brand-mark { flex-basis: 42px; width: 42px; height: 42px; }
  .brand-mark img { width: 36px; height: 36px; }
  .brand strong { font-size: 17px; }
  .brand small { margin-top: 3px; }
  .nav-group { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; width: 100%; max-width: 100%; min-width: 0; padding-bottom: 3px; scrollbar-width: thin; }
  .nav-item { flex: 0 0 auto; min-height: 40px; padding: 8px 10px; white-space: nowrap; }
  .nav-icon { width: 23px; height: 23px; }
  .sidebar-showcase,
  .sidebar-note { display: none; }
  .topbar { position: static; height: auto; align-items: stretch; flex-direction: column; gap: 10px; }
  .search { min-width: 0; width: 100%; }
  .content { padding: 18px; }
  .page-header { grid-template-columns: 1fr; }
  .page-actions { justify-content: flex-start; }
  .kpi-grid,
  .insight-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.compact,
  .field-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: 1fr; }
  .table-search { margin-left: 0; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .record-summary { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .search-results-grid { grid-template-columns: 1fr; }
  .attendance-side,
  .linked-records { grid-template-columns: 1fr; }
  .attendance-toolbar { align-items: stretch; }
  .attendance-toolbar .inline-search { flex-basis: 100%; }
  .technical-head { align-items: flex-start; flex-direction: column; }
  .technical-map-stage { min-height: 560px; }
  .field-check { grid-template-columns: 1fr; }
  .field-check form { grid-template-columns: 1fr; }
  .field-check .icon-button { width: 100%; }
  .evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .content { padding: 14px; }
  .nav-group,
  .kpi-grid,
  .insight-strip { grid-template-columns: 1fr; }
  .kpi-grid.compact,
  .field-kpis { grid-template-columns: 1fr; }
  .map-workbench { grid-template-columns: 1fr; }
  .tool-rail { flex-direction: row; overflow-x: auto; }
  .tool-rail button { min-width: 48px; }
  .data-table { min-width: 900px; }
  .panel { overflow-x: auto; }
  .page-header h1 { font-size: 26px; }
  .login-visual { padding: 28px; }
  .login-copy h1 { font-size: 38px; }
  .login-card { margin: 20px; }
  .record-summary { grid-template-columns: 1fr; }
  .technical-summary,
  .technical-work-summary { grid-template-columns: 1fr; }
  .technical-workbench { grid-template-columns: 1fr; }
  .cad-toolbox { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid #28514d; }
  .cad-toolbox button { min-width: 70px; min-height: 54px; }
  .technical-map-stage { min-height: 430px; }
  .cad-statusbar { grid-template-columns: 1fr 1fr; min-height: 58px; padding: 6px 10px; }
  .cad-statusbar span:not(:first-child) { border-left: 0; padding-left: 0; }
  .technical-queue article { grid-template-columns: 1fr; }
  .inline-search { align-items: stretch; flex-direction: column; }
  .inline-search .table-search { max-width: none; }
  .result-count { margin-left: 0; }
  .receipt-page { padding: 0; }
  .protocol-receipt { padding: 20px; border: 0; }
  .protocol-receipt header { align-items: flex-start; }
  .protocol-receipt header img { width: 76px; height: 76px; }
  .receipt-grid { grid-template-columns: 1fr; }
  .receipt-grid > div:nth-child(odd) { border-right: 0; }
}

@media print {
  .receipt-page { padding: 0; background: #fff; }
  .protocol-receipt { width: 100%; border: 0; box-shadow: none; padding: 0; }
  .receipt-actions { display: none; }
}
