/* Efektyvus Čekis – tas pats vaizdas kaip programoje (app/ui/styles.py): šviesus, mėlyna + žalia. */
:root {
  --accent: #0183b8; --accent-hover: #016c98; --green-brand: #96c519; --accent-soft: #e0f3f9;
  --red: #dc2626; --red-bg: #fde2e2; --green: #15803d; --green-bg: #dcfce7; --amber: #b45309; --amber-bg: #fef3c7;
  --muted: #64748b; --text: #0f172a; --line: #e2e8f0; --line2: #cbd5e1; --bg: #f4f6fa; --panel: #ffffff;
  --gray-bg: #eef2f6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- antraštė */
header.top { background: var(--panel); border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--green-brand)) 1; position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 10px; padding: 6px 16px; max-width: 1600px; margin: 0 auto; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand .t { font-size: 17px; font-weight: 600; line-height: 1.1; }
.brand .t small { font-size: 10px; color: var(--muted); font-weight: 500; }
.brand .s { color: var(--muted); font-size: 11.5px; }
.top-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- mygtukai, žetonai */
.btn { background: #fff; border: 1px solid var(--line2); border-radius: 5px; padding: 4px 11px; cursor: pointer;
  white-space: nowrap; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: #f1f5f9; }
.btn:disabled { color: #94a3b8; background: #f8fafc; border-color: var(--line); cursor: default; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { background: #9fd3e7; border-color: #9fd3e7; color: #f0fafd; }
.btn.danger { color: var(--red); border-color: #fca5a5; }
.btn.danger:hover { background: var(--red-bg); }
.btn.danger:disabled { color: #94a3b8; background: #f8fafc; border-color: var(--line); }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip { background: var(--accent-soft); color: #01587c; border-radius: 12px; padding: 3px 10px; font-weight: 600;
  font-size: 12px; white-space: nowrap; }
.chip.ok { background: var(--green-bg); color: var(--green); }
.chip.bad { background: var(--red-bg); color: var(--red); }
.chip.busy { background: var(--amber-bg); color: var(--amber); }
.chip.gray { background: var(--gray-bg); color: var(--muted); }
.chip.click { cursor: pointer; border: 1px solid transparent; }
.chip.click.on { border-color: currentColor; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red);
  color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }

/* ---------- puslapis */
main { padding: 10px 16px 30px; max-width: 1600px; margin: 0 auto; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.toolbar .grow { flex: 1; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.panel h2 { font-size: 14.5px; margin: 0 0 8px; }
.panel h3 { font-size: 15px; margin: 18px 0 8px; }
.notice { background: #fff7ed; border: 1px solid #fed7aa; color: var(--amber); padding: 6px 10px; border-radius: 5px;
  margin-bottom: 8px; }
.notice.info { background: var(--accent-soft); border-color: #a9dcec; color: #01587c; }
.notice.err { background: var(--red-bg); border-color: #fca5a5; color: var(--red); }
.notice.ok { background: var(--green-bg); border-color: #86efac; color: var(--green); }

/* ---------- lentelė */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { background: #f8fafc; border-bottom: 1px solid var(--line); padding: 5px 6px; font-weight: 600;
  color: #334155; text-align: left; position: sticky; top: 0; white-space: nowrap; font-size: 12px; }
table.grid td { border-bottom: 1px solid #eef2f7; padding: 3px 6px; vertical-align: middle; font-size: 13px; }
table.grid tr:nth-child(even) td { background: #fafbfd; }
table.grid tr:hover td { background: #f3f9fc; }
table.grid tr.sel td { background: var(--accent-soft); }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.st { text-align: center; white-space: nowrap; }
td.st.ok { background: var(--green-bg) !important; color: var(--green); }
td.st.bad { background: var(--red-bg) !important; color: var(--red); }
td.st.busy { background: var(--amber-bg) !important; color: var(--amber); }
td.st.gray { background: var(--gray-bg) !important; color: var(--muted); }
td.missing { background: var(--red-bg) !important; }
td.missing::after { content: "trūksta"; color: var(--red); font-size: 11px; }
td.missing.has::after { content: ""; }
.thumb { width: 26px; height: 34px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); cursor: zoom-in;
  background: #f1f5f9; display: block; }
.file { color: var(--muted); font-size: 11.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--muted); font-size: 11px; display: block; white-space: normal; max-width: 260px; margin: 2px auto 0; }
.vendor { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.vendor img { height: 14px; }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; font-size: 13.5px; }
input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }

/* ---------- formos */
label.f { display: block; margin-bottom: 8px; }
label.f > span { display: block; font-size: 12px; color: #334155; font-weight: 600; margin-bottom: 4px; }
label.f input, label.f select, label.f textarea, .inp { width: 100%; background: #fff; border: 1px solid var(--line2);
  border-radius: 5px; padding: 5px 8px; }
label.f input:focus, label.f select:focus, label.f textarea:focus, .inp:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
label.f input.invalid { background: var(--red-bg); border-color: var(--red); }
label.f small { color: var(--muted); font-size: 11px; }
label.f small.e { color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.segment { display: inline-flex; }
.segment .btn { border-radius: 0; min-width: 120px; justify-content: center; }
.segment .btn:first-child { border-radius: 6px 0 0 6px; }
.segment .btn:last-child { border-radius: 0 6px 6px 0; border-left: none; }

/* ---------- prisijungimas */
.auth { max-width: 420px; margin: 7vh auto; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.auth .logo { text-align: center; margin-bottom: 18px; }
.auth .logo img { width: 230px; max-width: 80%; }
.auth h1 { font-size: 17px; margin: 0 0 14px; text-align: center; }
.auth .btn.primary { width: 100%; justify-content: center; padding: 10px; margin-top: 4px; }
.auth .links { text-align: center; margin-top: 12px; font-size: 12.5px; }
.policy { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 16px;
  background: #fbfcfe; font-size: 12.5px; }
.auth.wide { max-width: 760px; }
.policy table, #pol table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.policy th, .policy td, #pol th, #pol td { border: 1px solid var(--line); padding: 5px 7px; vertical-align: top; text-align: left; }
.policy th, #pol th { background: #f1f5f9; }
.policy h1 { font-size: 18px; } .policy h2 { font-size: 15.5px; }

/* ---------- modalinis langas */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 10px; max-width: 1100px; width: 100%; max-height: 94vh; overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.small { max-width: 520px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-h h3 { margin: 0; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-b { padding: 12px 14px; }
.viewer { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 18px; }
.viewer .img { background: #f1f5f9; border-radius: 8px; text-align: center; min-height: 300px; display: flex;
  align-items: flex-start; justify-content: center; overflow: auto; max-height: 76vh; }
.viewer .img img { max-width: 100%; height: auto; }
.viewer .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 12.5px; margin: 6px 0 10px; }
.kv b { color: #334155; }
pre.raw { background: #f8fafc; border: 1px solid var(--line); border-radius: 5px; font: 12px Consolas, monospace;
  max-height: 200px; overflow: auto; padding: 8px; white-space: pre-wrap; }

/* ---------- įkėlimas */
.drop { position: fixed; inset: 0; background: rgba(1, 131, 184, .12); border: 4px dashed var(--accent);
  z-index: 60; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--accent);
  font-weight: 600; pointer-events: none; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff;
  padding: 10px 18px; border-radius: 8px; z-index: 80; max-width: 92vw; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.err { background: var(--red); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.foot { color: var(--muted); font-size: 11.5px; text-align: center; padding: 20px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.vend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vend-list div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; background: #fff; }
.vend-list img { height: 30px; display: block; margin: 0 auto 6px; }

/* ---------- telefonas: lentelė -> kortelės */
.only-mobile { display: none; }
@media (max-width: 760px) {
  .top-in { padding: 8px 12px; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand .t { font-size: 15px; }
  .brand .s { display: none; }
  .top-nav .btn { padding: 4px 8px; font-size: 12.5px; }
  main { padding: 12px 10px 40px; }
  .only-mobile { display: inline-flex; }
  .no-mobile { display: none !important; }
  .row2 { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; }
  .viewer .img { max-height: 55vh; }
  .segment .btn { min-width: 0; flex: 1; }
  table.grid.cards thead { display: none; }
  table.grid.cards, table.grid.cards tbody, table.grid.cards tr, table.grid.cards td { display: block; width: 100%; }
  table.grid.cards tr { border-bottom: 1px solid var(--line); padding: 7px 8px 7px 46px; position: relative;
    min-height: 60px; }
  table.grid.cards td { border: none; padding: 1px 0; background: transparent !important; text-align: left; }
  table.grid.cards td.c-check { position: absolute; left: 10px; top: 46px; width: auto; }
  table.grid.cards td.c-thumb { position: absolute; left: 10px; top: 10px; width: auto; }
  table.grid.cards td.c-file, table.grid.cards td.c-ocr { display: none; }
  table.grid.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 11.5px; }
  table.grid.cards td.st { display: inline-block; width: auto; border-radius: 12px; padding: 2px 10px;
    margin: 3px 4px 0 0; font-size: 11.5px; }
  table.grid.cards td.st.ok { background: var(--green-bg) !important; }
  table.grid.cards td.st.bad { background: var(--red-bg) !important; }
  table.grid.cards td.st.busy { background: var(--amber-bg) !important; }
  table.grid.cards td.st.gray { background: var(--gray-bg) !important; }
  table.grid.cards td.st .sub { text-align: left; margin: 0; }
  table.grid.cards td.c-act { margin-top: 6px; }
}
