/* ==========================================================================
   MVsoft – vlastný dizajn
   Firemné farby prichádzajú z config.php (brand) ako --brand, --brand-dark,
   --brand-accent, --ok, --bad. Jantárová (--due) všade znamená „čaká na fakturáciu“.
   ========================================================================== */
:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --ink: #17212b;
  --steel: #5b6b79;
  --mute: #8a97a3;
  --line: #e1e6eb;
  --line-soft: #eef1f4;
  --due: var(--brand-accent);
  --brand-tint: color-mix(in srgb, var(--brand) 9%, #fff);
  --due-tint: color-mix(in srgb, var(--due) 14%, #fff);
  --ok-tint: color-mix(in srgb, var(--ok) 12%, #fff);
  --bad-tint: color-mix(in srgb, var(--bad) 10%, #fff);
  --r-panel: 12px;
  --r-ctl: 8px;
  --rail-w: 248px;
}

/* ---------- základ ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 0.9rem; line-height: 1.5; color: var(--ink); background: var(--paper);
  font-feature-settings: 'tnum' 1;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 1.15rem; } h5 { font-size: 1rem; }
.text-muted { color: var(--mute) !important; }
.text-brand { color: var(--brand) !important; }
.text-due { color: color-mix(in srgb, var(--due) 75%, #000) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- kostra: bočná lišta + obsah ---------- */
.shell { display: flex; min-height: 100vh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 1040;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 14px 12px;
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); }
.rail-brand:hover { color: var(--ink); }
.rail-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; letter-spacing: .02em;
}
.rail-logo { max-height: 34px; max-width: 120px; }
.rail-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.rail-cta { margin: 0 0 14px; border-radius: var(--r-ctl); padding: .5rem .75rem; }
.rail-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.rail-group { font-size: .75rem; font-weight: 600; color: var(--mute); padding: 14px 10px 6px; }
.rail-link {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 1px;
  border-radius: var(--r-ctl); color: var(--steel); font-weight: 500;
}
.rail-link i { color: var(--mute); font-size: .95rem; }
.rail-link:hover { background: var(--paper); color: var(--ink); }
.rail-link.is-active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }
.rail-link.is-active i { color: var(--brand); }
.rail-link.is-active::before { content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.rail-user { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 8px; }
.rail-user-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; background: none; border-radius: var(--r-ctl); text-align: left; }
.rail-user-btn:hover { background: var(--paper); }
.rail-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rail-user-text b { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-text small { color: var(--mute); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem;
}
.rail-scrim { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--rail-w); display: flex; flex-direction: column; }
.topbar { display: none; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px 32px 18px; max-width: 1480px; width: 100%;
}
.page-head h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.025em; margin: 0; line-height: 1.15; }
.page-sub { color: var(--steel); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.trail { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--mute); margin-bottom: 6px; }
.trail a { color: var(--steel); }
.trail a:hover { color: var(--brand); }
.trail-sep { color: var(--line); }
.trail-sep:last-child { display: none; }
.trail-back {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; margin-right: 4px;
}
.page-body { padding: 0 32px 32px; max-width: 1480px; width: 100%; flex: 1; }
.foot { display: flex; justify-content: space-between; padding: 16px 32px; color: var(--mute); font-size: .78rem; border-top: 1px solid var(--line); }
.foot a { color: var(--steel); }

@media (max-width: 991.98px) {
  .rail { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.rail-open .rail { transform: none; box-shadow: 0 0 40px rgba(23,33,43,.18); }
  body.rail-open .rail-scrim { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(23,33,43,.35); }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
  .topbar-title { font-weight: 800; letter-spacing: -0.02em; }
  .page-head { padding: 20px 16px 14px; }
  .page-head h1 { font-size: 1.4rem; }
  .page-body { padding: 0 16px 24px; }
  .foot { padding: 14px 16px; }
}
.icon-btn { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 36px; border-radius: var(--r-ctl); color: var(--ink); }

/* ---------- panely (Bootstrap .card) ---------- */
.card { border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: none; margin-bottom: 20px; background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line-soft); padding: 14px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-header:first-child { border-radius: var(--r-panel) var(--r-panel) 0 0; }
.card-title { font-size: .98rem; font-weight: 700; margin: 0; }
.card-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px; }
.card-footer { background: var(--paper); border-top: 1px solid var(--line-soft); padding: 12px 18px; border-radius: 0 0 var(--r-panel) var(--r-panel); }
.card.card-body { padding: 14px 18px; }
.card-outline { border-top: 1px solid var(--line); }
.panel-flat { background: transparent; border: 0; }

