/* Tukuma novada ziņojumi — A variants "Gaišais"
   Krāsas no partijas vadlīnijām: #4EA88F (jūras zaļš), #F7941D (oranžs), #70AA43 (zaļš) */
* { box-sizing: border-box; margin: 0; }

:root {
  --accent: #4EA88F;
  --accent-dark: #3d8a75;
  --accent-pale: #e6f2ee;
  --orange: #f7941d;
  --leaf: #70aa43;
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #22302b;
  --muted: #64756f;
  --line: #e0e8e4;
  --shadow: 0 2px 10px rgba(34, 48, 43, 0.07);
  /* statusu krāsas */
  --st-jauns: #f7941d;   --st-jauns-bg: #fdeee0;   --st-jauns-tx: #a35800;
  --st-proc: #e0a800;    --st-proc-bg: #faf3d7;    --st-proc-tx: #8a6d00;
  --st-atri: #2e9e5b;    --st-atri-bg: #e3f2e6;    --st-atri-tx: #1e7c40;
  --st-sleg: #8a9490;    --st-sleg-bg: #eceeed;    --st-sleg-tx: #5a6360;
  --control-h: 3rem;
}

/* +20% burtu izmērs visā lapā */
html { scroll-behavior: smooth; font-size: 120%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  padding-bottom: 70px; /* vieta apakšējai navigācijai mobilajā */
}

h1, h2, h3, h4, .stats .num { font-family: "Raleway", -apple-system, sans-serif; }

/* ==== Galvene — balta ar logo zīmi ==== */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 18px 16px 14px;
}
.head-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.mark { display: flex; gap: 3px; align-items: flex-end; height: 30px; }
.mark i { width: 8px; border-radius: 1.5px; display: block; }
.mark .m1 { height: 19px; background: var(--orange); }
.mark .m2 { height: 30px; background: var(--leaf); }
.mark .m3 { height: 24px; background: var(--accent); }
header h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.01em; }

/* ==== Navigācija ==== */
#tabs {
  display: flex;
  justify-content: center;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 900;
}
#tabs button {
  flex: 1 1 0;
  max-width: 190px;
  border: 0;
  background: none;
  padding: 10px 4px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "Raleway", sans-serif;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#tabs button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 700; }

/* mobilajā navigācija apakšā */
@media (max-width: 640px) {
  #tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(34, 48, 43, 0.08);
  }
  #tabs button { max-width: none; border-bottom: 0; border-top: 3px solid transparent; font-size: 0.72rem; }
  #tabs button.active { border-top-color: var(--accent); }
}

main { max-width: 900px; margin: 0 auto; padding: 16px; }

