/* Lamida Papildymas — dense, table-first operations UI */
:root {
  --bg: #f5f6f8; --panel: #fff; --line: #d9dde3; --text: #1c2430;
  --muted: #6b7686;
  /* Lamida brand: logo turquoise + charcoal; teal darkened for text/buttons */
  --brand: #2bb7c5; --ink: #383e44;
  --accent: #117c89; --accent-dark: #0c5f6a;
  --ok-bg: #eef7ee; --ok-line: #bcd9bc;
  --err-bg: #fcecec; --err-line: #e3b3b3;
  --warn: #a96b00;
  --navh: 46px;   /* fixed top bar; frozen-table offsets depend on this */
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-top: var(--navh);
}
/* Both bars are FIXED: visible at all times, immune to horizontal scroll.
   Brand look: white top bar with the Lamida logo, charcoal second bar,
   turquoise accents (logo colours). */
header {
  display: flex; align-items: center; gap: 1.3rem;
  background: #fff; color: var(--ink); padding: 0 1rem;
  /* above .subnav (60) so the dropdown panel wins hover hit-testing in the
     band where it overlaps the second bar */
  position: fixed; top: 0; left: 0; right: 0; height: var(--navh); z-index: 65;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: baseline; gap: .55rem; white-space: nowrap;
  text-decoration: none; color: var(--ink);
}
.brand img { height: 24px; width: auto; align-self: center; display: block; }
.brand span {
  font-size: 13px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em;
}
nav { display: flex; flex-wrap: nowrap; height: 100%; }
nav a {
  color: #4a525a; text-decoration: none; padding: 0 .6rem; font-size: 13.5px;
  border-bottom: 3px solid transparent; display: flex; align-items: center;
  white-space: nowrap; font-weight: 500;
}
nav a:hover { color: var(--accent-dark); }
nav a.active { color: var(--accent-dark); border-bottom-color: var(--brand); }

