:root {
  --bg: #f5f4f1; --card: #fff; --ink: #1f2328; --muted: #6b7078; --line: #e3e1dc;
  --accent: #8a5a2b; --accent-ink: #fff;
  --s-n: #e6e6e6; --s-n-ink: #555;
  --s-v: #fde68a; --s-v-ink: #7a5a00;
  --s-a: #bbf7d0; --s-a-ink: #146c2e;
  --s-x: #f3f3f3; --s-x-ink: #aaa;
  --s-p: #fecaca; --s-p-ink: #9b1c1c;
  --red: #c62828; --orange: #d97706; --green: #2e7d32;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 10; background: #2b2420; color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px; overflow-x: auto; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 17px; padding: 12px 0; }
#nav { display: flex; gap: 2px; }
#nav a { color: #d8cfc7; text-decoration: none; padding: 14px 10px; white-space: nowrap; border-bottom: 3px solid transparent; }
#nav a.on { color: #fff; border-bottom-color: #d9a066; }
/* vartotojo meniu dešinėje */
.um-btn { margin-left: auto; flex: none; background: transparent; color: #d8cfc7; border: 1px solid #5a4c44; border-radius: 999px; padding: 5px 12px; font-size: 14px; white-space: nowrap; }
.um-btn:hover { color: #fff; border-color: #8a7a70; }
.um-pop { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; min-width: 240px; }
.um-pop[hidden] { display: none; }
.um-pop a { display: block; padding: 9px 12px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.um-pop a:hover { background: #f6f3ee; }

/* užsakymo santrauka */
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; margin-top: 10px; }
.sum-line { font-size: 15px; }
.sum-notes { margin-top: 10px; padding: 8px 10px; background: #faf8f5; border-radius: 8px; white-space: pre-wrap; font-size: 14px; }
.info-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
.grow { flex: 1; }
button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 6px 12px; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-block; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button.link { border: none; background: none; color: var(--muted); padding: 2px 4px; }
button.link:hover { color: var(--red); }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: #fff; color: var(--ink); min-width: 0; }
textarea { width: 100%; min-height: 60px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
label.f > * { color: var(--ink); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* užsakymų sąrašas */
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.order { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 12px; }
.order:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.order.r-late { border-left-color: var(--red); }
.order.r-soon { border-left-color: var(--orange); }
.order.r-ok { border-left-color: var(--green); }
.order .t { font-weight: 600; }
.bar { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin: 8px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--green); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eee; color: #444; white-space: nowrap; }
.pill.late { background: #fde2e2; color: var(--red); font-weight: 600; }
.pill.soon { background: #fdecc8; color: #8a4b00; }
.pill.ok { background: #dcf3e0; color: var(--green); }
.pill.warn { background: #fde2e2; color: var(--red); }

/* etapai */
.stages { display: flex; flex-wrap: wrap; gap: 4px; }
.st { border: none; border-radius: 6px; padding: 4px 8px; font-size: 12.5px; cursor: pointer; }
.st[data-s="Nepradėta"] { background: var(--s-n); color: var(--s-n-ink); }
.st[data-s="Vykdoma"] { background: var(--s-v); color: var(--s-v-ink); font-weight: 600; }
.st[data-s="Atlikta"] { background: var(--s-a); color: var(--s-a-ink); }
.st[data-s="Nereikalingas"] { background: var(--s-x); color: var(--s-x-ink); text-decoration: line-through; }
.st[data-s="Problema"] { background: var(--s-p); color: var(--s-p-ink); font-weight: 600; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.legend .st { cursor: default; }

/* sąrašai su varnelėmis */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #f0eeea; }
.list li:last-child { border-bottom: none; }
.list li.done .txt { color: var(--muted); text-decoration: line-through; }
.list input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.list .txt { flex: 1; }
.kas { display: inline-block; min-width: 22px; text-align: center; font-size: 11.5px; font-weight: 700; border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
.kas-T { background: #dbeafe; color: #1e40af; } .kas-C { background: #ede9fe; color: #5b21b6; }
.kas-B { background: #fce7f3; color: #9d174d; } .kas-M { background: #dcfce7; color: #166534; }
.kas-K { background: #ffedd5; color: #9a3412; } .kas-D { background: #e0f2fe; color: #075985; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 8px; }
.photos a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: #eee; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos a { position: relative; }
.photos a.pdf img { object-fit: contain; background: #fff; }
.pdf-badge { position: absolute; top: 5px; left: 5px; background: #c62828; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.pdf-name { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prio { border: none; background: none; padding: 0 2px; font-size: 17px; line-height: 1; cursor: pointer; color: #b8b2a8; }
.prio:hover { transform: scale(1.2); }
.prio-1 { color: inherit; }
.order.prio-hi { box-shadow: 0 0 0 2px #f3c4c4; }
.order.prio-lo { opacity: .6; }
.order.prio-lo:hover { opacity: 1; }
.day-doc { display: block; background: #eef6ff; border: 1px solid #cfe3fb; color: #0b4a8b; border-radius: 7px; padding: 6px 8px; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.day-doc:hover { background: #e0efff; }
.pill.plan { background: #e0f2fe; color: #075985; text-decoration: none; }
.plan-picker { margin-top: 6px; padding: 6px; background: #f6f3ee; border-radius: 8px; gap: 6px; }
.plan-picker input, .plan-picker select { font-size: 14px; padding: 4px 6px; }
button.link.cal { font-size: 16px; }
.pick-tasks { margin-top: 10px; max-height: 340px; overflow-y: auto; }
.pick-tasks .list li { align-items: center; }
.add-task { min-width: 34px; font-weight: 700; }
.list li.q { padding: 10px 0; }
.answer-box { margin-top: 6px; min-height: 38px; height: 38px; resize: vertical; }
.answer-box:focus { height: 70px; }
.answer { margin-top: 4px; color: var(--green); }
details summary { cursor: pointer; margin-top: 8px; }
.group-h { font-weight: 600; font-size: 13px; color: var(--muted); margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .03em; }

/* planas */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 120px; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px #e9d2b8; }
.day h3 { font-size: 13px; margin: 0 0 6px; display: flex; justify-content: space-between; }
.task { background: #faf8f5; border: 1px solid #eee7de; border-radius: 7px; padding: 6px; margin-bottom: 6px; font-size: 13.5px; }
.task.done { opacity: .55; }
.task.done .tt { text-decoration: line-through; }
.task .v { font-size: 11px; font-weight: 700; color: #fff; background: #8a5a2b; border-radius: 3px; padding: 0 4px; }
.task .v.B { background: #888; }
.task select { font-size: 12.5px; padding: 2px 4px; }

/* furnitūra */
table.hw tr.hot td { background: #fde2e2; }
table.hw tr.dim { opacity: .55; }
table.hw td { vertical-align: middle; }
.warn-txt { color: var(--red); font-weight: 600; font-size: 12.5px; }

/* katalogo paieška */
.suggest-wrap { position: relative; min-width: 260px; display: flex; }
.suggest-wrap > input { flex: 1; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 7px; z-index: 20; max-height: 320px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.1); margin-top: 2px; }
.suggest:empty { display: none; }
.sg { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #f0eeea; }
.sg:last-child { border-bottom: none; }
.sg:hover { background: #f6f3ee; }

/* eiga: gamyba ir montavimas */
.stage-row { padding: 8px 0; }
.stage-row + .stage-row { border-top: 1px solid #f0eeea; }
.stage-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }

/* gamyba: trijų mygtukų jungiklis */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; border-right: 1px solid var(--line); padding: 7px 16px; }
.seg button:last-child { border-right: none; }
.seg button.on[data-g="Laukia"] { background: var(--s-n); color: var(--s-n-ink); font-weight: 600; }
.seg button.on[data-g="Vykdoma"] { background: var(--s-v); color: var(--s-v-ink); font-weight: 600; }
.seg button.on[data-g="Baigta"] { background: var(--s-a); color: var(--s-a-ink); font-weight: 600; }

/* „Kas jūs?“ langas */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; padding: 16px; overflow-y: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #f0eeea; vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.scroll { overflow-x: auto; }

.inline-edit { border-color: transparent; background: transparent; }
.inline-edit:hover, .inline-edit:focus { border-color: var(--line); background: #fff; }

#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #2b2420; color: #fff; padding: 8px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }

@media (max-width: 1050px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
}
/* ===== Išvaizda (2026-11-14): aiškesnė hierarchija, spalvos tik su reikšme ===== */
/* Spalvos: raudona – problema, oranžinė – laukiama/vyksta, žalia – gerai, ruda – Sapelli mygtukai */
h1 { font-size: 24px; letter-spacing: -.01em; }
.card > h2, .card h2 { font-size: 17px; font-weight: 650; }
.card { padding: 16px; border-radius: 12px; }
.pill { font-size: 12.5px; padding: 2px 9px; }
.pill.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.risk-txt { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* užsakymų sąrašo kortelė */
.order { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.order .t { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-pills { gap: 5px; margin-top: 4px; }
.order-pills:empty { display: none; }
main { padding-bottom: 80px; } /* kad apačioje esantis Netlify ženkliukas neuždengtų paskutinių mygtukų */
.order.r-ok { border-left-color: var(--line); } /* spalvotas kraštas tik kai skuba ar vėluoja */

/* ===== Užsakymai: lenta ir sąrašas ===== */
.view-seg button { padding: 6px 12px; }
.view-seg button.on { background: var(--ink); color: #fff; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.bcol { background: #ece8e2; border-radius: 12px; padding: 8px; min-width: 0; }
.bcol-h { display: flex; justify-content: space-between; font-weight: 650; font-size: 14px; padding: 4px 6px 8px; }
.bcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 6px; color: inherit; text-decoration: none; }
.bcard:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.bcard.late { border-left: 4px solid var(--red); }
.bcard.soon { border-left: 4px solid var(--orange); }
.bcard.prio-hi { box-shadow: 0 0 0 2px #f3c4c4; }
.bcard-t { font-weight: 600; font-size: 14px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard .row { margin-top: 2px; }
.bmore { display: block; width: 100%; text-align: center; padding: 6px; color: var(--muted); }
.bempty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 6px; border: 1px dashed #d6d0c7; border-radius: 9px; }
.otable-wrap { padding: 4px 8px; }
table.otable tr:not(:first-child) { cursor: pointer; }
table.otable tr:not(:first-child):hover td { background: #faf8f5; }
table.otable td { vertical-align: middle; padding: 9px 8px; }
.ot-name { font-weight: 600; }
.ot-sub { font-size: 12.5px; }
.phone-only { display: none; }

/* telefone: viršuje „Sapelli“ + vartotojas, po jais – meniu (slenkamas į šoną) */
@media (max-width: 700px) {
  .top { flex-wrap: wrap; overflow: visible; gap: 8px; padding: 0 12px; }
  .brand { padding: 10px 0; }
  .um-btn { margin: 0 0 0 auto; }
  #nav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -12px; padding: 0 4px; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { padding: 10px 9px; }
  /* didesni mygtukai ir laukeliai pirštui; 16px neleidžia telefonui priartinti */
  button, .btn { min-height: 40px; padding: 8px 14px; }
  button.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
  button.link { min-height: 0; }
  input, select, textarea { font-size: 16px; min-height: 40px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; }
  .orders { grid-template-columns: 1fr; gap: 8px; }
  .card { padding: 14px 12px; }
  .seg button { padding: 8px 14px; }
  #nav.single { display: none !important; }
  /* lenta: stulpeliai slenkami braukiant į šoną */
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 8px; gap: 8px; }
  .bcol { flex: 0 0 82%; scroll-snap-align: start; }
  /* sąrašas: telefone kortelės vietoj lentelės */
  .otable-wrap { display: none; }
  .phone-only { display: block; }
  .search-row > input { flex-basis: 100%; }
}
@media (max-width: 600px) {
  main { padding: 12px; }
  #nav a { padding: 14px 7px; }
}
