/* Wplus Kalibrace - design system
   Brand: Wplus web (DM Sans, ink #041c2c, orange accent #e5600b).
   Each calibration area has its own colour (stripes, tabs, tags) so it's always obvious where you are:
   teploty blue, tlaky green, světlo yellow, hluk red, vlhkost purple. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Wplus Logo & Brand manuál v1.0 – Dark Blue, Signal Orange (jen akcent), Silver Gray, bílá; DM Sans;
     ploché plochy bez přechodů, ostré rohy (stejně jako web wplus.cz) */
  --ink: #041c2c;            /* Dark Blue */
  --ink-2: #0b2a3f;
  --ink-3: #143a54;
  --acc: #e5600b;            /* Signal Orange */
  --acc-text: #c44c0a;       /* oranžová pro text/tlačítka na bílé (kontrast) */
  --acc-soft: #fcefe6;
  --sg: #d3d9dd;             /* Silver Gray */
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --s2: #edf0f1;
  --line: #dfe4e7;
  --line-strong: #c3ccd2;
  --text: #041c2c;
  --muted: #4a5c69;
  --soft: #687780;

  /* obě oblasti v barvách manuálu: teploty = Dark Blue, tlaky = Dark Blue + Silver Gray štítky */
  --teploty: #041c2c;
  --teploty-dark: #000a12;
  --teploty-soft: #e6ebee;
  --tlaky: #041c2c;
  --tlaky-dark: #000a12;
  --tlaky-soft: #e6ebee;

  --dom: var(--ink);
  --dom-dark: #000a12;
  --dom-soft: #e6ebee;

  /* funkční (stavové) barvy – jako na webu */
  --ok: #1d7a4d; --ok-soft: #e4f2ea;
  --bad: #b3261e; --bad-soft: #fbe9e8;
  --warn: #a35c00; --warn-soft: #fdf1df;
  --info: #3c7fb1; --info-soft: #e8f1f8;
  --arch: #041c2c; --arch-soft: #d3d9dd;
  --idle: #4a5c69; --idle-soft: #edf0f1;

  --r: 0px;
  --r-sm: 0px;
  --shadow-1: none;
  --shadow-2: 0 18px 50px rgba(4, 28, 44, .18);
  --sidebar-w: 252px;
  color-scheme: light;

  /* barvy oblastí kalibrace (proužky, záložky, štítky): teploty modrá, tlaky zelená,
     světlo žlutá, hluk červená, vlhkost fialová */
  --c-teploty: #2563c9; --c-teploty-soft: #e8f0fb;
  --c-tlaky: #1f9a55;   --c-tlaky-soft: #e5f4eb;
  --c-svetlo: #e6ad00;  --c-svetlo-soft: #fdf5d8;
  --c-hluk: #d5392e;    --c-hluk-soft: #fbe9e7;
  --c-vlhkost: #7c47cc; --c-vlhkost-soft: #f1eafb;
  --dc: var(--acc); --dc-soft: var(--acc-soft);
}
body.dom-teploty, .d-teploty { --dc: var(--c-teploty); --dc-soft: var(--c-teploty-soft); }
body.dom-tlaky, .d-tlaky     { --dc: var(--c-tlaky); --dc-soft: var(--c-tlaky-soft); }
body.dom-svetlo, .d-svetlo   { --dc: var(--c-svetlo); --dc-soft: var(--c-svetlo-soft); }
body.dom-hluk, .d-hluk       { --dc: var(--c-hluk); --dc-soft: var(--c-hluk-soft); }
body.dom-vlhkost, .d-vlhkost { --dc: var(--c-vlhkost); --dc-soft: var(--c-vlhkost-soft); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration-color: var(--acc); }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.2; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
[v-cloak] { display: none; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--ink); color: #dbe5ec;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: block; padding: 22px 22px 16px; text-decoration: none; color: #fff; }
.brand svg { width: 168px; height: auto; display: block; }
.brand .bs { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; font-weight: 700; color: #b9c6ce; }
.brand .bs::before { content: ""; width: 18px; height: 3px; background: var(--acc); }
.nav { padding: 4px 10px 16px; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #6f8899; padding: 14px 10px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 0; color: #cdd9e2;
  text-decoration: none; font-weight: 500; font-size: 13.8px;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.on { background: var(--ink-3); color: #fff; box-shadow: inset 3px 0 0 var(--acc); }
.nav a.on svg { opacity: 1; color: var(--acc); }
.nav a .cnt { margin-left: auto; font-size: 11px; background: var(--ink-3); color: #cfe0ec; border-radius: 0; padding: 1px 7px; font-weight: 700; }
.sidebar .foot { margin-top: auto; padding: 12px 18px 16px; font-size: 11.5px; color: #6f8899; border-top: 1px solid var(--ink-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 26px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.crumbs b { color: var(--text); font-weight: 650; }
.crumbs .dompill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 3px 9px 3px 7px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--dc-soft); box-shadow: inset 3px 0 0 var(--dc); }
.crumbs .dompill svg { width: 13px; height: 13px; color: var(--dc); }
.gsearch { margin-left: auto; position: relative; width: min(380px, 40vw); }
.gsearch input {
  width: 100%; height: 36px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 0;
  padding: 0 14px 0 36px;
}
.gsearch input:focus { background: #fff; border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(229, 96, 11, .22); }
.gsearch svg { position: absolute; left: 12px; top: 10px; width: 16px; height: 16px; color: var(--soft); }
.gsearch .drop {
  position: absolute; right: 0; left: 0; top: 42px; background: #fff; border: 1px solid var(--line); border-radius: 0;
  box-shadow: var(--shadow-2); max-height: 60vh; overflow: auto; padding: 6px;
}
.gsearch .drop .it { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 0; cursor: pointer; }
.gsearch .drop .it:hover, .gsearch .drop .it.on { background: var(--surface-2); }
.gsearch .drop .h { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--soft); padding: 8px 10px 4px; font-weight: 700; }

.content { padding: 22px 26px 60px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 650; letter-spacing: -.025em; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 80ch; }
.page-head .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* calibration type tabs */
.ttabs { display: flex; gap: 6px; margin: -4px 0 18px; flex-wrap: wrap; }
.ttab {
  display: flex; align-items: center; gap: 9px; padding: 7px 12px 7px 8px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 0; cursor: pointer; text-decoration: none; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.ttab .code {
  font-weight: 800; font-size: 12px; letter-spacing: .03em; padding: 3px 7px;
  background: var(--s2); color: var(--ink);
}
.ttab .nm { font-size: 13px; font-weight: 550; }
.ttab .n { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 0; padding: 1px 7px; }
.ttab:hover { border-color: var(--line-strong); }
.ttab.on { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: inset 0 -4px 0 var(--dc); }
.ttab.on .code { background: #fff; color: var(--ink); }
.ttab.on .n { background: var(--dc); color: #fff; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); }
.card + .card { margin-top: 14px; }
.grid2 > .card, .grid3 > .card, .grid4 > .card, .split > .card, .domgrid > .card, .dash2 > .card { margin-top: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 15px; font-weight: 700; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .act { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 16px 18px; }
.card-b.tight { padding: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
@media (max-width: 1100px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .zgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .domgrid, .dash2 { grid-template-columns: 1fr; grid-template-areas: "open" "warn" "recent"; } }

/* stats */
.stat { padding: 14px 16px; border-radius: 0; background: var(--surface); border: 1px solid var(--line); }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.domcard { overflow: hidden; }
.domcard .card-h { border-bottom: 0; }
.domcard .band { height: 5px; background: var(--dc); }
.domcard h2 { display: flex; align-items: center; gap: 8px; }
.domcard h2 .dic { width: 18px; height: 18px; color: var(--dc); }
.domcard .typecell:hover { border-color: var(--dc); }
.domcard .typecell:hover .c { color: var(--ink); }
.domcard .typecell .c { display: inline-block; box-shadow: inset 0 -2px 0 var(--dc); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.kpis > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.kpis > div:last-child { border-right: 0; }
.kpis .v { font-size: 22px; font-weight: 750; }
.kpis .l { font-size: 12px; color: var(--muted); }
.typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); }
.typecell { border: 1px solid var(--line); border-radius: 0; padding: 9px 11px; cursor: pointer; text-decoration: none; color: var(--text); display: block; }
.typecell:hover { border-color: var(--line-strong); background: var(--surface-2); }
.typecell .c { font-weight: 800; font-size: 12px; }
.typecell .c { color: var(--ink); }
.typecell:hover .c { color: var(--acc-text); }
.typecell .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.typecell .o { font-size: 12px; margin-top: 4px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 0; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-2); border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-3); border-color: var(--ink-3); }
.btn.accent, .btn.cta { background: var(--acc-text); border-color: var(--acc-text); color: #fff; }
.btn.accent:hover, .btn.cta:hover { background: #a63f07; border-color: #a63f07; }
.btn.danger { color: var(--bad); border-color: #efc3bf; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger { border-color: #e3b6b2; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.8px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 14.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 0 0 0 var(--r-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--soft); }
.req::after { content: " *"; color: var(--bad); }
.inp, select.inp, textarea.inp {
  height: 38px; border: 1.5px solid var(--line-strong); border-radius: 0; background: #fff; padding: 0 10px;
  width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
textarea.inp { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.inp:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(229, 96, 11, .22); }
.inp.bad { border-color: var(--bad); background: var(--bad-soft); }
.inp.num { text-align: right; }
.inp.sm { height: 30px; font-size: 13px; }
select.inp { padding-right: 26px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.search { position: relative; }
.search input { padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--soft); pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 0; border: 1.5px solid var(--line-strong);
  background: #fff; cursor: pointer; font-size: 12.8px; font-weight: 550; user-select: none;
}
.chip:hover { border-color: #aab6bf; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.warn { border-color: #e8c27e; }
.chip.on.warn { background: var(--warn); border-color: var(--warn); }
.chip .x { opacity: .7; }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th {
  position: sticky; top: 0; background: var(--surface); z-index: 1; text-align: left; font-weight: 700; color: var(--soft);
  font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1.5px solid var(--ink);
  white-space: nowrap; user-select: none;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .ar { font-size: 10px; margin-left: 4px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; min-width: 200px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .08s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl tbody tr.sel { background: var(--acc-soft); box-shadow: inset 3px 0 0 var(--acc); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td.chk, .tbl th.chk { width: 36px; padding-right: 0; }
.tbl td.mono { font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 650; }
.tbl .sub { color: var(--muted); font-size: 12px; }
.tbl .nowrap { white-space: nowrap; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* status badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 0;
  white-space: nowrap; letter-spacing: .01em;
}
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.b-PŘIPRAVENO { background: var(--idle-soft); color: var(--idle); }
.b-ROZPRACOVÁNO { background: var(--warn-soft); color: var(--warn); }
.b-ZMĚŘENO { background: var(--info-soft); color: var(--info); }
.b-VYHOVUJE { background: var(--ok-soft); color: var(--ok); }
.b-NEVYHOVUJE { background: var(--bad-soft); color: var(--bad); }
.b-ARCHIVOVÁNO { background: var(--arch-soft); color: var(--arch); }
.b-IMPORT, .b-NEURCENO { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 0; letter-spacing: .03em; }
.tag { background: var(--dc-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--dc); padding-left: 8px; }
.yn { display: inline-block; min-width: 34px; text-align: center; font-weight: 800; font-size: 11.5px; padding: 2px 6px; border-radius: 0; }
.yn.ANO { background: var(--ok-soft); color: var(--ok); }
.yn.NE { background: var(--bad-soft); color: var(--bad); }
.yn.q { background: var(--warn-soft); color: var(--warn); }
.yn.n { background: var(--idle-soft); color: var(--idle); }

/* toolbar above tables */
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .sel-info { font-size: 13px; color: var(--muted); }
.toolbar .sel-info b { color: var(--text); }

/* ---------------------------------------------------------------- grid editor (spreadsheet-like) */
.sheet-wrap { overflow: auto; border-top: 1px solid var(--line); max-height: 62vh; }
table.sheet { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13.5px; }
.sheet th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--muted); font-size: 11.8px; font-weight: 700;
  text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap;
}
.sheet td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; }
.sheet td.rn { width: 42px; text-align: center; color: var(--soft); font-size: 12px; background: var(--surface-2); padding: 0 4px; }
.sheet td.ro { background: var(--surface-2); color: var(--muted); padding: 0 10px; white-space: nowrap; font-size: 13px; font-weight: 600; }
.sheet input.cell {
  border: 0; width: 100%; height: 36px; padding: 0 9px; background: transparent; min-width: 70px;
}
.sheet input.cell:focus { outline: none; box-shadow: inset 0 0 0 2px var(--acc); background: #fff; }
.sheet td.bad { background: var(--bad-soft); }
.sheet td.bad input.cell { color: var(--bad); }
.sheet td.found input.cell { background: #f6fbff; }
.sheet tr.blank td:not(.rn) { background: #fcfdfd; }
.sheet .w-xs input.cell { min-width: 64px; }
.sheet .w-s input.cell { min-width: 90px; }
.sheet .w-m input.cell { min-width: 130px; }
.sheet .w-l input.cell { min-width: 190px; }
.sheet td.del { width: 34px; text-align: center; background: var(--surface-2); }
.sheet td.del button { border: 0; background: transparent; color: var(--soft); cursor: pointer; width: 30px; height: 30px; border-radius: 0; }
.sheet td.del button:hover { color: var(--bad); background: var(--bad-soft); }
.problems { margin: 12px 18px; padding: 10px 14px; border-radius: 0; background: var(--bad-soft); color: #9c2a22; font-size: 13px; }
.problems li { margin: 3px 0; }
.problems ul { margin: 0; padding-left: 18px; }
.note { padding: 10px 14px; border-radius: 0; background: var(--warn-soft); color: #7e4f0a; font-size: 13px; }
.note.info { background: var(--info-soft); color: #1c4b97; }
.note.ok { background: var(--ok-soft); color: #136b3d; }

/* ---------------------------------------------------------------- measurement grid */
table.mgrid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.mgrid th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.mgrid th.pt { text-align: center; color: var(--text); font-size: 13px; }
.mgrid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.mgrid td.lab { min-width: 230px; background: #fff; }
.mgrid td.lab .i { font-weight: 700; }
.mgrid td.lab .n { font-size: 12px; color: var(--muted); }
.mgrid td.pc { min-width: 250px; width: 250px; }
.mgrid .pin { display: flex; align-items: center; gap: 8px; }
.mgrid .pin input { height: 34px; border: 1.5px solid var(--line-strong); border-radius: 0; padding: 0 9px; width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.mgrid .pin input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(229, 96, 11, .22); }
.mgrid .pin input.bad { border-color: var(--bad); background: var(--bad-soft); }
.mgrid .pin .u { color: var(--soft); font-size: 12px; }
.mgrid .res { display: grid; grid-template-columns: repeat(3, auto); gap: 2px 12px; margin-top: 7px; font-size: 12px; color: var(--muted); justify-content: start; min-height: 34px; }
.mgrid .pin .ynslot { display: inline-flex; min-width: 34px; }
.mgrid .res b { color: var(--text); font-weight: 650; }
.mgrid .res .e { color: var(--bad); grid-column: 1 / -1; }
.stdrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stdbox { border: 1px solid var(--line); border-radius: 0; padding: 10px 12px; background: var(--surface-2); }
.stdbox .t { font-weight: 700; font-size: 13px; }
.stdbox .t small { font-weight: 550; color: var(--muted); }
.stdbox input { margin-top: 6px; text-align: right; }

/* ---------------------------------------------------------------- split list + form */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
.split > .card:last-child { position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow: auto; }
@media (max-width: 1200px) { .split { grid-template-columns: 1fr; } .split > .card:last-child { position: static; max-height: none; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.subsec { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.subsec > .t { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--soft); font-weight: 800; margin-bottom: 10px; }

/* ---------------------------------------------------------------- modal, toasts */
.overlay { position: fixed; inset: 0; background: rgba(4, 28, 44, .42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 0; box-shadow: var(--shadow-2); width: min(560px, 100%); }
.modal.wide { width: min(980px, 100%); }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .mh h3 { font-size: 16px; }
.modal .mb { padding: 18px 20px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.modal .msg { white-space: pre-line; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; border-radius: 0; padding: 12px 14px 12px 16px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; animation: tin .18s ease-out; }
.toast.err { background: #8f241c; }
.toast.ok { background: #135e38; }
.toast .x { margin-left: auto; background: transparent; border: 0; color: #fff; opacity: .7; cursor: pointer; font-size: 16px; line-height: 1; }
.toast .tm { white-space: pre-line; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.combo { position: relative; }
.combo .drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow-2); z-index: 30; max-height: 280px; overflow: auto; padding: 4px; }
.combo .opt { padding: 8px 10px; border-radius: 0; cursor: pointer; }
.combo .opt small { display: block; color: var(--muted); font-size: 12px; }
.combo .opt:hover, .combo .opt.on { background: var(--surface-2); }
.combo .opt.add { color: var(--dom); font-weight: 650; border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }

.legend { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.saving { font-size: 12px; color: var(--soft); }
.kbd { font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 0; padding: 0 5px; background: #fff; color: var(--muted); }
.verify { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 0; padding: 3px 8px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { border: 0; background: transparent; padding: 12px 12px 10px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom: 3px solid var(--acc); }
.help h2 { font-size: 17px; margin: 22px 0 8px; }
.help h2:first-child { margin-top: 0; }
.help p, .help li { color: #2a3d4b; max-width: 92ch; }
.help li { margin: 4px 0; }

@media print { .sidebar, .topbar, .no-print { display: none !important; } .content { padding: 0; } }

/* loading screen (HTML verze) */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--ink); color: #fff; }
.boot svg { width: 260px; height: auto; }
.boot .bar { width: 260px; height: 4px; background: #143a54; overflow: hidden; }
.boot .bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .3s; }
.boot .msg { font-size: 14px; color: #b9c6ce; }
.boot .err { max-width: 560px; color: #ffd2c2; font-size: 14px; text-align: center; white-space: pre-line; }
.modebar { background: var(--acc-soft); color: #7a3100; font-size: 12.5px; padding: 7px 26px; border-bottom: 1px solid #f4cdb2; display: flex; gap: 12px; align-items: center; }
.modebar b { color: var(--acc-text); }

/* Tlaky – záznam o měření / výsledky (layout of the calibration workbooks) */
.mgrid.pz th { text-align: center; padding: 7px 8px; }
.mgrid.pz th small { font-weight: 500; color: var(--soft); }
.mgrid.pz td { padding: 5px 5px; vertical-align: middle; }
.mgrid.pz .cellin { height: 32px; width: 80px; border: 1.5px solid var(--line-strong); border-radius: 0; padding: 0 7px; text-align: right;
  font: inherit; font-variant-numeric: tabular-nums; background: #fff; }
.mgrid.pz .cellin:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(229, 96, 11, .22); }
.mgrid.pz .cellin:disabled { background: var(--surface-2); color: var(--muted); }
.mgrid.pz.res td { text-align: right; font-variant-numeric: tabular-nums; padding: 7px 10px; }
.vd { display: inline-block; min-width: 30px; padding: 2px 6px; font-size: 11.5px; font-weight: 700; text-align: center; border: 1.5px solid currentColor; }
.vd.ok { color: var(--ok); } .vd.bad { color: var(--bad); } .vd.warn { color: var(--warn); }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }


/* světlo / hluk / vlhkost – měření */
.vgrid td.pc { min-width: 0; width: auto; }
.vgrid .multi { display: flex; gap: 4px; flex-wrap: nowrap; }
.vgrid .multi input { width: 74px; }
.vgrid .lbl { font-size: 11.5px; color: var(--soft); margin: 4px 0 2px; }
.vgrid .lbl:first-child { margin-top: 0; }
.ptable td { padding: 4px 6px; }
.ptable input, .ptable select { height: 32px; }
.budget { font-size: 12px; color: var(--muted); }
.budget td { padding: 2px 8px 2px 0; }

/* ---------------------------------------------------------------- přihlášení, uživatel */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; padding: 34px 34px 26px; box-shadow: var(--shadow-2); display: grid; gap: 14px; }
.login-card h1 { margin: 6px 0 2px; font-size: 22px; }
.login-brand svg { width: 190px; height: auto; display: block; }
.login-brand .bs { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.login-brand .bs::before { content: ""; width: 18px; height: 3px; background: var(--acc); }
.note.err { background: var(--bad-soft); color: var(--bad); border-color: #f1c4c1; }
.userbox { margin-top: auto; padding: 12px 16px 10px; border-top: 1px solid var(--ink-2); color: #cdd9e2; }
.userbox .who { display: flex; gap: 10px; align-items: center; }
.userbox .who svg { width: 20px; height: 20px; color: var(--acc); flex: none; }
.userbox .who b { display: block; color: #fff; font-size: 13.5px; }
.userbox .who span { display: block; font-size: 11.5px; color: #8ea3b2; }
.userbox .acts { display: flex; gap: 6px; margin-top: 9px; }
.userbox .acts button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border: 1px solid #2b495e;
  background: transparent; color: #cdd9e2; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.userbox .acts button:hover { background: var(--ink-3); color: #fff; }
.userbox .acts svg { width: 14px; height: 14px; }
.sidebar .userbox + .foot { margin-top: 0; }
/* ---------------------------------------------------------------- oblasti v levém menu (pod sebou) */
.domlist { padding: 0 10px 6px; display: grid; gap: 2px; }
.domlist .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #6f8899; padding: 6px 10px 6px; font-weight: 700; }
.domlist .dom {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; border: 0; background: transparent;
  color: #cdd9e2; font-weight: 650; font-size: 14px; cursor: pointer; text-align: left; box-shadow: inset 4px 0 0 var(--dc);
}
.domlist .dom svg { width: 17px; height: 17px; flex: none; color: var(--dc); }
.domlist .dom .nm { flex: 1; }
.domlist .dom .cnt { font-size: 11px; background: var(--ink-3); color: #cfe0ec; padding: 1px 7px; font-weight: 700; }
.domlist .dom:hover { background: var(--ink-2); color: #fff; }
.domlist .dom.cur { background: var(--ink-3); color: #fff; }
.domlist .dom.on { background: #fff; color: var(--ink); box-shadow: inset 6px 0 0 var(--dc); }
.domlist .dom.on .cnt { background: var(--dc); color: #fff; }
.domlist .dom.locked { opacity: .45; box-shadow: inset 4px 0 0 #2b495e; cursor: not-allowed; }
.domlist .dom.locked svg { color: #8ea3b2; }
.domlist .dom.locked:hover { background: transparent; color: #cdd9e2; }
.domlist .dom .lk { width: 14px; height: 14px; }
.nav .sec.domsec span { color: #9fb3c1; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 11.5px; }

/* ---------------------------------------------------------------- přehled – šířka obrazovky */
.domgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "open warn" "open recent";
  gap: 14px; margin-top: 14px; align-items: start; }
.dash2 > .card { margin-top: 0; }
.dash2 .x-open { grid-area: open; } .dash2 .x-warn { grid-area: warn; } .dash2 .x-recent { grid-area: recent; }
.quick .qlist { border-top: 1px solid var(--line); }
.quick .qrow { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--dc); }
.quick .qrow:last-child { border-bottom: 0; }
.quick .qrow .qn { display: flex; align-items: center; gap: 8px; font-weight: 650; width: 120px; flex: none; }
.quick .qrow .qn svg { width: 16px; height: 16px; color: var(--dc); }
.quick .qrow.locked { opacity: .6; box-shadow: inset 4px 0 0 var(--line-strong); }
.quick .qrow.locked .qn svg { color: var(--soft); }

/* hlavička Nové zakázky: 4 sloupce, na širokém monitoru 12 (méně řádků) */
.zgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.zgrid .z-cust { grid-column: span 2; }
.zgrid .z-note { grid-column: 1 / -1; }

@media (min-width: 1880px) {
  .domgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash2 { grid-template-columns: 1.25fr 1fr 1fr; grid-template-areas: "open warn recent"; }
  .zgrid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .zgrid .z-cust { grid-column: span 4; }
  .zgrid .z-2 { grid-column: span 2; }
  .zgrid .z-1 { grid-column: span 1; }
  .zgrid .z-note { grid-column: span 9; }
}
.modebar.warn { background: var(--warn-soft); color: #6b3b00; border-bottom-color: #f2d7ae; }
.domcard.locked { opacity: .72; }
.domcard.locked .typecell { cursor: default; pointer-events: none; }
.tbl.perm td, .tbl.perm th { padding: 7px 10px; }
