/* Germanoauto sąskaitos – dark, phone-first; colours match germanoauto.lt */
:root {
  --bg: #0b0d10; --s1: #12151a; --s2: #181c22; --s3: #1f242c; --line: rgba(255,255,255,.09);
  --text: #eef1f5; --muted: #9099a6; --ice: #5cc8ff; --warm: #ff8a3d; --ok: #3ddc84; --bad: #ff5b5b; --warn: #ffc24d;
  --r: 14px; --sans: system-ui, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--ice); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 80dvh; color: var(--muted); }

/* layout */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(11,13,16,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; }
.topbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top .back { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); background: rgba(18,21,26,.97); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.nav a.on { color: var(--ice); }
.nav .brand, .nav .hide-m { display: none; }
.nav a.plus b { width: 46px; height: 46px; margin-top: -18px; border-radius: 50%; display: grid; place-items: center; background: var(--ice); color: #04101e; font-size: 28px; font-weight: 700; box-shadow: 0 6px 20px rgba(92,200,255,.35); }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.testbar { position: relative; z-index: 7; padding: 8px 16px; background: var(--warm); color: #1a0d00; font-weight: 700; font-size: 13px; text-align: center; }
.testbar a { color: #1a0d00; text-decoration: underline; }

/* two-column screens: on the phone the columns simply follow each other */
.cols { display: flex; flex-direction: column; }
.cols.dv .col { display: contents; }   /* document view: the action buttons come right after the summary */
.dv .o1 { order: 1; } .dv .o2 { order: 2; } .dv .o3 { order: 3; } .dv .o4 { order: 4; } .dv .o5 { order: 5; }
.dv .o6 { order: 6; } .dv .o7 { order: 7; } .dv .o8 { order: 8; } .dv .o9 { order: 9; } .dv .o10 { order: 10; }
.narrow { max-width: 760px; }

/* registrations */
.vhead { display: grid; gap: 10px; margin-bottom: 6px; }
.vhead .seg { margin: 0; }
@media (min-width: 600px) { .vhead { grid-template-columns: 1fr auto; align-items: center; } }
h3.day, h2.day { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; font-weight: 700; color: var(--text); }
h3.day span, h2.day span { padding: 1px 8px; border-radius: 999px; background: rgba(92,200,255,.14); color: var(--ice); font-size: 12px; }
.todayv { background: linear-gradient(135deg, rgba(92,200,255,.10), rgba(255,138,61,.06)); border: 1px solid rgba(92,200,255,.28); border-radius: var(--r); padding: 14px; margin-bottom: 16px; }
.todayv .visit { background: rgba(11,13,16,.55); }
.visit { display: grid; grid-template-columns: 58px 1fr auto; grid-template-areas: "t m c" "s s s"; gap: 6px 10px; align-items: center; padding: 12px; border-radius: var(--r);
  background: var(--s1); border: 1px solid var(--line); border-left: 4px solid var(--ice); margin-top: 8px; }
.visit .vt { grid-area: t; font-weight: 800; font-size: 18px; color: var(--text); }
.visit .main { grid-area: m; min-width: 0; color: var(--text); }
.visit .main .t { display: block; font-weight: 700; }
.visit .main .s { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit .main .w { color: #c9d3de; white-space: normal; }
.visit .vcall { grid-area: c; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--s2); border: 1px solid var(--line); font-size: 18px; }
.visit .vs { grid-area: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.visit .vs button { padding: 7px 2px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.visit .vs button.on { color: #04101e; }
.visit.st-laukiama { border-left-color: var(--ice); } .visit.st-laukiama .vs .on { background: var(--ice); border-color: var(--ice); }
.visit.st-atvyko { border-left-color: var(--warn); } .visit.st-atvyko .vs .on { background: var(--warn); border-color: var(--warn); }
.visit.st-atlikta { border-left-color: var(--ok); opacity: .8; } .visit.st-atlikta .vs .on { background: var(--ok); border-color: var(--ok); }
.visit.st-neatvyko { border-left-color: var(--bad); opacity: .7; } .visit.st-neatvyko .vs .on { background: var(--bad); border-color: var(--bad); color: #fff; }

/* blocks */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.sp { flex: 1; }

/* form */
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
:root { color-scheme: dark; }   /* native date/time pickers and their icons in dark colours */
input[type=date], input[type=time] { appearance: none; -webkit-appearance: none; min-width: 0; font-variant-numeric: tabular-nums; cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator {
  filter: invert(72%) sepia(60%) saturate(500%) hue-rotate(170deg); opacity: .9; cursor: pointer; padding: 4px; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--s2); outline: none; min-height: 46px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ice); box-shadow: 0 0 0 3px rgba(92,200,255,.15); }
input.plate { text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--s2); border: 1px solid var(--line); margin-bottom: 14px; }
.seg button { padding: 11px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--ice); color: #04101e; }
.chk { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; user-select: none; }
.chk input { width: 22px; height: 22px; accent-color: var(--ice); }
.hint { font-size: 13px; color: var(--ice); margin: -4px 0 10px; }

/* lines */
.ln { display: grid; grid-template-columns: 1fr 64px 86px 34px; gap: 6px; align-items: center; margin-bottom: 8px; }
.ln input { min-height: 44px; padding: 10px; }
.ln { position: relative; }
.ac { position: absolute; left: 0; right: 40px; top: calc(100% + 4px); z-index: 12; max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--s2); border: 1px solid rgba(92,200,255,.45); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.6); padding: 4px; }
.ac button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.ac button + button { border-top: 1px solid var(--line); }
.ac button:hover, .ac button.on { background: rgba(92,200,255,.12); }
.ac button b { flex: none; color: var(--ice); font-weight: 700; }
.ln .x { width: 34px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.ln-head { display: grid; grid-template-columns: 1fr 64px 86px 34px; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.add { width: 100%; padding: 11px; border-radius: 12px; border: 1px dashed rgba(92,200,255,.45); background: transparent; color: var(--ice); font-weight: 600; cursor: pointer; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.total b { font-size: 24px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--s2); font-weight: 600; cursor: pointer; text-align: center; white-space: nowrap; }
.row > .chips { min-width: 0; }
.btn.primary { background: var(--ice); color: #04101e; border-color: var(--ice); }
.btn.warm { background: var(--warm); color: #1a0d00; border-color: var(--warm); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btns { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
/* save / preview buttons: at the end of the form, scrolled to like everything else */
.sticky { margin-top: 4px; }

/* lists */
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--s1); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.chips button.on { color: #04101e; background: var(--ice); border-color: var(--ice); }
.item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line); margin-bottom: 8px; color: var(--text); }
.item .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.ico.sas { background: rgba(92,200,255,.14); color: var(--ice); }
.ico.akt { background: rgba(255,138,61,.14); color: var(--warm); }
.item .main { flex: 1; min-width: 0; }
.item .t, .item .s { display: block; }
.item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sum { font-weight: 700; text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.ok { background: rgba(61,220,132,.14); color: var(--ok); }
.tag.due { background: rgba(255,194,77,.14); color: var(--warn); }
.tag.late { background: rgba(255,91,91,.14); color: var(--bad); }
.tag.off { background: rgba(255,255,255,.08); color: var(--muted); }
.tag.mail { background: rgba(92,200,255,.12); color: var(--ice); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; text-align: center; }
.quick a b { font-size: 22px; color: var(--ice); }
.search { margin-bottom: 12px; }

/* doc view */
table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lines td, table.lines th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.lines th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.lines .n { text-align: right; white-space: nowrap; }
table.lines tr.sec td { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 12px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* summary */
.bar { height: 14px; border-radius: 999px; background: var(--s3); overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.bar.w i { background: var(--warn); } .bar.r i { background: var(--bad); }
.big { font-size: 28px; font-weight: 800; }
.months td { padding: 7px 4px; }

/* login */
.login { max-width: 380px; margin: 12vh auto 0; padding: 24px; }
.login h1 { margin: 0 0 6px; font-size: 24px; }
.login .logo { font-weight: 800; font-size: 20px; margin-bottom: 24px; }
.login .logo span { color: var(--ice); font-weight: 400; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 6px 0; }

/* PDF preview over the screen */
.btns2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.pv { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: rgba(5,7,10,.96); }
.pv-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid var(--line); }
.pv-top .seg { flex: 1; margin: 0; max-width: 420px; }
.pv-top b { flex: 1; }
.pv-x { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--s2); color: var(--text); font-size: 24px; cursor: pointer; }
.pv-body { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pv-body canvas { background: #fff; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 100%; }
.pv-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--s1); }
@media (min-width: 900px) { .pv-foot { justify-content: center; grid-template-columns: 220px 280px; } }

#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 20;
  padding: 12px 18px; border-radius: 12px; background: #e9eef4; color: #0b0d10; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); color: #fff; }

/* computer: one menu bar on top, content uses the width */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 0; bottom: auto; display: flex; align-items: center; gap: 4px; padding: 0 max(24px, calc(50% - 600px)); height: 62px;
    border-top: 0; border-bottom: 1px solid var(--line); background: rgba(14,17,21,.96); backdrop-filter: blur(10px); }
  .testbar { position: sticky; top: 0; height: 34px; }
  .testbar + .nav { top: 34px; }
  .nav .hide-m { display: flex; }
  .nav .brand { display: block; margin-right: 22px; font-weight: 800; font-size: 17px; color: var(--text); }
  .nav .brand span { color: var(--ice); font-weight: 400; }
  .nav a { flex-direction: row; gap: 8px; padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
  .nav a:hover { background: var(--s2); color: var(--text); }
  .nav a.on { background: rgba(92,200,255,.12); }
  .nav svg { width: 18px; height: 18px; }
  .nav a.plus { order: 9; margin-left: auto; background: var(--ice); color: #04101e; padding: 9px 16px; }
  .nav a.plus:hover { background: var(--ice); filter: brightness(1.08); }
  .nav a.plus b { width: auto; height: auto; margin: 0; background: none; box-shadow: none; color: inherit; font-size: 18px; line-height: 1; }
  .top { position: static; background: transparent; border-bottom: 0; padding: 26px 24px 0; max-width: 1248px; margin: 0 auto; backdrop-filter: none; }
  .top h1 { font-size: 24px; }
  .wrap { max-width: 1248px; padding: 16px 24px 40px; }
  .top.nw, .wrap:not(.wide) { max-width: 868px; }   /* single-column screens: centred, comfortable width */
  .only-m { display: none !important; }
  .wide .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .wide .cols.home { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .wide .cols.dv { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
  .wide .cols.dv .col { display: block; }
  .wide .cols.dv .col:last-child { position: sticky; top: 80px; }
  .wide .cols.dv .btns.o2 { grid-template-columns: 1fr; }
  #toast { bottom: 30px; }
}

/* act photos */
.ph { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ph:empty { display: none; }
.ph > div { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--s2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.ph .x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; cursor: pointer; }
.phv { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(5,7,10,.95); padding: 16px; cursor: zoom-out; }
.phv img { max-width: 100%; max-height: 100%; border-radius: 8px; }
