:root {
  --bg: #f3f8f4;
  --surface: #ffffff;
  --text: #12261a;
  --muted: #5d7566;
  --border: #d5e6da;
  --hover: #e8f3eb;
  --green: #1f8a4c;
  --green-dark: #146b39;
  --green-light: #4cc47f;
  --accent: #f5c542;
  --btn-text: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 80, 45, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1a11;
    --surface: #12251a;
    --text: #e7f5ec;
    --muted: #8fb09b;
    --border: #21402d;
    --hover: #183324;
    --green: #2fa962;
    --green-dark: #23874d;
    --green-light: #5fd892;
    --shadow: 0 10px 30px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Viršutinė juosta ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-badge {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #fff;
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}
.logo small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .8);
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .18); color: #fff; }
.nav a.nav-login { background: #ffffff; color: #146b39; font-weight: 700; margin-left: 6px; }
.nav a.nav-login:hover { background: #dff3e6; color: #0f5a2f; }

/* ---------- Datos laukas ---------- */
.date-wrap { position: relative; }
.date-wrap .input { padding-right: 52px; }
.date-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; border-radius: 10px;
  background: #1f8a4c; color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.date-btn:hover { background: #146b39; }
.date-btn svg { width: 18px; height: 18px; }
.date-native { position: absolute; right: 6px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Lentelė ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.table td.num { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- Turinys ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.narrow { max-width: 640px; }

/* ---------- Pagrindinis blokas ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 24px 0 8px;
}

.hero-tag {
  display: inline-block;
  background: var(--hover);
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.hero h1 span { color: var(--green); }
.hero p { color: var(--muted); font-size: 16px; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; max-width: 360px; }

/* ---------- Namo paveikslėlis ---------- */
.house {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 16 / 9;                 /* kaip nuotrauka – rodoma visa, niekas nenukerpama */
  box-shadow: 0 20px 50px rgba(20, 107, 57, .35), 0 0 0 6px var(--surface), 0 0 0 8px var(--green-light);
  transform: rotate(-1.5deg);
  transition: transform .4s ease;
}
.house:hover { transform: rotate(0deg) scale(1.02); }

.house svg, .house img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tikros nuotraukos „redagavimas“: ryškumas, kontrastas, sodrumas, lėtas priartinimas */
.house img {
  filter: saturate(1.25) contrast(1.08) brightness(1.04);
  transform-origin: left top;           /* priartinant kairysis viršutinis kampas (su logotipu) lieka vietoje */
  animation: kenburns 18s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

/* Žalias atspalvis + vinjetė */
.house::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 40, 15, .55) 100%),
    linear-gradient(180deg, rgba(76, 196, 127, .15) 0%, transparent 40%, rgba(10, 60, 30, .55) 100%);
  pointer-events: none;
}

.house-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  background: rgba(255, 255, 255, .95);
  color: #12261a;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.house-label::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green-light);
  box-shadow: 0 0 0 0 rgba(76, 196, 127, .7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 10px rgba(76, 196, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 196, 127, 0); }
}

.win { animation: flicker 6s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Mygtukai ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  background: #1f8a4c;
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 138, 76, .25);
  transition: transform .1s, background .15s, box-shadow .15s;
}
.btn:hover { background: #146b39; color: #ffffff; box-shadow: 0 6px 18px rgba(31, 138, 76, .35); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .6; cursor: wait; }

.btn-primary { background: #146b39; }
.btn-primary:hover { background: #0f5a2f; }

.contacts-img { display: block; max-width: 100%; height: auto; margin-top: 4px; }

/* ---------- Žingsniai ---------- */
.section-title { font-size: 22px; margin: 48px 0 16px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 10px;
}
.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 14px; }

.notice {
  margin-top: 24px;
  background: var(--hover);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
}

/* ---------- Kortelės / formos ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; margin-bottom: 8px; color: var(--green); }
.card p, .card li { color: var(--muted); }
.card p + p { margin-top: 8px; }
.card ul { padding-left: 20px; }
.card li + li { margin-top: 4px; }
.card ol { padding-left: 22px; }
.card a { color: var(--green); font-weight: 600; }
.card b { color: var(--text); }
.card code { background: var(--hover); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- Instrukcija ---------- */
.card h2 .step-no {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; margin-right: 6px;
  border-radius: 50%; background: #1f8a4c; color: #fff;
  font-size: 15px; vertical-align: 2px;
}
.card[id] { scroll-margin-top: 90px; }
.toc ol { columns: 2; column-gap: 24px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.tip {
  margin-top: 12px; padding: 10px 14px;
  background: var(--hover); border-left: 4px solid var(--green);
  border-radius: 8px; font-size: 14px;
}
.faq dt { font-weight: 700; color: var(--text); margin-top: 12px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { color: var(--muted); margin: 2px 0 0; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* ---------- Priminimai ---------- */
.rem-send-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #1f8a4c; }
.rem-admin { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rem-admin:last-child { border-bottom: none; }
.col-check { width: 36px; text-align: center; }
.col-check input { width: 18px; height: 18px; accent-color: #1f8a4c; cursor: pointer; vertical-align: middle; }
.table tr.row-off td { opacity: .45; }
.table tr.row-off td.col-check { opacity: 1; }
.mail-preview { margin-top: 18px; }
.mail-preview summary { cursor: pointer; color: #1f8a4c; font-weight: 600; font-size: 14px; }
.mail-preview pre {
  margin-top: 10px; padding: 14px; overflow-x: auto;
  background: var(--hover); border-radius: 10px;
  font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-wrap;
}

.page-title { font-size: 28px; font-weight: 700; margin: 16px 0 4px; }
.page-sub { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.form label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: -4px; }

.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 138, 76, .18); }
textarea.input { min-height: 120px; resize: vertical; }

.form-msg { min-height: 20px; font-size: 14px; color: var(--green); font-weight: 600; }
.form-msg.error { color: #d93636; }

.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: start; }

.hidden { display: none !important; }

/* ---------- Valdyba ---------- */
.container.wide { max-width: 1100px; }
.role-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: #dff3e6; color: #146b39; font-size: 12px; font-weight: 700; margin-left: 6px;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; border-bottom: 2px solid var(--border); }
.tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--text); }
.tab.active { color: #1f8a4c; border-bottom-color: #1f8a4c; }
.count-badge {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px;
  border-radius: 999px; background: #d93636; color: #fff; font-size: 12px; text-align: center;
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; padding: 10px 12px; }
.btn.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.btn.btn-light { background: #dff3e6; color: #146b39; }
.btn.btn-light:hover { background: #c9ebd5; color: #0f5a2f; }
.stat { color: var(--muted); font-size: 14px; }
.stat strong { color: var(--text); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.tag-ok { background: #dff3e6; color: #146b39; }
.tag-miss { background: #fde8e8; color: #b42323; }
.tag-warn { background: #fff4d6; color: #8a6100; }
.row-missing td { background: rgba(217, 54, 54, .05); }
.inline-input { width: 110px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.msg-item:last-child { border-bottom: none; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.msg-body { margin-top: 6px; white-space: pre-wrap; }
.temp-pass {
  font-family: Consolas, monospace; font-size: 18px; font-weight: 700;
  background: #fff4d6; color: #5c4100; padding: 10px 14px; border-radius: 10px; margin-top: 8px; display: inline-block;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--border);
}

/* ---------- Mobilus ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero h1 { font-size: 28px; }
  .actions { max-width: none; }
  .steps { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .house { transform: none; }
}

@media (max-width: 480px) {
  .logo small { display: none; }
  .nav a { padding: 6px 9px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .house img, .win, .house-label::before { animation: none; }
}

/* ================= Savitarna ================= */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 24px; }
.dash-tile {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  min-height: 210px; padding: 24px; border-radius: 20px; overflow: hidden;
  color: #fff; box-shadow: 0 10px 28px rgba(18, 38, 26, .14);
  transition: transform .2s, box-shadow .2s;
}
.dash-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(18, 38, 26, .24); }
.dash-tile h2 { font-size: 21px; line-height: 1.25; margin-top: 6px; }
.dash-tile p { opacity: .9; font-size: 15px; }
.dash-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: rgba(255, 255, 255, .2); font-size: 28px; }
.dash-heat { background: linear-gradient(135deg, #e5673a, #b8452a 55%, #1f8a4c 140%); }
.dash-vote { background: linear-gradient(135deg, #2a7fb8, #146b39 110%); }
.dash-forum { background: linear-gradient(135deg, #7a5bc7, #3f2f8a 110%); }
.dash-idea { background: linear-gradient(135deg, #e0a526, #a8650f 110%); }
.dash-contact { background: linear-gradient(135deg, #1f8a4c, #0f5a2f 110%); }
.dash-status { margin-top: auto; align-self: flex-start; padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .92); color: #146b39; }
.dash-status:empty { display: none; }
.dash-status.warn { color: #8a4b00; }

.section-h { font-size: 22px; margin: 32px 0 6px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.card .tip { margin-top: 10px; }

.poll-opts { display: grid; gap: 8px; margin: 14px 0 12px; }
.poll-opt {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; overflow: hidden;
}
.poll-opt.mine { border-color: #1f8a4c; }
.poll-opt input { position: relative; width: 18px; height: 18px; accent-color: #1f8a4c; flex: none; }
.poll-text { position: relative; flex: 1; color: var(--text); }
.poll-count { position: relative; font-weight: 700; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(31, 138, 76, .14); }

.card a.topic-row { font-weight: 400; color: inherit; }
.topic-row { display: flex; flex-direction: column; gap: 2px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.topic-row:last-child { border-bottom: none; }
.topic-row:hover .topic-title { color: #1f8a4c; }
.topic-title { font-weight: 700; color: var(--text); font-size: 16px; }
.back-link { color: #1f8a4c; font-weight: 600; }
.post-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.post .pre { color: var(--text); }
.post-admin { border-left: 4px solid #1f8a4c; }
.post-mine { background: rgba(31, 138, 76, .05); }
.answer { margin-top: 10px; padding: 10px 12px; border-left: 4px solid #1f8a4c; background: rgba(31, 138, 76, .06); border-radius: 8px; color: var(--text); }
.msg-item.row-off { opacity: .5; }
.mail-progress { display: block; width: 100%; height: 12px; margin-top: 10px; accent-color: #1f8a4c; }
