/* app.css — Transdirekta portalas. Vienas failas, kintamieji :root (kriterijai H1–H3).
   Paletė iš viešos svetainės (transdirekta-web): navy, navy-deep, blue, orange; neutralūs pilkai;
   statuso spalvos tik ženkleliams, dienų skaičiams ir plytelių kraštams. Šriftas Manrope. */

:root {
  --navy: #052a5e;
  --navy-deep: #031d44;
  --blue: #0a68c8;
  --blue-soft: #e9f1fb;
  --orange: #f28c28;
  --orange-hover: #ffa04a;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --line: #e3e8f0;
  --line-strong: #cbd3e0;
  --ink: #16213a;
  --body: #3d4660;
  --muted: #6b7280;
  --red: #c62828;
  --red-bg: #fdecea;
  --yellow: #b8860b;
  --yellow-bg: #fff4d6;
  --green: #2e7d32;
  --green-bg: #e6f4ea;
  --grey: #6b7280;
  --grey-bg: #eef1f5;
  --blue-bg: #e9f1fb;
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --bottomnav-h: 60px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow-pop: 0 12px 32px rgba(3, 29, 68, 0.18);
  --focus: 0 0 0 3px rgba(10, 104, 200, 0.28);
}

/* --- bazė ------------------------------------------------------------------ */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
img { max-width: 100%; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.muted { color: var(--muted); }

/* --- išdėstymas ------------------------------------------------------------ */

.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; padding: 24px; }
.page { display: flex; flex-direction: column; gap: 20px; }

