/* sandelis.daliubaze.lt — mobilus pirmiausia, jokių CDN */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f4f6f9; color: #1c2733; }
a { color: inherit; text-decoration: none; }

/* --- viršutinė juosta --- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #1c2733; color: #fff; }
.app-title { font-weight: 700; font-size: 17px; }
.wh-badge { background: #2f9e6e; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.spacer { flex: 1; }
.user { font-size: 13px; opacity: .85; }
.logout { font-size: 12px; background: #3a4a5c; padding: 6px 10px; border-radius: 6px; }

.content { padding: 14px; max-width: 760px; margin: 0 auto; }

/* --- KPI --- */
.kpi-row { display: flex; gap: 8px; margin-bottom: 12px; }
.kpi { flex: 1; background: #fff; border-radius: 10px; padding: 10px 8px; text-align: center;
  box-shadow: 0 1px 3px rgba(16,34,56,.08); }
.kpi-num { display: block; font-size: 22px; font-weight: 800; color: #17456e; }
.kpi-label { font-size: 11px; color: #5c6b7a; }

/* --- perspėjimo juosta --- */
.banner { display: block; padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
.banner.warn { background: #fff4d6; color: #7a5b00; border: 1px solid #f0d98c; }

/* --- plytelės --- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: #fff; border-radius: 12px; padding: 18px 6px; text-align: center;
  box-shadow: 0 1px 3px rgba(16,34,56,.08); font-size: 26px; transition: transform .06s; }
.tile:active { transform: scale(.97); }
.tile span { display: block; font-size: 13px; font-weight: 600; margin-top: 6px; color: #33414f; }

/* --- meta eilutė --- */
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: #6b7887; }

/* --- prisijungimas --- */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: #1c2733; }
.login-box { background: #fff; border-radius: 14px; padding: 28px 22px; width: min(360px, 92vw);
  display: flex; flex-direction: column; gap: 12px; }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-box input { padding: 12px; border: 1px solid #cdd6e0; border-radius: 8px; font-size: 16px; }
.login-box button { padding: 12px; border: 0; border-radius: 8px; background: #17456e; color: #fff;
  font-size: 16px; font-weight: 700; }
.error { background: #fde3e3; color: #8a1f1f; padding: 10px; border-radius: 8px; font-size: 14px; text-align: center; }

/* --- skenavimo juosta --- */
.scanbar { display: flex; gap: 8px; padding: 8px 14px; background: #fff;
  box-shadow: 0 1px 3px rgba(16,34,56,.08); position: sticky; top: 52px; z-index: 9; }
#scanInput { flex: 1; padding: 12px; font-size: 16px; border: 2px solid #17456e; border-radius: 8px; }
.btn-cam { border: 0; background: #17456e; color: #fff; border-radius: 8px; font-size: 20px; padding: 0 16px; }
.flash-err { animation: ferr .4s; }
@keyframes ferr { 0%,100% { background: #f4f6f9; } 50% { background: #ffdada; } }

/* --- sąrašai --- */
.list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px;
  padding: 12px 12px; box-shadow: 0 1px 3px rgba(16,34,56,.07); }
.row.clickable:active { transform: scale(.985); }
.row.done { opacity: .45; }
.row-code { font-family: ui-monospace, monospace; font-weight: 800; color: #17456e; min-width: 86px; }
.row-name { flex: 1; font-size: 13px; color: #33414f; overflow: hidden; }
.row-qty { font-weight: 700; white-space: nowrap; }
.small { font-size: 12px; }
.muted { color: #8b97a5; padding: 14px; text-align: center; }
.ok-text { color: #1d7a4f; }
.warn-text { color: #a06a00; }
.hidden { display: none !important; }

/* --- ženklai --- */
.badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.b-ok { background: #d9f2e4; color: #14663d; }
.b-warn { background: #fff0c9; color: #8a6a00; }
.b-wait { background: #e3e8ee; color: #55637a; }
.grp { margin: 14px 0 6px; font-size: 14px; }
.g-ok { color: #14663d; } .g-warn { color: #a06a00; } .g-wait { color: #55637a; }

/* --- kortelės / mygtukai / formos --- */
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(16,34,56,.08); }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.page-head h2 { font-size: 18px; flex: 1; }
.hint { font-size: 12px; color: #6b7887; margin-bottom: 8px; }
.btn { display: inline-block; border: 0; background: #e8eef5; color: #17456e; font-weight: 700;
  padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.btn.danger { background: #f7e0e0; color: #8a1f1f; }
.btn.small { padding: 6px 10px; font-size: 12px; }
input, select { padding: 10px; border: 1px solid #cdd6e0; border-radius: 8px; font-size: 15px; }
.item-head { display: flex; gap: 8px; align-items: center; font-size: 17px; }
.item-name { font-size: 14px; color: #33414f; margin: 4px 0; }
.item-meta { font-size: 12px; color: #6b7887; }
.tag { background: #e8eef5; color: #17456e; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.tag.t2 { background: #efe6f7; color: #5d3a8a; }
.actions-row { display: flex; gap: 8px; margin-bottom: 12px; }
.loc-hint { font-family: ui-monospace, monospace; font-size: 11px; color: #1d7a4f; }
.inv-edit { display: flex; gap: 6px; align-items: center; }
.inv-edit input { width: 70px; padding: 6px; }
.banner.ok { background: #d9f2e4; color: #14663d; border: 1px solid #b9e4cd; }
.mono { font-size: 12px; background: #10202f; color: #cde3f5; padding: 10px; border-radius: 8px;
  overflow: auto; white-space: pre-wrap; margin-top: 10px; }

/* --- modal / kandidatai --- */
.modal { position: fixed; inset: 0; background: rgba(12,22,36,.55); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; padding: 16px; width: min(420px, 92vw);
  display: flex; flex-direction: column; gap: 8px; max-height: 80vh; overflow: auto; }
.cand { padding: 10px; border-radius: 8px; background: #f0f4f9; font-size: 14px; }

/* --- toast --- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px);
  background: #10202f; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; transition: all .25s; z-index: 60; max-width: 92vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #8a1f1f; }

/* --- kamera --- */
.cam-overlay { position: fixed; inset: 0; background: #000; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cam-overlay video { width: 100vw; max-height: 80vh; object-fit: contain; }
.cam-hint { color: #fff; padding: 12px; }
.cam-stop { position: absolute; top: 16px; right: 16px; }

/* --- sandėlio perjungimas --- */
.wh-switch { background: #2f9e6e; color: #fff; border: 0; border-radius: 4px; font-weight: 700;
  font-size: 12px; padding: 4px 6px; }
.wh-switch option { color: #1c2733; }

/* --- lentynų žemėlapis --- */
.map { border-collapse: collapse; width: 100%; font-size: 11px; }
.map th { background: #17456e; color: #fff; padding: 5px; }
.map td { border: 1px solid #d7dfe8; text-align: center; padding: 6px 4px; min-width: 42px; cursor: pointer; }
.map td span { display: block; color: #55637a; font-size: 10px; }
.map td.zero { background: #f4d7d7; }
.map td.low { background: #fdf3d0; }
.map td.mid { background: #d9ecd9; }
.map td.empty { background: #eef1f5; cursor: default; }

/* --- likuciai --- */
.lik-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.lik-bar input[type=search] { flex: 1; }
.lik-row.zero { opacity: .5; }
.lik-loc { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.lik-loc input { width: 80px; padding: 6px; }
.lik-edit { background: #f0f4f9; border-radius: 8px; padding: 8px; margin-top: 6px; }
.lik-nav { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 10px 0; }
.tile.big { grid-column: span 1; background: #17456e; color: #fff; }
.tile.big span { color: #fff; }

/* --- kompaktiški likuciai + thumb --- */
.lik-list .row { padding: 5px 8px; gap: 7px; }
.lik-list .row-name, .lik-list .loc-hint { font-size: 12px; }
.lik-list .row-code { font-size: 13px; min-width: 76px; }
.thumb { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 6px;
  border: 1px solid #e3e8ee; flex-shrink: 0; }
.ord-entry { display: flex; gap: 8px; margin-bottom: 10px; }
.ord-entry input { flex: 1; padding: 12px; font-size: 16px; border: 2px solid #17456e; border-radius: 8px; }
#likLoc { max-width: 140px; }

/* --- priėmimo įvedimas --- */
.intake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.intake-grid label { font-size: 12px; color: #55637a; display: flex; flex-direction: column; gap: 3px; }
.intake-grid input, .intake-grid select { width: 100%; }

/* --- filtrų juosta --- */
.filt-bar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; gap: 6px;
  margin-bottom: 8px; align-items: center; }
.filt-bar select, .filt-bar input { padding: 8px; font-size: 13px; min-width: 0; }
@media (max-width: 900px) { .filt-bar { grid-template-columns: 1fr 1fr; } }

/* --- inventorizacijos dropzona + chip --- */
.dropzone { border: 2px dashed #b9c6d4; border-radius: 10px; padding: 16px; text-align: center;
  color: #55637a; background: #f8fafc; margin: 8px 0; }
.dropzone.over { border-color: #17456e; background: #eaf2fa; }
.dropzone .link { color: #17456e; text-decoration: underline; cursor: pointer; }
.chip { background: #eef3f8; border: 1px solid #d7dfe8; border-radius: 16px; padding: 6px 12px;
  font-size: 12px; color: #33414f; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
