:root {
  --paper: #f6f4ee;
  --paper-2: #efece2;
  --ink: #22301f;
  --ink-soft: #5c6657;
  --line: #ddd8c8;
  --green: #1e4d3b;
  --green-bright: #2e7d5b;
  --amber: #c77b28;
  --red: #b3402e;
  --slate: #7d8a96;
  --gold: #b99649;
  --shadow: 0 10px 40px rgba(34, 48, 31, .18);
  --font-display: "IBM Plex Serif", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
/* body ir kolonna: baneri (demo/abonements/skatīšanās) augšā, #app aizņem atlikumu - lapa nekad nav garāka par ekrānu */
body { display: flex; flex-direction: column; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 11px; background: #fff; color: var(--ink);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(46, 125, 91, .15);
}
label { display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 12px; }
label input, label textarea, label select { margin-top: 5px; font-weight: 400; }

.btn-primary {
  background: var(--green); color: #f3efe2; border: none;
  border-radius: 6px; padding: 10px 16px; font-weight: 600; font-size: 14px;
  letter-spacing: .01em; transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--green-bright); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; color: var(--ink-soft); font-weight: 500;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { border-color: var(--green-bright); color: var(--green); }
.btn-danger { background: none; border: none; color: var(--red); font-size: 12.5px; }
.btn-danger:hover { text-decoration: underline; }

/* ---------- AUTH ---------- */
#auth-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.auth-bg {
  position: absolute; inset: 0; background: var(--green);
  background-image:
    repeating-linear-gradient(115deg, transparent 0 90px, rgba(243,239,226,.05) 90px 91px),
    repeating-linear-gradient(25deg, transparent 0 70px, rgba(243,239,226,.05) 70px 71px),
    radial-gradient(1100px 600px at 80% -10%, #2e7d5b55, transparent);
}
.auth-card {
  position: relative; width: 380px; max-width: calc(100vw - 32px);
  background: var(--paper); border-radius: 14px; padding: 36px 34px 30px;
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 52px; height: 52px; border-radius: 10px;
  background: var(--green); color: var(--gold);
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gold); margin-bottom: 18px;
}
.brand-mark.small { width: 38px; height: 38px; font-size: 16px; margin: 0; flex: none; }
.auth-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.auth-sub { color: var(--ink-soft); margin: 6px 0 22px; line-height: 1.45; }
.auth-tabs { display: flex; gap: 4px; background: var(--paper-2); border-radius: 8px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button, .auth-tabs a {
  flex: 1; border: none; background: none; padding: 8px; border-radius: 6px;
  font-weight: 600; color: var(--ink-soft); font-size: 13.5px;
  text-decoration: none; text-align: center;
}
.auth-tabs button.active { background: #fff; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.auth-error { color: var(--red); margin-top: 12px; font-size: 13px; }
.auth-card .btn-primary { width: 100%; margin-top: 4px; }

/* SPEC 3, Task 4: LV/EN valodas slēdzis (auth karte, reģistrācijas josla) */
.lang-switch { position: absolute; top: 14px; right: 14px; display: flex; gap: 2px; background: var(--paper-2); border-radius: 7px; padding: 3px; }
.lang-switch button {
  border: none; background: none; padding: 4px 9px; border-radius: 5px; cursor: pointer;
  font-weight: 700; font-size: 11.5px; color: var(--ink-soft); letter-spacing: .02em;
}
.lang-switch button.active { background: #fff; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.plan-topbar .lang-switch { position: static; margin-right: 6px; }

/* ---------- LAYOUT ---------- */
#app { display: flex; flex: 1 1 auto; min-height: 0; height: auto; overflow: hidden; }
#sidebar {
  width: 340px; flex: none; display: flex; flex-direction: column;
  background: var(--paper); border-right: 1px solid var(--line); z-index: 500;
}
#map { flex: 1; background: #dfe8dc; }

.side-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 8px; }
.brand-row > div:not(.brand-mark):not(.hdr-actions) { min-width: 0; flex: 1 1 0; }
/* zobrata poga paliek nosaukuma rindas labajā malā (viena poga, nav jāliek atsevišķā rindā) */
.hdr-actions { flex: 0 0 auto; margin-left: auto; display: flex; gap: 6px; }
.hdr-actions .hdr-btn { flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.1; white-space: nowrap; }
.org-name { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btn-logout, #btn-password, #btn-admin {
  background: none; border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink-soft); font-size: 15px;
}
#btn-password { font-size: 13px; }
#btn-logout:hover { color: var(--red); border-color: var(--red); }
#btn-password:hover { border-color: var(--ink-soft); }
#btn-admin {
  margin-left: auto; font-size: 14px; text-decoration: none;
  display: flex; align-items: center; justify-content: center; flex: none;
}
#btn-admin:hover { border-color: var(--green-bright); }
#btn-admin ~ #btn-password { margin-left: 0; }

/* stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.stat { background: var(--paper); padding: 12px 16px 10px; }
.stat .v { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--ink-soft); font-family: var(--font-body); }
.stat .v small.sub { display: block; line-height: 1.3; margin-top: 1px; }
.stat .k { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }
.stat.warn .v { color: var(--amber); }
.stat.bad .v { color: var(--red); }

.list-head { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list-head input { flex: 1; }
.list-head .btn-primary { flex: none; padding: 9px 13px; }

.prop-list { flex: 1; overflow-y: auto; }
.prop-item {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; display: flex; gap: 10px; align-items: flex-start;
  transition: background .12s;
}
.prop-item:hover { background: var(--paper-2); }
.prop-item.selected { background: #e6efe4; box-shadow: inset 3px 0 0 var(--green); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; }
.dot.active { background: var(--green-bright); }
.dot.expiring { background: var(--amber); }
.dot.expired { background: var(--red); }
.dot.vacant { background: var(--slate); }
.dot.upcoming { background: var(--gold); }
.prop-item .t { font-weight: 600; font-size: 13.5px; }
.prop-item .s { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
/* robežas vēl nav ielasītas no VZD atvērtajiem datiem (stundas darbs) */
.prop-item .s .pi-pend { font-style: italic; opacity: 0.75; }
.prop-empty { padding: 40px 24px; text-align: center; color: var(--ink-soft); line-height: 1.6; }
.prop-empty .big { font-size: 34px; }