/* --- šoninė juosta --------------------------------------------------------- */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  overflow-y: auto;
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  color: #fff;
  text-decoration: none;
}
.brand::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 14px, transparent 14px 22px);
}
.brand-plate { flex: none; width: 92px; padding: 6px 8px; background: #fff; border-radius: 8px; }
.brand-plate img { display: block; width: 100%; height: auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; }
.brand-sub { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.6); }

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.nav-item .icon { opacity: 0.85; }
a.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
}
.nav-item.is-soon { color: rgba(255, 255, 255, 0.38); cursor: default; }
.soon {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: var(--navy-deep);
  font-size: 13px;
  font-weight: 800;
}
.user-text { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.btn-sidebar { justify-content: center; background: rgba(255, 255, 255, 0.08); color: #fff; border-color: transparent; }
.btn-sidebar:hover { background: rgba(255, 255, 255, 0.14); }

/* --- demo juostelė ir antraštė --------------------------------------------- */

.demo-strip {
  padding: 8px 24px;
  background: var(--yellow-bg);
  border-bottom: 1px solid #f0d890;
  color: #7a5800;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.page-title { flex: 1; min-width: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; }
.profile { position: relative; display: none; }
.profile-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 220px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-menu-head { display: flex; flex-direction: column; padding: 4px 8px 8px; border-bottom: 1px solid var(--line); }
.profile-menu .user-name { color: var(--ink); }
.profile-menu .user-role { color: var(--muted); }

/* --- mygtukai, nuorodos ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--navy-deep); }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-secondary { background: #fff; border-color: var(--line-strong); color: var(--navy); }
.btn-secondary:hover { background: var(--blue-soft); }
.btn-ghost { color: var(--navy); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-google { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-google:hover { background: var(--surface-alt); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-icon { padding: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 700; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .icon { width: 15px; height: 15px; }
.link-strong { color: var(--ink); }
.link-quiet { color: var(--body); font-weight: 600; text-decoration: none; }
.link-quiet:hover { text-decoration: underline; text-underline-offset: 3px; }
.plate { font-weight: 800; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.plate-lg { font-size: 15px; }

/* --- ženkleliai ir dienos --------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--grey-bg);
  color: var(--grey);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.pill-red { background: var(--red-bg); color: var(--red); }
.pill-yellow { background: var(--yellow-bg); color: var(--yellow); }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-blue { background: var(--blue-bg); color: var(--blue); }
.pill-grey { background: var(--grey-bg); color: var(--grey); }

.days { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.days-red { color: var(--red); }
.days-yellow { color: var(--yellow); }
.days-grey { color: var(--grey); }
.nearest { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; }
.nearest-kind { font-size: 12px; color: var(--muted); white-space: normal; }

/* --- plytelės (Pradžia) ------------------------------------------------------ */

.page-intro { margin: -6px 0 -4px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.45fr) minmax(0, 1fr); gap: 14px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--grey);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
a.tile:hover { border-color: var(--line-strong); background: #fcfdff; }
a.tile:hover .tile-label { text-decoration: underline; text-underline-offset: 3px; }
.tile-red { border-left-color: var(--red); }
.tile-yellow { border-left-color: var(--yellow); }
.tile-grey { border-left-color: var(--grey); }
.tile-blue { border-left-color: var(--blue); }
.tile-kicker { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tile-num { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile-num-money { font-size: 23px; white-space: nowrap; }
.tile-red .tile-num { color: var(--red); }
.tile-yellow .tile-num { color: var(--yellow); }
.tile-grey .tile-num { color: var(--grey); }
.tile-blue .tile-num { color: var(--blue); }
.tile-label { font-size: 13px; font-weight: 600; color: var(--body); }
.tile-alert {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* --- panelės ir eilučių sąrašai ------------------------------------------------ */

.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-titles { min-width: 0; }
.panel-title { font-size: 15.5px; }
.panel-sub { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.panel-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.panel-body { padding: 14px 18px; }
.panel-body > .table-wrap:only-child { margin: -14px -18px; width: calc(100% + 36px); }
.panel-table .panel-body { padding: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 2px; }
.row:last-child { padding-bottom: 2px; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { color: var(--ink); font-weight: 700; text-decoration: none; }
.row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-sub { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); }
.row-side { display: flex; align-items: center; gap: 10px; flex: none; }
.row-side-col { flex-direction: column; align-items: flex-end; gap: 4px; }
.row-num { min-width: 44px; text-align: right; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.row-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-km { color: var(--body); font-weight: 700; }

/* --- lentelės -------------------------------------------------------------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
.filter { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter > label { font-size: 12px; font-weight: 700; color: var(--muted); }
.filter-switches { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; min-height: 36px; }
.result-count { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.table-wrap { width: 100%; min-width: 0; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.data th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.data td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--body); overflow-wrap: break-word; }
.data td > * { min-width: 0; }
.data tbody tr:nth-child(even) td { background: #fafbfd; }
.data tbody tr:hover td { background: var(--blue-soft); }
.data tbody tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .actions { text-align: right; white-space: nowrap; }
.data td.primary { color: var(--ink); font-weight: 700; }
.num-strong { color: var(--ink); font-weight: 800; }
.cell-days { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stack-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.stack-sub .icon { width: 14px; height: 14px; }
.stack-num { align-items: flex-end; }
.subject { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.subject-icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: var(--grey-bg); color: var(--muted); }
.subject-icon .icon { width: 15px; height: 15px; }
.subject-vehicle { background: var(--blue-bg); color: var(--blue); }
.subject-driver { background: var(--green-bg); color: var(--green); }
.subject-company { background: #e8ecf5; color: var(--navy); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 18px; color: var(--muted); font-weight: 600; text-align: center; }
.loading { display: flex; align-items: center; gap: 10px; padding: 24px 0; color: var(--muted); font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- kortelės (autovežis, vairuotojas) ---------------------------------------- */

.breadcrumb { display: flex; gap: 8px; margin: -6px 0 -8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.crumb-sep { color: var(--line-strong); }
.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-kind { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.card-title { margin: 2px 0 6px; font-size: 30px; color: var(--navy); line-height: 1.1; }
.card-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14.5px; color: var(--body); }
.kv { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.kv-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius-sm); }
.stat-red { border-left-color: var(--red); }
.stat-green { border-left-color: var(--green); }
.stat-grey { border-left-color: var(--grey); }
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-red .stat-value { color: var(--red); }
.stat-sub { font-size: 12.5px; color: var(--muted); }

/* --- formos ---------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 700; color: var(--ink); }
.req { color: var(--red); }
.control {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
.control:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.control:disabled { background: var(--surface-alt); color: var(--muted); }
.control-sm { min-height: 36px; padding: 6px 10px; font-size: 13.5px; }
select.control { appearance: auto; }
textarea.control { min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hint { font-size: 12.5px; color: var(--muted); }
.form-info { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--navy); font-size: 13.5px; }
.form-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-bg); color: var(--red); font-size: 13.5px; font-weight: 700; }
.form-error .icon { width: 18px; height: 18px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--body); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--orange); outline-offset: 2px; }

/* --- modalas ---------------------------------------------------------------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--body);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(3, 29, 68, 0.45); }
.modal-wide { width: min(720px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 18px; }
.modal-body { flex: 1; padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-alt); }
.modal.is-busy .modal-body { opacity: 0.7; }

/* --- toast'ai ----------------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--navy-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.2s ease-out;
  pointer-events: auto;
}
.toast-ok .icon { color: #7fd48a; }
.toast-error { background: var(--red); }
.toast-out { opacity: 0; transition: opacity 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- prisijungimas ------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(1100px 600px at 15% -10%, #0a3d87 0%, var(--navy-deep) 60%);
}
.auth-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.auth-logo { width: 190px; height: auto; }
.auth-title { font-size: 22px; color: var(--navy); }
.auth-lead { color: var(--muted); font-size: 14px; text-align: center; }
.icon-google { width: 20px; height: 20px; stroke: none; }
.auth-status { font-size: 13px; color: var(--red); text-align: center; }
.auth-status:empty { display: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-foot { font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--yellow-bg); color: #7a5800; font-weight: 600; }
.auth-notice .icon { flex: none; margin-top: 1px; }

/* --- apatinė navigacija (tik telefone) ---------------------------------------- */

.bottom-nav { display: none; }

/* --- pritaikymas ekranams ------------------------------------------------------- */

@media (max-width: 1280px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Planšetė gulsčiai (960–1199 px): plačios lentelės slenka savo konteineryje, ne visas puslapis;
   lipni antraštė čia išjungiama, nes slinkimo konteineris ją „pririštų“ prie savęs. */
@media (min-width: 960px) and (max-width: 1199px) {
  .table-wrap { overflow-x: auto; }
  .data th { position: static; }
}

@media (max-width: 959px) {
  :root { --topbar-h: 56px; }
  .sidebar { display: none; }
  .profile { display: block; }
  .topbar { padding: 0 16px; gap: 10px; }
  .page-title { font-size: 19px; }
  /* apačioje vietos apatinei juostai (60) + tarpui (16) + plaukiojančiam „+“ (56) + tarpui (16), kad jis neuždengtų paskutinės eilutės mygtuko */
  .view { padding: 16px 16px calc(var(--bottomnav-h) + 16px + 56px + 16px + env(safe-area-inset-bottom)); }
  .page { gap: 16px; }
  .demo-strip { padding: 7px 16px; font-size: 12.5px; }
  .dash-grid { grid-template-columns: 1fr; gap: 16px; }
  .primary-action {
    position: fixed;
    right: 16px;
    bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom));
    z-index: 26;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(242, 140, 40, 0.45);
  }
  .primary-action span { display: none; }
  .primary-action .icon { width: 26px; height: 26px; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--line);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
  }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a.is-active { color: var(--blue); }
  .toasts { bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); }

  .modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .modal-wide { width: 100vw; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

  .toolbar { padding: 12px 14px; }
  .panel-head { padding: 12px 14px; }
  .panel-body { padding: 12px 14px; }
  .panel-body > .table-wrap:only-child { margin: -12px -14px; width: calc(100% + 28px); }

  /* lentelė → kortelės */
  .data thead { display: none; }
  table.data, .data tbody, .data tr, .data td { display: block; }
  .data tr { margin: 10px 12px; padding: 4px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
  .data td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--grey-bg); text-align: left; }
  .data td:last-child { border-bottom: 0; }
  .data td::before { content: attr(data-label); flex: none; min-width: 104px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
  .data td.primary { display: block; padding: 6px 0 8px; font-size: 15px; border-bottom: 1px solid var(--line); }
  .data td.primary::before { display: none; }
  .data td.actions { justify-content: flex-end; }
  .data td.actions::before { display: none; }
  .data td.actions:empty { display: none; }
  .data .num, .data .actions { text-align: right; }
  .data tbody tr:nth-child(even) td, .data tbody tr:hover td { background: transparent; }
  .data td > .stack, .data td > .nearest, .data td > .cell-days { align-items: flex-end; text-align: right; }
  .data td.primary > .stack { align-items: flex-start; text-align: left; }
  .data td.primary .stack-sub { justify-content: flex-start; }
  .stack-sub { justify-content: flex-end; }
  .card-head { grid-template-columns: 1fr; padding: 16px; }
  .card-title { font-size: 26px; }
}

@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 12px; }
  .tile-num { font-size: 26px; }
  .tile-num-money { font-size: 20px; }
  .tile-alert { white-space: normal; }
  .field-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { flex-direction: column; align-items: stretch; }
  .filter-switches { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; }
  .result-count { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