.tab { display: none; }
.tab.active { display: block; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.12rem; font-weight: 700; margin-bottom: 10px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.req { color: var(--orange); }

/* ==== Statistika ar ikonām ==== */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stats .stat {
  background: var(--card);
  border-radius: 14px;
  padding: 13px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.stats .ic {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-pale);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.stats .ic svg { width: 21px; height: 21px; fill: none; stroke: var(--accent-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stats .num { font-size: 1.45rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .lbl { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat:first-child { grid-column: span 2; }
}

/* ==== Statusa pilulas ==== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 12px;
  font-weight: 700; font-size: 0.78rem;
  white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pill.p-Jauns { background: var(--st-jauns-bg); color: var(--st-jauns-tx); } .pill.p-Jauns i { background: var(--st-jauns); }
.pill.p-Procesā { background: var(--st-proc-bg); color: var(--st-proc-tx); } .pill.p-Procesā i { background: var(--st-proc); }
.pill.p-Atrisināts { background: var(--st-atri-bg); color: var(--st-atri-tx); } .pill.p-Atrisināts i { background: var(--st-atri); }
.pill.p-Neaktuāli { background: var(--st-sleg-bg); color: var(--st-sleg-tx); } .pill.p-Neaktuāli i { background: var(--st-sleg); }

/* ==== Formas un vadīklas ==== */
form label { display: block; margin: 14px 0 0; font-size: 0.92rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

input:not([type="radio"]):not([type="checkbox"]),
select,
.btn-primary, .btn-sm, .btn-link, .pagination button, .admin-tabs button {
  min-height: var(--control-h);
}
.btn-sm, .btn-link, .pagination button, .admin-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-family: inherit;
}
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; }
form small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }
fieldset { border: 0; margin: 14px 0 0; padding: 0; }
legend { font-size: 0.92rem; font-weight: 600; margin-bottom: 8px; }

#category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
#category-grid label {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#category-grid input { display: none; }
#category-grid label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-pale);
  font-weight: 700;
}
#category-grid .emoji { font-size: 1.5rem; }

.btn-primary {
  margin-top: 18px;
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: "Raleway", sans-serif;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

#form-status, #suggestion-status, #comment-status { margin-top: 10px; font-weight: 600; }
.status-ok { color: var(--st-atri); }
.status-err { color: #c0392b; }

.btn-link {
  display: inline-flex;
  margin: 6px 8px 0 0;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-link:hover { background: var(--accent-dark); }

/* ==== Karte ==== */
#map { height: 62vh; min-height: 360px; border-radius: 12px; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 0.82rem; color: var(--muted); }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

/* ==== Filtri ==== */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.filters label { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* ==== Saraksts ==== */
.report-item {
  display: flex;
  gap: 12px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  align-items: center;
}
.report-item:last-of-type { border-bottom: 0; }
.report-item:hover { background: #f6faf8; }
.report-item img.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; background: var(--line); }
.report-item .no-photo { width: 64px; height: 64px; border-radius: 12px; flex: none; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.report-item .no-photo svg { width: 26px; height: 26px; stroke: var(--muted); fill: none; stroke-width: 1.6; }
.report-item .info { min-width: 0; flex: 1; }
.report-item .top-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-item .date { font-size: 0.8rem; color: var(--muted); }
.report-item .addr { font-weight: 700; font-family: "Raleway", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.report-item .meta { font-size: 0.85rem; color: var(--muted); }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
}
.pagination button.current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* ==== Detaļu skats ==== */
#detail-view .card { margin-bottom: 16px; }
#detail-view .back {
  background: none; border: 0; color: var(--accent-dark);
  font-size: 0.95rem; cursor: pointer; font-weight: 700; padding: 0 0 12px;
  font-family: "Raleway", sans-serif;
}
#detail-view h2.d-title { font-size: 1.5rem; font-weight: 800; margin: 8px 0 2px; }
#detail-view .d-city { color: var(--muted); margin-bottom: 10px; }
#detail-view .d-head-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#detail-view .d-date { color: var(--muted); font-size: 0.88rem; }

.d-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .d-grid { grid-template-columns: 1fr; } }

.fact {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-top: 10px;
}
.fact .f-ic {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-pale);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.fact .f-ic svg { width: 19px; height: 19px; stroke: var(--accent-dark); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fact b { display: block; font-size: 0.9rem; }
.fact .f-body { min-width: 0; }

/* gaita */
.steps { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.steps h3 { font-size: 1rem; margin-bottom: 14px; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step.done::before { background: var(--accent); }
.step .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 3px; position: relative; z-index: 1; background: #fff; border: 2px solid var(--line); }
.step.done .dot { background: var(--accent); border-color: var(--accent); }
.step.closed .dot { background: var(--st-sleg); border-color: var(--st-sleg); }
.step b { font-size: 0.92rem; display: block; }
.step small { color: var(--muted); font-size: 0.8rem; }

.d-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.d-photos img { max-width: 100%; width: 250px; border-radius: 12px; cursor: pointer; }

.reply {
  background: var(--accent-pale);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
}
.reply h3 { font-size: 0.98rem; margin-bottom: 6px; }

.comment { border-top: 1px solid var(--line); padding: 10px 0; }
.comment:first-of-type { border-top: 0; }
.comment .c-head { font-size: 0.85rem; color: var(--muted); }
.comment .c-head strong { color: var(--text); }

.info-box {
  background: var(--accent-pale);
  border-radius: 14px;
  padding: 16px;
  font-size: 0.92rem;
}
.info-box h3 { font-size: 0.98rem; margin-bottom: 6px; }

/* ==== Aptaujas ==== */
.poll-option { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 11px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; }
.poll-option:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); }
.poll-option input { width: auto; margin: 0; }
.poll-archived { border-top: 1px solid var(--line); padding: 12px 0; }
.poll-archived:first-child { border-top: 0; }
.poll-bar { background: var(--bg); border-radius: 8px; margin: 6px 0; overflow: hidden; position: relative; }
.poll-bar .fill { background: var(--accent); height: 30px; min-width: 2px; }
.poll-bar .cap { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px; font-size: 0.88rem; font-weight: 600; }

/* ==== Deputāti ==== */
.deputies { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.deputy { text-align: center; }
.deputy img { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; }
.deputy .name { font-weight: 700; margin-top: 6px; font-family: "Raleway", sans-serif; }
.deputy a { display: block; color: var(--accent-dark); text-decoration: none; font-size: 0.92rem; }

.link-list { list-style: none; padding: 0; }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; padding: 10px 4px; color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.link-list a:hover { background: #f6faf8; }

.participate { padding-left: 20px; }
.participate li { margin: 8px 0; }
.slogan { text-align: center; font-weight: 800; margin: 20px 0; font-family: "Raleway", sans-serif; }
.slogan a { color: var(--accent-dark); }

footer { text-align: center; padding: 12px 16px 30px; color: var(--muted); font-size: 0.85rem; }
footer .trust { margin-bottom: 6px; }
footer a { color: var(--accent-dark); }

/* pilnekrāna foto */
#lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2000;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
#lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 6px; }

/* ==== Admin (izmanto tās pašas krāsas) ==== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.b-Jauns { background: var(--st-jauns-bg); color: var(--st-jauns-tx); }
.b-Procesā { background: var(--st-proc-bg); color: var(--st-proc-tx); }
.b-Atrisināts { background: var(--st-atri-bg); color: var(--st-atri-tx); }
.b-Neaktuāli { background: var(--st-sleg-bg); color: var(--st-sleg-tx); }
