@font-face { font-family: "Roboto Condensed"; font-weight: 100 900; font-display: swap; src: url(/fonts/rc-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Roboto Condensed"; font-weight: 100 900; font-display: swap; src: url(/fonts/rc-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Inter; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --navy: #13233f; --navy-2: #1e3358; --navy-soft: #e8ecf4; --sea: #1f7a8c; --sea-2: #16606e; --bloom: #d9668a;
  --bg: #f5f3ef; --card: #fff; --line: #e4e1da; --line-2: #efece6; --ink: #18212f; --muted: #6a7280; --faint: #9aa1ab;
  --ok: #2f8a5b; --ok-soft: #e3f3ea; --warn: #c27a12; --warn-soft: #fbf0dc; --bad: #c2413a; --bad-soft: #fbe5e3; --head: #c9d2e3;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 Inter, system-ui, sans-serif; }
a { color: var(--sea); text-decoration: none; } a:hover { color: var(--sea-2); }
h1, h2, h3 { font-family: "Roboto Condensed", Inter, sans-serif; color: var(--navy); margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

/* hlavička */
.top { background: var(--navy); color: #fff; height: 60px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20; }
.top .brand { display: flex; align-items: center; gap: 10px; color: #fff; font: 700 19px "Roboto Condensed", sans-serif; }
.top .left, .top .right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top select, .top input { height: 36px; border-radius: 8px; border: 1px solid var(--navy-2); background: var(--navy-2); color: #fff; padding: 0 10px; }
.top input::placeholder { color: #aab4c8; }
.top .icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--navy-2); background: var(--navy-2); color: #fff; cursor: pointer; display: grid; place-items: center; }
.top .badge { position: absolute; top: 4px; right: 4px; background: var(--bloom); color: var(--navy); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 5px; }
.top .who { color: var(--head); font-size: 13px; }
.top .btn { color: var(--ink); }
.top .menu-btn { display: none; }

/* rozvržení */
.layout { display: flex; min-height: calc(100vh - 60px); }
.side { width: 232px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.side a { color: var(--ink); padding: 9px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.side a:hover { background: var(--bg); }
.side a.on { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.side .sep { height: 1px; background: var(--line-2); margin: 8px 4px; }
.pill { background: var(--bloom); color: var(--navy); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
main { flex: 1; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 1480px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* karty a mřížky */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { margin-bottom: 10px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpi .l { color: var(--muted); font-size: 13px; } .kpi .v { font: 700 32px "Roboto Condensed", sans-serif; color: var(--navy); white-space: nowrap; } .kpi .s { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.split { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.split > .list { flex: 1 1 360px; max-width: 470px; } .split > .detail { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* tlačítka a pole */
.btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #cfcac0; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.f input, .f select, .f textarea, input.in, select.in { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; color: var(--ink); font-size: 14px; width: 100%; min-width: 0; }
.f textarea { height: auto; min-height: 70px; padding: 8px 10px; }
.f input.r { text-align: right; } .f input.err { border-color: var(--bad); color: var(--bad); }
.f input:disabled, .f select:disabled, .f textarea:disabled { background: #faf9f7; color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form .w2 { grid-column: span 2; } .form .w3 { grid-column: 1 / -1; }
.sect { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; margin: 16px 0 8px; }
.tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; cursor: pointer; }
.tile.on { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); font-weight: 600; }

/* záložky */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { height: 42px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs button.on { border-bottom-color: var(--navy); color: var(--navy); font-weight: 600; }
.seg { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; font-weight: 600; }

/* tabulky */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; } .t tbody tr.click:hover td { background: #faf9f7; }
.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.t td.c, .t th.c { text-align: center; }
.t th.r, .t td.r { text-align: right; }
.t input.in, .t select.in { height: 34px; }

/* seznam dokladů */
.li { padding: 12px 16px; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; cursor: pointer; }
.li:hover { background: #faf9f7; }
.li.on { background: var(--navy-soft); box-shadow: inset 3px 0 0 var(--navy); }
.li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .m { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .r { text-align: right; white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: #1f6b44; } .chip.warn { background: var(--warn-soft); color: #8a5609; } .chip.bad { background: var(--bad-soft); color: #9b2f29; } .chip.info { background: var(--navy-soft); color: var(--navy); } .chip.mute { background: var(--line-2); color: var(--muted); }
.preview { border: 1px dashed var(--faint); border-radius: 10px; background: #faf9f7; min-height: 320px; display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.preview.nofile { min-height: 120px; }
.preview iframe, .preview img { width: 100%; height: 520px; border: 0; object-fit: contain; background: #fff; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: #fff; }
.drop.over { border-color: var(--sea); background: #e2f1f3; }

/* graf */
.bars { height: 200px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.bars .b { display: flex; gap: 4px; align-items: end; justify-content: center; height: 100%; }
.bars span { width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; }
.blabels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 6px 0 12px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.prog { height: 8px; background: var(--line-2); border-radius: 4px; margin-top: 4px; } .prog > div { height: 8px; border-radius: 4px; }

/* panely, dialogy, hlášky */
.drawer { position: fixed; top: 60px; right: 0; width: 400px; max-width: 100vw; height: calc(100vh - 60px); background: #fff; border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(19,35,63,.08); z-index: 30; padding: 18px; overflow-y: auto; }
.nt { padding: 12px 0; border-top: 1px solid var(--line-2); display: flex; gap: 12px; cursor: pointer; }
.nt .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(19,35,63,.35); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 20px; width: 640px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal.wide { width: 980px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--bad); }
#zb, #ab, #nb2, #nb3, #det-wrap { display: flex; flex-direction: column; gap: 16px; }
#zb td, #zb th { white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.login { max-width: 400px; margin: 10vh auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.note { background: var(--warn-soft); color: #6b4507; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.note.info { background: var(--navy-soft); color: var(--navy); }
.sticky-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* telefon */
@media (max-width: 900px) {
  .top .menu-btn { display: grid; }
  .side { position: fixed; left: 0; top: 60px; z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 0 24px rgba(0,0,0,.08); }
  .side.open { transform: none; }
  main { padding: 14px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g2, .g21 { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top .hide-m { display: none !important; }
  .top { padding: 0 10px; }
  .preview { min-height: 140px; }
  .split > .list { max-width: none; }
  .kpi .v { font-size: 26px; }
}
@media (max-width: 520px) { .form { grid-template-columns: minmax(0, 1fr); } .form .w2 { grid-column: auto; } .g4 { grid-template-columns: minmax(0, 1fr); } }
@media print { .top, .side, .actions, .btn { display: none !important; } main { padding: 0; } .card { border: 0; } }