/* Top-bar dropdown (Užklausų/užsakymų valdymas) — opens on hover/focus */
nav .dropdown { position: relative; display: flex; height: 100%; outline: none; }
nav .dropdown .parent {
  color: #4a525a; padding: 0 .6rem; font-size: 13.5px; font-weight: 500;
  border-bottom: 3px solid transparent; display: flex; align-items: center;
  white-space: nowrap; cursor: default;
}
nav .dropdown:hover .parent, nav .dropdown:focus-within .parent { color: var(--accent-dark); }
nav .dropdown .parent.active { color: var(--accent-dark); border-bottom-color: var(--brand); }
nav .dropdown .dd {
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brand);
  border-radius: 0 0 6px 6px; box-shadow: 0 8px 18px rgba(20, 40, 50, .12);
  padding: .25rem 0; z-index: 70;
  /* hidden via visibility (not display) with a close delay, so the mouse can
     cross the header border gap without the menu vanishing */
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .12s ease, visibility 0s linear .35s;
}
nav .dropdown .dd::before {
  /* invisible bridge over the gap between the bar and the panel */
  content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px;
}
nav .dropdown:hover .dd, nav .dropdown:focus-within .dd,
nav .dropdown.open .dd {
  visibility: visible; opacity: 1; pointer-events: auto;
  transition-delay: 0s, 0s;
}
nav .dd a {
  display: block; padding: .5rem .95rem; height: auto; border-bottom: none;
  color: #3c444c; font-size: 13.5px;
}
nav .dd a:hover { background: #eaf6f7; color: var(--accent-dark); }
nav .dd a.active { color: var(--accent-dark); font-weight: 700; }

/* quick search + logged-in user in the top bar */
.qsearch { margin-left: auto; }
.qsearch input {
  width: 13rem; padding: .25rem .55rem; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 12px; background: #f5f7f8;
}
.qsearch input:focus { background: #fff; outline: 1px solid var(--brand); }
.uinfo { font-size: 12px; color: var(--muted); white-space: nowrap; }
.uinfo a { color: var(--accent); text-decoration: none; }

/* login page */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding-top: 0;
}
.login-box {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 2rem 2.4rem; width: 21rem; text-align: center;
  box-shadow: 0 10px 30px rgba(20, 40, 50, .08);
}
.login-box img { height: 40px; margin-bottom: .6rem; }
.login-box h1 { font-size: 17px; margin: 0 0 1rem; color: var(--ink); }
.login-box .paramform { text-align: left; }
main { max-width: 1280px; margin: 0 auto; padding: 1rem 1.2rem 3rem; }
h1 { font-size: 20px; margin: .4rem 0 .8rem; }
h2 { font-size: 16px; margin: 1.4rem 0 .5rem; }
.muted { color: var(--muted); font-weight: normal; }

.box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: .8rem 1rem; margin: .8rem 0;
}
.box.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.box.error { background: var(--err-bg); border-color: var(--err-line); }
.hint { color: var(--muted); font-size: 13px; margin-top: .3rem; }
.hint-inline { font-size: 13px; margin-left: .6rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; margin: 1rem 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem;
}
.card h3 { margin: 0; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.card.seed { border-color: #c9b88a; background: #fdfaf2; }
.card input[type=file] { font-size: 13px; }
button {
  background: var(--accent); border: none; color: #fff; border-radius: 4px;
  padding: .45rem .9rem; font-size: 14px; cursor: pointer; align-self: start;
}
button:hover { background: var(--accent-dark); }

table.grid { border-collapse: collapse; width: 100%; background: var(--panel); }
table.grid th, table.grid td {
  border: 1px solid var(--line); padding: .28rem .5rem; text-align: left;
  font-size: 13px; vertical-align: top;
}
table.grid th { background: #eaeef3; font-weight: 600; white-space: nowrap; }
th .unit {
  display: block; font-weight: 400; font-size: 10.5px; color: var(--muted);
  margin-top: .05rem; letter-spacing: .01em;
}
table.grid tr.dim td { color: #98a1ae; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.num.warn { color: var(--warn); font-weight: 600; }
td.num.neg { color: #b32424; font-weight: 700; }
td.mono { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
td.trunc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.kv { margin-top: .5rem; border-collapse: collapse; }
table.kv td { padding: .15rem .8rem .15rem 0; font-size: 13.5px; vertical-align: top; }
table.kv td:first-child { color: var(--muted); white-space: nowrap; }
table.kv.kv3 { width: 100%; }
/* long labels (e.g. „Žaliavos fondas — vietoje…“) wrap instead of pushing
   the nowrap value columns out of the clipped box */
table.kv.kv3 td:first-child { white-space: normal; }
table.kv.kv3 td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.kv.kv3 tr.kv-head td {
  font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line);
  padding-bottom: .2rem; letter-spacing: .02em;
}

.filters { display: flex; gap: .5rem; align-items: center; margin: .6rem 0 .9rem; }
.filters input[type=search] {
  flex: 0 1 360px; padding: .4rem .6rem; border: 1px solid var(--line);
  border-radius: 4px; font-size: 14px;
}
.filters select { padding: .38rem .4rem; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; }

.warnings { margin: .4rem 0 0; padding-left: 1.2rem; font-size: 13px; }
.warnings li { margin: .15rem 0; }
details summary { cursor: pointer; margin-top: .5rem; color: var(--accent); }

.stats { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: .7rem 1rem; min-width: 130px;
}
.stat .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: .15rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin: .8rem 0; }
.pager a { color: var(--accent); text-decoration: none; }

/* Product-type quick filters (Pildom?=TAIP buckets) */
.tipai { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0 .9rem; }
a.tipas {
  display: inline-block; padding: .4rem .8rem; border-radius: 5px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); text-decoration: none; font-size: 13.5px;
}
a.tipas strong { margin-left: .3rem; }
a.tipas:hover { border-color: var(--accent); }
a.tipas.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
a.tipas.t-g { border-left: 4px solid #2e7d32; }
a.tipas.t-p { border-left: 4px solid #0b5fa5; }
a.tipas.t-m { border-left: 4px solid #a96b00; }
a.tipas.t-n { border-left: 4px solid #9aa3af; color: var(--muted); }

/* Zone colour quick-filters (DEGA / REIKIA / OK) */
a.tipas.z-em { background: #fbe3e3; border-color: #e3b3b3; color: #9b1c1c; }
a.tipas.z-dn { background: #fdf3d7; border-color: #e6d49a; color: #8a6100; }
a.tipas.z-ok { background: #e8f3e8; border-color: #bcd9bc; color: #2e7d32; }
a.tipas.z-em.active { box-shadow: inset 0 0 0 2px #9b1c1c; }
a.tipas.z-dn.active { box-shadow: inset 0 0 0 2px #8a6100; }
a.tipas.z-ok.active { box-shadow: inset 0 0 0 2px #2e7d32; }

/* Live filter row in table header */
tr.filterrow th { background: #f3f6f9; padding: .2rem .3rem; }
tr.filterrow input, tr.filterrow select {
  width: 100%; min-width: 3.2rem; padding: .25rem .35rem; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 3px; background: #fff;
}
tr.filterrow input.narrow { min-width: 2.6rem; }

/* Dashboard type row */
.stats.tipuose .stat { border-left-width: 4px; border-left-style: solid; }
.stat.t-g { border-left-color: #2e7d32; }
.stat.t-p { border-left-color: #0b5fa5; }
.stat.t-m { border-left-color: #a96b00; }
.stat.t-n { border-left-color: #9aa3af; }
a.statlink { text-decoration: none; color: inherit; display: block; }
a.statlink:hover .stat { border-color: var(--accent); }

/* Engine table */
table.grid.dense th, table.grid.dense td { padding: .22rem .4rem; font-size: 12.5px; }

/* Zebra striping (zone colours and edit cells win) */
table.frozen tbody tr:nth-child(even):not(.zone-em):not(.zone-dn) td:not(.editcell) {
  background: #f1f4f8;
}
tr.zone-em td { background: #fbe3e3; }
tr.zone-dn td { background: #fdf3d7; }
/* zebra inside zone colours: every second red/yellow row a shade darker */
table.frozen tbody tr:nth-child(even).zone-em td { background: #f5d2d2; }
table.frozen tbody tr:nth-child(even).zone-dn td { background: #f6e7bd; }

/* Excel-style freeze panes: sticky header rows + sticky left columns.
   Frozen cells carry .fz + a position class; offsets assume the fixed
   widths below. Tables with a leading checkbox column add .hascb. */
table.frozen thead tr:first-child th {
  position: sticky; top: var(--navh);
  z-index: 5; height: 46px; box-sizing: border-box;
}
table.frozen thead tr.filterrow th {
  position: sticky; top: calc(var(--navh) + 46px); z-index: 5;
}
table.frozen .fz { position: sticky; z-index: 2; }
table.frozen thead .fz { z-index: 6; }

table.frozen .fz-cb    { left: 0;     min-width: 34px;  max-width: 34px; }
table.frozen .fz-kodas { left: 0;     min-width: 84px;  max-width: 84px; }
table.frozen .fz-grupe { left: 84px;  min-width: 200px; max-width: 200px; }
table.frozen .fz-art   { left: 284px; min-width: 116px; max-width: 116px; }
table.frozen .fz-nomen { left: 284px; min-width: 300px; max-width: 300px; }
table.frozen.haskodas-art .fz-nomen { left: 400px; }     /* po Artikulo (Prekės) */
table.frozen.hascb .fz-kodas { left: 34px; }
table.frozen.hascb .fz-grupe { left: 118px; }
table.frozen.hascb .fz-art   { left: 318px; }
table.frozen.hascb .fz-nomen { left: 318px; }
table.frozen.hascb.haskodas-art .fz-nomen { left: 434px; }
table.frozen.nogrupe .fz-nomen { left: 84px; }            /* Išmuitinti: be grupės */
table.frozen.nogrupe.hascb .fz-nomen { left: 118px; }

/* Frozen body cells need opaque backgrounds per row state */
table.frozen tbody td.fz { background: #fff; }
table.frozen tbody tr:nth-child(even):not(.zone-em):not(.zone-dn) td.fz { background: #f1f4f8; }
table.frozen tbody tr.zone-em td.fz { background: #fbe3e3; }
table.frozen tbody tr.zone-dn td.fz { background: #fdf3d7; }
table.frozen tbody tr:nth-child(even).zone-em td.fz { background: #f5d2d2; }
table.frozen tbody tr:nth-child(even).zone-dn td.fz { background: #f6e7bd; }
td.veiksmas { white-space: nowrap; font-weight: 600; }
td.strong, .num.strong { font-weight: 700; }
.filters.wrap { flex-wrap: wrap; }
.filters .mid { flex: 0 1 220px; padding: .38rem .5rem; border: 1px solid var(--line); border-radius: 4px; font-size: 13.5px; }
label.chk { display: flex; gap: .3rem; align-items: center; font-size: 13.5px; }

/* Product detail */
h1 .plain { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 600; }
.preke-grupe {
  font-size: 17px; font-weight: 700; color: var(--accent-dark);
  margin: .5rem 0 .15rem; letter-spacing: .01em;
}
h1.preke-name { font-size: 24px; margin: 0 0 .25rem; }
.preke-kodas { font-size: 15px; margin: 0 0 .9rem; }
.preke-kodas .mono {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 650;
  font-size: 16px;
}
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .8rem; }
.cols .box h3 { margin: .2rem 0 .4rem; font-size: 14px; }
svg.spark { width: 100%; height: 60px; background: #f3f6f9; border: 1px solid var(--line); border-radius: 4px; }
svg.spark rect { fill: var(--accent); }
table.grid.mini { margin-top: .6rem; width: auto; min-width: 180px; }
.zone { font-size: 11px; padding: .1rem .4rem; border-radius: 3px; margin-left: .4rem; font-weight: 700; }
.z-EMERGENCY { background: #fbe3e3; color: #9b1c1c; }
.z-DANGER { background: #fdf3d7; color: #8a6100; }
.z-OK { background: #e8f3e8; color: #2e7d32; }

td.trunc.grupe { max-width: 190px; color: var(--muted); }

/* Sales-history pivots on the product card */
details > summary { padding: .35rem .2rem; font-size: 13.5px; }
table.grid.indent { margin: .2rem 0 .6rem 1.2rem; width: calc(100% - 1.2rem); }

/* Inline editing (Prekės) */
td.editcell { background: #fdfaf2; padding: .12rem .2rem !important; }
td.editcell input:not([type=checkbox]), td.editcell select {
  width: 100%; min-width: 2.8rem; border: 1px solid #e3dcc8; border-radius: 3px;
  padding: .18rem .3rem; font-size: 12.5px; background: #fff;
}
td.editcell input.narrow { max-width: 5.5rem; }
@keyframes flash-ok { 0% { background: #b7e0b7; } 100% { background: #fff; } }
@keyframes flash-err { 0% { background: #f3b9b9; } 50% { background: #f3b9b9; } 100% { background: #fff; } }
.saved { animation: flash-ok 1.2s ease-out; }
.errflash { animation: flash-err 2s ease-out; border-color: #c33 !important; }
.bulkbar {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: .45rem .8rem; margin: 0 0 .7rem; font-size: 13.5px;
}
.bulkbar input { padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 3px; }
button.mini { padding: .25rem .6rem; font-size: 12.5px; }
button.mini.danger, button.danger { background: #a33; }
form.inline { display: inline; }
.grupe-row td {
  background: #d9edf1; font-weight: 600; font-size: 12.5px;
  border-top: 2px solid #9fc6cd;
}
.kgsub { display: block; font-size: 10.5px; color: #777; font-weight: 400; }

/* Inquiry lines already turned into orders: full vs partial coverage */
tr.uzs-full td { background: #cfe9cf; }
tr.uzs-dalis td { background: #e9f5e9; }
.swatch {
  display: inline-block; width: 14px; height: 12px; border-radius: 3px;
  vertical-align: -1px; border: 1px solid #b8d4b8;
}
.swatch.uzs-full-sw { background: #cfe9cf; }
.swatch.uzs-dalis-sw { background: #e9f5e9; }

/* Status row colours for the inquiry / order / production lists.
   One palette everywhere: yellow=ruošiama, blue=vyksta, violet=perduota,
   green=baigta. Legend chips reuse the same classes. */
tr.st-y td { background: #fdf3d7; }
tr.st-b td { background: #e2edf8; }
tr.st-v td { background: #ece5f6; }
tr.st-g td { background: #e6f3e6; }
tr.st-r td { background: #fbe0e0; }
.stchip.st-r { background: #fbe0e0; }
.stdot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15); vertical-align: -1px;
}
.stdot.st-g { background: #5bb85b; }
.stdot.st-y { background: #e8b800; }
.stdot.st-r { background: #d9534f; }
.stchip {
  display: inline-block; width: 14px; height: 12px; border-radius: 3px;
  vertical-align: -1px; border: 1px solid rgba(0, 0, 0, .12);
}
.stchip.st-y { background: #fdf3d7; }
.stchip.st-b { background: #e2edf8; }
.stchip.st-v { background: #ece5f6; }
.stchip.st-g { background: #e6f3e6; }
.stlegend { margin: .2rem 0 .6rem; font-size: 13px; color: var(--muted); }

/* Transport tags on kanban cards */
.ttag {
  margin-top: .3rem; font-size: 12px; border-radius: 4px; padding: .2rem .45rem;
}
.ttag.t-need { background: #fdf3d7; border: 1px solid #e8d9a0; }
.ttag.t-ok { background: #e6f3e6; border: 1px solid #c4dfc4; }
.ttag summary { cursor: pointer; font-weight: 600; color: #7a5d00; margin: 0; }
.ttag.t-ok summary { color: #2e6b2e; }
.tform { display: grid; gap: .3rem; margin-top: .4rem; font-size: 12px; }
.tform input { padding: .2rem .35rem; border: 1px solid var(--line); border-radius: 3px; }
.mailink { text-decoration: none; color: var(--accent); white-space: nowrap; }
.mailink:hover { color: var(--accent-dark); }

/* comment marker on quote prices */
.cmnt { cursor: help; font-size: 11px; margin-left: .15rem; }

/* dedicated supplier under the product name (Reikia užsakyti) */
.subtiek { display: block; font-size: 11px; color: var(--accent-dark); }

/* ± toggle for the inquiry skirta rows */
button.sk-toggle { padding: 0 .4rem; min-width: 1.4rem; font-weight: 700; }

/* žaliavų sąrašas: compact one-line rows, narrow supplier select */
table.zaliavos-t td { white-space: nowrap; }
table.zaliavos-t td.trunc { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
table.zaliavos-t .ztiek select { max-width: 10rem; }
table.zaliavos-t td.editcell input { width: auto; }

/* žaliavų tipo ženkliukai (pirminė / antrinė / etiketė) */
.zbadge {
  font-size: 10.5px; padding: .05rem .4rem; border-radius: 3px;
  font-weight: 700; margin-left: .3rem; white-space: nowrap;
}
.zbadge.zb-p { background: #d9f0f3; color: #0c5f6a; }
.zbadge.zb-a { background: #ece5f6; color: #5b3f87; }
.zbadge.zb-e { background: #fdf3d7; color: #7a5d00; }
.zbadge.zb-obi { background: #ff7900; color: #fff; }   /* OBI firminė oranžinė */

/* Dashboard brand header */
.brandhead { display: flex; align-items: center; gap: 1.1rem; margin: .5rem 0 1.1rem; }
.brandhead img { height: 46px; width: auto; }
.brandhead h1 { margin: 0; font-size: 21px; color: var(--ink); }
.brandhead .muted { margin: .1rem 0 0; font-size: 13px; }
.brandhead .sep { width: 1px; height: 40px; background: var(--line); }

/* Parameter forms (Skydelis / Nustatymai): label and control on ONE line —
   text left, a compact identical-width input right, value centered.
   `form.paramform label` outranks the generic `.box label` rule below. */
.paramform { display: flex; flex-direction: column; gap: .5rem; }
form.paramform label {
  display: grid; grid-template-columns: 1fr auto; gap: .7rem;
  align-items: center; font-size: 13.5px; text-align: left; margin: 0;
}
form.paramform input, form.paramform select {
  min-width: 0; padding: .3rem .4rem; border: 1px solid var(--line);
  border-radius: 4px; font-size: 13.5px; background: #fff;
}
form.paramform input:not([type=date]) { width: 6.5rem; text-align: center; }
form.paramform input[type=date] { width: 10rem; }
form.paramform select { max-width: 12rem; text-align: left; }
form.paramform button { margin-top: .5rem; }
.cols.top3 { margin-bottom: .6rem; }

/* Keep every card's content inside its frame */
.cols .box { min-width: 0; overflow: hidden; }
.cols .box table.grid { width: 100%; table-layout: auto; }
.cols .box table.grid.mini td, .cols .box table.grid.mini th {
  white-space: normal; word-break: break-word;
}
.cols .box table.grid input:not([type=checkbox]):not([type=date]) {
  width: 100%; min-width: 0;
}

/* Seasonality ahead */
.ahead { display: flex; gap: 1rem; flex-wrap: wrap; padding: .5rem 0; }
.ahead .m { font-size: 22px; }
.ahead .m strong { color: var(--accent-dark); }

/* Skydelis top row — centered cards */
.cols.top3 .box.center { text-align: center; display: flex; flex-direction: column; }
.cols.top3 .box.center h3 {
  font-size: 15px; margin: .1rem 0 .15rem; padding-bottom: .35rem;
  border-bottom: 2px solid #dce6f1;
}
.muted.small { font-size: 12.5px; margin: .15rem 0 .6rem; }
.paramform.centered { max-width: 330px; margin: 0 auto; text-align: left; flex: 1; }
.paramform.centered button { align-self: center; min-width: 9rem; }

.ahead.centered { justify-content: center; gap: .8rem; flex: 1; align-items: center; }
.ahead .m {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  background: #f0f5fa; border: 1px solid #d7e3ef; border-radius: 8px;
  padding: .6rem 1.1rem; min-width: 84px;
}
.ahead .m strong { color: var(--accent-dark); font-size: 15px; }
.ahead .m .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Zone matrix */
.cols .box table.grid.zonematrix { width: auto; }
table.zonematrix { width: auto; min-width: 250px; margin: 0 auto; }
table.zonematrix td, table.zonematrix th { text-align: center; padding: .4rem 1.1rem; }
table.zonematrix th.dn, table.zonematrix td.dn { background: #fdf3d7; }
table.zonematrix th.em, table.zonematrix td.em { background: #fbe3e3; }
table.zonematrix th.dn { color: #8a6100; }
table.zonematrix th.em { color: #9b1c1c; }
table.zonematrix td a { font-weight: 700; text-decoration: none; color: inherit; display: block; font-size: 15px; }
table.zonematrix td a:hover { text-decoration: underline; }

.legend { margin-top: .7rem; font-size: 12.5px; color: var(--muted); display: grid; gap: .25rem; justify-items: center; }
.legend strong { color: var(--text); }
.legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: .35rem; vertical-align: baseline;
}
.legend .dot.em { background: #e89b9b; }
.legend .dot.dn { background: #ecd28a; }
.legend .abc-legend { margin-top: .35rem; border-top: 1px dashed var(--line); padding-top: .45rem; }

/* Nustatymai */
table.suppliers input {
  width: 100%; min-width: 5rem; border: 1px solid var(--line); border-radius: 3px;
  padding: .22rem .35rem; font-size: 12.5px;
}
table.suppliers input.narrow { min-width: 3.5rem; }
table.suppliers td { padding: .15rem .25rem; }

.btnrow { display: flex; gap: .6rem; align-items: center; margin-top: .5rem; }
a.btn {
  display: inline-block; background: #5b6b7d; color: #fff; border-radius: 4px;
  padding: .42rem .8rem; font-size: 13.5px; text-decoration: none;
}
a.btn:hover { background: #46535f; }
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 4px;
  font: 13px ui-monospace, Menlo, Consolas, monospace; padding: .4rem .5rem;
}
.box label { display: block; font-size: 13.5px; margin: .35rem 0; }

/* Kanban board */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: .8rem 0; }
.kcol { background: #eef1f5; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; min-height: 220px; }
.khead { font-weight: 700; font-size: 13.5px; padding: .2rem .3rem .5rem; }
.kcard {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #5b6b7d;
  border-radius: 6px; padding: .5rem .6rem; margin-bottom: .5rem; font-size: 13px;
}
.kcard.inquiry { border-left-color: #0b5fa5; }
/* supplier orders = teal, production jobs = violet (visually distinct) */
.kcard.k-pirkimas { border-left-color: var(--brand); }
.kcard.k-gamyba { border-left-color: #9b7fc7; background: #fbf9fe; }
.kcard.overdue { border-left-color: #b32424; background: #fdf3f3; }
.tbadge {
  font-size: 11px; padding: .1rem .5rem; border-radius: 3px; font-weight: 700;
  white-space: nowrap; align-self: flex-start;
}
.tbadge.tb-p { background: #d9f0f3; color: #0c5f6a; }
.tbadge.tb-g { background: #ece5f6; color: #5b3f87; }
.kcard .kc-top { display: flex; justify-content: space-between; gap: .4rem; }
.kcard .kc-actions { display: flex; gap: .7rem; margin-top: .35rem; align-items: center; }
.kcard .kc-actions a { text-decoration: none; color: var(--accent); }

/* Quote comparison */
td.cheapest { background: #e8f3e8; font-weight: 700; }
.ok-tag { color: #2e7d32; font-weight: 600; font-size: 12px; }
.warn-tag { color: var(--warn); font-weight: 600; font-size: 12px; }
tfoot th { background: #eaeef3; font-size: 12.5px; vertical-align: top; }

/* Fondas breakdown links */
a.fondas-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
a.fondas-link:hover { color: var(--accent-dark); border-bottom-style: solid; }

/* Raw-material sub-rows in the production job */
tr.zaliava-row td { background: #f7f9fb; padding: .1rem .5rem; border-top: none; }
tr.zaliava-row summary { margin: 0; font-size: 12.5px; }
tr.zaliava-row table.mini { margin: .3rem 0 .5rem 1.2rem; width: auto; min-width: 560px; }

/* Parameter hints on Skydelis */
.param-hint { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: .1rem; line-height: 1.3; }
form.paramform .ptxt { display: block; }
