/* Dienpinigiai – kelio ženklų paletė: ES kelio mėlyna, gintarinis įspėjimas, tarptautinių lipdukų ovalai */
:root {
  --ink: #16212e;
  --ink-2: #4a5666;
  --muted: #778292;
  --line: #d9dee5;
  --ground: #eef1f4;
  --surface: #ffffff;
  --road: #1f5fae;
  --road-ink: #174a88;
  --amber: #e8a33d;
  --amber-bg: #fdf3e1;
  --green: #2f7d55;
  --green-bg: #e7f3ec;
  --red: #b3372f;
  --radius: 6px;
  --display: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--body); line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: var(--road); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--road-ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0; }
h1 { font-size: 2rem; line-height: 1.1; }
h2 { font-size: 1.3rem; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbl { display: block; font-family: var(--display); font-weight: 600; font-size: .78rem;
       text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: .25rem; }

/* Viršutinė juosta */
.top {
  display: flex; align-items: center; gap: 2rem; padding: 0 1.5rem; height: 56px;
  background: var(--road); color: #fff; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display);
         font-weight: 700; font-size: 1.25rem; color: inherit; text-decoration: none; }
.brand-sign { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
              border: 2px solid currentColor; font-size: .95rem; }
.top nav { display: flex; gap: .25rem; height: 100%; }
.top nav a { display: flex; align-items: center; padding: 0 .9rem; color: #dbe6f5; text-decoration: none;
             font-family: var(--display); font-weight: 600; font-size: 1.02rem; border-bottom: 3px solid transparent; }
.top nav a:hover { color: #fff; }
.top nav a[aria-current] { color: #fff; border-bottom-color: #fff; }
.who { margin-left: auto; display: flex; gap: .8rem; align-items: center; color: #dbe6f5; }
.who .link { color: #fff; }

main { max-width: 1320px; margin: 0 auto; padding: 1.5rem; }

/* Mygtukai ir laukai */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--road); color: #fff; border: 0; border-radius: var(--radius);
  padding: .55rem 1rem; font: 600 .95rem var(--display); letter-spacing: .02em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--road-ink); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: .35rem .7rem; font-size: .88rem; }
.btn.ghost { background: transparent; color: var(--road); box-shadow: inset 0 0 0 1.5px var(--road); }
.btn.ghost:hover { background: var(--road); color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--road); font: inherit; cursor: pointer;
        text-decoration: underline; text-underline-offset: 2px; }
input[type=date], input:not([type]), input[type=search], input[type=password], input[inputmode] {
  font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); min-width: 0;
}
input:focus { border-color: var(--road); outline: none; box-shadow: 0 0 0 3px rgba(31, 95, 174, .18); }
.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
input[type=checkbox] { accent-color: var(--road); width: 16px; height: 16px; }

/* Filtrai */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.field { display: flex; flex-direction: column; }
.field.check { flex-direction: row; padding-bottom: .5rem; }
.months { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 99px;
        padding: .38rem .75rem; font: 500 .9rem var(--body); cursor: pointer; }
.chip:hover { border-color: var(--road); color: var(--road); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.picker { position: relative; }
.picker summary { list-style: none; cursor: pointer; min-width: 220px; padding: .45rem 2rem .45rem .6rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; position: relative; }
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after { content: "▾"; position: absolute; right: .7rem; color: var(--muted); }
.picker-body { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; width: 320px; max-height: 380px;
  overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(22, 33, 46, .14); padding: .5rem; }
.picker-body input[type=search] { width: 100%; margin-bottom: .4rem; }
.picker-body label { display: flex; gap: .5rem; align-items: center; padding: .3rem .4rem; border-radius: 4px; cursor: pointer; }
.picker-body label:hover { background: var(--ground); }
.picker-body .all { border-bottom: 1px solid var(--line); margin-bottom: .3rem; padding-bottom: .5rem; font-weight: 600; }

/* Antraštė su suma */
.ledger-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-end;
               margin-bottom: 1.25rem; }
