/* Vaikystės sodas: dokumentų pasirašymas. Spalvos ir šriftas — vaikystes-sodas.lt. Jokių išorinių bibliotekų. */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Vaikystės sodo spalvos: tamsiai mėlyna #1E354A, auksinė #BF9773, smėlio #DFC69E */
  --brand: #1e354a;
  --brand-600: #2b4a66;
  --brand-700: #13253a;
  --brand-50: #f0f4f8;
  --brand-100: #e4ebf1;
  --brand-200: #c3d1de;
  --gold: #bf9773;
  --gold-ink: #85603d;
  --gold-50: #faf6f0;
  --gold-100: #f1e7d7;
  --sand: #dfc69e;

  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #fbf9f6;
  --surface-3: #f0efed;
  --line: #ebe6de;
  --line-2: #dcd5c9;
  --ink: #1e354a;
  --ink-2: #4b5d6d;
  --ink-3: #85909b;

  --ok: #1d7a3a;   --ok-bg: #e9f6ed;   --ok-line: #bfe3ca;
  --warn: #93560a; --warn-bg: #fdf3e1; --warn-line: #efd6a6;
  --bad: #b3261e;  --bad-bg: #fdeceb;  --bad-line: #f5c6c2;
  --info: #2b5a85; --info-bg: #edf3f9; --info-line: #c9dbec;
  --mute: #67717b; --mute-bg: #f0efed;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sh-1: 0 1px 2px rgb(30 53 74 / 5%);
  --sh-2: 0 1px 2px rgb(30 53 74 / 5%), 0 4px 16px rgb(30 53 74 / 6%);
  --sh-3: 0 12px 40px rgb(30 53 74 / 18%), 0 2px 6px rgb(30 53 74 / 8%);
  --ring: 0 0 0 3px rgb(30 53 74 / 16%);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar: 252px;
  color-scheme: light;
}

