@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --line: #d7e1dd;
  --text: #182521;
  --muted: #65746f;
  --primary: #0071e3;
  --primary-dark: #005bb8;
  --primary-soft: #e7f2ff;
  --blue: #0071e3;
  --accent: #15956c;
  --amber: #b7791f;
  --red: #b42318;
  --shadow: 0 16px 36px rgba(30, 50, 44, 0.08);
  --radius: 8px;
  font-family: "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 246, 245, 0.94) 320px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 12px;
}

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

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, #0071e3, #15956c);
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.brand-mark::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px 999px 999px 2px;
  content: "";
  transform: rotate(-45deg);
}

.brand-mark::before {
  position: absolute;
  inset: 8px 7px auto auto;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: -7px 6px 0 rgba(255, 255, 255, 0.35);
  content: "";
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.municipality-chip {
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.municipality-chip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.municipality-chip strong {
  font-size: 0.9rem;
}

.site-notice {
  padding: 10px 12px;
  margin: 2px 0 14px;
  border: 1px solid #bedcff;
  border-radius: var(--radius);
  color: #17446f;
  background: #eef6ff;
  font-size: 0.88rem;
  line-height: 1.45;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin: 4px 0 22px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.tab.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 30, 27, 0.08);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

body.portal-home .app-shell {
  width: min(1120px, calc(100vw - 32px));
}

body.portal-home .tabs,
body.portal-home .top-actions {
  display: none;
}

.screen-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.screen-title.compact {
  align-items: start;
}

.screen-title h1 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.screen-title p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.portal-title {
  align-items: center;
  margin-top: 42px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 14px;
}

.portal-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.portal-card:hover {
  border-color: var(--municipality-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--municipality-color) 16%, transparent), var(--shadow);
}

.portal-card .municipality-mark {
  background: var(--municipality-color);
}

.portal-card strong,
.portal-card small,
.portal-card em {
  display: block;
}

.portal-card strong {
  font-size: 1rem;
}

.portal-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.portal-card em {
  grid-column: 2;
  color: var(--primary);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 800;
}

.report-title {
  align-items: stretch;
}

.report-title-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: min(330px, 100%);
}

.report-title-side div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.report-title-side strong {
  font-size: 1.55rem;
  line-height: 1;
}

.report-title-side span {
  color: var(--muted);
  font-size: 0.82rem;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(390px, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.form-panel,
.detail-panel,
.lookup-panel,
.status-result,
.login-panel,
.public-list-panel,
.list-panel,
.map-panel,
.roadmap-panel {
  padding: 18px;
}

.operator-toolbar {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(240px, 420px) max-content max-content;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.form-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-step {
  display: grid;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7eeeb;
}

.form-step:last-of-type {
  border-bottom: 0;
  padding-bottom: 2px;
}

.step-head {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
}

.step-head h2 {
  margin: 0;
  font-size: 1rem;
}

.step-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--primary);
  font-size: 0.88rem;
  font-weight: 900;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.category-tile {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 10px;
  min-height: 74px;
  padding: 11px;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  color: var(--text);
  background: #ffffff;
  text-align: left;
  white-space: normal;
}

.category-tile:hover,
.category-tile.active {
  border-color: var(--category-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color) 16%, transparent);
}

.category-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 12%, #ffffff);
}

.category-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.category-tile strong {
  font-size: 0.92rem;
}

.category-tile span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.field {
  display: grid;
  gap: 7px;
}

.field.two-columns {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.security-challenge {
  display: grid;
  gap: 8px;
}

.turnstile-box {
  display: flex;
  align-items: center;
  min-height: 66px;
}

.turnstile-box > div {
  min-height: 66px;
}

.consent-check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #cce2d9;
  border-radius: var(--radius);
  background: #f0f8f5;
  color: #244a3e;
  font-size: 0.88rem;
  line-height: 1.4;
}

.consent-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  padding: 0;
}

