:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --text: #172033;
  --muted: #697386;
  --line: #e7edf4;
  --teal: #159a82;
  --teal-soft: #e2f6f1;
  --danger: #d94f5c;
  --warning: #d99a37;
  --success: #178f72;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #dbe5ef; border-radius: 6px; background: #fff; padding: 9px 11px; outline: none; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21,154,130,.12); }
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 28px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--teal); color: #fff; font-weight: 800; font-size: 24px; }
.brand strong, .brand small { display: block; }
.brand strong { color: var(--teal); font-size: 12px; text-transform: uppercase; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; }
.nav-link { min-height: 42px; padding: 11px 12px; border-radius: 6px; color: #344052; font-size: 14px; }
.nav-link:hover, .nav-link.active { background: var(--teal-soft); color: #0f6f61; }
.content { min-width: 0; padding: 0 28px 34px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.breadcrumb { color: #47536a; font-weight: 700; }
.user-card { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.user-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.link-button { border: 0; background: transparent; color: var(--teal); cursor: pointer; padding: 0; }
.menu-button { display: none; }
.page-title, .detail-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 18px 0 18px; }
.page-title h1, .detail-hero h1 { margin: 4px 0 0; font-size: 30px; }
.page-title p, .detail-hero p { margin: 7px 0 0; color: var(--muted); }
.eyebrow { color: var(--teal); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 12px 32px rgba(23,32,51,.05); margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading h2, .form-section h2 { margin: 0; font-size: 18px; }
.primary-button, .secondary-button, .ghost-button, .icon-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 6px; padding: 9px 14px; border: 1px solid transparent; cursor: pointer; }
.primary-button { background: var(--teal); color: #fff; }
.secondary-button { background: #fff; border-color: #cfe0eb; color: #26364f; }
.ghost-button { background: transparent; color: var(--muted); }
.danger-button { background: #fff; border-color: #f2b8c0; color: var(--danger); font-weight: 800; }
.icon-button { width: 42px; padding: 0; background: var(--teal); color: #fff; font-size: 22px; }
.full-button { width: 100%; }
.alert { border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.alert.success { background: #e7f8f0; color: #0f684f; }
.alert.danger { background: #feecef; color: #9d2e38; }
.validation-summary {
  display: grid;
  gap: 8px;
}
.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}
.validation-summary li {
  margin: 3px 0;
}
.toast-wrap { position: fixed; z-index: 3000; top: 18px; right: 18px; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); pointer-events: none; }
.toast { transform: translateY(-8px); opacity: 0; border-radius: 8px; padding: 13px 15px; background: #263142; color: #fff; box-shadow: 0 16px 40px rgba(23,32,51,.2); font-weight: 700; transition: opacity .18s ease, transform .18s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #9d2e38; }
.toast.success { background: #0f684f; }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; align-items: end; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 15px; display: grid; gap: 5px; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { font-size: 22px; }
.metric-card small { color: var(--muted); }
.address-search { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; gap: 10px; align-items: center; }
.address-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.address-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 12px; }
.address-card strong { display: block; font-size: 16px; }
.address-card span, .muted-text { color: var(--muted); font-size: 13px; }
.address-card-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.address-card-stats span { border-radius: 999px; background: var(--teal-soft); color: #0f6f61; padding: 5px 9px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.row-link { color: var(--teal); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 28px; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; background: #eef2f7; color: #435066; }
.status.submitted, .status.in_review { background: #fff4df; color: #986414; }
.status.approved { background: #e3f8ef; color: var(--success); }
.status.rejected { background: #feecef; color: var(--danger); }
.form-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.step { min-height: 42px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #506078; font-weight: 800; cursor: pointer; }
.step.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.complete { background: var(--teal-soft); border-color: #b9e5dc; color: #0f6f61; }
.form-step-panel { display: none; }
.form-step-panel.active { display: block; }
.form-grid { display: grid; gap: 14px; margin-top: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.address-editor { margin-bottom: 18px; }
.address-editor summary { cursor: pointer; color: #26364f; font-weight: 800; }
.address-form-action { display: flex; align-items: end; }
.address-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-editor { position: relative; }
.inline-editor > summary { list-style: none; }
.inline-editor > summary::-webkit-details-marker { display: none; }
.inline-editor form { display: flex; gap: 8px; align-items: center; min-width: 420px; margin-top: 8px; }
.inline-editor input, .inline-editor select { min-width: 130px; }
.selected-address-row { background: #eefafa; }
.street-management { margin-top: 18px; }
.empty-address-selection { margin-top: 18px; text-align: center; }
.empty-address-selection p { margin-top: 6px; }
@media (max-width: 760px) {
  .inline-editor form { min-width: 0; flex-direction: column; align-items: stretch; }
  .address-form-action .primary-button { width: 100%; }
}
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #26364f; font-weight: 650; }
label span, .field-error, label small { color: var(--danger); font-size: 12px; font-weight: 600; }
label small { color: var(--muted); }
.inline-field { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; }
.hidden { display: none; }
.native-select-hidden { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.searchable-select-shell { position: relative; min-width: 0; }
.searchable-select-input { padding-right: 34px; cursor: text; }
.searchable-select-shell::after { content: ""; position: absolute; right: 13px; top: 18px; width: 8px; height: 8px; border-right: 2px solid #7c8392; border-bottom: 2px solid #7c8392; transform: rotate(45deg); pointer-events: none; }
.searchable-select-list { position: absolute; z-index: 1200; left: 0; right: 0; top: calc(100% + 6px); max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 16px 36px rgba(23,32,51,.14); padding: 6px; }
.searchable-select-option { display: block; width: 100%; min-height: 36px; border: 0; border-radius: 6px; background: transparent; color: #2b3446; text-align: left; padding: 8px 10px; cursor: pointer; }
.searchable-select-option:hover, .searchable-select-option[aria-selected="true"] { background: var(--teal-soft); color: #0f6f61; }
.searchable-select-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.border-red-500 { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(217,79,92,.12) !important; }
.opacity-50 { opacity: .5; }
.cursor-not-allowed { cursor: not-allowed; }
.segmented-field { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 0; }
.segmented-field legend { padding: 0 6px; color: #26364f; font-weight: 800; }
.segmented-field label { display: flex; align-items: center; gap: 7px; }
.segmented-field input { width: auto; min-height: auto; }
.check-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; }
.check-grid label, .check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check-grid input, .check-row input { width: auto; min-height: auto; }
.total-area-manual { align-self: end; display: flex; align-items: center; gap: 8px; min-height: 44px; padding-bottom: 2px; color: #4a5261; }
.total-area-manual input { width: auto; min-height: auto; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 16px; }
.map-shell { position: relative; min-width: 0; }
.map-toolbar { position: absolute; z-index: 500; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 8px; max-width: calc(100% - 24px); }
.map-tool { min-height: 36px; border: 1px solid #cfe0eb; border-radius: 6px; background: #fff; color: #26364f; padding: 7px 10px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(23,32,51,.12); }
.map-tool.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.map-tool.finish { border-color: #b9e5dc; color: #0f6f61; }
.map-tool.finish.active { background: #e3f8ef; border-color: #78d7bd; color: #0f6f61; }
.map-tool.locate { border-color: #b8d6e4; color: #0b6f78; }
.map-tool.locate:disabled { opacity: .7; cursor: wait; }
.map-tool.danger { color: var(--danger); }
.leaflet-map { min-height: 430px; width: 100%; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #dfe8ef; }
.leaflet-container, .leaflet-grab, .leaflet-dragging .leaflet-grab { cursor: crosshair !important; }
.measure-panel { display: grid; align-content: start; gap: 12px; }
.map-help, .map-summary { border: 1px solid var(--line); border-radius: 6px; background: #fbfdff; color: #4b5a70; padding: 12px; line-height: 1.45; }
.image-upload-grid, .existing-image-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; }
.existing-image-grid { margin-bottom: 14px; }
.image-slot { border: 1px dashed #c8d7e4; border-radius: 8px; padding: 12px; min-height: 210px; align-content: start; background: #fbfdff; }
.image-slot input[type="file"] { border-style: dashed; background: #fff; }
.image-slot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #eef2f7; }
.image-slot strong { display: block; word-break: break-word; margin: 8px 0; }
.image-clear { justify-self: start; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.94); border-top: 1px solid var(--line); padding: 14px 0 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr); gap: 18px; }
.detail-actions { margin: -4px 0 16px; }
.detail-list { display: grid; gap: 12px; }
.detail-list div { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.detail-list span { color: var(--muted); font-size: 13px; }
.document-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.document-grid a { border: 1px solid var(--line); border-radius: 6px; padding: 12px; color: var(--teal); background: #fbfdff; }
.readonly-request .form-section h2 { margin-bottom: 12px; }
.readonly-field { display: grid; gap: 6px; min-width: 0; border: 1px solid var(--cabinet-line); border-radius: 8px; background: #f7f8fa; padding: 12px; }
.readonly-field span { color: var(--cabinet-muted); font-size: 12px; font-weight: 800; }
.readonly-field strong { color: #263142; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.readonly-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.readonly-badges span { display: inline-flex; align-items: center; min-height: 34px; border-radius: 999px; background: #eaf6f4; color: #087d76; padding: 7px 11px; font-weight: 800; font-size: 13px; }
.readonly-media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.readonly-media-card { display: grid; gap: 9px; min-width: 0; border: 1px solid var(--cabinet-line); border-radius: 8px; background: #fff; padding: 10px; color: #283142; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.readonly-media-card:hover { border-color: #9ccfc8; box-shadow: 0 12px 28px rgba(23,32,51,.11); transform: translateY(-1px); }
.readonly-media-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #eef2f7; }
.readonly-media-card span { font-weight: 800; font-size: 13px; overflow-wrap: anywhere; }
.readonly-documents { margin-top: 16px; }
.timeline { display: grid; gap: 12px; padding-left: 0; list-style: none; }
.timeline li { display: grid; gap: 8px; border: 1px solid var(--cabinet-line); border-radius: 8px; background: #fff; padding: 12px; }
.timeline li > strong { color: #0f6f61; font-size: 15px; }
.timeline span { display: block; color: var(--muted); font-size: 13px; margin: 0; }
.timeline .audit-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; line-height: 1.45; }
.timeline .audit-meta b { color: #536276; font-weight: 800; }
.change-list { display: grid; gap: 8px; margin-top: 8px; }
.change-row { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fbfdff; }
.readable-change-row > strong { color: #263142; line-height: 1.35; overflow-wrap: anywhere; }
.readable-change-row > span { display: grid; gap: 4px; min-width: 0; border-radius: 6px; background: #fff; color: #263142; padding: 8px; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.readable-change-row small { color: var(--cabinet-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.change-row code { white-space: pre-wrap; word-break: break-word; color: #26364f; }
pre { white-space: pre-wrap; background: #f6f8fb; border-radius: 6px; padding: 10px; overflow: auto; }
.auth-page { display: grid; place-items: center; padding: 22px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: 0 20px 60px rgba(23,32,51,.1); }
.auth-brand { margin-bottom: 20px; }
nav[role="navigation"] { margin-top: 14px; }
nav[role="navigation"] > div:first-child { display: none; }
nav[role="navigation"] span, nav[role="navigation"] a { display: inline-flex; margin: 2px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 900px) {
  .app-shell, .detail-grid, .map-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .filters, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .address-search { grid-template-columns: 1fr; }
  .image-upload-grid, .existing-image-grid { grid-template-columns: 1fr; }
  .page-title, .detail-hero { align-items: flex-start; flex-direction: column; }
  .stepper { grid-template-columns: 1fr; }
  .map-toolbar { position: static; margin-bottom: 8px; }
}

/* Cabinet-style UI refresh */
:root {
  --cabinet-bg: #f7f7f8;
  --cabinet-muted: #7c8392;
  --cabinet-text: #283142;
  --cabinet-line: #e7e9ee;
  --cabinet-teal: #0b6f78;
  --cabinet-teal-bright: #00a99d;
  --cabinet-teal-soft: #cfeeee;
  --cabinet-pink: #ff4b7a;
}

body { background: var(--cabinet-bg); color: var(--cabinet-text); }
input, select, textarea { border: 0; background: #f0f1f3; min-height: 46px; border-radius: 7px; color: #394153; }
input:focus, select:focus, textarea:focus { border-color: transparent; box-shadow: 0 0 0 3px rgba(0,169,157,.16); background: #fff; }

.app-shell { grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { background: #fff; padding: 24px 14px; border-right: 1px solid #dfe3ea; }
.brand { align-items: center; gap: 9px; padding: 12px 12px 20px; margin: 0 0 14px; border-bottom: 1px solid var(--cabinet-line); }
.brand-mark { width: 34px; height: 38px; border-radius: 0; clip-path: polygon(0 0, 100% 0, 63% 22%, 63% 100%, 35% 100%, 35% 22%, 0 22%); background: linear-gradient(135deg, #00bfa6, #0b6f78); font-size: 0; }
.brand strong { color: #00a99d; font-size: 13px; line-height: 1.05; letter-spacing: .02em; }
.brand small { color: #242b38; font-size: 12px; }
.nav-list { gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; border-radius: 7px; padding: 10px 13px; color: #30394d; font-weight: 700; }
.nav-link svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover, .nav-link.active { background: var(--cabinet-teal-soft); color: #009b96; }

.content { padding: 0 34px 36px; }
.topbar { min-height: 72px; border-bottom: 1px solid var(--cabinet-line); margin: 0 -34px 0; padding: 0 34px; background: #fff; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.breadcrumb { font-size: 15px; color: #252d3d; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.topbar-export-button { min-width: 96px; min-height: 36px; padding: 7px 12px; }
.report-link { display: inline-flex; align-items: center; gap: 7px; color: var(--cabinet-pink); font-size: 14px; font-weight: 650; }
.report-link svg, .bell-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; color: #687085; cursor: pointer; }
.user-card { border: 0; padding: 0; background: transparent; }
.user-avatar { width: 34px; height: 34px; border: 2px solid #e5e7eb; color: #fff; background: linear-gradient(135deg, #7b8794, #263142); }

.compact-title { align-items: center; margin: 22px 0 18px; }
.compact-title h1 { font-size: 28px; line-height: 1.15; margin: 0; }
.compact-title p { margin-top: 8px; color: var(--cabinet-muted); }
.title-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.panel, .registry-card, .empty-state-card { border: 0; box-shadow: 0 20px 55px rgba(32,40,54,.08); }
.soft-panel { box-shadow: none; border: 1px solid var(--cabinet-line); background: #fff; }
.registry-card { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 22px; }
.form-panel { max-width: 1260px; margin: 0 auto 28px; padding: 22px 20px 18px; }
.inset-panel { box-shadow: none; border: 1px solid var(--cabinet-line); background: #fff; }

.primary-button, .secondary-button, .ghost-button, .icon-button, .danger-button { border-radius: 7px; min-height: 42px; font-weight: 800; }
.primary-button { background: var(--cabinet-teal); color: #fff; min-width: 170px; }
.primary-button:hover { background: #075e66; }
.secondary-button { background: #fff; border-color: #d6dbe4; }
.ghost-button { color: #6d7482; }
.danger-button { background: #fff5f6; border-color: #f2b8c0; color: #b83243; }
.danger-button:hover { background: #feecef; }
.icon-button { background: var(--cabinet-teal-bright); }
.is-submitting {
  pointer-events: none;
}
.is-submitting button[type="submit"] {
  opacity: .9;
}
.button-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin .8s linear infinite;
}
@keyframes button-spin {
  to { transform: rotate(360deg); }
}

.filters { grid-template-columns: minmax(250px, 2fr) repeat(auto-fit, minmax(145px, 1fr)); }
.table-panel { overflow: hidden; }
th { color: #8b92a1; }
.registry-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 820px;
}
.registry-table th {
  color: #8b92a1;
  font-size: 10px;
  letter-spacing: .02em;
  padding: 11px 12px;
  background: #fbfcfd;
}
.registry-table td {
  padding: 13px 12px;
  background: #fff;
  vertical-align: middle;
}
.registry-table tbody tr:hover td {
  background: #fbfdfd;
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--cabinet-line);
}
.pagination-bar p {
  margin: 0;
  color: #687085;
  font-weight: 800;
  font-size: 13px;
}
.pagination-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid #d6dbe4;
  border-radius: 7px;
  background: #fff;
  color: #30394d;
  padding: 8px 11px;
  font-weight: 800;
  font-size: 13px;
}
.pagination-link:hover {
  border-color: #9ccfc8;
  color: var(--cabinet-teal);
}
.pagination-link.active {
  border-color: var(--cabinet-teal);
  background: var(--cabinet-teal);
  color: #fff;
}
.pagination-link.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.pagination-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 38px;
  color: #8b92a1;
  font-weight: 900;
}
.row-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #eef7f6;
  color: var(--cabinet-teal);
  font-weight: 900;
}
.row-link { color: var(--cabinet-teal); }
.registry-table th:nth-child(6),
.registry-table td:nth-child(6) {
  max-width: 260px;
  white-space: normal;
}
.registry-table th:nth-child(7),
.registry-table td:nth-child(7) {
  width: 190px;
}
.registry-table th:nth-child(8),
.registry-table td:nth-child(8) {
  width: 120px;
}
.registry-table th:nth-child(9),
.registry-table td:nth-child(9) {
  width: 92px;
  text-align: right;
}
.row-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 7px;
  background: var(--cabinet-teal-soft);
  padding: 6px 10px;
  font-size: 12px;
}
.row-action-button:hover {
  background: var(--cabinet-teal);
  color: #fff;
}
.file-status-list {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.file-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f3f5f8;
  color: #687085;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.file-status-chip.uploaded {
  background: var(--cabinet-teal-soft);
  color: var(--cabinet-teal);
}
.file-status-chip b {
  font-size: 12px;
}
.existing-file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}
.existing-file-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--cabinet-line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 11px 12px;
}
.existing-file-item span {
  color: #26364f;
  font-size: 12px;
  font-weight: 900;
}
.existing-file-item a {
  color: var(--cabinet-teal);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.existing-file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.existing-file-actions a {
  min-width: 0;
}
.existing-file-actions .secondary-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 9px;
}
.existing-file-item strong,
.existing-file-item small {
  color: var(--cabinet-muted);
  font-size: 12px;
}
.monitoring-metrics .metric-card strong {
  overflow-wrap: anywhere;
}
.monitoring-shell {
  display: grid;
  gap: 10px;
  padding: 14px 0 22px;
}
.monitoring-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 12px;
}
.monitoring-hero h1 {
  margin: 0;
  color: #102246;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  line-height: 1.1;
}
.monitoring-hero p {
  margin: 5px 0 0;
  color: #13284f;
  font-weight: 750;
  font-size: 13px;
}
.monitoring-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr)) minmax(260px, 1.45fr);
  gap: 10px;
}
.monitoring-stat-card,
.monitoring-progress-card,
.monitoring-card {
  border: 1px solid #d9e4f1;
  border-radius: 9px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(31, 47, 58, .05);
}
.monitoring-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
}
.monitoring-stat-card span:not(.stat-icon),
.monitoring-progress-card span {
  color: #102246;
  font-size: 13px;
  font-weight: 750;
}
.monitoring-stat-card strong {
  display: block;
  margin-top: 4px;
  color: #08162f;
  font-size: 23px;
  line-height: 1;
}
.monitoring-stat-card small,
.monitoring-progress-card small {
  color: #375071;
  font-weight: 750;
}
.stat-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 9px;
  color: #0b376f;
  background: #eef7f6;
  border: 1px solid #d7e6f1;
}
.stat-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-blue .stat-icon { color: #0b376f; background: #e9f1fb; }
.stat-green .stat-icon { color: #159a82; background: #e4f7f2; }
.stat-cyan .stat-icon { color: #256fd9; background: #eaf2ff; }
.monitoring-progress-card {
  display: grid;
  grid-template-columns: auto 62px;
  align-items: center;
  gap: 6px 12px;
  min-height: 76px;
  padding: 12px 14px;
}
.monitoring-progress-card strong {
  display: block;
  margin-top: 3px;
  color: #08162f;
  font-size: 19px;
}
.mini-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(#256fd9 calc(var(--value) * 1%), #dfe7f1 0);
  display: grid;
  place-items: center;
}
.mini-ring::after {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
}
.progress-track {
  height: 7px;
  border-radius: 999px;
  background: #dfe7f1;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #256fd9, #2c8be8);
}
.monitoring-filter-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(120px, 1fr)) repeat(2, minmax(118px, .9fr)) auto;
  gap: 9px;
  align-items: end;
  padding: 10px;
  border: 1px solid #d9e4f1;
  border-radius: 9px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(31, 47, 58, .05);
}
.monitoring-filter-card label {
  gap: 5px;
  min-width: 0;
}
.monitoring-filter-card label span {
  color: #102246;
  font-size: 10px;
  font-weight: 900;
}
.monitoring-filter-card input,
.monitoring-filter-card select {
  min-height: 33px;
  border: 1px solid #cfdbea;
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
  font-size: 11px;
}
.monitoring-filter-button {
  min-width: 104px;
  min-height: 33px;
  gap: 7px;
  padding: 7px 11px;
  background: #0b8e86;
  font-size: 11px;
}
.monitoring-filter-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.monitoring-grid {
  display: grid;
  grid-template-columns: minmax(520px, .98fr) minmax(620px, 1.02fr);
  gap: 10px;
  align-items: start;
}
.monitoring-analytics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.monitoring-card {
  min-width: 0;
  padding: 12px;
}
.monitoring-card h2,
.table-card-heading h2 {
  margin: 0;
  color: #102246;
  font-size: 12px;
}
.monitoring-insight-card h3 {
  margin: 0;
  color: #375071;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.insight-layout {
  display: grid;
  gap: 16px;
  margin-top: 10px;
}
.compact-bars,
.type-bars,
.rank-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}
.compact-bar-row,
.type-bar-row,
.rank-item {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 23px;
  color: #102246;
  font-size: 11px;
}
.compact-bar-row {
  grid-template-columns: minmax(90px, 1fr) minmax(95px, 1.45fr) minmax(54px, auto);
}
.compact-bar-row span,
.rank-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-bar-row div,
.type-bar-row div,
.rank-item div {
  height: 11px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}
.compact-bar-row i,
.type-bar-row i,
.rank-item i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b8e86, #10aaa0);
}
.compact-bar-row strong,
.type-bar-row strong,
.rank-item strong {
  color: #071734;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}
.type-bar-row {
  grid-template-columns: 24px minmax(74px, 1fr) minmax(92px, 1.3fr) minmax(34px, auto);
}
.mini-type-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: #0b376f;
}
.mini-type-icon svg,
.table-eye svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-chart {
  position: relative;
  min-height: 150px;
  margin-top: 12px;
  padding: 12px 8px 20px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f9fcfd);
}
.trend-chart svg {
  position: absolute;
  inset: 24px 8px 25px;
  width: calc(100% - 16px);
  height: calc(100% - 49px);
}
.trend-chart svg path:first-child {
  fill: none;
  stroke: #0b8e86;
  stroke-width: 3;
}
.trend-chart svg path:last-child {
  fill: rgba(11, 142, 134, .12);
  stroke: none;
}
.trend-point {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0b8e86;
  box-shadow: 0 0 0 3px #dff6f4;
}
.trend-point b {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  color: #102246;
  font-size: 9px;
  white-space: nowrap;
}
.point-1 { left: 7%; top: 73%; }
.point-2 { left: 29%; top: 68%; }
.point-3 { left: 50%; top: 47%; }
.point-4 { left: 73%; top: 32%; }
.point-5 { left: 94%; top: 18%; }
.trend-labels {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  display: flex;
  justify-content: space-between;
  color: #375071;
  font-size: 9px;
}
.monitoring-svg-map {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-top: 12px;
  border-radius: 8px;
  background: radial-gradient(circle at 45% 45%, #f7fffe, #eef6f8);
  overflow: hidden;
}
.monitoring-svg-map svg {
  width: 100%;
  max-height: 160px;
}
.monitoring-svg-map path {
  fill: #dfe8ef;
  stroke: #ffffff;
  stroke-width: 2;
  transition: fill .16s ease, opacity .16s ease;
}
.monitoring-svg-map path:nth-of-type(2n) { fill: #cfeeee; }
.monitoring-svg-map path:nth-of-type(3n) { fill: #a8ded8; }
.monitoring-svg-map path:nth-of-type(5n) { fill: #78c8c1; }
.monitoring-svg-map path:hover {
  fill: #0b8e86;
  opacity: .95;
}
.rank-item {
  grid-template-columns: 24px minmax(86px, 1fr) minmax(82px, 1.1fr) minmax(62px, auto);
}
.rank-item em {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #0b8e86;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}
.donut-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 112px;
  margin-top: 9px;
}
.donut-chart {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}
.donut-chart::after {
  content: "";
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e7edf4;
}
.donut-chart span {
  position: relative;
  z-index: 1;
  display: grid;
  color: #08162f;
  width: 50px;
  overflow-wrap: anywhere;
  color: #071734;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
}
.donut-chart small {
  color: #375071;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.1;
}
.legend-list {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.legend-list div {
  display: grid;
  grid-template-columns: 7px minmax(70px, 1fr) minmax(44px, auto);
  gap: 6px;
  align-items: center;
  color: #102246;
  font-size: 11px;
}
.legend-list i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.legend-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-list strong,
.rank-row strong,
.bar-row strong {
  color: #102246;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}
.horizontal-bars,
.rank-bars {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}
.bar-row,
.rank-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.05fr) minmax(70px, 1fr) minmax(54px, auto);
  align-items: center;
  gap: 8px;
  color: #102246;
  font-size: 11px;
}
.bar-row div,
.rank-row div {
  height: 10px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}
.bar-row i,
.rank-row i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #256fd9, #2c8be8);
}
.table-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.table-card-heading span {
  color: #375071;
  font-size: 12px;
  font-weight: 800;
}
.monitoring-table-card {
  border: 1px solid var(--cabinet-line);
  box-shadow: 0 16px 45px rgba(32,40,54,.06);
  overflow: hidden;
  padding: 0;
}
.monitoring-table-card .table-card-heading {
  min-height: 56px;
  margin: 0;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--cabinet-line);
}
.monitoring-table-card .table-wrap {
  border-radius: 0;
}
.empty-mini {
  margin: 0;
  color: #687085;
  font-size: 13px;
}
.monitoring-table td,
.monitoring-table th {
  white-space: nowrap;
  padding: 15px 18px;
  font-size: 13px;
  line-height: 1.35;
  vertical-align: middle;
  border-bottom: 1px solid var(--cabinet-line);
}
.monitoring-table th {
  color: var(--cabinet-muted);
  font-size: 11px;
  letter-spacing: 0;
  background: #fbfcfd;
  font-weight: 900;
  text-transform: uppercase;
}
.monitoring-table td {
  color: #252d3d;
}
.monitoring-table td:first-child,
.monitoring-table th:first-child {
  white-space: normal;
  min-width: 190px;
}
.monitoring-table td:first-child strong {
  color: #172033;
  font-weight: 900;
}
.monitoring-table td:last-child,
.monitoring-table th:last-child {
  text-align: right;
}
.monitoring-table tbody tr:last-child td {
  border-bottom: 0;
}
.monitoring-table small {
  color: var(--cabinet-muted);
  font-size: 11px;
}
.table-eye {
  display: inline-grid;
  place-items: center;
  color: #0b8e86;
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover td {
  background: #f6fbfa;
}
.clickable-metric {
  border-radius: 6px;
  padding: 2px 3px;
}
.clickable-metric:hover {
  background: #f3fbfa;
}

.map-monitoring-shell {
  display: grid;
  gap: 22px;
  min-height: calc(100vh - 100px);
  padding: 28px 0 24px;
}

.map-monitoring-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.map-monitoring-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.05;
}

.map-monitoring-header p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.map-monitoring-totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.map-monitoring-totals span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.map-monitoring-totals b {
  color: var(--teal);
  font-size: 14px;
}

.map-monitoring-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr);
  gap: 34px;
  align-items: stretch;
  min-height: calc(100vh - 160px);
}

.fergana-map-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 620px;
  background: #fff;
  overflow: visible;
}

.fergana-map-canvas svg {
  width: min(100%, 1180px);
  height: auto;
  max-height: calc(100vh - 170px);
}

.fergana-map-canvas path {
  fill: #d9dee4;
  stroke: none;
  cursor: pointer;
  outline: none;
  transition: fill .16s ease, filter .16s ease, opacity .16s ease;
}

.fergana-map-canvas path.has-data {
  fill: #d9dee4;
}

.fergana-map-canvas path:not(.has-data) {
  fill: #d9dee4;
  opacity: 1;
}

.fergana-map-canvas path:hover {
  fill: var(--teal);
  opacity: 1;
  filter: drop-shadow(0 8px 10px rgba(21, 154, 130, .22));
}

.fergana-map-canvas path.selected {
  fill: var(--teal) !important;
  opacity: 1;
  filter: drop-shadow(0 10px 14px rgba(21, 154, 130, .3));
}

.map-selected-label {
  position: absolute;
  z-index: 2;
  top: 70px;
  right: 4%;
  color: var(--teal);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-district-panel {
  position: relative;
  align-self: stretch;
  border-top: 1px solid var(--teal);
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
  padding: 56px 46px;
  overflow: hidden;
}

.panel-eyebrow {
  display: inline-flex;
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
}

.map-district-panel h2 {
  margin: 20px 0 12px;
  color: var(--text);
  font-size: 30px;
  line-height: 1.15;
}

.map-district-panel p {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  line-height: 1.45;
}

.panel-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 28px 0 18px;
}

.panel-metrics div,
.panel-type-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 48px;
  border-bottom: 0;
}

.panel-metrics span,
.panel-type-list span {
  flex: 0 0 150px;
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
}

.panel-metrics strong,
.panel-type-list strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
}

.panel-metrics small {
  margin-left: 4px;
  color: #536276;
  font-size: 11px;
  font-weight: 800;
}

.panel-type-list {
  display: grid;
  gap: 0;
  margin: 14px 0 26px;
}

.panel-type-list strong {
  font-size: 18px;
}

.panel-link {
  justify-self: start;
  min-width: 210px;
  background: var(--teal);
}

.empty-state-card { width: min(560px, 100%); margin: 145px auto 0; border-radius: 12px; padding: 38px 42px 32px; background: #fff; text-align: center; }
.empty-illustration { display: grid; place-items: center; width: 104px; height: 92px; margin: 0 auto 10px; }
.empty-illustration svg { width: 96px; height: 96px; fill: #dff7f0; stroke: #20b46b; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(12px 14px 10px rgba(0, 132, 121, .18)); }
.empty-state-card h2 { margin: 8px 0 12px; font-size: 27px; line-height: 1.1; color: #283142; }
.empty-state-card p { margin: 0 auto 28px; max-width: 390px; color: #1f2530; font-weight: 700; line-height: 1.4; }
.empty-action { min-width: 270px; }
.empty-inline { border-radius: 9px; background: #f5f6f8; color: #687085; font-weight: 700; padding: 26px; text-align: center; }

.stepper { grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin: 0 0 22px; }
.step { border: 0; background: #eef0f3; color: #687085; }
.step.active { background: var(--cabinet-teal); }
.step.complete { background: var(--cabinet-teal-soft); color: #008c86; }
.form-section { border-top-color: var(--cabinet-line); }
.form-section h2 { font-size: 18px; color: #303849; }
label { color: #777e8d; font-weight: 650; }
.segmented-field { background: #f7f8fa; border-color: var(--cabinet-line); }
.check-grid label, .check-row { color: #4a5261; }
.leaflet-map { border: 0; border-radius: 8px; min-height: 430px; }
.map-layout { grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr); }
.sticky-actions { margin: 20px -20px -18px; padding: 16px 20px; border-top-color: var(--cabinet-line); border-radius: 0 0 14px 14px; }

.detail-workspace { display: grid; gap: 18px; }
.detail-grid { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); }
.detail-list div { border-bottom-color: var(--cabinet-line); }
.document-grid a { background: #f7f8fa; border-color: var(--cabinet-line); color: var(--cabinet-teal); }

.auth-page { min-height: 100vh; background: #e9f4f4; padding: 24px; }
.compact-login-card { width: min(390px, 100%); border: 0; border-radius: 11px; padding: 22px; box-shadow: 0 18px 45px rgba(31,47,58,.08); }
.compact-login-card .auth-brand { justify-content: center; margin-bottom: 18px; padding: 0; border: 0; }
.compact-login-card .brand-mark { width: 28px; height: 32px; }
.compact-login-card .brand strong { font-size: 10px; }
.compact-login-card .brand small { font-size: 10px; text-align: center; }
.compact-login-card label { font-size: 13px; color: #555d6b; margin-bottom: 10px; }
.compact-login-card input { min-height: 40px; }
.compact-login-card .primary-button { width: 100%; min-height: 40px; font-size: 13px; }
.error-card { width: min(520px, 100%); text-align: center; border: 0; border-radius: 14px; padding: 28px; }
.error-card .auth-brand { justify-content: center; padding: 0; border: 0; margin-bottom: 18px; }
.error-icon { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; margin: 0 auto 18px; background: #feecef; color: #9d2e38; font-size: 28px; font-weight: 900; }
.error-card h1 { margin: 0 0 10px; font-size: 28px; color: #283142; }
.error-card p { margin: 0 auto 22px; max-width: 410px; color: #687085; line-height: 1.5; font-weight: 650; }
.error-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .content { padding: 0 16px 24px; }
  .topbar { margin: 0 -16px; padding: 0 16px; gap: 12px; flex-wrap: wrap; min-height: auto; padding-top: 12px; padding-bottom: 12px; }
  .topbar-actions { width: 100%; justify-content: space-between; gap: 10px; }
  .report-link span, .user-card > span:not(.user-avatar) { display: none; }
  .empty-state-card { margin-top: 54px; padding: 28px 20px; }
  .empty-action { min-width: 0; width: 100%; }
  .registry-card { padding: 16px; }
  .sticky-actions { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; flex-wrap: wrap; }
  .map-layout { grid-template-columns: 1fr; }
}

/* Responsive and WebView hardening */
html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@supports (min-height: 100dvh) {
  body,
  .app-shell,
  .auth-page {
    min-height: 100dvh;
  }
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

input,
select,
textarea {
  font-size: max(16px, 1rem);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.map-tool,
.step,
.nav-link,
.link-button,
.bell-button,
.menu-button {
  touch-action: manipulation;
}

.app-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.sidebar {
  height: 100vh;
  height: 100svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.content,
.panel,
.registry-card,
.form-grid,
.map-layout,
.detail-grid,
.table-wrap,
.topbar,
.topbar-actions,
.user-card,
.address-card,
.metric-card,
.document-grid a {
  min-width: 0;
}

.page-title h1,
.detail-hero h1,
.compact-title h1 {
  font-size: clamp(1.35rem, 4vw, 1.875rem);
  overflow-wrap: anywhere;
}

.page-title p,
.detail-hero p,
.detail-list strong,
.document-grid a,
td,
th,
pre,
code {
  overflow-wrap: anywhere;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

table {
  min-width: 720px;
}

.sticky-actions {
  z-index: 20;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}

.toast-wrap {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  left: auto;
}

.session-expired-banner {
  position: fixed;
  z-index: 3200;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(520px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid #f2b8c0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(31, 47, 58, .18);
  color: #283142;
}

.session-expired-banner[hidden] {
  display: none;
}

.session-expired-banner div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.session-expired-banner strong {
  color: #9d2e38;
}

.session-expired-banner span {
  color: #687085;
  line-height: 1.35;
}

.session-reload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: #0b6f78;
  color: #fff;
  padding: 9px 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.session-reload-button span:first-child {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.menu-button {
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f3f6f8);
  color: #0b6f78;
  box-shadow: 0 8px 20px rgba(32, 40, 54, .08);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  margin: 3px 0;
  transition: transform .18s ease, opacity .18s ease, width .18s ease;
}

.menu-button:hover {
  box-shadow: 0 10px 24px rgba(32, 40, 54, .12);
}

.menu-button:active {
  transform: scale(.97);
}

body.sidebar-open .menu-button {
  background: #0b6f78;
  border-color: #0b6f78;
  color: #fff;
}

body.sidebar-open .menu-button span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

body.sidebar-open .menu-button span:nth-child(2) {
  opacity: 0;
  width: 0;
}

body.sidebar-open .menu-button span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  .map-monitoring-workspace {
    grid-template-columns: 1fr;
  }

  .fergana-map-canvas {
    min-height: 460px;
  }

  .monitoring-hero {
    align-items: flex-start;
  }

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

  .monitoring-filter-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .monitoring-filter-card label:first-child {
    grid-column: span 2;
  }

  .monitoring-table-card {
    grid-column: 1 / -1;
  }

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

  .filters .secondary-button {
    width: 100%;
  }

  .image-upload-grid,
  .existing-image-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .map-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .menu-button {
    display: inline-grid;
    flex: 0 0 44px;
  }

  .sidebar {
    position: fixed;
    z-index: 2100;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    height: 100vh;
    height: 100svh;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 18px 0 45px rgba(25, 32, 44, .18);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 2090;
    inset: 0;
    display: block;
    background: rgba(17, 24, 39, .38);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .content {
    padding: 0 max(12px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 0 calc(-1 * max(12px, env(safe-area-inset-right))) 0 calc(-1 * max(12px, env(safe-area-inset-left)));
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    align-items: center;
  }

  .topbar-title {
    width: 100%;
  }

  .breadcrumb {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .map-monitoring-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-monitoring-totals {
    justify-content: flex-start;
  }

  .fergana-map-canvas {
    min-height: 340px;
  }

  .map-district-panel {
    padding: 14px;
  }

  .user-card {
    gap: 6px;
  }

  .page-title,
  .detail-hero,
  .compact-title {
    gap: 12px;
    margin: 16px 0;
  }

  .title-actions,
  .page-title > .primary-button,
  .page-title > .secondary-button {
    width: 100%;
  }

  .title-actions .secondary-button,
  .page-title > .primary-button,
  .page-title > .secondary-button {
    justify-content: center;
  }

  .panel,
  .registry-card {
    border-radius: 10px;
  }

  .filters,
  .monitoring-summary-grid,
  .monitoring-grid,
  .monitoring-analytics,
  .monitoring-filter-card,
  .address-search,
  .form-grid.two,
  .form-grid.three,
  .detail-grid,
  .change-row {
    grid-template-columns: 1fr;
  }

  .filters .secondary-button,
  .monitoring-filter-button,
  .address-search .secondary-button,
  .address-search .ghost-button {
    width: 100%;
  }

  .monitoring-filter-card label:first-child {
    grid-column: auto;
  }

  .monitoring-shell {
    padding-top: 14px;
  }

  .monitoring-stat-card,
  .monitoring-progress-card {
    min-height: auto;
  }

  .donut-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend-list {
    width: 100%;
  }

  .metrics,
  .address-grid,
  .document-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 4px;
    margin-left: 0;
    margin-right: 0;
    border-radius: 12px;
    background: #eef2f4;
  }

  .step {
    min-width: 0;
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 9px;
    font-size: clamp(.62rem, 2.6vw, .78rem);
    line-height: 1.1;
    white-space: normal;
    word-break: keep-all;
    box-shadow: none;
  }

  .step.active {
    box-shadow: 0 8px 18px rgba(11, 111, 120, .22);
    transform: translateY(-1px);
  }

  .step.complete {
    background: #d8f2ed;
    color: #087d76;
  }

  .segmented-field {
    flex-wrap: wrap;
  }

  .check-grid label,
  .check-row {
    min-height: 44px;
  }

  .leaflet-map {
    min-height: clamp(280px, 62svh, 430px);
  }

  .map-toolbar {
    position: static;
    max-width: none;
    margin-bottom: 8px;
  }

  .map-tool {
    flex: 1 1 140px;
    min-height: 44px;
  }

  .image-upload-grid,
  .existing-image-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions > * {
    flex: 1 1 150px;
  }

  .primary-button {
    min-width: 0;
  }

  .empty-state-card {
    margin-top: 24px;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .monitoring-card,
  .monitoring-stat-card,
  .monitoring-progress-card {
    padding: 14px;
  }

  .monitoring-stat-card {
    gap: 12px;
  }

  .stat-icon {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .monitoring-stat-card strong {
    font-size: 23px;
  }

  .bar-row,
  .rank-row {
    grid-template-columns: 86px minmax(0, 1fr) 54px;
  }

  .registry-card,
  .panel,
  .login-card,
  .compact-login-card,
  .error-card {
    padding: 14px;
  }

  .form-panel {
    padding: 14px;
  }

  .sticky-actions {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .session-expired-banner {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    align-items: stretch;
    flex-direction: column;
  }

  .session-reload-button {
    width: 100%;
  }

  .report-link {
    width: 44px;
    height: 44px;
    justify-content: center;
  }

  .bell-button,
  .user-avatar {
    width: 44px;
    height: 44px;
  }

  .link-button {
    min-height: 44px;
    padding: 0 8px;
  }

  .empty-state-card h2 {
    font-size: 1.35rem;
  }

  .empty-illustration {
    width: 84px;
    height: 78px;
  }
}