/* --- Pagrindai -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 23px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 .8em; }
a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gold-ink); }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.inline { display: inline; }
.stack > * + * { margin-top: 12px; }

/* --- Karkasas ------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 8px 2px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img { display: block; height: auto; }
.brand-sub { font-size: 11px; color: var(--gold-ink); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.brand-sm img { width: 150px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 14px 10px 6px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background .15s var(--ease), color .15s; }
.nav-link .icon { color: var(--ink-3); transition: color .15s; }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.is-active { background: var(--gold-50); color: var(--brand); box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.is-active .icon { color: var(--gold-ink); }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
.nav-count.is-alert { background: var(--gold); color: var(--brand-700); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.me-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.me-text small { font-size: 12px; color: var(--ink-3); }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; }
.mobilebar { display: none; }
.sidebar-backdrop { display: none; }
.solo { min-height: 100vh; }

/* --- Avatarai -------------------------------------------------------------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--gold-100); color: var(--brand); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* --- Mygtukai -------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid transparent; font: 500 13.5px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s var(--ease), border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgb(19 37 58 / 30%), inset 0 1px 0 rgb(255 255 255 / 8%); }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--sh-1); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1d17; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-bg); color: var(--bad); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 99px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: 99px; }
.btn-block { width: 100%; }
.btn-dashed { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-2); width: 100%; height: 42px; border-radius: 12px; }
.btn-dashed:hover { border-color: var(--gold); color: var(--brand); background: var(--gold-50); }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn-primary { background: var(--brand); color: #fff; }
.icon-btn-primary:hover { background: var(--brand-700); color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-danger { color: var(--bad); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; margin-bottom: 14px; }
.back:hover { color: var(--brand); }
.back .icon { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Puslapio antraštė ----------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }

/* --- Kortelės -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 20px 22px; margin-bottom: 18px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head .count { color: var(--ink-3); font-weight: 500; }
.card-danger { border-color: var(--bad-line); }

/* --- KPI ------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.kpi:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-1px); color: var(--ink); }
.kpi.is-active { border-color: var(--brand); box-shadow: var(--ring); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.kpi-ico .icon { width: 16px; height: 16px; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.kpi-sub { font-size: 12.5px; color: var(--ink-3); }
.tone-warn .kpi-ico { background: var(--warn-bg); color: var(--warn); }
.tone-ok .kpi-ico { background: var(--ok-bg); color: var(--ok); }
.tone-bad .kpi-ico { background: var(--bad-bg); color: var(--bad); }
.tone-brand .kpi-ico { background: var(--gold-50); color: var(--gold-ink); }

/* --- Sąrašo įrankių juosta ------------------------------------------------- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 11px; overflow-x: auto; max-width: 100%; }
.seg a, .seg label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.seg a:hover, .seg label:hover { color: var(--ink); }
.seg a.is-active, .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 0 0 1px var(--line); }
.seg .n { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.seg-radio { padding: 3px; }
.seg-radio label { padding: 0; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 8px; }
.seg-radio input:focus-visible + span { box-shadow: var(--ring); }
.search-row { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; min-width: 260px; }
.search { position: relative; flex: 1; max-width: 360px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; pointer-events: none; }
.search input { padding-left: 34px !important; padding-right: 34px !important; height: 36px; }
.kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px/1 var(--font); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 6px; background: var(--surface-2); pointer-events: none; }
.search input:focus ~ .kbd { display: none; }

/* --- Lentelės -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover { background: var(--surface-2); }
.cell-actions { text-align: right; white-space: nowrap; }
.list-empty { padding: 56px 20px; text-align: center; color: var(--ink-2); }
.list-empty .empty-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); margin-bottom: 12px; }
.list-empty .empty-ico .icon { width: 22px; height: 22px; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; background: var(--surface-2); }
.pager { display: flex; gap: 6px; align-items: center; }
.is-loading [data-results] { opacity: .55; transition: opacity .15s; }

/* Dokumento eilutė */
.doc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-body { min-width: 0; }
.doc-title { font-weight: 600; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.doc-title:hover { color: var(--brand); }
.doc-meta { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.ft { width: 36px; height: 40px; flex: none; border-radius: 8px; display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; position: relative; }
.ft::before { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: linear-gradient(225deg, var(--bg) 50%, rgb(0 0 0 / 8%) 50%); border-bottom-left-radius: 3px; }
.ft-pdf { background: #fbe7e6; color: #b3261e; }
.ft-word { background: #e5effb; color: #1f5f99; }
.ft-xls { background: #e6f4ea; color: #1d7a3a; }
.ft-img { background: #f3ecfa; color: #6b3fa0; }
.ft-other { background: var(--surface-3); color: var(--ink-2); }
.ft-lg { width: 46px; height: 52px; font-size: 11px; border-radius: 10px; }

/* Pasirašančiųjų avatarai sąraše */
.people { display: flex; align-items: center; gap: 10px; }
.av-stack { display: flex; }
.av-stack .av { margin-left: -7px; }
.av-stack .av:first-child { margin-left: 0; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); box-shadow: 0 0 0 2px var(--surface); position: relative; }
.av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); background: var(--line-2); }
.av.st-signed::after, .av.st-approved::after, .av.st-received::after { background: var(--ok); }
.av.st-pending::after { background: #e0a019; }
.av.st-declined::after { background: var(--bad); }
.av.st-queued::after { background: var(--line-2); }
.av-more { background: var(--surface-3); color: var(--ink-3); }
.av-more::after { display: none; }
.prog { display: flex; flex-direction: column; gap: 4px; min-width: 70px; }
.prog-text { font-size: 12px; color: var(--ink-3); }

progress { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--ok); border-radius: 99px; transition: width .4s var(--ease); }
progress::-moz-progress-bar { background: var(--ok); border-radius: 99px; }
.progress-lg { height: 8px; }

/* Būsenos ženkleliai */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-pending { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill-completed { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill-declined, .pill-expired { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pill-cancelled, .pill-deleted { background: var(--mute-bg); color: var(--mute); border-color: var(--line); }
.hint-ok { color: var(--ink-3); }
.hint-warn { color: var(--warn); font-weight: 500; }
.hint-bad { color: var(--bad); font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.chip-brand { background: var(--gold-50); color: var(--gold-ink); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* --- Formos ---------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label, .label { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 6px; color: var(--ink); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.req { color: var(--gold-ink); }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: 14px var(--font);
  transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-1);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8d91' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input::placeholder, textarea::placeholder { color: #a5a7ab; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[aria-invalid="true"] { border-color: var(--bad); }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }
.hint-warning { color: var(--warn); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 500; font-size: 13.5px; margin-bottom: 8px; padding: 0; }
.input-group { display: flex; gap: 6px; }
.input-group select { width: 78px; flex: none; }

/* Jungiklis */
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; font-weight: 400; margin: 0; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row .sw-text { flex: 1; }
.switch-row .sw-text strong { display: block; font-weight: 500; font-size: 13.5px; }
.switch-row .sw-text small { display: block; color: var(--ink-3); font-size: 12.5px; }
input[type="checkbox"].switch { -webkit-appearance: none; appearance: none; flex: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s var(--ease); margin: 0; border: 0; box-shadow: none; }
input[type="checkbox"].switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .2s var(--ease); }
input[type="checkbox"].switch:checked { background: var(--brand); }
input[type="checkbox"].switch:checked::after { transform: translateX(16px); }
input[type="checkbox"].switch:focus-visible { box-shadow: var(--ring); outline: none; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; margin: 8px 0; cursor: pointer; font-size: 13.5px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }

/* Greiti mygtukai */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.qchip { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 500 12.5px var(--font); cursor: pointer; transition: all .15s; }
.qchip:hover { border-color: var(--brand); color: var(--brand); }
.qchip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* --- Pranešimai ------------------------------------------------------------ */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--ok-bg); border-color: var(--ok-line); color: #145a2a; }
.alert-error { background: var(--bad-bg); border-color: var(--bad-line); color: #8f1d17; }
.alert-info { background: var(--info-bg); border-color: var(--info-line); color: #174a78; }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); color: #7a4800; }
.note { background: var(--surface-3); border-radius: 10px; padding: 10px 14px; color: var(--ink-2); font-size: 13px; }
.toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); font-size: 13.5px; animation: toast-in .25s var(--ease); }
.toast-icon { margin-top: 1px; }
.toast-success .toast-icon { color: var(--ok); }
.toast-error { border-color: var(--bad-line); }
.toast-error .toast-icon { color: var(--bad); }
.toast-info .toast-icon { color: var(--info); }
.toast-text { flex: 1; }
.toast-close { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 2px; border-radius: 6px; }
.toast-close:hover { color: var(--ink); background: var(--surface-3); }
.toast-close .icon { width: 16px; height: 16px; }
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* --- Meniu (⋯) ------------------------------------------------------------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); animation: pop .15s var(--ease); }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; font: 500 13.5px var(--font); color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.menu-list button:hover, .menu-list a:hover { background: var(--surface-3); }
.menu-list .icon { width: 16px; height: 16px; color: var(--ink-3); }
.menu-list .danger, .menu-list .danger .icon { color: var(--bad); }
.menu-list .danger:hover { background: var(--bad-bg); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* --- Dialogai -------------------------------------------------------------- */
dialog.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--sh-3); color: var(--ink); background: var(--surface); }
dialog.modal[open] { animation: pop .2s var(--ease); }
dialog.modal::backdrop { background: rgb(31 31 32 / 40%); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; }
.modal-body { padding: 14px 22px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.modal-danger .modal-head h2 { color: var(--bad); }

/* --- Pasirašymo detalės ---------------------------------------------------- */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dh-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dh-title h1 { margin: 0 0 6px; word-break: break-word; }
.dh-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13.5px; }
.dh-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.dh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.progress-card { display: flex; flex-direction: column; gap: 12px; }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pc-big { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.pc-facts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.pc-facts span { display: inline-flex; align-items: center; gap: 6px; }
.pc-facts .icon { width: 16px; height: 16px; color: var(--ink-3); }

.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.step { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; }
.step + .step { border-top: 1px dashed var(--line); }
.step-av { position: relative; }
.step-av .avatar { width: 40px; height: 40px; font-size: 13px; background: var(--surface-3); color: var(--ink-2); }
.step.st-signed .step-av .avatar, .step.st-approved .step-av .avatar, .step.st-received .step-av .avatar { background: var(--ok-bg); color: var(--ok); }
.step.st-pending .step-av .avatar { background: var(--warn-bg); color: var(--warn); }
.step.st-declined .step-av .avatar { background: var(--bad-bg); color: var(--bad); }
.step-seq { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2); font-size: 10.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; justify-content: center; }
.step-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-top strong { font-weight: 600; }
.step-sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.step-right { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.step-status { text-align: right; font-size: 13px; }
.step-status strong { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.step-status .icon { width: 15px; height: 15px; }
.step-status small { display: block; color: var(--ink-3); font-size: 12px; }
.st-text-signed, .st-text-approved, .st-text-received { color: var(--ok); }
.st-text-pending { color: var(--warn); }
.st-text-declined { color: var(--bad); }
.st-text-queued, .st-text-removed { color: var(--ink-3); }
.step.is-removed { opacity: .55; }
.step-actions { display: flex; gap: 2px; }

.kv { margin: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.kv div { display: grid; gap: 2px; }
.kv dt { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kv dd { margin: 0; font-size: 13.5px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--line-2); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.tl-ok::before { box-shadow: 0 0 0 2px var(--ok); background: var(--ok); }
.timeline li.tl-bad::before { box-shadow: 0 0 0 2px var(--bad); background: var(--bad); }
.timeline li.tl-brand::before { box-shadow: 0 0 0 2px var(--brand); }
.tl-text { font-size: 13.5px; }
.tl-meta { font-size: 12px; color: var(--ink-3); }

/* --- Naujas siuntimas ------------------------------------------------------ */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.step-card { padding: 22px 24px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step-no { width: 28px; height: 28px; border-radius: 50%; background: var(--gold-100); color: var(--brand); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step-head h2 { margin: 0; font-size: 16px; }
.step-head p { margin: 0; font-size: 13px; color: var(--ink-3); }

.dropzone { position: relative; display: block; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); padding: 26px 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 16px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--gold-50); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone input[type="file"]:focus-visible + .dz-inner { outline: 2px solid var(--brand); outline-offset: 6px; border-radius: 8px; }
.dz-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); box-shadow: var(--sh-1); display: inline-flex; align-items: center; justify-content: center; color: var(--gold-ink); margin-bottom: 10px; }
.dz-ico .icon { width: 20px; height: 20px; }
.dz-title { font-weight: 500; }
.dz-title u { color: var(--gold-ink); text-decoration-thickness: 1px; }
.dz-file { display: flex; align-items: center; gap: 12px; text-align: left; }
.dz-file .dz-name { font-weight: 600; word-break: break-all; }
.dropzone.has-file { border-style: solid; background: var(--surface); padding: 14px 16px; }

.party-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 4px 0 10px; }
.party-label + .person, .person + .party-label { margin-top: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 18px; cursor: pointer; transition: border-color .15s, background .15s; }
.person:hover { border-color: var(--line-2); }
.person.is-on { border-color: var(--sand); background: var(--gold-50); }
.person-body { flex: 1; min-width: 0; }
.person-body strong { display: block; font-weight: 600; }
.person-body small { display: block; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signer-card { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 4px; margin-bottom: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.signer-card:focus-within { border-color: var(--line-2); box-shadow: var(--sh-2); }
.signer-card .sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.signer-card .sc-head strong { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.signer-card .sc-no { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.signer-card .grid-4 { grid-template-columns: 1fr 1fr 1.4fr 0.9fr; }
.sc-more { margin: -4px 0 12px; }
.sc-more-toggle { font-size: 12.5px; color: var(--gold-ink); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; }

.summary { position: sticky; top: 24px; }
.summary h2 { font-size: 15px; margin-bottom: 14px; }
.sum-list { margin: 0 0 18px; display: grid; gap: 14px; }
.sum-list dt { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-bottom: 3px; }
.sum-list dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.sum-empty { color: var(--ink-3); }
.sum-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sum-flow li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sum-flow .n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--ink-2); }
.sum-flow .is-dir .n { background: var(--gold-100); color: var(--brand); }

/* --- Vartotojai ------------------------------------------------------------ */
.request { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.request .r-body { flex: 1; min-width: 200px; }
.request .r-body strong { display: block; }
.request .r-body small { color: var(--ink-2); }
.request .r-actions { display: flex; gap: 8px; align-items: center; }
.request select { width: auto; height: 34px; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-cell small { display: block; color: var(--ink-3); font-size: 12.5px; }
.role-select { width: auto; height: 34px; font-size: 13px; }
.legend { display: flex; gap: 10px 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin: 0 0 18px; }
.legend strong { color: var(--ink-2); font-weight: 600; }

/* --- Nustatymai ------------------------------------------------------------ */
.tabs-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs-bar a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-bar a .icon { width: 16px; height: 16px; color: var(--ink-3); }
.tabs-bar a:hover { color: var(--ink); }
.tabs-bar a.is-active { color: var(--brand); border-bottom-color: var(--gold); }
.tabs-bar a.is-active .icon { color: var(--gold-ink); }
.settings-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.settings-grid:last-of-type { border-bottom: 0; }
.settings-grid h2 { font-size: 15px; margin-bottom: 4px; }
.settings-grid > div:first-child p { color: var(--ink-3); font-size: 13px; }
.status-list { margin: 0; display: grid; gap: 0; }
.status-list > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.status-list > div:first-child { border-top: 0; padding-top: 0; }
.status-list dt { color: var(--ink-2); font-size: 13.5px; }
.status-list dd { margin: 0; font-size: 13.5px; }
.badge-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.badge-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }

/* --- Žurnalas -------------------------------------------------------------- */
.log-action { font-weight: 500; }

/* --- Prisijungimas --------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; color: #fff; background: radial-gradient(900px 520px at -10% -20%, #2c4a66 0%, transparent 60%), radial-gradient(700px 480px at 120% 120%, #13253a 0%, transparent 60%), var(--brand); }
.auth-brand::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 380px; height: 380px; background: url("../img/mark.png") center / contain no-repeat; opacity: .14; }
.auth-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-logo img { width: 264px; height: auto; }
.auth-claim { position: relative; z-index: 1; }
.auth-claim h1 { color: #fff; font-size: 32px; line-height: 1.2; margin-bottom: 12px; max-width: 460px; }
.auth-claim p { color: rgb(255 255 255 / 80%); max-width: 420px; font-size: 15px; }
.auth-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: rgb(255 255 255 / 88%); font-size: 14px; }
.auth-points .icon { width: 18px; height: 18px; color: var(--sand); }
.auth-foot { font-size: 12px; color: rgb(255 255 255 / 60%); position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card > p { color: var(--ink-2); margin-bottom: 26px; }
.btn-ms { width: 100%; height: 48px; justify-content: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 99px; font-size: 14.5px; box-shadow: var(--sh-1); }
.btn-ms:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.auth-note { display: flex; gap: 10px; margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.auth-note .icon { color: var(--ink-3); margin-top: 1px; }
.auth-mobile-logo { display: none; }
.auth-mobile-logo img { width: 240px; height: auto; }
.pending-card { text-align: center; }
.pending-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--warn-bg); color: var(--warn); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; position: relative; }
.pending-ico .icon { width: 28px; height: 28px; }
.pending-ico::after { content: ""; position: absolute; inset: -6px; border-radius: 24px; border: 2px solid var(--warn-line); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); opacity: .4; } }
.who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin: 18px 0; text-align: left; }
.who small { display: block; color: var(--ink-3); }
.actions-row { display: flex; gap: 10px; justify-content: center; }
.error-wrap { max-width: 520px; margin: 8vh auto; text-align: center; }
.error-code { font-size: 64px; font-weight: 700; color: var(--sand); letter-spacing: -.02em; margin: 24px 0 0; line-height: 1; }

/* --- Mažesni ekranai ------------------------------------------------------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid, .compose { grid-template-columns: 1fr; }
  .summary { position: static; }
  .settings-grid { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--sh-3); }
  .nav-open .sidebar { transform: none; }
  .nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgb(31 31 32 / 35%); }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 40; padding: 10px 14px; background: rgb(255 255 255 / 92%); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .content { padding: 20px 16px 56px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: flex; justify-content: center; margin-bottom: 22px; }
}
@media (max-width: 720px) {
  h1 { font-size: 21px; }
  .card { padding: 16px; border-radius: 14px; }
  .step-card { padding: 18px 16px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 22px; }
  .grid-2, .grid-3, .grid-4, .signer-card .grid-4 { grid-template-columns: 1fr; }
  .list-toolbar { padding: 10px; }
  .search-row { min-width: 0; width: 100%; flex-wrap: wrap; }
  .search { max-width: none; }
  .table-signings thead { display: none; }
  .table-signings, .table-signings tbody, .table-signings tr, .table-signings td { display: block; }
  .table-signings tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-signings td { border: 0; padding: 4px 0; }
  .table-signings td.col-people, .table-signings td.col-deadline { display: inline-block; margin-right: 14px; }
  .table-signings td.col-sent { display: none; }
  .doc-title, .doc-meta { max-width: 70vw; }
  .step { grid-template-columns: 40px minmax(0, 1fr); }
  .step-right { grid-column: 2; justify-content: flex-start; }
  .step-status { text-align: left; }
  .status-list > div { grid-template-columns: 1fr; gap: 2px; }
  .detail-head .dh-actions { width: 100%; }
  .dh-meta .sep { display: none; }
  .menu-list { right: auto; left: 0; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .table-users thead { display: none; }
  .table-users, .table-users tbody, .table-users tr, .table-users td { display: block; }
  .table-users tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-users td { border: 0; padding: 4px 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Smulkūs papildymai ---------------------------------------------------- */
.search { margin: 0; font-weight: 400; }
.switch-inline { margin: 0; align-items: center; color: var(--ink-2); font-weight: 500; }
.switch-inline input { margin-top: 0; }
.dz-inner { display: block; }
.dz-inner > span:not(.dz-ico) { display: block; }
.dz-inner .tiny { margin-top: 4px; }
.compose-main { min-width: 0; }
.blocked-row { padding: 10px 0; border-top: 1px solid var(--line); }
.blocked-row:first-of-type { border-top: 0; padding-top: 0; }
.blocked-row .person-body { flex: 1; }
.card > .settings-grid:first-child, .card > form > .settings-grid:first-child { padding-top: 0; }
.card > .settings-grid:last-child, .card > form > .settings-grid:last-child { padding-bottom: 0; border-bottom: 0; }
.user-cell > span:last-child { min-width: 0; }

/* =============================================================================
   Vaikystės sodas: padaliniai, teisės, suvestinė
   ============================================================================= */

/* Padalinio žymos */
.chip-branch { background: var(--brand-50); color: var(--brand); }
.chip-branch .icon { width: 14px; height: 14px; vertical-align: -2px; }
.chip-branch.is-admin { background: var(--gold-50); color: var(--gold-ink); }
.meta-branch { color: var(--brand-600); font-weight: 500; }
.meta-branch.is-admin { color: var(--gold-ink); }
.branch-filter { margin: 0; font-weight: 400; }
.list-toolbar .search-row:has(.branch-filter) { min-width: 480px; }
.list-toolbar .search { min-width: 180px; }
.branch-filter select { height: 36px; width: auto; min-width: 190px; max-width: 260px; font-size: 13px; }

/* Naujo siuntimo padalinys */
.branch-card .step-no .icon { width: 15px; height: 15px; }
.branch-card .field { margin-bottom: 0; }
.branch-fixed { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.branch-fixed .icon { color: var(--gold-ink); }

/* Nustatymai: sodelių sąrašas */
.branch-list { display: grid; gap: 8px; margin-bottom: 12px; }
.branch-row { display: grid; grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.branch-row.is-closed { opacity: .6; }
.branch-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--gold-50); color: var(--gold-ink); display: inline-flex; align-items: center; justify-content: center; }
.branch-main, .branch-lead { min-width: 0; }
.branch-main strong, .branch-lead strong { display: block; font-weight: 600; font-size: 13.5px; }
.branch-main small, .branch-lead small { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.branch-main code { font-size: 11.5px; padding: 0 5px; }
.form-section { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-ink); margin: 6px 0 12px; padding-top: 6px; }
.form-section + .grid-2 { margin-bottom: 8px; }
dialog.modal.modal-wide { width: min(680px, calc(100vw - 32px)); }
dialog.modal .modal-body { max-height: calc(100vh - 220px); overflow-y: auto; }

/* Vartotojų teisės */
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-opt { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt > span { display: block; height: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color .15s, background .15s, box-shadow .15s; }
.role-opt strong { display: block; font-weight: 600; font-size: 13.5px; }
.role-opt small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
.role-opt:hover > span { border-color: var(--ink-3); }
.role-opt input:checked + span { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.role-opt input:focus-visible + span { box-shadow: var(--ring); }
.branch-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; padding: 4px 2px 0; }
.bc-group { break-inside: avoid; }
.bc-city { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 8px 0 2px; }
.branch-checks .check { margin: 5px 0; }
.r-suggest { display: flex !important; align-items: center; gap: 5px; color: var(--gold-ink) !important; margin-top: 3px; }
.r-suggest .icon { width: 14px; height: 14px; }
.chip-role { font-weight: 600; }
.chip-role.role-admin { background: var(--brand); color: #fff; }
.chip-role.role-administration { background: var(--brand-100); color: var(--brand); }
.chip-role.role-manager { background: var(--gold-50); color: var(--gold-ink); }
.scope-text { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; max-width: 360px; }
.table-users .cell-actions .btn + form { margin-left: 4px; }

/* Suvestinė pagal padalinius */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.board-head h2 { margin: 0; font-size: 15px; }
.board-legend { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.is-ok, .sbar .is-ok { background: var(--ok); fill: var(--ok); }
.lg.is-wait, .sbar .is-wait { background: #e0a019; fill: #e0a019; }
.lg.is-bad, .sbar .is-bad { background: var(--bad); fill: var(--bad); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); animation: pulse 2s ease-in-out infinite; }
.table-stats th.num, .table-stats td.num { text-align: right; }
.table-stats th { padding: 0; }
.table-stats th:not(:has(.th-sort)) { padding: 10px 16px; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 10px 14px; border: 0; background: transparent; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
th.num .th-sort { justify-content: flex-end; }
.th-sort .icon { width: 13px; height: 13px; opacity: .35; }
.th-sort:hover { color: var(--ink); }
.th-sort.is-sorted { color: var(--brand); }
.th-sort.is-sorted .icon { opacity: 1; color: var(--gold-ink); }
.table-stats td { padding: 12px 14px; }
.table-stats .col-branch { min-width: 250px; }
.table-stats .th-sort { white-space: normal; line-height: 1.3; text-align: left; }
.table-stats th.num .th-sort { text-align: right; }
.table-stats .col-branch .small { white-space: nowrap; }
.table-stats td.num { width: 1%; white-space: nowrap; }
.table-stats tbody tr { box-shadow: inset 3px 0 0 transparent; }
.table-stats tbody tr.has-problem { box-shadow: inset 3px 0 0 var(--bad); }
.table-stats tbody tr.has-soon { box-shadow: inset 3px 0 0 #e0a019; }
.table-stats tbody tr.is-admin-row { background: var(--gold-50); }
.table-stats tbody tr.is-admin-row:hover { background: var(--gold-100); }
.table-stats tr.is-closed .branch-name { color: var(--ink-3); }
.branch-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.branch-name:hover { color: var(--gold-ink); }
.stat-n { font-size: 18px; font-weight: 600; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
a.stat-n:hover { text-decoration: underline; }
.stat-n.is-zero { color: var(--line-2); font-weight: 500; }
.stat-n.is-ok { color: var(--ok); }
.stat-n.is-warn { color: var(--warn); }
.stat-n.is-bad { color: var(--bad); }
.table-stats td .tiny { white-space: nowrap; }
.col-bar { min-width: 150px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-n { min-width: 26px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sbar { flex: 1; height: 10px; min-width: 70px; border-radius: 99px; overflow: hidden; display: block; }
.sbar .sbar-bg { fill: var(--surface-3); }
.spark { width: 80px; height: 24px; display: block; }
.spark .v { fill: var(--brand-200); }
.spark .z { fill: var(--line); }
.table-stats tr:hover .spark .v { fill: var(--brand-600); }
.table-stats tfoot th, .table-stats tfoot td { background: var(--surface-2); border-top: 1px solid var(--line-2); padding: 12px 16px; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); }
.table-stats tfoot .stat-n { font-size: 15px; }

@media (max-width: 1180px) {
  .branch-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .branch-lead { grid-column: 2; grid-row: 2; }
}
@media (max-width: 720px) {
  .role-grid, .branch-checks { grid-template-columns: 1fr; }
  .branch-filter, .branch-filter select { width: 100%; max-width: none; }
  .list-toolbar .search-row:has(.branch-filter) { min-width: 0; }
  .list-toolbar .search { min-width: 0; }
  .branch-row { grid-template-columns: 36px minmax(0, 1fr); }
  .branch-row > .btn { grid-column: 1 / -1; justify-self: start; }
  .table-stats thead { display: none; }
  .table-stats, .table-stats tbody, .table-stats tfoot, .table-stats tr { display: block; }
  .table-stats tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-stats td, .table-stats tfoot th, .table-stats tfoot td { display: block; border: 0; padding: 0; text-align: left !important; background: none; }
  .table-stats td.col-branch, .table-stats tfoot th { grid-column: 1 / -1; }
  .table-stats td.col-bar { grid-column: 1 / 4; min-width: 0; }
  .table-stats td.num::before, .table-stats td.col-bar::before, .table-stats td.col-trend::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
  .table-stats tfoot tr { background: var(--surface-2); }
}
