/* Revizinka – klidný, předvídatelný vzhled (převzato z dema, demo/styles.css).
   Zásady: žádné animace, stav vždy barva + ikona + slovo, velké písmo, vysoký kontrast. */

:root {
  --pozadi: #f4f5f2;
  --plocha: #ffffff;
  --text: #1d2730;
  --text-tlumeny: #4f5b66;
  --cara: #d5d9d4;
  --primarni: #2c5a85;
  --primarni-tmava: #1f4466;
  --primarni-svetla: #e6eef6;
  --fokus: #f2b705;

  --prosle: #a3261c;   --prosle-bg: #fbe8e6;
  --do30: #985000;     --do30-bg: #fdf0df;
  --do90: #6d5c00;     --do90-bg: #f8f3d6;
  --ok: #2b6636;       --ok-bg: #e5f2e8;

  --radius: 8px;
  --mezera: 1rem;
  font-size: 106.25%; /* 17 px */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--pozadi);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--primarni); }
a:hover { color: var(--primarni-tmava); }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
small { font-size: .88rem; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.preskocit { position: absolute; left: -9999px; }
.preskocit:focus { left: 1rem; top: 1rem; background: var(--plocha); padding: .5rem 1rem; z-index: 10; }

/* ---------- Hlavička ---------- */
.hlavicka {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--plocha);
  border-bottom: 1px solid var(--cara);
  padding: .6rem 1.25rem;
}
.znacka { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--text); }
.logo { height: 40px; width: auto; max-width: 140px; display: block; }
.znacka-text { display: flex; flex-direction: column; line-height: 1.2; padding-left: .85rem; border-left: 1px solid var(--cara); }
.znacka-text strong { font-size: 1.1rem; }
.znacka-text small { color: var(--text-tlumeny); }
.uzivatel { text-align: right; font-size: .9rem; line-height: 1.3; }
.uzivatel small { color: var(--text-tlumeny); }