.ledger-head p { margin: .35rem 0 0; }
.total { display: flex; align-items: center; gap: 1rem; }
.total strong { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1; }
.total .lbl { margin: 0; }
.crumbs { margin: 0 0 .75rem; }
.warn-link, .warn-text { color: #9a5d00; font-weight: 600; }

/* Lentelės */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font: 600 .78rem var(--display); text-transform: uppercase; letter-spacing: .06em;
           color: var(--ink-2); padding: .65rem .8rem; border-bottom: 2px solid var(--ink); background: #f7f8fa; white-space: nowrap; }
.grid td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr:hover td { background: #f7f9fc; }
.grid tfoot td { font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }
.grid.compact td, .grid.compact th { padding: .4rem .6rem; }
.grid .num, .num { text-align: right; white-space: nowrap; }
.strong { font-weight: 600; }
.grid tr.warn td { background: var(--amber-bg); }
.grid tr.warn td:first-child { box-shadow: inset 4px 0 var(--amber); }
.grid tr.ok td:first-child { box-shadow: inset 4px 0 var(--green); }
.grid tr.fix td { background: #f7f9fc; }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }
.actions > * + * { margin-left: .6rem; }

.tag { display: inline-block; font: 600 .78rem var(--display); letter-spacing: .03em; padding: .15rem .5rem;
       border-radius: 3px; margin-right: .3rem; }
.tag.ok { background: var(--green-bg); color: var(--green); }
.tag.warn { background: var(--amber-bg); color: #8a5300; box-shadow: inset 0 0 0 1px var(--amber); }
.tag.bad { background: #f8e3e1; color: var(--red); }
.tag.muted-tag { background: var(--ground); color: var(--ink-2); }

/* Parašas: tarptautinis ovalus valstybės lipdukas */
.plates { display: inline-flex; flex-wrap: wrap; gap: .3rem; vertical-align: middle; }
.plate {
  display: inline-grid; place-items: center; min-width: 2.6em; height: 1.55em; padding: 0 .45em;
  border: 1.5px solid var(--ink); border-radius: 50%; background: #fff;
  font: 700 .8rem var(--display); letter-spacing: .04em; color: var(--ink); line-height: 1;
}
.plate.lt { opacity: .45; }

/* Komandiruotė */
.trip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.5rem; }
.trip .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.trip-head { padding: 1rem 1.25rem .75rem; }
.trip-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .3rem 0 0; color: var(--ink-2); }
.route { margin: .6rem 0 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.route .lbl { margin: 0; }
.note { background: var(--surface); border-left: 3px solid var(--road); padding: .5rem .8rem; margin: .5rem 0 0; }
.note.small { background: var(--ground); }

/* Dienų juosta – komandiruotė kaip kelias */
.strip { list-style: none; display: flex; gap: 0; margin: 0; padding: .75rem 1.25rem 1rem; overflow-x: auto;
         position: relative; }
.strip li {
  flex: 1 0 92px; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .55rem .3rem .5rem; position: relative; border-top: 4px solid var(--road); text-align: center;
}
.strip li + li { border-left: 1px dashed var(--line); }
.strip li.out { opacity: .38; border-top-color: var(--muted); }
.strip li.warn { border-top-color: var(--amber); background: var(--amber-bg); }
.strip li.ok { border-top-color: var(--green); }
.strip .sd { font: 600 .82rem var(--display); color: var(--ink-2); }
.strip .sd em { font-style: normal; color: var(--muted); font-weight: 500; }
.strip .sa { font-weight: 600; font-size: .9rem; }
.strip .plates { justify-content: center; }

.fix-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.fix-form label { display: flex; flex-direction: column; }
.fix-form .grow { flex: 1 1 240px; }
.fix-form .grow input { width: 100%; }

/* Nustatymai */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.panel h2 { margin-bottom: .6rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.stack label:not(.check) { width: 100%; }
.stack input:not([type=checkbox]) { width: 100%; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-top: 1rem; }
.inline-form label { display: flex; flex-direction: column; flex: 1 1 140px; }
.inline-form .narrow { flex: 0 1 100px; }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .15rem 1.5rem; margin-top: .75rem; }
.rate { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid var(--ground); }
.rate .rn { flex: 1; font-size: .92rem; }
.rate .rv { font-weight: 600; }

/* Pranešimai */
.flash { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: var(--radius); margin: 0 0 1.25rem; }
.error { color: var(--red); font-weight: 600; }
.empty { padding: 2rem; text-align: center; color: var(--ink-2); background: var(--surface);
         border: 1px dashed var(--line); border-radius: var(--radius); }
.section { margin: 2rem 0 .75rem; }
.foot { margin-top: 1rem; font-size: .87rem; }

/* Prisijungimas */
.login { max-width: 360px; margin: 12vh auto 0; background: var(--surface); padding: 2rem;
         border-radius: var(--radius); border-top: 5px solid var(--road); display: flex; flex-direction: column; gap: 1rem; }
.login .brand { color: var(--road); font-size: 1.6rem; margin: 0; }
.login .muted { margin: -.6rem 0 .4rem; }
.login input { width: 100%; }

@media (max-width: 760px) {
  .top { gap: .75rem; padding: 0 .75rem; overflow-x: auto; }
  .top nav a { padding: 0 .5rem; font-size: .95rem; }
  .who span { display: none; }
  main { padding: 1rem; }
  .total strong { font-size: 1.6rem; }
  .picker summary { min-width: 180px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Buhalterija: moduliai */
.modname { font-family: var(--display); font-weight: 600; font-size: 1.02rem; color: #fff; opacity: .75;
           padding-left: 1rem; border-left: 1px solid rgba(255, 255, 255, .35); }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.module { display: flex; flex-direction: column; gap: .5rem; padding: 1.4rem 1.5rem; background: var(--surface);
          border: 1px solid var(--line); border-top: 4px solid var(--road); border-radius: var(--radius);
          color: var(--ink); text-decoration: none; }
.module:hover { border-color: var(--road); color: var(--ink); }
.module-title { font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.module-go { margin-top: .5rem; color: var(--road); font-weight: 600; }
.btn.google { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); gap: .6rem; padding: .7rem 1rem; }
.btn.google:hover { background: var(--ground); color: var(--ink); }