/* ---------- DETAIL PANEL ---------- */
.detail {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: 440px;
  max-width: calc(100vw - 380px);
  background: var(--paper); border-radius: 12px; box-shadow: var(--shadow);
  z-index: 1100; overflow-y: auto; border: 1px solid var(--line);
}
.detail-close {
  position: sticky; top: 8px; float: right; margin: 8px 10px 0 0;
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--paper-2); color: var(--ink-soft); font-size: 17px; z-index: 2;
}
.detail-close:hover { background: var(--red); color: #fff; }
/* Galvas (.ch-*), ciļņu un ritināšanas noteikumi ir card.css - tas ielādējas pēc šī faila. */
.d-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 14px; } /* admin.js organizācijas galva */
.badge {
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  background: var(--paper-2); color: var(--ink-soft);
}
.badge.active { background: #dcefe2; color: var(--green); }
.badge.expiring { background: #f6e8d3; color: var(--amber); }
.badge.expired { background: #f4ddd8; color: var(--red); }
.badge.vacant { background: #e5e9ec; color: #5a6a77; }
.badge.upcoming { background: #f0e9d4; color: #8a6d25; }

.d-section { margin-top: 20px; }
.d-section > h3 {
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.d-section > h3 .btn-ghost { font-size: 12px; padding: 4px 10px; font-family: var(--font-body); }

.lease-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
  background: #fff;
}
.lease-card .lc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lease-card .lc-lessee { font-weight: 600; }
.lease-card .lc-meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.lease-card .lc-actions { margin-top: 8px; display: flex; gap: 12px; }

.pay-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.pay-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green-bright); }
.pay-row .pr-due { width: 90px; color: var(--ink-soft); }
.pay-row .pr-amt { margin-left: auto; font-weight: 600; }
.pay-row.overdue .pr-due { color: var(--red); font-weight: 600; }
.pay-more { font-size: 12px; color: var(--ink-soft); padding: 6px 2px; }

form.inline-form { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; margin-top: 8px; }
.form-row { display: flex; gap: 10px; }
.form-row label { flex: 1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ---------- MODAL ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(34, 48, 31, .45);
  display: flex; align-items: center; justify-content: center; z-index: 1200;
  backdrop-filter: blur(2px);
}
.modal-card {
  width: 460px; max-width: calc(100vw - 32px); max-height: 86vh; overflow-y: auto;
  background: var(--paper); border-radius: 14px; padding: 26px 28px;
  box-shadow: var(--shadow); position: relative;
}
.modal-card h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 16px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: none; background: var(--paper-2); font-size: 16px; color: var(--ink-soft);
}
.modal-close:hover { background: var(--red); color: #fff; }

#add-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--ink-soft); }
.spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--line);
  border-top-color: var(--green-bright); border-radius: 50%;
  animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
#add-results { margin-top: 12px; font-size: 13px; max-height: 200px; overflow-y: auto; }
#add-results .r-ok { color: var(--green); padding: 2px 0; }
#add-results .r-err { color: var(--red); padding: 2px 0; }

/* map bits */
.leaflet-container { font-family: var(--font-body); }
.parcel-tip { font-weight: 600; }

/* filtri */
.filters { display: flex; gap: 6px; padding: 0 14px 8px; }
.filters select {
  flex: 1; min-width: 0; font-size: 12px; padding: 5px 6px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: inherit;
}

/* eksports */
.export-row { padding: 8px 14px; font-size: 12px; color: var(--ink-soft); border-top: 1px solid var(--line); }
.export-row a { color: inherit; text-decoration: underline; }

/* demo */
.demo-btn { width: 100%; margin-top: 10px; }
.demo-banner {
  background: #b99649; color: #fff; text-align: center; padding: 6px 10px;
  font-size: 13px; font-weight: 600;
}

/* zemes lietojums */
.lu-grid { display: flex; flex-direction: column; gap: 4px; }
.lu-row { display: grid; grid-template-columns: 92px 1fr 60px; gap: 8px; align-items: center; font-size: 12px; }
.lu-k { color: var(--ink-soft); }
.lu-bar { background: var(--line); border-radius: 3px; height: 8px; overflow: hidden; }
.lu-bar span { display: block; height: 100%; background: #2e7d5b; border-radius: 3px; }
.lu-v { text-align: right; font-variant-numeric: tabular-nums; }

/* LAD */
.lad-year { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.lad-row { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.lad-row:last-of-type { border-bottom: none; }
.lad-code { color: var(--ink-soft); font-size: 12px; }
.lad-meta { color: var(--ink-soft); font-size: 12px; margin-top: 2px; }
.lad-blocks { margin-top: 6px; font-size: 11px; color: var(--ink-soft); }

/* dokumenti */
.doc-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.doc-row:last-of-type { border-bottom: none; }
.doc-ico { flex: none; }
.doc-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: inherit; text-decoration: none;
}
.doc-name:hover { text-decoration: underline; }
.doc-size { flex: none; color: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.doc-del { flex: none; padding: 0 7px; line-height: 1.4; }

/* LAD popup kartē */
.lad-popup .leaflet-popup-content-wrapper {
  border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  padding: 0; overflow: hidden;
}
.lad-popup .leaflet-popup-content { margin: 0; width: 280px !important; }
.ladp { padding: 14px 16px 10px; font-size: 13px; }
.ladp-loading { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); padding: 6px 0; }
.ladp-empty { color: var(--ink-soft); padding: 4px 0; }
.ladp-head { margin-bottom: 8px; }
.ladp-crop { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.ladp-sub { color: var(--ink-soft); font-size: 12px; margin-top: 2px; }
.ladp-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.ladp-chip {
  background: #eef4f0; color: #2e7d5b; border: 1px solid #d3e4da;
  border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 600;
}
.ladp-rows { border-top: 1px solid var(--line); }
.ladp-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.ladp-row span { color: var(--ink-soft); }
.ladp-prev { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.ladp-src { margin-top: 8px; font-size: 10px; color: var(--ink-soft); opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }

/* NĪN */
.tax-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.tax-year { font-weight: 700; }
.tax-amt { color: var(--ink-soft); flex: 1; }
.tax-q { display: flex; align-items: center; gap: 2px; font-size: 11px; cursor: pointer; }
.tax-q.overdue { color: var(--red); font-weight: 700; }
.tax-del { padding: 0 7px; line-height: 1.4; }
.tax-form { margin-top: 8px; }
/* zemes gabalu etiķetes uz kartes: nosaukums + kadastra nr. mazākiem burtiem */
.parcel-label {
  background: none; border: none; box-shadow: none; padding: 0;
  color: #fff; text-align: center;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 5px #000;
}
.parcel-label::before { display: none; }
.parcel-label .pl-name { font-size: 12px; font-weight: 700; line-height: 1.15; }
.parcel-label .pl-code { font-size: 9px; font-weight: 500; opacity: 0.9; letter-spacing: 0.03em; }
.layer-switch {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); overflow: hidden; display: flex;
}
.layer-switch button { border: none; background: none; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.layer-switch button.active { background: var(--green); color: #f3efe2; }

@media (max-width: 860px) {
  #sidebar { width: 280px; }
  .detail { max-width: calc(100vw - 300px); }
}

/* formu virsraksts (līguma labošana/jauns) */
.form-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }

/* klikšķis uz zemes vienības: bez pārlūka fokusa taisnstūra — izceļam pašu kontūru */
.leaflet-interactive:focus { outline: none !important; }

/* leģenda kartē */
.map-legend {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; box-shadow: 0 3px 14px rgba(0,0,0,.12); font-size: 12px;
  max-width: 190px;
}
.map-legend select { font-size: 12px; padding: 4px 6px; margin-bottom: 6px; }
.legend-row { display: flex; align-items: center; gap: 6px; padding: 1.5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* klikšķināmās statistikas šūnas */
.stat.clickable { cursor: pointer; transition: background .12s; }
.stat.clickable:hover { background: var(--paper-2); }
.stat.stat-active { background: #e6efe4; box-shadow: inset 0 -3px 0 var(--green); }

/* ģeolokācijas poga kartē (visi izmēri) */
.geo-btn {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); overflow: hidden;
}
.geo-btn button {
  border: none; background: none; width: 34px; height: 34px; font-size: 16px;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.geo-btn button:hover { background: var(--paper-2); }

/* ---------- mobilais ---------- */
#mob-tabs { display: none; }

@media (max-width: 768px) {
  #sidebar {
    display: none;
    position: fixed; inset: 0; width: 100%;
    z-index: 600;
    padding-bottom: 54px; /* lai saturs neapslēpjas zem ciļņu joslas */
  }
  #app.mob-view-list #sidebar { display: flex; }
  #app.mob-view-list #map { display: none; }

  #mob-tabs {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    background: var(--paper); border-top: 1px solid var(--line);
  }
  #mob-tabs button {
    flex: 1; border: none; background: none; padding: 10px 8px;
    font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
    min-height: 48px;
  }
  #mob-tabs button.active { color: var(--green); background: var(--paper-2); }

  /* pilnekrāna detaļu panelis, virs ciļņu joslas */
  .detail {
    position: fixed; inset: 0; width: 100%; max-width: 100%;
    border-radius: 0; z-index: 1100;
  }

  /* kompaktāka statistika horizontālā joslā */
  .stats {
    display: flex; overflow-x: auto; grid-template-columns: none;
    -webkit-overflow-scrolling: touch;
  }
  .stat { flex: 0 0 44%; padding: 10px 12px 8px; }
  .stat .v { font-size: 19px; }
  .stat .v small { font-size: 11px; }
  .stat .k { font-size: 10px; }

  /* filtri rindā ar horizontālu ritināšanu */
  .filters { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filters select { flex: 0 0 auto; min-width: 130px; }

  /* pieskārienu izmēri */
  .list-head input, .list-head .btn-primary,
  .prop-item, #btn-logout, #btn-password,
  .stat.clickable, #mob-tabs button {
    min-height: 40px;
  }

  /* slāņu panelis: sākumā sakļauts, redzama tikai pamata rinda un "Slāņi" poga */
  .ls-mobile-toggle {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    width: 100%; min-height: 40px; border: none; background: none;
    border-top: 1px solid var(--line); padding: 8px 10px;
    font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  }
  .ls-mobile-toggle .ls-chevron { font-size: 10px; transition: transform .15s; }
  .layer-switch.ls-collapsed .ls-mobile-toggle .ls-chevron { transform: rotate(-90deg); }
  .layer-switch.ls-collapsed .ls-overlays { display: none; }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .ls-mobile-toggle .ls-chevron { transition: none; }
}

/* NĪN aplēse no kadastrālās vērtības */
.nin-est { font-size: 12.5px; margin-bottom: 8px; line-height: 1.6; }
.nin-src { color: var(--ink-soft); font-size: 11px; }

/* Meža nogabali (VMD MVR) */
.fs-row {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 0;
  border-bottom: 1px dashed var(--line); font-size: 12.5px; cursor: pointer;
}
.fs-row:last-of-type { border-bottom: none; }
.fs-row:hover .fs-kv { color: var(--green-bright); }
.fs-kv { font-weight: 600; white-space: nowrap; }
.fs-desc { flex: 1; color: var(--ink-soft); }
.fs-ha { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-popup { font-family: var(--font-body); font-size: 12.5px; line-height: 1.5; }
.fs-popup-title { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.fs-popup-row { color: var(--ink); }

/* nogabalu etiķetes kartē */
.fs-label {
  background: none; border: none; box-shadow: none; padding: 0;
  color: #eaf6ea; text-align: center;
  text-shadow: 0 0 3px #0e3d2b, 0 0 3px #0e3d2b, 0 0 5px #0e3d2b;
}
.fs-label::before { display: none; }
.fs-label .fsl-nr { font-size: 11px; font-weight: 700; line-height: 1.1; }
.fs-label .fsl-suga { font-size: 9px; font-weight: 600; opacity: 0.95; }

/* Īpašumā / Nomā cilnes - 2x2 režģis, lai 4 cilnes nekad nepārplūst pāri sānjoslai */
.tenure-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px;
  padding: 6px 14px 0; background: var(--paper);
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.tenure-tabs button {
  border: none; background: none; padding: 6px 4px 7px;
  font-weight: 600; font-size: 12px; color: var(--ink-soft);
  border-bottom: 2px solid transparent; border-radius: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tenure-tabs button.active { color: var(--green); border-bottom-color: var(--green); }
.tenure-tabs button:hover { color: var(--green-bright); }

/* eksporta josla */
.export-bar { padding: 10px 14px; border-top: 1px solid var(--line); position: relative; background: var(--paper); }
.export-main { width: 100%; font-size: 13px; padding: 9px 12px; }
.export-menu {
  position: absolute; bottom: calc(100% + 6px); left: 14px; right: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px; z-index: 900;
}
.export-menu .em-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 4px 8px; }
.export-menu a { display: block; padding: 7px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.export-menu a:hover { background: var(--paper-2); color: var(--green); }
.export-menu .em-sep { border-top: 1px solid var(--line); margin: 6px 0; }
.export-menu .em-pick { width: 100%; text-align: left; border: none; background: none; padding: 7px 8px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink); }
.export-menu .em-pick:hover { background: var(--paper-2); color: var(--green); }
.export-sel { display: flex; flex-direction: column; gap: 6px; }
.export-sel .es-count { font-size: 13px; }
.export-sel .es-links { font-size: 12.5px; color: var(--ink-soft); }
.export-sel .es-links a { color: var(--green); font-weight: 600; }
.export-sel .es-links a.dis { pointer-events: none; opacity: .4; }
.export-sel .es-actions { display: flex; gap: 6px; }
.export-sel .es-actions .btn-ghost { flex: 1; font-size: 12px; padding: 6px 8px; }
.prop-item .sel-cb { width: auto; margin-top: 3px; flex: none; }

/* NĪN salokāmā sadaļa */
h3.collapsible { cursor: pointer; user-select: none; }
h3.collapsible:hover { color: var(--green-bright); }
h3.collapsible .chev { font-size: 12px; color: var(--ink-soft); }

/* kartes kontroles pabīdās, kad atvērta kartiņa (lai nepārsedzas) */
@media (min-width: 861px) {
  #app.detail-open .leaflet-right { right: 464px; transition: right .15s; }
}

/* slāņu pārslēgs ar overlay ķekšiem */
.layer-switch { flex-direction: column; }
.layer-switch .ls-base { display: flex; }
.layer-switch .ls-overlays {
  border-top: 1px solid var(--line); padding: 6px 10px 7px;
  display: flex; flex-direction: column; gap: 4px;
}
.layer-switch .ls-overlays label {
  display: flex; align-items: center; gap: 6px; margin: 0;
  font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.layer-switch .ls-overlays input { width: auto; }
.layer-switch .ls-overlays label[hidden] { display: none; }
.layer-switch .ls-overlays .ls-hint {
  font-size: 11.5px; color: var(--ink-soft); line-height: 1.4;
  margin: -1px 0 3px 20px; max-width: 210px;
}
.layer-switch .ls-overlays .ls-hint[hidden] { display: none; }
.ls-hint-legend { display: block; max-height: 140px; margin-bottom: 4px; }
.ls-swatch { display: inline-block; vertical-align: middle; margin-right: 4px; border-radius: 1px; }
.ls-swatch-line { width: 14px; height: 3px; }
.ls-swatch-box { width: 14px; height: 10px; }
/* Geolatvija robežu WMS ir pelēks uz balta - invertēts lasās uz satelīta */
.hyb-admin { filter: invert(1) brightness(1.6); }
.fs-popup .fs-open {
  margin-top: 8px; width: 100%; border: 1px solid var(--line); background: var(--paper-2);
  border-radius: 6px; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--green);
}
.fs-popup .fs-open:hover { border-color: var(--green-bright); background: #e6efe4; }

/* abonementa banneri */
.demo-banner.sub-warn { background: var(--amber); }
.demo-banner.sub-bad { background: var(--red); }

/* cirtes gatavība un LAD deklarāciju brīdinājums */
.fell-ready { color: #b3402e; font-weight: 600; }
.fell-soon { color: #c77b28; font-weight: 600; }
.fell-summary { margin: 8px 0 2px; font-size: 12.5px; }
.fell-summary .fell-ready, .fell-summary .fell-soon { margin-right: 8px; }
.fell-note { color: var(--ink-soft, #6b7a6f); font-size: 11.5px; margin-top: 3px; }
.forest-vol-hint { color: var(--ink-soft, #6b7a6f); font-size: 11.5px; line-height: 1.4; margin: 2px 0 4px; }
.lad-warn { background: #fdf3e7; border: 1px solid #ecd9bd; color: #8a5a1e;
  border-radius: 6px; padding: 7px 9px; font-size: 12.5px; margin: 4px 0; }

/* Teritorijas dati (zemes novērtējums, zonējums, plūdi, meliorācija) - vienmēr pilnā izmērā,
   bez rindu sakļaušanas (kompaktā, klikšķinot izvēršamā uzvedība bija paredzēta vecajai
   viena ritināšanas laukuma kartiņai un ir novecojusi). */
#facts-section .fact-row { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
.fact-muted { color: var(--ink-soft); font-size: 11.5px; margin-top: 1px; }

/* pārdoto cilne un badge */
#tenure-tabs .tt-sold { grid-column: 1 / -1; background: #f6ecec; color: #8a3a2e; border-color: #dcc3bd; }
#tenure-tabs .tt-sold.active { background: #8a3a2e; color: #fff; border-color: #8a3a2e; }

/* galvenes pogas ar parakstiem: auto izmērs, centrēts saturs (pārraksta 30x30 noklusējumu) */
.hdr-btn, #btn-admin.hdr-btn {
  width: auto !important; height: auto !important; min-width: 34px; flex: none;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; line-height: 1.15; padding: 4px 5px 3px; cursor: pointer; white-space: nowrap;
}
.hdr-btn span { font-size: 9px; letter-spacing: 0.02em; color: var(--ink-soft, #6b7a6f); display: block; }
/* Aktīvi / Pārdotie pārslēgs */
.life-switch { display: flex; gap: 0; margin: 0 0 6px; border: 1px solid var(--line, #dfe5df); border-radius: 8px; overflow: hidden; }
.life-switch button { flex: 1; padding: 6px 8px; font-size: 12.5px; background: #fff; border: 0; cursor: pointer; color: var(--ink, #26332a); }
.life-switch button + button { border-left: 1px solid var(--line, #dfe5df); }
.life-switch button.active { background: var(--green, #2e7d5b); color: #fff; font-weight: 600; }
.life-switch button.ls-sold.active { background: #8a3a2e; }
/* statistikas pielāgošana */
.stats { position: relative; }
#stats-cfg-btn { grid-column: 1 / -1; border: 0; background: var(--paper, #fff); cursor: pointer;
  font-size: 11.5px; color: var(--ink-soft, #6b7a6f); padding: 6px 8px; text-align: center; }
#stats-cfg-btn:hover { color: var(--green, #2e7d5b); background: #f2f6f2; }
.stats-cfg-menu { position: absolute; bottom: 34px; left: 10px; right: 10px; z-index: 30;
  background: #fff; border: 1px solid var(--line, #dfe5df); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 35, 25, 0.18); padding: 12px 14px 10px; max-height: 300px; overflow: auto; }
.stats-cfg-menu .cfg-title { font-size: 11px; font-weight: 700; color: var(--ink-soft, #6b7a6f);
  text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 7px; margin-bottom: 5px;
  border-bottom: 1px solid var(--line, #e6eae6); }
.stats-cfg-menu label { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink, #26332a);
  padding: 6px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; }
.stats-cfg-menu label:hover { background: #f2f6f2; }
.stats-cfg-menu input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green, #2e7d5b); flex: none; margin: 0; }

#tenure-tabs .life-switch { grid-column: 1 / -1; }
.chk-inline label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; margin: 2px 0 6px; }
.chk-inline input { width: auto; }

/* piezīmju lauks kartiņā - vairāk elpas */
#form-prop-meta textarea[name="notes"] { min-height: 96px; resize: vertical; line-height: 1.45; }

/* dokumentu priekšskatījums */
.doc-preview-card { width: min(920px, 94vw); max-height: 90vh; overflow: auto; }
.dp-title { font-size: 16px !important; padding-right: 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-frame { width: 100%; height: 68vh; border: 1px solid var(--line, #dfe5df); border-radius: 8px; margin-top: 8px; }
.dp-img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 8px; }
.dp-sec-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft, #6b7a6f); margin: 12px 0 6px; }
.dp-sig { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; background: #f2f7f2; border: 1px solid #dbe7db; border-radius: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.dp-sig-who { font-weight: 600; }
.dp-sig-meta { font-size: 12px; color: var(--ink-soft, #6b7a6f); }
.dp-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed var(--line, #e3e8e3); font-size: 13px; }
.dp-file-act { display: flex; gap: 6px; flex: none; }
.doc-prev { border: 0; background: transparent; cursor: pointer; font-size: 13px; opacity: 0.6; padding: 2px 4px; }
.doc-prev:hover { opacity: 1; }

.doc-name { cursor: pointer; }
.doc-dl { text-decoration: none; font-size: 13px; opacity: 0.6; padding: 2px 5px; border-radius: 5px; flex: none; }
.doc-dl:hover { opacity: 1; background: #eef3ee; }
.dp-download { display: inline-block; margin-bottom: 4px; text-decoration: none; font-size: 12.5px; }

/* users.js */

/* paroles atjaunošana ieiešanas ekrānā */
.link-btn {
  background: none; border: none; padding: 6px 0 0; width: 100%;
  color: var(--ink-soft); font-size: 12.5px; text-decoration: underline;
}
.link-btn:hover { color: var(--green-bright); }
.forgot-hint { color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; margin-bottom: 12px; }
.forgot-msg { color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; margin-top: 12px; }
.forgot-msg a { color: inherit; }
.forgot-msg.forgot-err { color: var(--red); }

/* jaunās paroles lapa (reset.html) */
.reset-ok { color: var(--green); font-size: 13.5px; line-height: 1.5; margin-bottom: 14px; }
.reset-home { display: block; text-align: center; text-decoration: none; }

/* galvenes poga "Lietotāji" */
#btn-users {
  background: none; border: 1px solid var(--line);
  border-radius: 6px; width: 30px; height: 30px; color: var(--ink-soft); font-size: 13px;
  margin-left: auto;
}
#btn-users:hover { border-color: var(--green-bright); color: var(--green); }
#btn-admin ~ #btn-users { margin-left: 0; }
#btn-users ~ #btn-password { margin-left: 0; }

/* organizācijas lietotāju modālis */
.users-card { width: 660px; }
.users-intro { color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; margin: -8px 0 14px; }
.users-loading { color: var(--ink-soft); font-size: 13px; padding: 10px 0; }
.users-list { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th {
  text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; padding: 0 8px 6px 0; border-bottom: 1px solid var(--line);
}
.users-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users-table tr:last-child td { border-bottom: none; }
.users-email { color: var(--ink-soft); word-break: break-all; }
.users-self { color: var(--ink-soft); font-size: 11.5px; }
.users-role { padding: 5px 6px; font-size: 12.5px; min-width: 128px; }
.users-role:disabled { background: var(--paper-2); color: var(--ink-soft); }
.users-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding-right: 0 !important; }
.users-acts .btn-ghost { font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.users-acts .btn-danger { white-space: nowrap; }
.users-sub {
  font-family: var(--font-display); font-size: 15.5px; font-weight: 600;
  margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--line);
}
.users-add { display: grid; grid-template-columns: 1fr 1fr 150px; gap: 0 10px; align-items: end; }
.users-add .btn-primary { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }

/* vienreiz rādāmā pagaidu parole */
#modal-users .pw-box {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 14px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
#modal-users .pw-box code { flex: 1; font-size: 15px; font-weight: 600; letter-spacing: .02em; word-break: break-all; }
#modal-users .copy-ok { font-size: 12px; color: var(--green-bright); }
#modal-users .pw-warn { font-size: 12px; color: var(--amber); margin: -8px 0 14px; line-height: 1.45; }

@media (max-width: 700px) {
  .users-add { grid-template-columns: 1fr; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table thead { display: none; }
  .users-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .users-table td { border-bottom: none; padding: 3px 0; }
  .users-acts { justify-content: flex-start; }
}

/* skatīšanās režīms (role = viewer): acīmredzamās mainīšanas pogas paslēptas,
   pārējo aizsargā servera 403 */
body.role-viewer #btn-add,
body.role-viewer #btn-new-lease,
body.role-viewer #btn-del-prop,
body.role-viewer #btn-doc-upload,
body.role-viewer .btn-danger,
body.role-viewer [data-del-doc],
body.role-viewer [data-del-lease],
body.role-viewer [data-del-tax],
body.role-viewer [data-edit-lease],
body.role-viewer [data-edoc-save],
body.role-viewer #form-prop-meta button,
body.role-viewer #form-lease button,
body.role-viewer #form-sale button,
body.role-viewer #form-tax button { display: none !important; }
body.role-viewer #form-prop-meta input,
body.role-viewer #form-prop-meta textarea,
body.role-viewer #form-prop-meta select,
body.role-viewer #form-lease input,
body.role-viewer #form-lease textarea,
body.role-viewer #form-lease select,
body.role-viewer #form-sale input,
body.role-viewer #form-sale select,
body.role-viewer #form-tax input,
body.role-viewer #form-tax select {
  pointer-events: none; background: var(--paper-2); color: var(--ink-soft);
}

/* import-xlsx.js */
.list-head { flex-wrap: wrap; }
#btn-import-xlsx { flex: 1 0 100%; padding: 8px 12px; font-size: 13px; text-align: center; }

.imp-card { width: 780px; }
.imp-lead { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 14px; }
.imp-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; }
.imp-note.bad { color: var(--red); }

.imp-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0; }
.imp-steps li {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2);
}
.imp-steps li b {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.imp-steps li.active { color: var(--green); border-color: var(--green-bright); background: #fff; }
.imp-steps li.active b { background: var(--green); border-color: var(--green); color: #f3efe2; }
.imp-steps li.done b { background: var(--green-bright); border-color: var(--green-bright); color: #f3efe2; }

.imp-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.imp-actions-end { justify-content: flex-end; margin-top: 14px; }

.imp-cols { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12.5px; }
.imp-cols th {
  text-align: left; font-weight: 600; white-space: nowrap;
  padding: 6px 12px 6px 0; vertical-align: top; color: var(--ink);
}
.imp-cols td { padding: 6px 0; color: var(--ink-soft); line-height: 1.45; }
.imp-cols tr + tr th, .imp-cols tr + tr td { border-top: 1px solid var(--line); }

.imp-file { margin-bottom: 12px; }
.imp-file input { padding: 8px 10px; }

.imp-counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 500; margin-top: 10px; }
.imp-ok { color: var(--green-bright); }
.imp-bad { color: var(--red); }
.imp-muted { color: var(--ink-soft); }

.imp-table-wrap { max-height: 320px; overflow: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; }
.imp-table-wrap:empty { display: none; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th {
  position: sticky; top: 0; z-index: 1; background: var(--paper-2);
  text-align: left; font-weight: 600; white-space: nowrap;
  padding: 7px 10px; border-bottom: 1px solid var(--line);
}
.imp-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* kods, datumi un summa vienā rindā; teksta kolonnas drīkst laust */
.imp-table td:nth-child(1), .imp-table td:nth-child(2),
.imp-table td:nth-child(6), .imp-table td:nth-child(7), .imp-table td:nth-child(8) { white-space: nowrap; }
.imp-table tr:last-child td { border-bottom: none; }
.imp-table tr.row-bad td { background: rgba(179, 64, 46, .07); }
.imp-table tr.row-bad td { border-bottom-color: transparent; }
.imp-table tr.row-err td { padding-top: 0; padding-bottom: 8px; white-space: normal; border-bottom: 1px solid var(--line); }

.imp-progress { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--ink-soft); font-size: 13px; }
#imp-results .r-err, #imp-summary .r-err { color: var(--red); font-size: 13px; padding: 6px 0; }

@media (max-width: 700px) {
  .imp-steps { flex-direction: column; gap: 6px; }
  .imp-cols th { white-space: normal; }
}

/* archive.js */
.export-menu .em-arch { display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 8px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink, #22301f);
  cursor: pointer; font-family: inherit; }
.export-menu .em-arch:hover { background: var(--paper-2, #efece2); color: var(--green, #1e4d3b); }
.export-sel .es-arch { width: 100%; font-size: 12px; padding: 6px 8px; margin-top: 6px; }

.arch-card { width: 520px; }
.arch-status { font-size: 13.5px; color: var(--ink-soft, #5c6657); line-height: 1.45; }
.arch-status.arch-ok { color: var(--green, #1e4d3b); font-weight: 600; }
.arch-status.arch-err { color: var(--red, #b3402e); font-weight: 600; }
.arch-bar { height: 6px; border-radius: 4px; background: var(--paper-2, #efece2); overflow: hidden; margin: 12px 0 7px; }
.arch-bar-fill { height: 100%; width: 0; background: var(--green-bright, #2e7d5b); border-radius: 4px;
  transition: width .2s linear; }
.arch-sub { font-size: 12.5px; color: var(--ink-soft, #5c6657); font-variant-numeric: tabular-nums; min-height: 17px; }
.arch-errors { margin-top: 12px; padding: 9px 11px; border-radius: 8px; background: #fbf0ee;
  border: 1px solid #e8cdc7; font-size: 12px; color: var(--ink, #22301f); max-height: 150px; overflow-y: auto;
  word-break: break-word; }
.arch-err-head { font-weight: 600; color: var(--red, #b3402e); margin-bottom: 4px; }
.arch-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

/* abonementa baneri: pogas, aizvēršana, izmēģinājuma krāsa (SPEC 6.1) */
.demo-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.demo-banner.sub-trial { background: var(--green-bright); }
.banner-btn {
  background: none; border: 1px solid rgba(255, 255, 255, .75); color: #fff;
  border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  transition: background-color .15s, color .15s;; text-decoration: none; display: inline-block; }
.banner-btn:hover { background: #fff; color: var(--ink); }
.banner-close {
  background: none; border: none; color: #fff; opacity: .75; font-size: 15px;
  line-height: 1; padding: 0 2px; transition: opacity .15s;
}
.banner-close:hover { opacity: 1; }
#add-results .r-warn { color: var(--amber); padding: 4px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#add-results .r-warn .btn-ghost { font-size: 12px; padding: 4px 9px; }

@media (prefers-reduced-motion: reduce) {
  .banner-btn, .banner-close { transition: none; }
}

/* settings.js - viena Iestatījumu izvēlne */
.settings-card {
  width: 760px; height: min(86vh, 640px); max-height: 86vh;
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
}
.settings-layout { display: flex; flex: 1; min-height: 0; }
.settings-nav {
  width: 200px; flex: none; border-right: 1px solid var(--line);
  padding: 22px 0; display: flex; flex-direction: column; overflow-y: auto;
}
.settings-nav-btn {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 10px 22px; font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  text-decoration: none;
}
.settings-nav-btn:hover { background: var(--paper-2); color: var(--ink); }
.settings-nav-btn.active {
  background: var(--paper-2); color: var(--green); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--green-bright);
}
.settings-nav-exit { color: var(--red); }
.settings-nav-sep { border: none; border-top: 1px solid var(--line); margin: 10px 22px; }
.settings-body { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 30px; }
.settings-body h2#settings-title { font-family: var(--font-display); font-size: 20px; margin-bottom: 18px; }

@media (max-width: 768px) {
  .settings-card { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .settings-layout { flex-direction: column; }
  .settings-nav {
    width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--line); padding: 8px 10px; gap: 4px;
  }
  .settings-nav-btn { width: auto; flex: none; white-space: nowrap; padding: 8px 12px; border-radius: 6px; }
  .settings-nav-btn.active { box-shadow: none; background: var(--green-bright); color: #fff; }
  .settings-nav-exit.active { background: var(--red); }
  .settings-nav-sep { display: none; }
  .settings-body { padding: 18px 16px; }
}

/* Moduļi sadaļa */
.settings-plan-line { font-size: 13px; color: var(--ink-soft); margin: -6px 0 16px; }
.mod-group + .mod-group { margin-top: 22px; }
.mod-group-title { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.mod-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mod-row:last-child { border-bottom: none; }
.mod-row-muted { opacity: .55; }
.mod-row-text { min-width: 0; }
.mod-row-name { font-size: 13.5px; font-weight: 500; }
.mod-row-desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.mod-row-right { display: flex; align-items: center; gap: 8px; flex: none; }
.mod-lock-row { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--ink-soft); font-size: 12px; padding: 0; }
.mod-lock-row:hover { color: var(--green-bright); }
.mod-badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--paper-2); border-radius: 999px; padding: 3px 8px;
}
.mod-pending { font-size: 12px; color: var(--ink-soft); }
.mod-note { font-size: 12.5px; color: var(--green-bright); margin-top: 16px; }
.mod-note.mod-note-err { color: var(--red); }

/* slēdzis (.switch) - 36x20, knob 16x16 */
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line); border: none; padding: 0; flex: none; cursor: pointer; transition: background-color .15s; }
.switch .switch-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch.on, .switch[aria-pressed="true"] { background: var(--green-bright); }
.switch.on .switch-knob, .switch[aria-pressed="true"] .switch-knob { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  .switch, .switch .switch-knob { transition: none; }
}

/* rēķini nomniekiem (SPEC 7.1) */
.badge.inv-st-draft { background: #e5e9ec; color: #5a6a77; }
.badge.inv-st-sent { background: #f6e8d3; color: var(--amber); }
.badge.inv-st-paid { background: #dcefe2; color: var(--green); }
.badge.inv-st-cancelled { background: #f4ddd8; color: var(--red); }
.inv-list-title { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin: 10px 0 4px; }
.inv-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 2px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.inv-row .inv-num { font-weight: 600; }
.inv-row .inv-date { color: var(--ink-soft); }
.inv-row .inv-amt { margin-left: auto; font-weight: 600; }
.inv-row .inv-actions { display: flex; gap: 6px; flex: none; width: 100%; margin-top: 2px; }
.inv-row .inv-actions .btn-ghost { font-size: 11.5px; padding: 4px 9px; }
.pay-row .pay-inv-btn { font-size: 11px; padding: 3px 8px; margin-left: 6px; }

/* kadastra izmaiņu brīdinājums kartiņā (SPEC 7.3) */
.card-warn { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #f6e8d3; color: #8a6d25; font-size: 12.5px; line-height: 1.5; }

/* Iestatījumi - sadaļa "Izmaiņas" */
.chg-actions { margin-bottom: 12px; }
.chg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.chg-row:last-child { border-bottom: none; }
.chg-link { background: none; border: none; padding: 0; color: var(--green); font-weight: 600; cursor: pointer; font: inherit; }
.chg-link:hover { text-decoration: underline; }
.chg-kind { color: var(--ink-soft); }
.chg-vals { color: var(--ink-soft); font-size: 12px; }
.chg-date { margin-left: auto; color: var(--ink-soft); font-size: 12px; }
/* neredzēta izmaiņa - sarkans punkts un treknāks nosaukums; pēc atzīmēšanas rinda paliek
   redzama, bet pelēkāka - kā vēsture, nevis kā uzdevums */
.chg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
.chg-row.chg-unseen .chg-link { font-weight: 700; }
.chg-row.chg-seen { opacity: .6; }

/* galvenes zobrata sarkanais punkts (neredzētas kadastra izmaiņas, SPEC 7.3) */
.hdr-btn { position: relative; }
.hdr-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--paper); }

/* flīžu piegādātāja logo (MapTiler noteikumi) */
.tile-logo { margin: 0 4px 2px 0; opacity: 0.85; line-height: 0; }
.tile-logo img { height: 18px; display: block; }

/* saite uz VZD kadastrs.lv izmaiņu rindās */
.chg-src { font-size: 12px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.chg-src:hover { color: var(--green); }
