*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e6eaf0;
  --brand: #1570ef;
  --brand-dark: #0d5bc4;
  --brand-soft: #eaf2ff;
  --green: #12b76a;
  --amber: #f79009;
  --red: #f04438;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.12);
  --maxw: 1080px;
}

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(28px, 6vw, 44px); }
h2 { font-size: clamp(20px, 4vw, 28px); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.hide { display: none !important; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; }

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 12px; height: 62px; }
.logo { font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: var(--ink); }
.logo span { color: var(--brand); }
.spacer { flex: 1; }
.langs { display: flex; gap: 2px; background: var(--bg-soft); border-radius: 999px; padding: 3px; }
.langs button {
  border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.langs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.top-link { font-weight: 600; font-size: 15px; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 600; padding: 14px 22px; min-height: 50px;
  background: var(--brand); color: #fff; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.wide { width: 100%; }
.btn.sm { padding: 8px 14px; min-height: 38px; font-size: 14px; border-radius: 10px; }
.btn.wa { background: #25d366; }
.btn.wa:hover { background: #1eb257; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 24px; text-align: center; }
.hero p.lead { font-size: clamp(16px, 3.4vw, 20px); color: var(--muted); max-width: 560px; margin: 0 auto 28px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 34px 0; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s;
  color: inherit; display: block;
}
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.tile .ico { font-size: 40px; line-height: 1; display: block; margin-bottom: 10px; }
.tile .t { font-weight: 650; font-size: 17px; }
.tile .d { color: var(--muted); font-size: 14px; margin-top: 4px; }

.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 48px 0; }
.trust div { background: var(--bg-soft); border-radius: 14px; padding: 18px; }
.trust b { display: block; font-size: 15px; }
.trust span { color: var(--muted); font-size: 14px; }

/* ---------- Cards / forms ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; min-height: 50px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

/* ---------- Adresų pasiūlymai ---------- */
.sugg-wrap { position: relative; }
.sugg {
  position: absolute; left: 0; right: 0; top: calc(100% - 22px); z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(16,24,40,.22); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.sugg-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 12px 14px; cursor: pointer; font: inherit; border-bottom: 1px solid var(--line);
}
.sugg-item:last-child { border-bottom: 0; }
.sugg-item:hover, .sugg-item.on { background: var(--brand-soft); }
.sugg-item .s1 { display: block; font-weight: 600; font-size: 15px; }
.sugg-item .s2 { display: block; color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pick {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 18px 10px;
  text-align: center; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink);
}
.pick .ico { display: block; font-size: 30px; margin-bottom: 6px; }
.pick.on { border-color: var(--brand); background: var(--brand-soft); }

.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; margin: 6px 0 14px; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: 0 0 auto; }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 6px; margin: 20px 0 22px; }
.steps i { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.steps i.on { background: var(--brand); }
.step-label { font-size: 13px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.nav-row { display: flex; gap: 10px; margin-top: 8px; }
.nav-row .btn { flex: 1; }

/* ---------- Orders ---------- */
.order { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; background: #fff; }
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.onum { font-weight: 700; }
.badge { font-size: 13px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); }
.badge.pending { background: #fff6e5; color: #b54708; }
.badge.confirmed { background: #e7f7ee; color: #027a48; }
.badge.in_progress { background: var(--brand-soft); color: var(--brand-dark); }
.badge.completed { background: #eafaf1; color: #05603a; }
.badge.cancelled { background: #fee4e2; color: #b42318; }
.route { font-size: 15px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin-top: 10px; font-size: 14px; }
.kv b { display: block; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--bg-soft); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-size: 30px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.filters input, .filters select { min-height: 44px; padding: 10px 12px; }
.daygroup { margin: 22px 0 10px; font-weight: 700; font-size: 15px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 15px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw;
}
footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 26px 0; color: var(--muted); font-size: 14px; }


.sugg-note { padding: 14px; font-size: 14px; color: var(--muted); }

/* ---------- Vairuotojai, pristatymo laikas, dokumentai ---------- */
.sum { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
.sum::-webkit-details-marker { display: none; }
.sum::after { content: '▾'; margin-left: auto; color: var(--muted); }
details[open] > .sum::after { content: '▴'; }
.sub-h { font-weight: 700; font-size: 14px; margin: 16px 0 8px; }
.drv { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.drv.off { opacity: .55; }
.badge.drv-b { background: #f2f4f7; color: var(--ink); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; margin-top: 14px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }
.grid3 select, .grid3 input { min-height: 44px; padding: 10px 12px; }

details.docs { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.docs-in { margin-top: 10px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 8px; background: #fff; }
.doc-link { color: inherit; }
.doc-link:hover { border-color: var(--brand); }
.doc-ico { font-size: 22px; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-main a, .doc-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-act { display: flex; align-items: center; gap: 6px; }
.mini-check input { width: 20px; height: 20px; min-height: 0; }
.ok-txt { color: #027a48; }
.upl { background: var(--bg-soft); border-radius: 12px; padding: 14px; margin-top: 12px; }
.upl .sub-h { margin-top: 0; }
.upl input[type=file] { background: #fff; }

.eta-box { display: flex; flex-wrap: wrap; gap: 14px 28px; background: var(--brand-soft); border-radius: 12px;
  padding: 14px 16px; margin: 12px 0 4px; }
.eta-big { font-size: 18px; }

.stop { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.stop-l { grid-column: 1 / -1; font-size: 14px; }
.stop-a { font-size: 15px; }
.big-actions { margin-top: 14px; display: grid; gap: 8px; }
.btn.ok { background: var(--green); }
.btn.ok:hover { background: #0e9f5c; }

/* ---------- Vairuotojo reiso žingsniai ---------- */
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; min-height: 84px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--muted); }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--bg-soft); color: var(--muted); font-size: 14px; }
.step-t { font-size: 13px; font-weight: 650; text-align: center; line-height: 1.25; }
.step.done { border-color: #b7e4cc; background: #f3fbf6; color: #027a48; }
.step.done .step-n { background: var(--green); color: #fff; }
.step.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); cursor: default; }
.step.on .step-n { background: var(--brand); color: #fff; }
.step:not(.on):hover { border-color: var(--brand); }
.step[disabled] { opacity: 1; }

.eta-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.grid3 .eta-pair input { min-height: 44px; padding: 10px 12px; }

/* ---------- Užsakymo kortelės suskleidimas ---------- */
.order.collapsed > :not(.order-head):not(.route) { display: none !important; }
.order.collapsed .order-head { margin-bottom: 4px; }
.col-btn { width: 34px; height: 34px; min-height: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 15px; color: var(--muted); flex: 0 0 auto; }
.col-btn::after { content: '▴'; }
.order.collapsed .col-btn::after { content: '▾'; }
.col-btn:hover { border-color: var(--brand); color: var(--brand); }
.col-bar { display: flex; gap: 8px; justify-content: flex-end; margin: 4px 0 10px; flex-wrap: wrap; }