/* ---------- Rozvržení ---------- */
.rozvrzeni { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 120px); }
.menu { background: var(--plocha); border-right: 1px solid var(--cara); padding: 1rem .75rem; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li + li { margin-top: .2rem; }
.menu a {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .75rem; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.menu a:hover { background: var(--pozadi); }
.menu a[aria-current="page"] { background: var(--primarni-svetla); color: var(--primarni-tmava); font-weight: 700; box-shadow: inset 4px 0 0 var(--primarni); }
.menu-ikona { width: 1.25rem; text-align: center; font-size: 1rem; color: var(--text-tlumeny); }
.menu a[aria-current="page"] .menu-ikona { color: var(--primarni); }

.nastaveni { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--cara); display: flex; flex-direction: column; gap: .5rem; }
.nastaveni-nadpis { font-size: .85rem; color: var(--text-tlumeny); margin: 0 0 .25rem; font-weight: 600; }

.obsah { padding: 1.5rem 2rem 3rem; max-width: 1100px; width: 100%; }
.obsah:focus { outline: none; }
.uvod { color: var(--text-tlumeny); font-size: 1.05rem; max-width: 46rem; }
.pomoc { color: var(--text-tlumeny); font-size: .92rem; }

.paticka { text-align: center; font-size: .85rem; color: var(--text-tlumeny); padding: 1rem; border-top: 1px solid var(--cara); background: var(--plocha); }

/* ---------- Tlačítka ---------- */
.tlacitko {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem;
  border: 2px solid var(--primarni); border-radius: var(--radius);
  background: var(--primarni); color: #fff;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.tlacitko:hover { background: var(--primarni-tmava); border-color: var(--primarni-tmava); color: #fff; }
.tlacitko.druhotne { background: var(--plocha); color: var(--primarni); }
.tlacitko.druhotne:hover { background: var(--primarni-svetla); color: var(--primarni-tmava); }
.tlacitko.nebezpeci { background: var(--prosle); border-color: var(--prosle); }
.tlacitko.male { min-height: 38px; padding: .35rem .8rem; font-size: .92rem; text-align: left; justify-content: flex-start; }
.akce { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }

/* ---------- Stavové štítky ---------- */
.stav {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .15rem .6rem .15rem .25rem; border-radius: 999px;
  font-weight: 700; font-size: .88rem; white-space: nowrap;
  border: 1.5px solid currentColor;
}
.stav-ikona {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  color: #fff; font-size: .8rem; font-weight: 800; line-height: 1;
}
.stav-prosle { color: var(--prosle); background: var(--prosle-bg); }
.stav-do30   { color: var(--do30);   background: var(--do30-bg); }
.stav-do90   { color: var(--do90);   background: var(--do90-bg); }
.stav-ok     { color: var(--ok);     background: var(--ok-bg); }
.stav-prosle .stav-ikona { background: var(--prosle); }
.stav-do30 .stav-ikona   { background: var(--do30); }
.stav-do90 .stav-ikona   { background: var(--do90); }
.stav-ok .stav-ikona     { background: var(--ok); }

/* ---------- Dlaždice přehledu ---------- */
.dlazdice { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin: 1.25rem 0 .5rem; }
.dl {
  display: flex; flex-direction: column; gap: .2rem;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  border: 2px solid currentColor; text-decoration: none;
}
.dl:hover { box-shadow: 0 0 0 3px var(--cara); }
.dl-hlava { display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.dl-cislo { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.dl-popis { font-size: .88rem; color: var(--text); }
.dl.stav-prosle, .dl.stav-do30, .dl.stav-do90, .dl.stav-ok { border-radius: var(--radius); }

/* ---------- Řádky povinností ---------- */
.radky { list-style: none; margin: .75rem 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.radek {
  display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 1rem; align-items: center;
  background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius);
  padding: .75rem 1rem; text-decoration: none; color: var(--text);
}
.radek:hover { border-color: var(--primarni); }
.radek-nazev { font-weight: 700; color: var(--primarni-tmava); }
.radek-pod { display: block; color: var(--text-tlumeny); font-size: .9rem; }
.radek-termin { text-align: right; white-space: nowrap; }
.radek-termin strong { display: block; }
.radek-termin small { color: var(--text-tlumeny); }

.prazdne { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); border-radius: var(--radius); padding: 1rem; font-weight: 600; }

/* ---------- Tabulky ---------- */
.tabulka-obal { background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius); overflow: hidden; }
.tabulka { width: 100%; border-collapse: collapse; }
.tabulka th, .tabulka td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--cara); vertical-align: top; }
.tabulka th { background: #eef0ec; font-size: .9rem; }
.tabulka tbody tr:last-child td { border-bottom: 0; }
.tabulka td small { color: var(--text-tlumeny); }
.tabulka .cislo { text-align: center; }
.tabulka a.pocet { display: inline-block; min-width: 2.2rem; padding: .1rem .4rem; border-radius: 6px; font-weight: 700; text-decoration: none; }
.tabulka .nula { color: #9aa3ab; }

/* ---------- Filtry ---------- */
.filtry {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem;
  background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius);
  padding: 1rem; margin: 1rem 0;
}
.filtry .pole { margin: 0; }
.filtry-pata { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.pocet-vysledku { font-weight: 600; margin: 0; }

/* ---------- Formuláře ---------- */
.pole { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.pole label, .pole .popisek { font-weight: 600; }
input[type="text"], input[type="email"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 2px solid #9aa5ae; border-radius: 6px; padding: .5rem .65rem; min-height: 44px; width: 100%;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primarni); }
.zaskrtavatko { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; font-weight: 500; }
.zaskrtavatko input { width: 1.25rem; height: 1.25rem; }
fieldset { border: 1px solid var(--cara); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.formular { background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius); padding: 1.25rem; max-width: 42rem; }
.formular h2 { margin-top: 0; }
.dva-sloupce { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.nahled { background: var(--primarni-svetla); border-left: 4px solid var(--primarni); padding: .65rem .9rem; border-radius: 4px; }
.chyba { background: var(--prosle-bg); color: var(--prosle); border-left: 4px solid var(--prosle); padding: .65rem .9rem; border-radius: 4px; font-weight: 600; }

/* ---------- Oznámení po akci ---------- */
.oznameni {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
  background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok);
  border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1.25rem; font-weight: 600;
}
.oznameni .akce { margin: 0; }

.potvrzeni { background: var(--prosle-bg); border: 1px solid var(--prosle); border-radius: var(--radius); padding: .75rem; font-size: .92rem; display: flex; flex-direction: column; gap: .5rem; }
.potvrzeni p { margin: 0; }

/* ---------- Detail ---------- */
.zpet { display: inline-block; margin-bottom: 1rem; font-weight: 600; }
.stav-box { border: 2px solid currentColor; border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.stav-box .velky { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: .5rem 0 .25rem; }
.stav-box p { color: var(--text); margin: 0; }
.varovani { background: var(--do30-bg); border-left: 4px solid var(--do30); padding: .75rem 1rem; border-radius: 4px; margin: 1rem 0; }
.udaje { display: grid; grid-template-columns: 13rem 1fr; gap: 0; background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius); margin: 0; overflow: hidden; }
.udaje dt, .udaje dd { margin: 0; padding: .6rem .9rem; border-bottom: 1px solid var(--cara); }
.udaje dt { font-weight: 600; background: #f7f8f6; }
.udaje dt:last-of-type, .udaje dd:last-of-type { border-bottom: 0; }
.dokument { display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Jeden úkol ---------- */
.pocitadlo { font-weight: 700; color: var(--text-tlumeny); }
.ukol-karta { background: var(--plocha); border: 2px solid var(--cara); border-radius: var(--radius); padding: 1.5rem; max-width: 44rem; }
.ukol-karta h2 { font-size: 1.6rem; margin: .75rem 0 .25rem; }
.ukol-termin { font-size: 1.2rem; font-weight: 700; margin: .75rem 0; }
.kroky { padding-left: 1.5rem; margin: .5rem 0 0; }
.kroky li { margin-bottom: .5rem; padding-left: .25rem; }
.listovani { display: flex; justify-content: space-between; gap: 1rem; max-width: 44rem; margin-top: 1rem; }

/* ---------- Střediska ---------- */
.karty { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: 1rem; }
.karta { background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.karta h2 { margin: 0; font-size: 1.2rem; }
.karta-stavy { list-style: none; padding: 0; margin: .25rem 0; display: flex; flex-direction: column; gap: .35rem; }
.karta-stavy li { display: flex; justify-content: space-between; align-items: center; }
.karta .tlacitko { margin-top: auto; align-self: flex-start; }

/* ---------- Kalendář ---------- */
.mesic { background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 1rem; }
.mesic h2 { margin: 0 0 .5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 1.15rem; }
.mesic h2 small { font-weight: 500; color: var(--text-tlumeny); }
.mesic-prosle { border: 2px solid var(--prosle); background: var(--prosle-bg); }
.mesic ul { list-style: none; padding: 0; margin: 0; }
.mesic li { display: grid; grid-template-columns: 4.5rem 9.5rem 1fr; gap: .75rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--cara); }
.mesic li:first-child { border-top: 0; }
.mesic .datum { font-weight: 700; }
.mesic .nic { color: var(--text-tlumeny); margin: 0; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .dlazdice { grid-template-columns: repeat(2, 1fr); }
  .filtry { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .rozvrzeni { grid-template-columns: 1fr; }
  .menu { border-right: 0; border-bottom: 1px solid var(--cara); padding: .5rem 1rem; }
  .menu ul { display: flex; flex-wrap: wrap; gap: .25rem; }
  .menu li + li { margin-top: 0; }
  .menu a { padding: .45rem .6rem; font-size: .95rem; }
  .menu a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--primarni); }
  .nastaveni { margin-top: .5rem; padding-top: .5rem; flex-direction: row; flex-wrap: wrap; }
  .nastaveni-nadpis { width: 100%; }
  .obsah { padding: 1.25rem 1rem 2.5rem; }
  .hlavicka { padding: .6rem 1rem; }
  .uzivatel { display: none; }
  .logo { height: 28px; }
  .radek { grid-template-columns: 1fr; gap: .4rem; }
  .radek-termin { text-align: left; }
  .filtry, .dva-sloupce { grid-template-columns: 1fr; }
  .udaje { grid-template-columns: 1fr; }
  .udaje dt { border-bottom: 0; padding-bottom: .1rem; }
  .mesic li { grid-template-columns: 4.5rem 1fr; }
  .mesic li > :last-child { grid-column: 1 / -1; }
  .tabulka.karticky thead { display: none; }
  .tabulka.karticky tr { display: block; border-bottom: 1px solid var(--cara); padding: .5rem 0; }
  .tabulka.karticky td { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; border: 0; padding: .3rem .85rem; }
  .tabulka.karticky td::before { content: attr(data-label); font-weight: 600; color: var(--text-tlumeny); font-size: .88rem; }
}

/* ---------- Tisk ---------- */
@media print {
  .menu, .hlavicka .uzivatel, .filtry, .akce, .oznameni, .paticka, .preskocit, .tlacitko { display: none !important; }
  .rozvrzeni { display: block; }
  body { background: #fff; }
  .obsah { padding: 0; max-width: none; }
}

/* ======================================================================
   Doplňky aplikace (oproti demu)
   ====================================================================== */
.rozvrzeni.bez-menu { grid-template-columns: minmax(0, 1fr); }
.rozvrzeni.bez-menu .obsah { margin: 0 auto; max-width: 46rem; width: 100%; }
.znacka-text.bez-loga { padding-left: 0; border-left: 0; }

.menu-nadpis { font-size: .85rem; color: var(--text-tlumeny); margin: 1.25rem .75rem .35rem; font-weight: 600; }
.menu form { margin: 0; }
.menu-tlacitko {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .6rem .75rem; border-radius: var(--radius); border: 0; background: none;
  color: var(--text); font: inherit; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-tlacitko:hover { background: var(--pozadi); }

input[type="password"], input[type="url"], input[type="number"] {
  font: inherit; color: var(--text); background: #fff;
  border: 2px solid #9aa5ae; border-radius: 6px; padding: .5rem .65rem; min-height: 44px; width: 100%;
}
.zaskrtavatko input[type="radio"] { flex: none; }
.formular.uzky { max-width: 28rem; }
.chyba ul { margin: .25rem 0 0; padding-left: 1.25rem; }
.chyba p { margin: 0; }
.chyba, .oznameni, .varovani, .nahled { margin-bottom: 1rem; }

.stav-vypnuto { color: #4f5b66; background: #eceeea; }
.stav-vypnuto .stav-ikona { background: #4f5b66; }

pre.prikaz, code { font-family: Consolas, "DejaVu Sans Mono", monospace; }
pre.prikaz { background: #1d2730; color: #fff; padding: .75rem 1rem; border-radius: var(--radius); overflow-x: auto; }

@media (max-width: 760px) {
  .menu-nadpis { width: 100%; margin: .5rem 0 .1rem; }
  .menu-tlacitko { padding: .45rem .6rem; font-size: .95rem; }
  .tabulka.karticky td > * { justify-self: start; }
}

/* ---------- Fáze 2: zařízení, střediska, kategorie, tagy ---------- */
.formular.siroky { max-width: 56rem; }
.formular fieldset fieldset { border-style: dashed; }
.volby-radek { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.volby-mrizka { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1rem; }
.ikona-kategorie { width: 1.25rem; text-align: center; color: var(--primarni); }

/* Tag: barva + ikona + název. Žádná červená/oranžová/žlutá (ty patří termínům). */
.tag {
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
  padding: .05rem .55rem; border-radius: 6px; border: 1.5px solid currentColor;
  font-size: .85rem; font-weight: 600; margin: .1rem 0;
}
.tag .fa-tag { font-size: .75rem; }
.tag-modra     { color: #1f4f86; background: #e4edf8; }
.tag-zelena    { color: #24613a; background: #e3f1e7; }
.tag-fialova   { color: #5b3a8a; background: #efe8f7; }
.tag-tyrkysova { color: #0f5e63; background: #e0f2f2; }
.tag-hneda     { color: #6b4a2b; background: #f2ebe3; }
.tag-seda      { color: #4f5b66; background: #eceeea; }

/* Stav zařízení: neutrální (ikona + slovo). */
.stitek {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  padding: .1rem .6rem; border-radius: 999px; border: 1.5px solid #9aa5ae;
  font-size: .88rem; font-weight: 600; color: var(--text); background: var(--plocha);
}
.stitek-vyrazeno, .stitek-mimo_provoz { color: var(--text-tlumeny); border-style: dashed; }

.potvrzeni-box { background: var(--prosle-bg); border: 2px solid var(--prosle); border-radius: var(--radius); padding: 1rem 1.25rem; max-width: 46rem; }
.potvrzeni-box > p { font-weight: 600; color: var(--prosle); }

.vyber-kategorie { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .6rem; }
.vyber-kategorie .tlacitko { width: 100%; justify-content: flex-start; min-height: 56px; font-size: 1.05rem; }

.posun { display: flex; gap: .3rem; }
.posun .tlacitko { min-height: 36px; padding: .25rem .6rem; }
.tlacitko[disabled] { opacity: .35; cursor: default; }
.filtry .hledani { grid-column: 1 / -1; }
.historie { padding-left: 1.25rem; }
.historie li { margin-bottom: .35rem; }
.karta h2 .fa-building { color: var(--primarni); }
