:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --ink-2: #44443f;
  --ink-3: #64645d;
  --line: #e3e2dc;
  --line-2: #cfcec6;
  --nav: #1f2a37;
  --nav-ink: #dde4ec;
  --accent: #2563c9;
  --accent-ink: #ffffff;
  --good: #0ca30c;
  --good-bg: #e3f5e3;
  --good-ink: #0b6b0b;
  --warn: #fab219;
  --warn-bg: #fff4d6;
  --warn-ink: #7a5300;
  --bad: #d03b3b;
  --bad-bg: #fbe5e5;
  --bad-ink: #9c2121;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
/* Veľkosť písma – mení sa v menu tlačidlami A− / A+ po 1 px (10–24 px), pamätá si ju prehliadač */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 0.267rem; font-weight: 650; }
h2 { font-size: 1.1rem; margin: 0 0 0.8rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 0 0 0.533rem; font-weight: 650; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .92em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 16.667rem; flex-shrink: 0; background: var(--nav); color: var(--nav-ink);
  display: flex; flex-direction: column; padding: 1.2rem 0.8rem; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 0.667rem; color: #fff; font-weight: 700; font-size: 1.05rem; padding: 0.267rem 0.667rem 1.467rem; }
.brand svg { flex-shrink: 0; }
.nav a {
  display: flex; align-items: center; gap: 0.667rem; padding: 0.667rem 0.8rem; border-radius: 8px;
  color: var(--nav-ink); font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a.primary-action { background: rgba(12,163,12,.18); color: #b8f0b8; margin: 0.4rem 0 0.8rem; }
.nav a.primary-action.active { background: var(--good); color: #fff; }
.nav svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.sidebar .user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 0.933rem 0.667rem 0; font-size: .9rem; }
.sidebar .user b { color: #fff; display: block; }
.sidebar .user a { color: var(--nav-ink); margin-right: 0.667rem; }
.main { flex: 1; min-width: 0; padding: 1.733rem 2.133rem 4rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.067rem; margin-bottom: 1.333rem; flex-wrap: wrap; }
.actions { display: flex; gap: 0.533rem; flex-wrap: wrap; align-items: center; }

/* ---------- cards / grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.333rem; }
.card + .card { margin-top: 1.2rem; }
.grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 1.2rem; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.2rem; }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.grid.half { grid-template-columns: 1fr 1fr; }
.kpi .card { padding: 1.067rem 1.2rem; }
.kpi .label { color: var(--ink-2); font-size: .88rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 2rem; font-weight: 650; margin-top: 0.267rem; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--ink-3); font-size: .9rem; }
.kpi .value.good { color: var(--good-ink); }
.kpi .value.bad { color: var(--bad-ink); }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); padding: 0.533rem 0.933rem; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f0f0ec; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d52aa; }
.btn.success { background: var(--good); border-color: var(--good); color: #fff; }
.btn.success:hover { background: #098a09; }
.btn.danger { color: var(--bad-ink); border-color: #e9b7b7; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 0.333rem 0.733rem; font-size: .9rem; }
.btn.lg { padding: 0.8rem 1.333rem; font-size: 1.05rem; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
label { display: block; font-size: .92rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.333rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 0.6rem 0.733rem; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37,99,201,.35); border-color: var(--accent); }
textarea { min-height: 5.333rem; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.933rem 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { margin-top: 1.333rem; display: flex; gap: 0.667rem; }
.inline-form { display: inline; }
.hint { font-size: .88rem; color: var(--ink-3); margin-top: 0.267rem; }

/* ---------- flash ---------- */
.flash { padding: 0.733rem 0.933rem; border-radius: 8px; margin-bottom: 0.933rem; font-weight: 500; display: flex; gap: 0.533rem; align-items: center; }
.flash.ok { background: var(--good-bg); color: var(--good-ink); border: 1px solid #b9e4b9; }
.flash.error { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid #efc0c0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; padding: 0.6rem 0.667rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data th.num { text-align: right; }
table.data td.num .inline-form { display: inline-block; }
table.data td { padding: 0.533rem 0.667rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td.mono { white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #fafaf7; }
tr.row-ok td { background: var(--good-bg) !important; }
tr.row-partial td { background: var(--warn-bg) !important; }
tr.row-missing td { background: #fff; }
tr.row-ok td:first-child { box-shadow: inset 4px 0 0 var(--good); }
tr.row-partial td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.row-missing td:first-child { box-shadow: inset 4px 0 0 var(--bad); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.333rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--good-bg); color: var(--good-ink); }
.badge.partial { background: var(--warn-bg); color: var(--warn-ink); }
.badge.missing { background: var(--bad-bg); color: var(--bad-ink); }
.badge.neutral { background: #eeeee9; color: var(--ink-2); }
.badge.admin { background: #e1eaf9; color: #1d4b97; }
.badge svg { width: 0.8rem; height: 0.8rem; }

/* ---------- thumbnails ---------- */
.thumb { width: 2.8rem; height: 2.8rem; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: #fafaf7; display: block; cursor: zoom-in; }
.thumb.ph { display: flex; align-items: center; justify-content: center; color: var(--ink-3); cursor: default; }
.thumb.lg { width: 9.333rem; height: 9.333rem; }
.thumb.md { width: 4.267rem; height: 4.267rem; }
.thumb.sm { width: 2.133rem; height: 2.133rem; border-radius: 5px; }
.thumb.ph.proj { color: #2563c9; background: #eef3fc; border-color: #d4e0f5; }
.thumb.ph svg { width: 55%; height: 55%; }
/* nahrávanie obrázka ťahaním */
.imgdrop { position: relative; display: inline-block; vertical-align: middle; border-radius: 7px; }
.imgdrop .thumb.ph { cursor: pointer; }
.imgdrop-btn { position: absolute; right: -0.4rem; bottom: -0.4rem; width: 1.333rem; height: 1.333rem; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; }
.imgdrop-btn svg { width: 0.733rem; height: 0.733rem; }
.imgdrop:hover .imgdrop-btn { display: flex; }
.imgdrop.over { outline: 3px dashed var(--accent); outline-offset: 3px; }
.imgdrop.over .thumb { opacity: .5; }
.imgdrop.busy .thumb { opacity: .35; }
.imgdrop.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.067rem; height: 1.067rem; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 1.333rem; bottom: 1.333rem; z-index: 300; padding: 0.733rem 1.067rem; border-radius: 8px; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.ok { background: var(--good-bg); color: var(--good-ink); border: 1px solid #b9e4b9; }
.toast.error { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid #efc0c0; }
.title-with-img { display: flex; align-items: center; gap: 0.933rem; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 88vh; border-radius: 8px; background: #fff; }

/* ---------- progress ---------- */
.progress { height: 0.667rem; border-radius: 999px; background: var(--bad-bg); display: flex; overflow: hidden; gap: 2px; }
.progress .seg { height: 100%; }
.progress .seg.ok { background: var(--good); }
.progress .seg.partial { background: var(--warn); }
.progress .seg.missing { background: #e8a3a3; }
.progress.big { height: 1.067rem; }
.proj-row { display: grid; grid-template-columns: 4.267rem minmax(0, 1fr) 6rem; gap: 0.4rem 1.067rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.proj-row:last-child { border-bottom: none; }
.proj-row .title { font-weight: 600; }
.proj-row .pct { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.proj-row .bar, .proj-row .foot { grid-column: 2 / -1; position: relative; }
.proj-row .pimg { grid-row: 1 / span 3; align-self: center; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.donut { position: relative; width: 12.667rem; height: 12.667rem; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .center b { font-size: 2.1rem; font-variant-numeric: tabular-nums; }
.donut .center span { font-size: .9rem; color: var(--ink-2); }
.donut circle.seg { transition: stroke-width .15s; cursor: default; }
.donut circle.seg:hover { stroke-width: 22; }
.legend { display: flex; flex-direction: column; gap: 0.667rem; }
.legend .item { display: flex; align-items: center; gap: 0.667rem; }
.legend .sw { width: 0.8rem; height: 0.8rem; border-radius: 3px; flex-shrink: 0; }
.legend .val { font-weight: 650; font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 1.067rem; }

/* top missing bars */
.hbar { display: grid; grid-template-columns: 2.533rem minmax(0, 1fr) 3.6rem; gap: 0.667rem; align-items: center; padding: 0.467rem 0; }
.hbar .track { height: 0.533rem; background: transparent; border-radius: 4px; margin-top: 0.267rem; }
.hbar .fill { height: 100%; background: var(--bad); border-radius: 0 4px 4px 0; min-width: 0.267rem; }
.hbar .name { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tooltip */
.tip { position: fixed; pointer-events: none; background: #1c1c1a; color: #fff; font-size: .95rem; padding: 0.533rem 0.8rem; border-radius: 6px; z-index: 200; display: none; max-width: 21.333rem; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.2); }

/* ---------- receive ---------- */
.scan-box { display: flex; gap: 0.667rem; }
.scan-box input { font-size: 1.25rem; padding: 0.933rem 1.067rem; font-family: Consolas, "SF Mono", Menlo, monospace; }
.part-head { display: flex; gap: 1.2rem; align-items: flex-start; }
.part-head .meta { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.933rem; font-size: .95rem; margin-top: 0.533rem; }
.part-head .meta dt { color: var(--ink-2); }
.part-head .meta dd { margin: 0; font-weight: 500; }
.alloc-input { width: 6.5em !important; text-align: right; font-size: 1.1rem; font-weight: 600; }
.qty-total { display: flex; align-items: center; gap: 0.667rem; background: #f4f7fd; border: 1px solid #d4e0f5; border-radius: 8px; padding: 0.8rem 0.933rem; margin-bottom: 0.933rem; flex-wrap: wrap; }
.qty-total input { width: 7em; font-size: 1.1rem; font-weight: 600; }
.sum-line { margin-top: 0.8rem; font-weight: 600; }
.empty { text-align: center; color: var(--ink-3); padding: 2rem 0.667rem; }

.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filters a { padding: 0.4rem 0.867rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: .92rem; font-weight: 550; }
.filters a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters a:hover { text-decoration: none; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--nav); }
.login-card { width: 24rem; max-width: calc(100vw - 2.133rem); }
.login-card .brand { color: var(--ink); padding: 0 0 1.2rem; }

details.more summary { cursor: pointer; color: var(--accent); font-weight: 550; }

@media (max-width: 1100px) {
  .grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.half { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  form.card > div[style*="grid-template-columns:minmax(0,2fr)"] { grid-template-columns: 1fr 1fr !important; }
}
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  /* zbalené menu: logo + rad ikoniek + tlačidlo Menu */
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 50; flex-direction: column; align-items: stretch; padding: 0.533rem 0.667rem; }
  .brand { padding: 0.267rem 0.4rem 0.4rem; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto; background: rgba(255,255,255,.1); color: #fff;
    border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 0.4rem 0.7rem; font: inherit; font-weight: 600; cursor: pointer; }
  .menu-toggle svg { width: 1.3em; height: 1.3em; }
  .menu-toggle .i-close { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 0.267rem; }
  .nav a { padding: 0.533rem 0.667rem; margin: 0; }
  .nav a span { display: none; }
  .nav a .nav-count { display: inline-block; margin-left: 0.2rem; }
  .sidebar .user { display: none; }
  /* rozbalené menu: celé názvy pod sebou + písmo a používateľ */
  .sidebar.open { max-height: 100vh; overflow-y: auto; }
  .sidebar.open .menu-toggle .i-open { display: none; }
  .sidebar.open .menu-toggle .i-close { display: inline; }
  .sidebar.open .nav { flex-direction: column; flex-wrap: nowrap; }
  .sidebar.open .nav a { padding: 0.75rem 0.9rem; font-size: 1.1rem; }
  .sidebar.open .nav a span { display: inline; }
  .sidebar.open .nav a .nav-count { margin-left: auto; }
  .sidebar.open .user { display: block; margin: 0.6rem 0 0.2rem; border-top: 1px solid rgba(255,255,255,.1); padding: 0.8rem 0.4rem 0; }
  .sidebar.open .fontsize span { display: inline; }
  .main { padding: 1.067rem; }
  .form-grid { grid-template-columns: 1fr; }
  .part-head { flex-direction: column; }
}
@media print {
  .sidebar, .actions, .no-print { display: none !important; }
  .main { padding: 0; }
}

/* prepínač veľkosti písma */
.fontsize { display: flex; align-items: center; gap: 5px; margin: 0 0 12px; }
.fontsize span { margin-right: 4px; }
.fontsize button { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; cursor: pointer; font-weight: 700; line-height: 1; padding: 0; width: 32px; height: 28px; font-family: inherit; font-size: 13px; }
.fontsize button.fs-val { width: 36px; background: transparent; font-weight: 600; font-variant-numeric: tabular-nums; }
.fontsize button:disabled { opacity: .35; cursor: default; }
.fontsize button:hover { background: rgba(255,255,255,.18); }
@media (max-width: 760px) { .fontsize { margin: 0 8px 0 0; } .fontsize span { display: none; } }

/* umiestnenie v sklade */
.loc { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.267rem 0.533rem; line-height: 1.3; }
.loc .rack { font-family: Consolas, "SF Mono", Menlo, monospace; font-weight: 700; background: #e1eaf9; color: #1d4b97; padding: 1px 0.467rem; border-radius: 5px; }
.loc .rack:hover { text-decoration: none; background: #cddcf5; }
.loc .rack-name { font-weight: 600; }
.loc .shelf { color: var(--ink-2); white-space: nowrap; }
.rack-row { display: grid; grid-template-columns: 7em minmax(0,1.4fr) minmax(0,1.4fr) minmax(0,1fr) 4em 9em; gap: 0.667rem; align-items: center; padding: 0.533rem 0; border-bottom: 1px solid var(--line); }
.rack-row:last-of-type { border-bottom: none; }
.rack-row.new { border: none; align-items: end; padding: 0; }
.rack-row.head { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line-2); padding-top: 0; }
@media (max-width: 1100px) { .rack-row { grid-template-columns: 1fr 1fr; } .rack-row.head { display: none; } }
.rack-row input, .rack-row select { padding: 0.4rem 0.533rem; }

/* pole na obrázok vo formulári */
.formdrop { display: flex; align-items: center; gap: 0.933rem; padding: 0.667rem 0.933rem; border: 2px dashed var(--line-2); border-radius: 10px; cursor: pointer; background: #fafaf7; }
.formdrop:hover { border-color: var(--accent); }
.formdrop.over { border-color: var(--accent); background: #eef3fc; }
.formdrop .thumb { cursor: pointer; }
.formdrop-name { color: var(--good-ink); font-weight: 600; margin-top: 2px; }

/* časová os projektov (dashboard) */
.tl { display: flex; flex-direction: column; gap: 0.55rem; }
.tl-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 13.5rem; gap: 0.8rem; align-items: center; }
.tl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; height: 1.8rem; }
.tl-head .tl-track, .tl-foot .tl-track { height: 1.1rem; }
.tl-tick { position: absolute; top: 0; transform: translateX(-2px); font-size: .78rem; color: var(--ink-3); white-space: nowrap; border-left: 1px solid var(--line-2); padding-left: 4px; line-height: 1.1rem; }
.tl-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); }
.tl-bar { position: absolute; top: 0.25rem; bottom: 0.25rem; border-radius: 4px; overflow: hidden; min-width: 4px; cursor: default; }
.tl-bar .tl-fill { height: 100%; }
.tl-bar.plan { background: #c9d9f4; } .tl-bar.plan .tl-fill { background: #2563c9; }
.tl-bar.warn { background: #fde7b4; } .tl-bar.warn .tl-fill { background: #fab219; }
.tl-bar.late { background: #f3c4c4; } .tl-bar.late .tl-fill { background: #d03b3b; }
.tl-bar.ok   { background: #0ca30c; } .tl-bar.ok .tl-fill { background: #0ca30c; }
.tl-open { position: absolute; top: 0.62rem; height: 0.55rem; right: 0; border-radius: 4px 0 0 4px; background: repeating-linear-gradient(90deg, #d8d7d0 0 6px, transparent 6px 10px); }
.tl-today { position: absolute; top: -0.35rem; bottom: -0.35rem; border-left: 2px solid var(--ink); opacity: .55; }
.tl-today-label { position: absolute; transform: translateX(-50%); font-size: .78rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.tl-label { font-size: .85rem; color: var(--ink-2); display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }
.tl-label.ok { color: var(--good-ink); font-weight: 600; }
.tl-label.warn { color: var(--warn-ink); font-weight: 600; }
.tl-label.late { color: var(--bad-ink); font-weight: 600; }
@media (max-width: 760px) { .tl-row { grid-template-columns: 6rem minmax(0, 1fr); } .tl-label { display: none; } }
.grid.charts { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); margin-bottom: 1.2rem; align-items: stretch; }
.grid.charts > .card { margin: 0; }
@media (max-width: 1100px) { .grid.charts { grid-template-columns: 1fr; } }

/* lokácie a regály */
.loc .loc-place { color: var(--ink-2); font-weight: 600; }
.loc .loc-place::after { content: "›"; margin-left: 0.5rem; color: var(--ink-3); font-weight: 400; }
.loc-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.loc-grid > .card { margin: 0; }
.loc-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 0.667rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.loc-row.new { align-items: end; border: none; padding: 0; }
.loc-row.head, .rack-row.head { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line-2); padding-top: 0; }
.loc-row input, .rack-row input, .rack-row select { padding: 0.4rem 0.533rem; }
.rack-row { grid-template-columns: 6rem minmax(0, 1.2fr) minmax(0, 1fr) 4.5rem minmax(0, 1.2fr) minmax(0, 1fr) 3.5rem 8.5rem !important; }
.rack-group { margin-top: 0.9rem; padding: 0.3rem 0; font-weight: 700; color: var(--accent); border-bottom: 2px solid #d4e0f5; }
.place-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 2px 0.8rem; align-items: center; }
.place-grid .hint { margin: 0; }
.place-grid select, .place-grid input { width: 100%; }
@media (max-width: 1100px) { .loc-grid { grid-template-columns: 1fr; } .rack-row { grid-template-columns: 1fr 1fr !important; } .rack-row.head { display: none; } .place-grid { grid-template-columns: 1fr 1fr; } }

/* pripomienky */
.nav-count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: .78rem; font-weight: 700; padding: 0.1rem 0.5rem; }
.fb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
.fb-grid > .card { margin: 0; }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fb-kind { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; padding: 0.45rem 0.8rem; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 500; color: var(--ink); cursor: pointer; }
.fb-kind:has(input:checked) { border-color: var(--accent); background: #eef3fc; }
.fb-item { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.fb-item:last-child { border-bottom: none; }
.fb-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.fb-body { display: flex; gap: 0.9rem; align-items: flex-start; }
.fb-reply { margin-top: 0.6rem; padding: 0.6rem 0.8rem; background: #f4f7fd; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.badge.fb-st-nova { background: #e1eaf9; color: #1d4b97; }
.badge.fb-st-riesi_sa { background: var(--warn-bg); color: var(--warn-ink); }
.badge.fb-st-hotovo { background: var(--good-bg); color: var(--good-ink); }
.badge.fb-st-zamietnute { background: #eeeee9; color: var(--ink-2); }
@media (max-width: 1100px) { .fb-grid { grid-template-columns: 1fr; } }
.pp-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; }

/* skenovanie kódov kamerou */
.scan-btn svg { width: 1.2em; height: 1.2em; }
.scan-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.scan-overlay[hidden] { display: none; }
.scan-dialog { background: var(--surface); border-radius: 12px; padding: 1rem; width: min(36rem, 100%); display: flex; flex-direction: column; gap: 0.7rem; }
.scan-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.scan-video-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 22% 10%; border: 3px solid rgba(255,255,255,.85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.scan-msg { text-align: center; color: var(--ink-2); min-height: 1.2em; }
.scan-choices { display: flex; flex-direction: column; gap: 0.4rem; }
.scan-choices .btn { justify-content: center; font-family: Consolas, "SF Mono", Menlo, monospace; white-space: normal; }
@media (max-width: 760px) { .scan-box { flex-wrap: wrap; } .scan-box input { flex-basis: 100%; } .scan-box .btn { flex: 1; justify-content: center; } }
input.stock-input { width: 5.067rem; text-align: right; padding: 0.333rem 0.467rem; font-weight: 700; }
#stock-dlg .btn { white-space: normal; text-align: left; justify-content: flex-start; display: block; }

/* automatické obnovovanie dashboardu */
.refresh-box { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.6rem; }
.refresh-box svg { width: 1.05rem; height: 1.05rem; color: var(--ink-2); }
.refresh-box label { margin: 0; color: var(--ink); }
.refresh-box select { width: auto; padding: 0.3rem 0.5rem; }
