/* DESIDUS Sąskaitos ir sandėlis — sąsaja.
   Principai: vienas pagrindinis veiksmas puslapyje; sąraše tik tai, ko reikia sprendimui; detalės — paspaudus.
   Spalvos: navy tekstas ir veiksmai, mėlyna — pasirinkimas, popierius — fonas, baltas — darbo paviršius. */

:root {
  --navy: #2b2e46;
  --navy-2: #3b3f5f;
  --blue: #7b97cc;
  --blue-soft: #eaf0fa;
  --paper: #f6f3ec;
  --surface: #ffffff;
  --line: #e6e2d8;
  --line-soft: #efece5;
  --text: #2b2e46;
  --muted: #7c7f8e;
  --ok: #3f7a4a;   --ok-bg: #e9f2e6;
  --warn: #9a6a12; --warn-bg: #fbf1dc; --attn: #c58a1f;
  --bad: #b0412e;  --bad-bg: #fbeae6;
  --radius: 14px;
  --side-w: 232px;
  --st-ok: var(--ok); --st-check: var(--attn); --st-new: var(--blue); --st-skip: #cfd0d6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 15px/1.55 Poppins, system-ui, sans-serif; }
h1, h2, h3 { font-family: Lora, Georgia, serif; font-weight: 500; letter-spacing: -.005em; margin: 0; color: var(--navy); }
h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 20px; line-height: 1.3; margin-bottom: 12px; }
h3 { font-size: 17px; margin-bottom: 10px; }
p { margin: 0 0 10px; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #000; }
small { font-size: 13px; }
b, strong { font-weight: 500; }
.muted, .meta { color: var(--muted); }
.meta { font-size: 13px; margin: 12px 0 0; }
.r { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt { margin-top: 14px; }
.warn-text { color: var(--warn); }
.empty, .empty-hint { color: var(--muted); }
.empty { text-align: center; padding: 36px 16px; }
.ico { vertical-align: -4px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Karkasas ---------- */
main { padding: 36px 40px 80px; }
body.with-side main { margin-left: var(--side-w); }
body.with-side main > * { max-width: 1100px; }
body.no-side main { max-width: 480px; margin: 0 auto; padding-top: 48px; }

.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--navy); color: #d8dbe6; display: flex; flex-direction: column; z-index: 20; }
.side-logo { display: block; padding: 26px 26px 22px; }
.side-logo img { height: 40px; display: block; }
.side nav { flex: 1; overflow-y: auto; padding: 4px 14px; display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9cddc; text-decoration: none; font-size: 14.5px; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(123,151,204,.2); color: #fff; }
.side-label { height: 1px; background: rgba(255,255,255,.08); margin: 14px 12px; font-size: 0; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 500; flex: none; }
.side-user .who { flex: 1; min-width: 0; line-height: 1.25; }
.side-user .who b { display: block; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: #9ea4bb; font-size: 12px; }
.side-user a { color: #9ea4bb; padding: 7px; border-radius: 8px; display: flex; }
.side-user a:hover { color: #fff; background: rgba(255,255,255,.08); }
.mobilebar, .side-shade { display: none; }
.topbar { background: var(--navy); padding: 16px 24px; }
.topbar .brand { display: flex; align-items: center; gap: 14px; color: #c9cddc; font-size: 14px; }
.topbar img { height: 34px; display: block; }

/* ---------- Puslapio antraštė: pavadinimas + vienas pagrindinis veiksmas ---------- */
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.row-between h1, .row-between h2 { margin: 0; }
.row-between .actions { margin: 0; }
h1 + .meta, .page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.hello { font-size: 36px; }
.lead { color: var(--muted); margin: 6px 0 28px; font-size: 16px; }

/* ---------- Mygtukai ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px/1 Poppins, system-ui, sans-serif;
  padding: 11px 18px; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--navy);
  text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { border-color: #cfcabd; background: #fbfaf7; color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { background: rgba(43,46,70,.05); color: var(--navy); }
.btn.big { min-height: 48px; padding: 13px 22px; font-size: 15px; }
.btn .ico { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.linkish { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13.5px; color: var(--navy); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: #b9bccb; cursor: pointer; }
.linkish:hover { text-decoration-color: var(--navy); }

/* „Daugiau“ — antraeiliai veiksmai */
details.more { position: relative; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(43,46,70,.12); }
details.more .menu a, details.more .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  color: var(--navy); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
details.more .menu a:hover, details.more .menu button:hover { background: var(--paper); }
details.more .menu .danger { color: var(--bad); }

/* ---------- Formos ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea { width: 100%; font: 400 15px Poppins, system-ui, sans-serif; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
input:hover, select:hover { border-color: #d6d1c4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(123,151,204,.25); }
input::placeholder { color: #a9abb7; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy); margin: 0; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.fields .wide { grid-column: 1 / -1; }
.fields-4 { grid-template-columns: repeat(4, 1fr); }
.missing input, .missing select { border-color: #e7c27c; background: #fffbf2; }
input.unknown { border-color: #e7c27c; }
.hint-bad { color: var(--bad); font-size: 13px; margin: 6px 0 0; }
.inline-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.inline-row input { flex: 1; }
.code-input { font-size: 26px; letter-spacing: 8px; text-align: center; max-width: 220px; }
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- Paviršiai ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Pranešimai */
.alert { border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.alert::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.ok::before { background: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.warn::before { background: var(--attn); }
.alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.bad::before { background: var(--bad); }
.alert a { color: inherit; }
main > .alert { max-width: 1100px; }

/* Būsenos žyma: taškas + žodis */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c3c5cd; }
.pill.ok { color: var(--ok); } .pill.ok::before { background: var(--ok); }
.pill.wait { color: var(--warn); } .pill.wait::before { background: var(--attn); }
.pill.info { color: var(--navy); } .pill.info::before { background: var(--blue); }
a.pill { text-decoration: none; } a.pill:hover { text-decoration: underline; }

/* Skaičiai */
.stats { display: flex; gap: 0; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.stat { flex: 1 1 160px; padding: 16px 20px; border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat small { color: var(--muted); }
.stat-bad b { color: var(--bad); }

/* Juostelė (biudžeto panaudojimas) */
.bar { height: 6px; background: #ece9e1; border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.bar.near span { background: var(--attn); } .bar.over span { background: var(--bad); }
.bar.thin { height: 4px; margin-bottom: 8px; }
.grow { display: flex; justify-content: space-between; padding: 8px 0 6px; font-size: 14px; }
.mini { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.mini .bar { flex: 1; }

/* ---------- Lentelės: ramios, be rėmelių kiekvienam langeliui ---------- */
.scroll-x { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th { text-align: left; font-weight: 400; font-size: 13px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: #fcfbf8; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #faf9f5; }
tr.inactive td { color: var(--muted); }
td.neg { color: var(--bad); } td.pos { color: var(--ok); }
td .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
td a { text-decoration: none; } td a:hover { text-decoration: underline; }
.cell-strong { font-weight: 500; }

/* Sąrašo eilutės (pradžia, projektai, žurnalas) */
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { color: #000; }
a.list-row:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pradžia: ką reikia padaryti ---------- */
.todo { list-style: none; margin: 0 0 28px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.todo li + li { border-top: 1px solid var(--line-soft); }
.todo a { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; padding: 16px 22px; text-decoration: none; color: var(--text); }
.todo a:hover { background: #fbfaf7; }
.todo .n { font-family: Lora, Georgia, serif; font-size: 34px; line-height: 1; color: var(--navy); text-align: right; font-variant-numeric: lining-nums; }
.todo .n.bad { color: var(--bad); } .todo .n.attn { color: var(--attn); }
.todo .what b { display: block; font-size: 16px; }
.todo .what small { color: var(--muted); }
.todo .go { color: var(--muted); }
.todo-done { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 28px; color: var(--ok); display: flex; gap: 12px; align-items: center; }
.quicklinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: 14px; color: var(--muted); }

/* ---------- Skirtukai, filtrai ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; }
.tabs a { padding: 10px 0; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 500; }
.tabs a .count { color: var(--muted); font-weight: 400; margin-left: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search], .filters input[name=q] { flex: 1 1 320px; width: auto; padding-left: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237c7f8e' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
.filters select { width: auto; flex: 0 1 220px; }
.filters .meta { margin: 0; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Sąskaitų sąrašas ir įkėlimas ---------- */
.upload { margin-bottom: 28px; }
.drop { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1.5px dashed #cfc9ba; border-radius: var(--radius);
  padding: 22px 24px; cursor: pointer; transition: border-color .15s, background .15s; margin: 0; color: var(--text); font-size: 15px; }
.drop:hover, .drop.over { border-color: var(--blue); background: #fbfcfe; }
.drop-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-soft); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.drop b { display: block; font-size: 16px; }
.drop span { color: var(--muted); font-size: 14px; }
.drop small { display: none; }
.upload-buttons { display: none; gap: 8px; }
.progress-list { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.progress-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.progress-row:first-child { border-top: 0; }
.progress-row .p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-row .p-state { color: var(--muted); text-align: right; }
.progress-row[data-kind="bad"] .p-state { color: var(--bad); }
.progress-row[data-kind="ok"] .p-state a { font-weight: 500; }

/* ---------- Sąskaitos peržiūra ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.review iframe { width: 100%; height: calc(100vh - 170px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: sticky; top: 20px; }
.doc-image { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 170px); position: sticky; top: 20px; }
.doc-image img { display: block; width: 100%; height: auto; }
.review .panel .alert { margin-bottom: 8px; }
details.extra-fields { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.extra-fields > summary { cursor: pointer; color: var(--muted); font-size: 14px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.extra-fields > summary::before { content: "+"; display: inline-block; width: 14px; }
details.extra-fields[open] > summary::before { content: "−"; }
details.extra-fields .fields { margin-top: 14px; }
.found-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: 2px; }
.pay-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 16px 20px; }
.pay-box input[type=date] { width: auto; }

/* ---------- Sąskaitos prekės: lapeliai ---------- */
.lines-panel { margin-top: 24px; }
.slip-tools { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 14px 20px; align-items: end; margin: 18px 0 16px; }
.slip-tools .tool label { margin-bottom: 6px; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-row select { flex: 1 1 220px; width: auto; }
.found-project { display: block; margin-top: 6px; color: var(--ok); font-size: 13px; }
.legend { display: none; }
.legend-reread { list-style: none; }
.slips { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.slip { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--st-skip); }
.slip:first-child { border-top: 0; }
.slip[data-state="atsiminta"], .slip[data-state="pasirinkta"], .slip[data-state="rankinė"] { box-shadow: inset 4px 0 0 var(--st-ok); }
.slip[data-state="panaši"] { box-shadow: inset 4px 0 0 var(--st-check); }
.slip[data-state="nauja"] { box-shadow: inset 4px 0 0 var(--st-new); }
.slip.skip { background: #fbfbfa; }
.slip.skip .z-match, .slip.skip .alloc { opacity: .4; }
.slip.done { background: #fbfcfa; box-shadow: inset 4px 0 0 #b9d0b2; }
.z { padding: 18px 20px; min-width: 0; }
.z + .z { border-left: 1px solid var(--line-soft); }
.zl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.z-invoice { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-left: 22px; }
.slip-nr { font-family: Lora, Georgia, serif; font-size: 17px; color: #a6a8b4; line-height: 1.35; }
.slip .desc { margin: 0; font-size: 15px; line-height: 1.45; }
.slip .desc .tag { font-size: 12.5px; color: var(--warn); }
.slip .z-invoice small.muted { display: none; }
.slip .calc { margin: 8px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.slip .calc b { color: var(--text); }
.calc-edit { display: grid; grid-template-columns: minmax(58px, 78px) minmax(72px, 92px) minmax(80px, 108px) minmax(80px, 1fr); gap: 8px; margin-top: 12px; align-items: end; }
.mini-field { margin: 0; }
.mini-field span, .calc-edit .sum span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.mini-field input, .mini-field select { padding: 8px 9px; min-height: 40px; font-size: 14.5px; }
.calc-edit .sum { text-align: right; padding-bottom: 9px; }
.calc-edit .sum b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-state { font-size: 13px; color: var(--muted); margin-top: 8px; }
.slip[data-state="panaši"] .m-state { color: var(--warn); }
.slip[data-state="atsiminta"] .m-state { color: var(--ok); }
.m-state.unit-warn { color: var(--bad) !important; }
.z-match .p-new { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.slip.skip .p-new { display: none; }
.new-product { display: grid; gap: 8px; margin-top: 10px; }
.z-dist .alloc-row { display: grid; grid-template-columns: 1fr 76px 32px; gap: 6px; margin-bottom: 6px; align-items: center; }
.z-dist .a-del { width: 32px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.z-dist .a-del:hover { background: var(--bad-bg); color: var(--bad); }
.z-dist .a-add { font-size: 13px; }
.alloc-rest { font-size: 14px; margin: 8px 0 0; color: var(--navy); font-weight: 500; }
.alloc-rest.all-stock { color: var(--muted); font-weight: 400; }
.alloc-rest.bad { color: var(--bad); }
.slip-flags { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.slip-flags .check { font-size: 13.5px; color: var(--muted); }
.alloc-done { font-size: 14px; margin-top: 6px; color: var(--navy); }

/* Apatinė juosta */
.ledger { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 16px 0 0; padding: 14px 16px 14px 22px; background: var(--navy); color: #d9dcea; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(43,46,70,.22); }
.ledger-sum { margin: 0; font-size: 15px; }
.ledger-sum b { color: #fff; }
.ledger-warn { display: block; color: #f1cf8c; font-size: 13px; }
.ledger.has-bad .ledger-warn { color: #ffb5a7; }
.ledger-actions { display: flex; gap: 8px; }
.ledger .btn.primary { background: var(--paper); border-color: var(--paper); color: var(--navy); }
.ledger .btn.primary:hover { background: #fff; }

/* ---------- Sandėlio dokumento forma ---------- */
table.lines td { padding: 8px 10px; vertical-align: top; }
.p-note { font-size: 12.5px; color: var(--blue); }

/* ---------- Mokėjimai ---------- */
table.pay tr.late td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
table.pay td.iban { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
table.pay form.inline-row { margin: 0; justify-content: flex-end; }
table.pay input[type=date] { width: 150px; flex: none; }

/* ---------- Projektai ---------- */
.dup-group { margin-bottom: 16px; }
.facts { display: flex; gap: 32px; flex-wrap: wrap; margin: 6px 0 18px; }
.facts small { display: block; color: var(--muted); }
.report { max-width: 900px; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--navy); color: #fff; padding: 22px 26px;
  border-radius: var(--radius); margin-bottom: 20px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-head h1 { color: #fff; margin: 4px 0; }
.report-head .meta { color: #c4cbe0; margin: 0; }
.report-kicker { font-size: 14px; color: #a9badd; }
.report-logo { height: 34px; }
.report h2 { margin-top: 26px; }

/* ---------- Prisijungimas ---------- */
.steps { padding-left: 20px; } .steps li { margin-bottom: 8px; }
.secret { font-size: 20px; letter-spacing: 1px; background: var(--paper); padding: 10px 12px; border-radius: 10px; margin: 8px 0; user-select: all; word-break: break-all; font-variant-numeric: tabular-nums; }

/* ---------- Spausdinimas ---------- */
.sign { display: none; }
@media print {
  .side, .mobilebar, .noprint, .quick, .filters, .actions, .alert, .ledger, .slip-tools, .upload { display: none !important; }
  body { background: #fff; } body.with-side main { margin: 0; padding: 0; }
  table { border: 0; } .sign { display: flex; gap: 60px; margin-top: 50px; }
  .sign div { border-top: 1px solid #333; padding-top: 4px; width: 220px; font-size: 11px; }
  input.count { border: 0; border-bottom: 1px solid #999; border-radius: 0; }
  .report .stat, .report .bar, .report .bar span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}

/* ---------- Mažesni ekranai ---------- */
.unit-m { display: none; }
@media (max-width: 1100px) {
  .slip { grid-template-columns: 1fr 1fr; }
  .z-invoice { grid-column: 1 / -1; border-bottom: 1px solid var(--line-soft); }
  .z-match { border-left: 0 !important; }
}
@media (max-width: 900px) {
  body.with-side main { margin-left: 0; padding: 84px 18px 48px; }
  .mobilebar { display: flex; position: fixed; inset: 0 0 auto 0; height: 60px; background: var(--navy); align-items: center; gap: 12px; padding: 0 12px; z-index: 15; }
  .mobilebar img { height: 30px; }
  .menu-btn { background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; display: flex; }
  .side { transform: translateX(-100%); transition: transform .2s; }
  body.side-open .side { transform: none; }
  body.side-open .side-shade { display: block; position: fixed; inset: 0; background: rgba(20,22,35,.4); z-index: 18; }
  .review, .two, .fields-4 { grid-template-columns: 1fr; }
  .review iframe, .doc-image { position: static; height: 56vh; min-height: 0; }
  h1 { font-size: 27px; } .hello { font-size: 30px; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  input, select, .btn { min-height: 46px; font-size: 16px; }
  .panel { padding: 18px; }
  .fields { grid-template-columns: 1fr; }
  .row-between { align-items: stretch; flex-direction: column; }
  .row-between .actions { justify-content: stretch; } .row-between .actions .btn { flex: 1; }
  .slip-tools { grid-template-columns: 1fr; }
  .slip { grid-template-columns: 1fr; }
  .z + .z { border-left: 0; border-top: 1px solid var(--line-soft); }
  .calc-edit { grid-template-columns: 1fr 1fr 1fr; }
  .calc-edit .sum { grid-column: 1 / -1; display: flex; justify-content: space-between; padding: 6px 0 0; }
  .ledger { bottom: 0; margin: 16px -18px 0; border-radius: 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .ledger-actions, .ledger .btn.primary { width: 100%; }
  .drop { display: none; }
  .upload-buttons { display: flex; flex-direction: column; }
  .upload-buttons .btn { width: 100%; min-height: 56px; font-size: 16px; }
  .todo a { grid-template-columns: 52px 1fr auto; padding: 14px 16px; gap: 12px; }
  .todo .n { font-size: 28px; }
  .stat { flex: 1 1 50%; } .stat:nth-child(odd) { border-left: 0; }
  .filters select { flex: 1 1 100%; }
  /* Lentelės telefone — sąrašas */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 2px 0; text-align: left; display: flex; justify-content: space-between; gap: 12px; }
  table.stack td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 14px; }
  table.stack td.lead-cell { display: block; font-size: 16px; padding-bottom: 4px; }
  table.stack td.hide-m, table.stack td:empty { display: none; }
  table.stack tfoot, table.stack tfoot tr { display: flex; justify-content: space-between; width: 100%; }
  table.stack tfoot td { border: 0; background: none; padding: 12px 16px; }
  .unit-m { display: inline; color: var(--muted); }
  table.stack td.unit-d { display: none; }
  table.pay form.inline-row { width: 100%; } table.pay input[type=date] { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
@media (max-width: 700px) {
  .quicklinks { display: grid; grid-template-columns: 1fr 1fr; }
  .quicklinks .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .quicklinks .btn.primary { grid-column: 1 / -1; }
}

/* Dialogas (naujas projektas) */
dialog.dlg { border: 0; border-radius: 16px; padding: 26px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(43,46,70,.25); color: var(--text); }
dialog.dlg::backdrop { background: rgba(20,22,35,.45); }
dialog.dlg h2 { margin-bottom: 18px; }