/* ---------- tlačidlá ---------- */
.btn { border-radius: var(--r-ctl); font-weight: 600; font-size: .86rem; padding: .42rem .85rem; }
.btn-sm { font-size: .8rem; padding: .3rem .65rem; }
.btn-xs { font-size: .74rem; padding: .18rem .5rem; border-radius: 6px; font-weight: 600; }
.btn-lg { font-size: 1rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):active { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }
.btn-default, .btn-light { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-default:hover, .btn-light:hover { background: var(--paper); color: var(--ink); border-color: #cfd7de; }
.btn-outline-primary { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, #fff); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-success { background: var(--ok); border-color: var(--ok); }
.btn-success:hover { background: color-mix(in srgb, var(--ok) 85%, #000); border-color: color-mix(in srgb, var(--ok) 85%, #000); }
.btn-due { background: var(--due); border-color: var(--due); color: #2b1d00; }
.btn-due:hover { background: color-mix(in srgb, var(--due) 88%, #000); color: #2b1d00; }
.btn-accent { background: var(--due); border-color: var(--due); color: #2b1d00; }
.btn-accent:hover { color: #2b1d00; filter: brightness(.95); }
.btn-ghost { background: transparent; border: 0; color: var(--steel); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-link { font-weight: 600; }
.btn .fas, .btn .far { margin-right: 2px; }
.dropdown-icon::after { margin-left: 0; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(23,33,43,.12); padding: 6px; font-size: .86rem; }
.dropdown-item { border-radius: 6px; padding: .4rem .7rem; }
.dropdown-item:active { background: var(--brand); }

/* ---------- formuláre ---------- */
label { font-weight: 600; font-size: .82rem; color: var(--steel); margin-bottom: .3rem; }
.form-control, .custom-select { border-radius: var(--r-ctl); border-color: var(--line); color: var(--ink); font-size: .9rem; height: calc(1.5em + .9rem + 2px); }
textarea.form-control { height: auto; }
.form-control-sm { height: calc(1.5em + .5rem + 2px); font-size: .82rem; border-radius: 7px; }
.form-control:focus, .custom-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.form-control[readonly], .form-control:disabled { background: var(--paper); }
.input-group-text { background: var(--paper); border-color: var(--line); }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--brand); border-color: var(--brand); }
.custom-control-label { color: var(--ink); font-weight: 500; }
.custom-range::-webkit-slider-thumb { background: var(--brand); }
.custom-range::-moz-range-thumb { background: var(--brand); }
.form-hint { font-size: .78rem; color: var(--mute); margin-top: 4px; }

/* filter lišta nad tabuľkami */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 14px; }
.filterbar .fb { display: flex; flex-direction: column; min-width: 150px; }
.filterbar .fb label { margin-bottom: 2px; font-size: .74rem; }
.filterbar .fb-wide { min-width: 220px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--steel); font-size: .8rem; font-weight: 500; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- tabuľky ---------- */
.table { color: var(--ink); margin-bottom: 0; }
.table thead th {
  border-top: 0; border-bottom: 1px solid var(--line); font-size: .76rem; font-weight: 600; color: var(--mute);
  padding: .6rem .75rem; vertical-align: bottom; white-space: nowrap; background: transparent;
}
.table td { border-top: 1px solid var(--line-soft); padding: .65rem .75rem; vertical-align: top; }
.table-sm td, .table-sm th { padding: .45rem .6rem; }
.table-hover tbody tr:hover { background: #f8fafb; }
.table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.table tfoot td { border-top: 1px solid var(--line); font-weight: 700; }
.table .thead-light th { background: transparent; color: var(--mute); border-color: var(--line); }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--line-soft); }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { display: block; font-size: .8rem; color: var(--mute); }
.cell-sub.brand { color: var(--brand); }
.table a.cell-main:hover { color: var(--brand); }
tr.is-selected td { background: var(--brand-tint) !important; }
.row-check { width: 17px; height: 17px; cursor: pointer; accent-color: var(--brand); vertical-align: middle; }

/* DataTables */
div.dataTables_wrapper div.dataTables_filter input { border-radius: var(--r-ctl); border: 1px solid var(--line); margin-left: 6px; padding: .3rem .6rem; height: auto; }
div.dataTables_wrapper div.dataTables_length select { border-radius: 7px; border-color: var(--line); }
div.dataTables_wrapper div.dataTables_filter label, div.dataTables_wrapper div.dataTables_length label, div.dataTables_info { color: var(--mute); font-weight: 500; font-size: .8rem; }
div.dataTables_wrapper div.dataTables_paginate ul.pagination { margin-top: 10px; }
.page-link { border: 0; color: var(--steel); border-radius: 7px !important; margin: 0 2px; font-weight: 600; font-size: .8rem; }
.page-item.active .page-link { background: var(--ink); color: #fff; }
.page-item.disabled .page-link { color: var(--line); }
table.dataTable thead .sorting::before, table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before, table.dataTable thead .sorting_desc::after { opacity: .25; }
table.dataTable { margin-top: 6px !important; margin-bottom: 6px !important; }

/* ---------- štítky stavov ---------- */
.badge { font-weight: 600; font-size: .74rem; padding: .28em .62em; border-radius: 999px; letter-spacing: 0; }
.badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; opacity: .8; }
.badge-primary { background: var(--brand-tint); color: var(--brand-dark); }
.badge-info { background: color-mix(in srgb, #2c8fb8 12%, #fff); color: #1d6584; }
.badge-success { background: var(--ok-tint); color: color-mix(in srgb, var(--ok) 80%, #000); }
.badge-warning { background: var(--due-tint); color: color-mix(in srgb, var(--due) 60%, #000); }
.badge-danger { background: var(--bad-tint); color: color-mix(in srgb, var(--bad) 85%, #000); }
.badge-secondary, .badge-light { background: var(--line-soft); color: var(--steel); }
.badge-dark { background: var(--ink); color: #fff; }
.badge.plain::before { display: none; }
.st-nefakturovane { color: color-mix(in srgb, var(--due) 60%, #000); font-weight: 600; }
.st-fakturovane { color: color-mix(in srgb, var(--ok) 80%, #000); font-weight: 600; }

/* ---------- oznamy ---------- */
.note {
  position: relative; display: flex; align-items: center; gap: 10px; padding: .7rem 2.6rem .7rem 1rem; margin-bottom: 16px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); font-weight: 500;
}
.note .close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }
.note-success { border-left-color: var(--ok); }
.note-danger { border-left-color: var(--bad); background: var(--bad-tint); }
.note-warning { border-left-color: var(--due); background: var(--due-tint); }
.note-info { border-left-color: var(--brand); }
.alert { border-radius: 10px; }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; color: var(--steel); }

.empty { text-align: center; padding: 48px 16px; color: var(--steel); }
.empty i { font-size: 1.8rem; color: var(--mute); margin-bottom: 10px; display: block; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }

/* ---------- prehľad (dashboard) ---------- */
.due-band {
  display: grid; grid-template-columns: minmax(260px, 1.2fr) 2fr; gap: 0; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden;
}
.due-main { padding: 22px 24px; background: var(--due-tint); border-right: 1px solid color-mix(in srgb, var(--due) 30%, #fff); }
.due-main .lbl { font-weight: 600; color: color-mix(in srgb, var(--due) 55%, #000); font-size: .85rem; }
.due-main .amt { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 6px 0 2px; }
.due-main .meta { color: var(--steel); font-size: .85rem; }
.due-main .btn { margin-top: 14px; }
.due-side { display: grid; grid-template-columns: repeat(3, 1fr); }
.due-stat { padding: 22px 20px; border-left: 1px solid var(--line-soft); color: var(--ink); display: flex; flex-direction: column; }
.due-stat:first-child { border-left: 0; }
.due-stat:hover { background: #fafbfc; color: var(--ink); }
.due-stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.due-stat .l { color: var(--steel); font-weight: 500; }
.due-stat .h { margin-top: auto; padding-top: 8px; font-size: .8rem; color: var(--brand); font-weight: 600; }
.due-stat.alert-on .v { color: var(--bad); }
@media (max-width: 991.98px) { .due-band { grid-template-columns: 1fr; } .due-main { border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--due) 30%, #fff); } }
@media (max-width: 575.98px) { .due-stat { padding: 14px 12px; } .due-stat .v { font-size: 1.25rem; } .due-stat .l { font-size: .8rem; line-height: 1.3; } .due-stat .h { display: none; } .due-main { padding: 18px; } }

/* účtovná kniha hodín po firmách */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 2.2fr 100px 110px 120px 36px; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.ledger-row:first-child { border-top: 0; }
.ledger-head { font-size: .74rem; color: var(--mute); font-weight: 600; padding-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ledger-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-name small { display: block; font-weight: 500; color: var(--mute); }
.hbar { display: flex; height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.hbar .b-ok { background: var(--ok); }
.hbar .b-due { background: var(--due); }
.ledger-sub { background: #fafbfc; padding-top: 8px; padding-bottom: 8px; font-size: .85rem; }
.ledger-sub .ledger-name { font-weight: 500; padding-left: 14px; }
.ledger-sub .hbar { height: 6px; }
.ledger-toggle { border: 0; background: none; color: var(--mute); width: 28px; height: 28px; border-radius: 6px; }
.ledger-toggle:hover { background: var(--paper); color: var(--ink); }
.ledger-toggle[aria-expanded="true"] i { transform: rotate(90deg); }
.ledger-toggle i { transition: transform .15s; }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--steel); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 991.98px) {
  .ledger-row { grid-template-columns: 1fr auto 32px; row-gap: 6px; column-gap: 10px; padding: 12px 14px; }
  .ledger-row .hbar-wrap { grid-column: 1 / -1; order: 5; }
  .ledger-sub .ledger-name { padding-left: 0; }
  .ledger-row .lg-h, .ledger-row .lg-billed { display: none; }
  .ledger-head { display: none; }
}

/* ---------- detailové stránky ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); margin-bottom: 20px; overflow: hidden; }
.fact { padding: 14px 18px; border-left: 1px solid var(--line-soft); }
.fact:first-child { border-left: 0; }
.fact .l { color: var(--mute); font-size: .78rem; font-weight: 600; }
.fact .v { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
dl.props dt { font-size: .76rem; color: var(--mute); font-weight: 600; margin-top: 10px; }
dl.props dt:first-child { margin-top: 0; }
dl.props dd { margin: 2px 0 0; }
.progress { background: var(--line-soft); border-radius: 999px; height: 8px; }
.progress-bar { background: var(--brand); border-radius: 999px; }
.progress-thin { height: 6px; }

/* časová os aktivít projektu */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 20px 46px; }
.tl-item .avatar { position: absolute; left: 0; top: 0; box-shadow: 0 0 0 4px var(--paper); }
.tl-meta { font-size: .8rem; color: var(--mute); }
.tl-meta b { color: var(--ink); font-weight: 600; }
.tl-body { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 6px; }

/* vlákno tiketu */
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { display: flex; gap: 12px; max-width: 760px; }
.msg-bubble { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.msg .meta { font-size: .78rem; color: var(--mute); margin-bottom: 4px; }
.msg .meta b { color: var(--ink); }
.msg.staff .avatar { background: var(--brand); color: #fff; }
.msg.client .avatar { background: var(--due-tint); color: color-mix(in srgb, var(--due) 55%, #000); }
.msg.internal .msg-bubble { background: #fffaf0; border-style: dashed; border-color: color-mix(in srgb, var(--due) 50%, #fff); }

/* plávajúca lišta hromadných akcií */
.bulk {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 1030;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 12px 10px 18px;
  box-shadow: 0 16px 40px rgba(23,33,43,.28); transition: transform .2s ease, visibility .2s; max-width: calc(100vw - 24px);
}
.bulk:not(.is-visible) { visibility: hidden; }
.bulk.is-visible { transform: translate(-50%, 0); visibility: visible; }
.bulk .bulk-count { font-weight: 700; white-space: nowrap; }
.bulk .bulk-sum { color: #b9c4ce; white-space: nowrap; }
.bulk .form-control { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; width: 150px; }
.bulk .form-control::placeholder { color: #9aa7b3; }
.bulk .btn-ghost { color: #d6dde3; }
.bulk .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (min-width: 992px) { .bulk { left: calc(50% + var(--rail-w) / 2); } }

/* sumárny pruh nad zoznamom */
.sumline { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; color: var(--steel); font-size: .85rem; }
.sumline b { color: var(--ink); }

/* výkaz */
.report-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 2px solid var(--brand); margin-bottom: 20px; }
.report-head h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.report-total { display: flex; gap: 28px; flex-wrap: wrap; }
.report-total .l { color: var(--mute); font-size: .78rem; font-weight: 600; }
.report-total .v { font-size: 1.3rem; font-weight: 800; }
.sub-block { margin-top: 26px; }
.sub-block h5 { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.sub-block h5 small { color: var(--steel); font-weight: 600; }

/* kalendár */
.fc { --fc-border-color: var(--line-soft); --fc-today-bg-color: var(--due-tint); --fc-event-border-color: transparent; font-size: .82rem; }
.fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 700; }
.fc .fc-button { background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .8rem; border-radius: 7px; text-transform: none; box-shadow: none !important; }
.fc .fc-button:hover { background: var(--paper); color: var(--ink); border-color: var(--line); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--ink); border-color: var(--ink); color: #fff; }
.fc .fc-col-header-cell-cushion { color: var(--steel); font-weight: 600; }
.fc .fc-daygrid-day-number { color: var(--steel); }
.fc .fc-event { border-radius: 5px; padding: 1px 4px; font-weight: 500; }

/* ---------- prihlásenie ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth-side { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 56px solid rgba(255,255,255,.07); }
.auth-side .rail-mark { background: #fff; color: var(--brand); }
.auth-side h2 { color: #fff; font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; max-width: 14ch; line-height: 1.1; }
.auth-side p { color: rgba(255,255,255,.8); max-width: 38ch; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 767.98px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 28px 24px; } .auth-side h2 { font-size: 1.5rem; } .auth-side::after { display: none; } }

/* ---------- modal ---------- */
.modal-content { border: 0; border-radius: 14px; }
.modal-header { border-bottom: 1px solid var(--line-soft); }
.modal-footer { border-top: 1px solid var(--line-soft); background: var(--paper); border-radius: 0 0 14px 14px; }

/* ---------- tlač ---------- */
@media print {
  .rail, .topbar, .foot, .no-print, .page-actions, .trail, .bulk, .filterbar, .quick { display: none !important; }
  .main { margin-left: 0 !important; }
  body { background: #fff; font-size: 10.5pt; }
  .page-head, .page-body { padding-left: 0; padding-right: 0; max-width: none; }
  .card { border: 0; }
  .card-body { padding: 0; }
  a { color: inherit !important; }
}

/* ==========================================================================
   Aktíva – trezor prístupov
   ========================================================================== */
.vault-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-panel);
  background: var(--surface); border: 1px solid var(--line); color: var(--steel); }
.vault-bar > i { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--line-soft); color: var(--steel); flex: none; }
.vault-bar.is-open { border-color: color-mix(in srgb, var(--ok) 40%, #fff); background: var(--ok-tint); color: var(--ink); }
.vault-bar.is-open > i { background: var(--ok); color: #fff; }
.vault-lock-icon { width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 16px; display: flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); font-size: 1.5rem; }
.asset-title { display: flex; gap: 10px; align-items: flex-start; }
.asset-ico { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.secret-line { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.secret-val, .mono-ish { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; word-break: break-all; }
.js-secret.is-shown .secret-val { background: var(--due-tint); border-radius: 4px; padding: 0 4px; }
.btn-icon { border: 0; background: none; color: var(--mute); width: 32px; height: 32px; border-radius: 6px; flex: none; }
.btn-icon:hover { background: var(--paper); color: var(--ink); }
.btn-icon.is-done { color: var(--ok); }
.btn-icon.is-done i::before { content: "\f00c"; font-family: 'Font Awesome 5 Free'; font-weight: 900; }
.log-list { list-style: none; margin: 0; padding: 6px 18px 12px; }
.log-list li { padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: .86rem; }
.log-list li:first-child { border-top: 0; }

/* ==========================================================================
   Mobil
   ========================================================================== */
.fab { display: none; }
@media (max-width: 991.98px) {
  .fab {
    display: flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1025;
    width: 56px; height: 56px; border-radius: 50%; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; font-size: 1.3rem; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 40%, transparent);
  }
  .fab:hover, .fab:focus { color: #fff; background: var(--brand-dark); }
  body.bulk-on .fab { display: none; }
  .page-body { padding-bottom: 96px; }
  .rail-link { padding: 10px 10px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
}

@media (max-width: 767.98px) {
  body { font-size: .95rem; }
  /* iOS nepribližuje stránku, keď má pole aspoň 16 px */
  .form-control, .custom-select, .form-control-sm, .bulk .form-control, div.dataTables_wrapper div.dataTables_filter input { font-size: 16px; }
  .form-control, .custom-select { height: 44px; }
  .form-control-sm { height: 40px; }
  textarea.form-control { height: auto; }
  .btn { padding: .55rem .9rem; }
  .btn-sm { padding: .45rem .75rem; }
  .btn-xs { padding: .35rem .6rem; font-size: .8rem; }

  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .page-actions .btn-group { flex: 1 1 100%; display: flex; }
  .page-actions .btn-group .btn { flex: 1; }

  .filterbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .filterbar .fb, .filterbar .fb-wide { min-width: 0; }
  .filterbar .fb-wide { grid-column: 1 / -1; }
  .filterbar > .btn { grid-column: 1 / -1; }
  .quick { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; -webkit-overflow-scrolling: touch; }
  .chip { white-space: nowrap; padding: .4rem .8rem; }

  div.dataTables_wrapper div.dataTables_length, div.dataTables_wrapper div.dataTables_filter { text-align: left; }
  div.dataTables_wrapper div.dataTables_filter label { display: flex; width: 100%; align-items: center; }
  div.dataTables_wrapper div.dataTables_filter input { flex: 1; width: auto; }
  div.dataTables_wrapper .d-flex { flex-wrap: wrap; gap: 6px; }
  div.dataTables_wrapper div.dataTables_paginate ul.pagination { justify-content: center !important; flex-wrap: wrap; }

  /* tabuľky ako karty */
  table.table-stack, table.table-stack tbody, table.table-stack tr, table.table-stack td { display: block; width: 100% !important; }
  table.table-stack thead { display: none; }
  table.table-stack tfoot { display: none; }
  table.table-stack tr { display: flex !important; flex-direction: column; position: relative; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 10px 12px; background: var(--surface); }
  table.table-stack tbody tr:hover { background: var(--surface); }
  table.table-stack td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; text-align: right; }
  table.table-stack td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-size: .78rem; font-weight: 600; color: var(--mute); padding-top: 2px; }
  table.table-stack td[data-label=""]::before { display: none; }
  table.table-stack td.num { white-space: normal; }
  table.table-stack td > * { min-width: 0; }
  /* prvý stĺpec (názov) ako nadpis karty */
  table.table-stack tr:has(.stack-corner) td.stack-title { padding-right: 84px; }
  table.table-stack td.stack-title { order: -1; padding-right: 8px; display: block; text-align: left; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
  table.table-stack td.stack-title::before { display: none; }
  table.table-stack td.stack-full { display: block; text-align: left; }
  table.table-stack td.stack-full::before { display: block; max-width: none; margin-bottom: 2px; }
  table.table-stack td.stack-corner { position: absolute; top: 8px; right: 6px; width: auto !important; padding: 0; }
  table.table-stack td.stack-corner::before, table.table-stack td.stack-check::before { display: none; }
  table.table-stack td.stack-check { position: absolute; top: 12px; left: 12px; width: auto !important; padding: 0; }
  table.table-stack tr.has-check { padding-left: 44px; }
  table.table-stack td.text-right { justify-content: flex-end; }
  table.dataTable.table-stack { border-collapse: separate !important; }
  table.items-table td .form-control { flex: 1; max-width: 60%; }
  table.items-table td.stack-title .form-control { max-width: none; }
  table.items-table tr { padding-right: 12px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* plávajúca lišta hromadných akcií ako spodný panel */
  .bulk { left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateY(140%); justify-content: flex-start; padding: 12px; }
  .bulk.is-visible { transform: none; }
  .bulk .form-control { width: 100%; order: 3; }
  .bulk .bulk-count, .bulk .bulk-sum { order: 1; }
  .bulk .btn-due { order: 4; flex: 1 1 100%; }
  .bulk .btn-ghost { order: 5; }

  .due-main .amt { font-size: 2rem; }
  .report-total .v { font-size: 1.1rem; }
  .vault-bar .btn, .vault-bar form { width: 100%; margin-left: 0 !important; }
  .vault-bar form .btn { width: 100%; }
  .msg { gap: 8px; }
  .msg .avatar { width: 28px; height: 28px; font-size: .7rem; }
  .tl-item { padding-left: 40px; }
  .fc .fc-toolbar { flex-direction: column; gap: 8px; align-items: stretch; }
  .fc .fc-toolbar-title { font-size: 1rem; text-align: center; }
  .modal-dialog { margin: .5rem; }
}
@media (max-width: 575.98px) {
  .filterbar { grid-template-columns: 1fr; }
  .filterbar .fb-wide { grid-column: auto; }
}

/* ==========================================================================
   Zákaznícky portál
   ========================================================================== */
.rail-count { margin-left: auto; background: var(--due); color: #2b1d00; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.is-portal .main { margin-left: 0; }
.portal-shell { flex-direction: column; }
.ptop { position: sticky; top: 0; z-index: 1030; background: var(--surface); border-bottom: 1px solid var(--line); }
.ptop-in { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.ptop-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.ptop-brand:hover { color: var(--ink); }
.ptop-brand span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.ptop-brand small { color: var(--mute); font-size: .74rem; }
.ptop-nav { display: flex; gap: 4px; flex: 1; }
.ptop-nav a { padding: 8px 12px; border-radius: var(--r-ctl); color: var(--steel); font-weight: 500; white-space: nowrap; }
.ptop-nav a:hover { background: var(--paper); color: var(--ink); }
.ptop-nav a.is-active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }
.ptop-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ptop-right .rail-user-btn { width: auto; }
.is-portal .page-head, .is-portal .page-body { max-width: 1180px; margin: 0 auto; }
.is-portal .foot { max-width: 1180px; margin: 0 auto; width: 100%; border-top: 0; }
@media (max-width: 991.98px) {
  .is-portal .topbar { display: none; }
  .ptop-in { flex-wrap: wrap; padding: 10px 16px 0; gap: 8px 12px; }
  .ptop-nav { order: 3; flex: 1 1 100%; overflow-x: auto; margin: 0 -16px; padding: 0 12px 8px; -webkit-overflow-scrolling: touch; }
  .ptop-nav a { padding: 8px 10px; }
}

.auth-points { list-style: none; padding: 0; margin: 18px 0 0; }
.auth-points li { padding: 4px 0; color: rgba(255,255,255,.9); }
.auth-points i { width: 22px; color: var(--due); }
.auth-alt { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.portal-page { background: var(--paper); }
.reg-wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.reg-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.reg-brand:hover { color: var(--ink); }
.reg-wrap .card-header + .card-body { padding-top: 14px; }
.reg-wrap .card-body + .card-header { border-top: 1px solid var(--line-soft); border-radius: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.reg-card .card-header .badge { margin-left: 4px; }
@media (max-width: 767.98px) {
  .auth-portal .auth-points, .auth-portal .auth-side > small { display: none; }
  .auth-portal .auth-side { padding: 22px 20px; gap: 14px; }
  .auth-portal .auth-side p { margin-bottom: 0; }
  .ptop-brand small { display: none; }
}

/* ---------- logo MVsoft ---------- */
:root { --ink: #2b2a29; }
.brand-logo { display: block; height: 30px; width: auto; max-width: 100%; }
.brand-logo-sm { height: 24px; }
.rail-brand { padding: 6px 8px 20px; }
.rail-brand .brand-logo { height: 32px; }
.topbar-title { display: flex; align-items: center; }
.ptop-brand .brand-logo { height: 30px; }
.ptop-tag { color: var(--mute); font-size: .8rem; font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line); line-height: 1.2; }
.logo-plate { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.logo-plate .brand-logo { height: 34px; }
.reg-brand { gap: 12px; margin-bottom: 4px; }
.reg-brand .brand-logo { height: 34px; }
@media (max-width: 767.98px) { .logo-plate .brand-logo { height: 28px; } .ptop-brand .brand-logo { height: 26px; } }

/* ---------- typ problému v tikete ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cat-tile { margin: 0; cursor: pointer; }
.cat-tile input { position: absolute; opacity: 0; pointer-events: none; }
.cat-tile span { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font-weight: 500; font-size: .88rem; height: 100%; }
.cat-tile span i { width: 20px; text-align: center; color: var(--mute); }
.cat-tile:hover span { border-color: #cfd7de; background: #fafbfc; }
.cat-tile input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); box-shadow: inset 0 0 0 1px var(--brand); }
.cat-tile input:checked + span i { color: var(--brand); }
.cat-tile input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
legend.col-form-label { font-weight: 600; font-size: .82rem; color: var(--steel); }
@media (max-width: 575.98px) { .cat-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- zdroj aktivity v projekte ---------- */
.src-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--line-soft); color: var(--steel); }
a.src-tag:hover { background: var(--brand-tint); color: var(--brand-dark); }
.avatar-email { background: color-mix(in srgb, #2c8fb8 14%, #fff); color: #1d6584; }
.avatar-ticket { background: var(--due-tint); color: color-mix(in srgb, var(--due) 55%, #000); }
.mail-body { white-space: pre-wrap; font-size: .88rem; background: var(--paper); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; }

/* Logo na bielej strane prihlásenia (vpravo hore) */
.auth-form { position: relative; }
.auth-logo { position: absolute; top: 40px; right: 48px; display: block; line-height: 0; }
.auth-logo .brand-logo { height: 64px; }
@media (max-width: 767.98px) {
  .auth-form { flex-direction: column; justify-content: flex-start; padding-top: 24px; }
  .auth-side-top { display: none; }
  .auth-logo { position: static; align-self: center; margin-bottom: 22px; }
  .auth-logo .brand-logo { height: 46px; }
}

/* Import z KeePass */
.kp-group .card-header { position: sticky; top: 0; z-index: 3; background: var(--surface, #fff); }
.kp-table td { vertical-align: middle; }
.kp-actions { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
@media (max-width: 767.98px) { .kp-actions { bottom: 72px; } .kp-group .card-header { position: static; } }

/* IČO → register */
.is-filled { background: rgba(0,152,70,.08) !important; border-color: var(--brand) !important; transition: background .6s, border-color .6s; }
#icoInfo { margin-top: 6px; line-height: 1.45; }

/* Cenové ponuky */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--steel); font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-value { font-size: 1.3rem; } }

.qi-table td { vertical-align: top; }
.qi-table .qi-name { font-weight: 600; }
.qi-table .qi-desc { margin-top: 4px; font-size: .82rem; color: var(--steel); resize: none; overflow: hidden; min-height: 30px; }
.qi-table td.js-t { padding-top: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.js-grow { resize: vertical; }
.qt-card { position: sticky; top: 16px; z-index: 2; }
.qt-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--steel); font-variant-numeric: tabular-nums; }
.qt-row b { color: var(--ink); font-weight: 600; }
.qt-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--brand); color: #fff; }
.qt-total span { font-weight: 600; }
.qt-total b { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.q-events li { padding: 3px 0; border-bottom: 1px solid var(--line-soft); }
.q-events li:last-child { border-bottom: 0; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--paper); font-size: .9rem; }
.attach-chip i { color: var(--bad); font-size: 1.1rem; }
@media (max-width: 1199.98px) { .qt-card { position: static; } }
@media (max-width: 767.98px) {
  .qi-table td.stack-title .qi-desc { max-width: none; }
  .qi-table tr { padding-right: 12px !important; }
  .qi-table td.stack-title { padding-right: 70px !important; }
  .form-actions .btn { flex: 1 1 auto; }
  .form-actions .ml-auto { display: none; }
}
.stamp-box { min-height: 110px; border: 1px dashed var(--line); border-radius: var(--r-ctl); display: flex; align-items: center; justify-content: center; padding: 12px;
  background: repeating-conic-gradient(#f4f6f8 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.stamp-box img { max-height: 160px; max-width: 100%; }

/* Bočné menu na nižších obrazovkách (notebooky) – kompaktnejšie, aby bolo vidieť celé */
.rail-nav { min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail-nav::-webkit-scrollbar { width: 6px; }
.rail-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
@media (min-width: 992px) and (max-height: 860px) {
  .rail { padding-top: 14px; }
  .rail-brand { padding-bottom: 12px; }
  .rail-cta { margin-bottom: 8px; padding: .4rem .75rem; }
  .rail-group { padding: 9px 10px 3px; }
  .rail-link { padding: 5px 10px; font-size: .92rem; }
  .rail-link.is-active::before { top: 5px; bottom: 5px; }
}
@media (min-width: 992px) and (max-height: 700px) {
  .rail { padding-top: 10px; padding-bottom: 8px; }
  .rail-brand { padding-bottom: 8px; }
  .rail-brand .brand-logo { height: 26px; }
  .rail-cta { margin-bottom: 4px; padding: .3rem .75rem; font-size: .88rem; }
  .rail-group { padding: 6px 10px 1px; font-size: .7rem; }
  .rail-link { padding: 3px 10px; font-size: .88rem; }
  .rail-link.is-active::before { top: 3px; bottom: 3px; }
  .rail-user { padding-top: 6px; margin-top: 4px; }
  .rail-user-btn { padding: 3px 8px; }
}

/* Podpis zákazníka na protokole */
.sig-img { border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; padding: 8px; text-align: center; }
.sig-img img { max-width: 100%; max-height: 120px; }
body.sig-open { overflow: hidden; }
.sig-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(20, 24, 22, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sig-overlay[hidden] { display: none; }
.sig-sheet { background: var(--surface); border-radius: 14px; width: 100%; max-width: 760px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 100%; }
.sig-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 6px; }
.sig-head h2 { font-size: 1.2rem; font-weight: 800; margin: 0; }
.sig-body { padding: 8px 18px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sig-pad-wrap { position: relative; height: 260px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; }
.sig-pad-wrap canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; border-radius: 10px; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 54px; border-bottom: 1.5px solid #c9cfcb; pointer-events: none; }
.sig-line span { position: absolute; left: 0; top: 4px; font-size: .72rem; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b7beb9; font-size: 1.15rem; pointer-events: none; }
.sig-foot { display: flex; gap: 8px; padding: 12px 18px 16px; }
@media (max-width: 767.98px) {
  .sig-overlay { padding: 0; align-items: stretch; }
  .sig-sheet { border-radius: 0; max-width: none; height: 100%; }
  .sig-pad-wrap { flex: 1; height: auto; min-height: 200px; }
  .sig-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sig-foot .btn { flex: 1; }
  .sig-foot .ml-auto { margin-left: 0 !important; }
}
@media (max-width: 767.98px) and (orientation: landscape) {
  .sig-head { padding: 8px 14px 0; } .sig-body { padding: 4px 14px; } .sig-foot { padding: 6px 14px 8px; }
  .sig-body p { display: none; }
}

/* 2FA */
.mfa-code { font-size: 1.5rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.mfa-code::placeholder { letter-spacing: .35em; color: #c9cfcb; }
.mfa-alt { margin-top: 18px; font-size: .92rem; }
.mfa-alt .btn-link { font-size: .92rem; }
.mfa-setup { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.mfa-qr { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; display: flex; align-items: center; justify-content: center; padding: 6px; }
.mfa-qr svg { width: 100%; height: 100%; }
.mfa-key code { font-size: 1.05rem; letter-spacing: .06em; color: var(--ink); background: var(--paper); padding: 6px 10px; border-radius: 6px; display: inline-block; word-break: break-all; }

/* Nastavenia – karty */
.set-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 18px; border-bottom: 1px solid var(--line); }
.set-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 8px 8px 0 0; color: var(--steel); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.set-tab:hover { color: var(--ink); text-decoration: none; background: var(--paper); }
.set-tab.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.set-tab i { opacity: .75; }
@media (max-width: 767.98px) {
  .set-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 12px; }
  .set-tabs::-webkit-scrollbar { display: none; }
  .set-tab { white-space: nowrap; padding: 9px 11px; }
}
.set-test { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.set-test-result { font-size: .88rem; }
.pw-saved { font-size: .82rem; color: var(--ok); }

/* ===================== Dohľad nad IT ===================== */
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #b9c0bc; vertical-align: baseline; flex: 0 0 10px; }
.sdot-up { background: var(--ok); box-shadow: 0 0 0 3px rgba(0,152,70,.15); }
.sdot-down { background: var(--bad); box-shadow: 0 0 0 3px rgba(214,69,69,.18); animation: sdot-pulse 1.6s infinite; }
.sdot-warn { background: var(--brand-accent); box-shadow: 0 0 0 3px rgba(232,163,23,.18); }
.sdot-paused { background: #dfe3e1; }
@keyframes sdot-pulse { 50% { box-shadow: 0 0 0 6px rgba(214,69,69,.06); } }
@media (prefers-reduced-motion: reduce) { .sdot-down { animation: none; } }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid var(--line-soft, #eef1ef); }
.plist li:last-child { border-bottom: 0; }
.plist li > .sdot { margin-top: 6px; }
.plist li > div { min-width: 0; flex: 1; }
.plist small { display: block; color: var(--steel); font-size: .82rem; margin-top: 1px; }
.empty-ok i { color: var(--ok) !important; }

.kpi-link { color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.kpi-link:hover { border-color: var(--brand); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cust-tile { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border-radius: var(--r-panel, 12px); background: var(--surface, #fff); border: 1px solid var(--line); color: inherit; text-decoration: none !important; border-left: 4px solid #cfd6d2; }
.cust-tile:hover { border-color: var(--brand); }
.cust-up { border-left-color: var(--ok); }
.cust-down { border-left-color: var(--bad); background: #fff8f8; }
.cust-warn { border-left-color: var(--brand-accent); }
.cust-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cust-meta { font-size: .82rem; color: var(--steel); }
.cust-alert { font-size: .8rem; font-weight: 700; color: var(--bad); }

.site-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 15px 18px; margin-bottom: 10px; border-radius: var(--r-panel, 12px); background: var(--surface, #fff); border: 1px solid var(--line); color: inherit; text-decoration: none !important; }
.site-card:hover { border-color: var(--brand); }
.site-stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: .86rem; color: var(--steel); align-items: center; }

.token-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.token-box code { font-size: 1rem; font-weight: 700; letter-spacing: .04em; color: var(--ink); background: var(--paper); padding: 7px 11px; border-radius: 8px; word-break: break-all; }
.token-card .token-box code { font-size: 1.05rem; }

.mbar { margin: 10px 0; }
.mbar-top { display: flex; justify-content: space-between; font-size: .86rem; margin-bottom: 4px; gap: 10px; }
.mbar-top span { color: var(--steel); }
.mbar-track { height: 8px; border-radius: 6px; background: #eef1ef; overflow: hidden; }
.mbar-fill { height: 100%; border-radius: 6px; }
.mbar-ok { background: var(--ok); } .mbar-warn { background: var(--brand-accent); } .mbar-bad { background: var(--bad); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin-bottom: 12px; font-size: .92rem; }
.kv dt { color: var(--steel); font-weight: 500; } .kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.lat-svg { width: 100%; height: 90px; display: block; background: linear-gradient(#f6f8f7 1px, transparent 1px) 0 0 / 100% 30px; border-radius: 6px; }
.card-attn { border: 1px solid var(--brand-accent); }
.card-attn .card-header { background: #fff8e8; }
.dl-icon { width: 56px; height: 56px; border-radius: 14px; background: #e8f6ee; color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex: 0 0 56px; }
.dl-steps { padding-left: 20px; } .dl-steps li { padding: 4px 0; }
@media (max-width: 575.98px) { .dl-main .d-flex { flex-wrap: wrap; } .kpis-3 { grid-template-columns: 1fr 1fr; } }

/* spotrebný materiál, udalosti */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.ev-list li { align-items: flex-start; }
.ev-list li .badge { margin-top: 2px; min-width: 54px; }
.ev-list small { word-break: break-word; }
.kv dd.small { line-height: 1.35; }
.dl-main .dl-ico { width: 52px; height: 52px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-size: 1.5rem; flex: 0 0 52px; }
.code-cmd { display: block; background: var(--paper); border-radius: 8px; padding: 10px 12px; font-size: .86rem; word-break: break-all; color: var(--ink); }
.diff-table td { vertical-align: top; font-size: .86rem; }
.diff-table .old { color: var(--mute); text-decoration: line-through; white-space: pre-line; }
.diff-table .new { font-weight: 600; white-space: pre-line; }
.hw-spec { white-space: pre-line; font-size: .88rem; }