label {
  color: #30433d;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c8d6d1;
  border-radius: 7px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.hint,
.muted {
  color: var(--muted);
}

.hint {
  font-size: 0.78rem;
  text-align: right;
}

.split-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.inline-control {
  display: flex;
  gap: 8px;
}

.inline-control input {
  min-width: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  color: #ffffff;
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  color: var(--primary-dark);
  border-color: #b9d7cc;
  background: var(--primary-soft);
}

.button.ghost {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.button.wide {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notice,
.duplicate-box,
.location-summary {
  border: 1px solid #cce2d9;
  border-radius: var(--radius);
  background: #f0f8f5;
}

.notice.success {
  border-color: #9bd4bd;
  background: #e8f8f0;
  color: #145039;
}

.notice.warning {
  border-color: #efd89d;
  background: #fff9e8;
  color: #624313;
}

.notice.error {
  border-color: #f3b5aa;
  background: #fff0ed;
  color: #7a271a;
}

.notice,
.duplicate-box {
  padding: 11px 12px;
  color: #244a3e;
  font-size: 0.9rem;
  line-height: 1.45;
}

.quick-report-form {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.location-summary.compact {
  padding: 10px 12px;
}

.image-preview,
.detail-photo {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cce2d9;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.image-preview img,
.detail-photo img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #d7e2de;
}

.detail-photo {
  margin-top: 10px;
}

.detail-photo span,
.image-preview span {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.timeline-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.history-toggle {
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.13);
}

.timeline-body {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f0;
}

.timeline-body strong,
.timeline-body span {
  display: block;
}

.timeline-body strong {
  font-size: 0.92rem;
}

.timeline-body span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-body p {
  margin: 5px 0 0;
  color: #334741;
  line-height: 1.4;
}

.duplicate-box {
  border-color: #efd89d;
  background: #fff9e8;
  color: #624313;
}

.location-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.location-summary span,
.location-summary strong {
  display: block;
}

.location-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.location-summary strong {
  margin-top: 3px;
  font-size: 0.95rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2,
.detail-header h2,
.roadmap-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.map {
  position: relative;
  height: 560px;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #c7d6d1;
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, transparent 0 44%, rgba(255, 255, 255, 0.58) 44% 47%, transparent 47%),
    linear-gradient(35deg, transparent 0 48%, rgba(145, 163, 157, 0.26) 48% 50%, transparent 50%),
    linear-gradient(90deg, rgba(65, 91, 83, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(65, 91, 83, 0.12) 1px, transparent 1px),
    #d9e7e5;
  background-size: 520px 420px, 420px 360px, 96px 96px, 96px 96px, auto;
  user-select: none;
  touch-action: none;
}

.report-map-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.report-map-panel .map {
  height: 100%;
  min-height: 660px;
}

.small-map {
  height: 390px;
  min-height: 320px;
}

.map-tile-pane,
.map-marker-pane {
  position: absolute;
  inset: 0;
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
}

.map-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.3);
  transform: translate(-50%, -50%);
}

.map-marker.selected {
  width: 34px;
  height: 34px;
  outline: 3px solid rgba(0, 113, 227, 0.28);
}

.map-marker-button {
  border: 3px solid #ffffff;
  padding: 0;
}

.map-marker svg {
  width: 16px;
  height: 16px;
  color: #ffffff;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.map-marker.selected svg {
  width: 18px;
  height: 18px;
}

.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  gap: 6px;
  z-index: 4;
}

.map-controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(40, 59, 54, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 1.2rem;
  font-weight: 900;
}

.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  padding: 3px 6px;
  border-radius: 5px;
  color: #22312d;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
}

.map-attribution a {
  color: #123f80;
}

.map-hint {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  max-width: min(310px, calc(100% - 72px));
  padding: 8px 10px;
  border-radius: 7px;
  color: #28423a;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  box-shadow: 0 2px 8px rgba(20, 30, 27, 0.1);
}

.status-layout {
  display: grid;
  grid-template-columns: minmax(300px, 460px) 1fr;
  gap: 18px;
  align-items: start;
}

.login-panel {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
}

.public-map-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.public-map {
  height: 620px;
}

.filters.vertical {
  grid-template-columns: 1fr;
}

.public-list-panel {
  display: grid;
  gap: 12px;
}

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

.public-summary div {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.public-summary strong {
  font-size: 1.25rem;
  line-height: 1;
}

.public-summary span {
  color: var(--muted);
  font-size: 0.78rem;
}

.public-selected {
  min-height: 110px;
  padding: 12px;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.public-selected h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.public-selected p {
  margin: 5px 0;
  color: #334741;
  line-height: 1.4;
}

.public-report-list {
  max-height: 410px;
}

.status-card {
  display: grid;
  gap: 14px;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0f2f25;
  background: #e4f2ec;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge.status-new {
  color: #17406b;
  background: #e4effa;
}

.badge.status-triage {
  color: #624313;
  background: #fff0c8;
}

.badge.status-assigned {
  color: #233876;
  background: #e4e9ff;
}

.badge.status-in_progress {
  color: #315b23;
  background: #e8f6df;
}

.badge.status-done {
  color: #145039;
  background: #dbf4e8;
}

.badge.status-field_done {
  color: #315b23;
  background: #e8f6df;
}

.badge.status-needs_more {
  color: #7a3e08;
  background: #fff0c8;
}

.badge.status-rejected {
  color: #7a271a;
  background: #fde8e4;
}

.badge.status-duplicate {
  color: #4b3b64;
  background: #efe8ff;
}

.badge.status-overdue {
  color: #7a271a;
  background: #fde8e4;
}

.badge.status-transfer-ready,
.badge.status-transfer-draft {
  color: #24507a;
  background: #e7f2ff;
}

.badge.status-transfer-awaiting_acceptance,
.badge.status-transfer-sent,
.badge.status-transfer-delivered {
  color: #6b4b08;
  background: #fff4cf;
}

.badge.status-transfer-accepted {
  color: #145039;
  background: #dbf4e8;
}

.badge.status-transfer-rejected,
.badge.status-transfer-needs_info {
  color: #7a271a;
  background: #fde8e4;
}

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

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat strong {
  display: block;
  font-size: 1.55rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(360px, 1fr) minmax(330px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.admin-layout > *,
.field-layout > * {
  min-width: 0;
}

.admin-center-column {
  display: grid;
  gap: 18px;
  min-width: 0;
  align-content: start;
}

.field-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(360px, 1fr) minmax(330px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.list-panel .filters input {
  grid-column: 1 / -1;
}

.report-list {
  display: grid;
  gap: 9px;
  max-height: 590px;
  overflow: auto;
  padding-right: 3px;
}

.report-card {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 12px;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  background: #ffffff;
  text-align: left;
}

.report-card:hover,
.report-card.active {
  border-color: #8cc5ff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.report-card-top,
.report-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-card-top strong {
  font-size: 0.96rem;
}

.report-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #3a4d47;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.38;
}

.report-card-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-panel {
  min-height: 390px;
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: #334741;
  line-height: 1.45;
}

.field-action {
  display: flex;
  align-items: end;
}

.field-action .button {
  width: 100%;
}

.transfer-box {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  background: #f8fbfa;
}

.transfer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.transfer-head h3,
.transfer-sent-box h3 {
  margin: 0;
  font-size: 1rem;
}

.transfer-form,
.transfer-sent-box {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.transfer-sent-box {
  margin: 0;
  padding: 12px;
  border: 0;
}

.transfer-box .field.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transfer-box .inline-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transfer-box .button,
.transfer-box input,
.transfer-box select,
.transfer-box textarea {
  min-width: 0;
  max-width: 100%;
}

.transfer-box .button {
  width: 100%;
}

.transfer-head .button,
.road-owner-check .button {
  width: auto;
  flex: 0 0 auto;
}

.road-owner-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #b9d8f6;
  border-radius: var(--radius);
  background: #eef7ff;
}

.road-owner-check strong,
.road-owner-check span {
  display: block;
}

.road-owner-check span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.road-owner-suggestion {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px dashed #b8c9c3;
  border-radius: var(--radius);
  color: var(--muted);
  background: #ffffff;
  font-size: 0.86rem;
  line-height: 1.45;
}

.road-owner-suggestion strong,
.road-owner-suggestion span {
  display: block;
}

.road-owner-suggestion .button {
  margin-top: 2px;
}

.road-owner-suggestion.is-loading {
  color: #17406b;
  border-style: solid;
  border-color: #b9d8f6;
  background: #eef7ff;
}

.road-owner-suggestion.is-error {
  color: #7a271a;
  border-style: solid;
  border-color: #f3b5aa;
  background: #fff0ed;
}

.road-confidence {
  font-weight: 800;
}

.transfer-details {
  overflow: hidden;
  border: 1px solid #d7e2de;
  border-radius: var(--radius);
  background: #ffffff;
}

.transfer-details summary {
  padding: 11px 12px;
  color: #173f74;
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

.transfer-details[open] summary {
  border-bottom: 1px solid #d7e2de;
  background: #f5f9fd;
}

.transfer-details-content {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.transfer-letter-textarea {
  min-height: 360px;
  padding: 14px;
  line-height: 1.55;
  resize: vertical;
}

.transfer-reason-textarea {
  min-height: 150px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

.transfer-internal-textarea {
  min-height: 180px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

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

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

.road-details-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.road-candidate-picker {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.road-candidate-picker label {
  color: var(--text);
  font-size: 0.8rem;
}

.empty-state {
  display: grid;
  min-height: 330px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 120px;
}

.privacy-grid,
.report-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.privacy-card {
  min-height: 150px;
}

.privacy-card h2,
.report-section h2 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.privacy-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.report-toolbar-field {
  display: grid;
  gap: 7px;
}

.report-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.report-section {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  padding: 18px;
}

.report-section .settings-list div {
  padding: 10px 2px;
}

.report-section .settings-list span,
.workload-list span,
.technical-list .visit-row span {
  min-width: 0;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

.workload-list div,
.technical-list .visit-row {
  align-items: flex-start;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(280px, 460px);
}

.account-panel,
.password-reset-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.account-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.account-summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #e7eeeb;
  padding-top: 8px;
}

.account-summary div:first-child {
  border-top: 0;
  padding-top: 0;
}

.account-summary span {
  color: var(--muted);
  text-align: right;
}

.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #7a271a;
  font-size: 0.8rem;
}

.password-rules span {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fde8e4;
  font-weight: 700;
}

.password-rules span.ok {
  color: #145039;
  background: #dbf4e8;
}

.password-reset-panel {
  margin-bottom: 18px;
}

.password-reset-panel h2 {
  margin: 0;
  font-size: 1.08rem;
}

.compact-report-list {
  max-height: 360px;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.operator-system-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.municipality-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.municipality-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.municipality-top .badge {
  margin-left: auto;
}

.municipality-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--primary);
  font-weight: 900;
}

.municipality-card h2 {
  margin: 0;
  font-size: 1rem;
}

.municipality-card p {
  margin: 2px 0 0;
  color: var(--muted);
}

.municipality-status.status-aktywna {
  color: #145039;
  background: #dbf4e8;
}

.municipality-status.status-testowa {
  color: #17406b;
  background: #e4effa;
}

.municipality-status.status-zablokowana {
  color: #7a271a;
  background: #fde8e4;
}

.settings-list {
  display: grid;
  gap: 7px;
  color: #334741;
  font-size: 0.9rem;
}

.settings-list div,
.roadmap div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #edf2f0;
  padding-top: 8px;
}

.settings-list span {
  color: var(--muted);
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.operator-report-list {
  max-height: 520px;
  margin-top: 12px;
}

.operator-technical-panel {
  padding: 18px;
}

.operator-technical-panel h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

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

.technical-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #edf2f0;
  padding-top: 8px;
}

.technical-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.technical-list span {
  color: var(--muted);
  text-align: right;
}

.roadmap div {
  display: grid;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.roadmap span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.42;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #ffffff;
  background: #18362d;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  line-height: 1.4;
}

.toast.visible {
  display: block;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.38);
}

.confirm-box {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid #c9d8d3;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.confirm-box h2 {
  margin: 0;
  font-size: 1.12rem;
}

.confirm-box p {
  margin: 0;
  color: #334741;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.app-footer strong {
  color: var(--text);
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .work-grid,
  .admin-layout,
  .field-layout,
  .status-layout,
  .public-map-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .operator-grid,
  .portal-grid,
  .roadmap,
  .report-metrics {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

  .report-map-panel .map {
    min-height: 520px;
  }

  .admin-center-column {
    order: 3;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 1480px);
    padding-top: 8px;
  }

  .topbar,
  .screen-title,
  .location-summary,
  .detail-header,
  .app-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .top-actions .button,
  .location-summary .button,
  .detail-header .button {
    width: 100%;
  }

  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .screen-title h1 {
    font-size: 1.55rem;
  }

  .municipality-chip {
    min-width: 0;
    width: 100%;
  }

  .category-grid,
  .public-summary {
    grid-template-columns: 1fr;
  }

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

  .field.two-columns,
  .filters,
  .operator-toolbar,
  .report-toolbar,
  .stats-grid,
  .operator-grid,
  .portal-grid,
  .roadmap,
  .privacy-grid,
  .report-metrics {
    grid-template-columns: 1fr;
  }

  .inline-control {
    flex-direction: column;
  }

  .transfer-head,
  .road-owner-check {
    align-items: stretch;
    flex-direction: column;
  }

  .transfer-head .button,
  .road-owner-check .button {
    width: 100%;
  }

  .transfer-box .field.two-columns,
  .transfer-box .inline-control,
  .road-details-grid {
    grid-template-columns: 1fr;
  }

  .map {
    height: 430px;
  }

  .report-map-panel .map {
    min-height: 430px;
  }

  .small-map {
    height: 360px;
  }

  .public-map {
    height: 430px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .site-notice,
  .tabs,
  .app-footer,
  .toast,
  .report-toolbar button,
  .view:not([data-view="reports"]) {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .view[data-view="reports"] {
    display: block !important;
  }

  .panel,
  .stat {
    box-shadow: none;
    break-inside: avoid;
  }
}
