:root {
  --cierna: #000;
  --povrch: #131316;
  --povrch-2: #1c1c21;
  --linka: #2b2b33;
  --text: #f5f5f7;
  --tlmene: #8d8d96;
  --modra: #3b6cf0;
  --modra-tmava: #2a51bd;
  --vysoka: #f2483b;
  --stredna: #e0a52b;
  --nizka: #5b5b66;
  --zelena: #32d074;
  --horny: env(safe-area-inset-top);
  --dolny: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--cierna);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 17px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { display: flex; flex-direction: column; }

/* ---------------------------------------------------------- hlavička */

header.hlavicka {
  padding: calc(var(--horny) + 10px) 18px 10px;
  background: rgba(0,0,0,.82);
  backdrop-filter: saturate(180%) blur(20px);
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--linka);
}

.hlavicka h1 {
  margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em;
}
.hlavicka .podnadpis { color: var(--tlmene); font-size: 14px; margin-top: 2px; }

.hlavicka-riadok { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* ---------------------------------------------------------- týždňový pás */

.tyzden { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tyzden::-webkit-scrollbar { display: none; }

.den-bunka {
  flex: 0 0 auto; width: 46px; padding: 7px 0 8px; border-radius: 12px;
  text-align: center; background: var(--povrch); border: 1px solid transparent;
  cursor: pointer; transition: background .15s;
}
.den-bunka .dtyz { font-size: 11px; color: var(--tlmene); }
.den-bunka .dcis { font-size: 18px; font-weight: 600; margin-top: 1px; }
.den-bunka.vikend .dtyz, .den-bunka.vikend .dcis { color: #c9564c; }
.den-bunka.dnes { border-color: var(--modra); }
.den-bunka.vybrany { background: var(--modra); }
.den-bunka.vybrany .dtyz, .den-bunka.vybrany .dcis { color: #fff; }
.den-bunka .bodky { display: flex; gap: 2px; justify-content: center; margin-top: 4px; height: 4px; }
.den-bunka .bodka { width: 4px; height: 4px; border-radius: 50%; }

/* ---------------------------------------------------------- obsah */

main { flex: 1; overflow-y: auto; padding: 6px 18px calc(92px + var(--dolny)); -webkit-overflow-scrolling: touch; }

.skupina { margin-top: 22px; }
.skupina:first-child { margin-top: 10px; }
.skupina h2 {
  font-size: 13px; font-weight: 600; color: var(--tlmene);
  margin: 0 0 8px; letter-spacing: .01em;
}
.skupina.naliehava h2 { color: var(--vysoka); }

/* ---------------------------------------------------------- udalosť */

.udalost {
  display: flex; gap: 12px; padding: 12px 14px; background: var(--povrch);
  border-radius: 14px; margin-bottom: 8px; align-items: flex-start;
  border-left: 3px solid var(--modra); cursor: pointer;
}
.udalost .cas { flex: 0 0 62px; font-size: 14px; color: var(--tlmene); font-variant-numeric: tabular-nums; padding-top: 1px; }
.udalost .telo { flex: 1; min-width: 0; }
.udalost .nazov { font-weight: 500; }
.udalost .kal { font-size: 13px; color: var(--tlmene); margin-top: 2px; }
.udalost .miesto { font-size: 13px; color: var(--tlmene); margin-top: 2px; }

/* ---------------------------------------------------------- úloha */

.uloha {
  background: var(--povrch); border-radius: 14px; margin-bottom: 8px;
  border-left: 3px solid var(--nizka); overflow: hidden;
}
.uloha[data-priorita="vysoka"] { border-left-color: var(--vysoka); }
.uloha[data-priorita="stredna"] { border-left-color: var(--stredna); }

.uloha-hlava { display: flex; gap: 12px; padding: 13px 14px; align-items: flex-start; }

.odklik {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--nizka); background: none; cursor: pointer;
  display: grid; place-items: center; padding: 0; margin-top: 1px;
  transition: background .15s, border-color .15s;
}
.odklik:active { transform: scale(.9); }
.odklik.hotove { background: var(--zelena); border-color: var(--zelena); }
.odklik svg { width: 13px; height: 13px; opacity: 0; }
.odklik.hotove svg { opacity: 1; }

.uloha .telo { flex: 1; min-width: 0; cursor: pointer; }
.uloha .nazov { font-weight: 500; }
.uloha.je-hotova .nazov { text-decoration: line-through; color: var(--tlmene); }
.uloha .meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--tlmene); margin-top: 3px; }
.uloha .meta .po-termine { color: var(--vysoka); font-weight: 500; }

.znacka { display: inline-flex; align-items: center; gap: 5px; }
.znacka .kruh { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 600; color: #fff; }

.podulohy { padding: 0 14px 12px 50px; }
.poduloha { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 15px; }
.poduloha button {
  flex: 0 0 19px; width: 19px; height: 19px; border-radius: 5px; border: 2px solid var(--nizka);
  background: none; cursor: pointer; padding: 0; display: grid; place-items: center;
}
.poduloha button.hotove { background: var(--modra); border-color: var(--modra); }
.poduloha button svg { width: 11px; height: 11px; opacity: 0; }
.poduloha button.hotove svg { opacity: 1; }
.poduloha.hotova span { text-decoration: line-through; color: var(--tlmene); }

.pokrok { height: 3px; background: var(--linka); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.pokrok i { display: block; height: 100%; background: var(--modra); border-radius: 2px; transition: width .2s; }

/* ---------------------------------------------------------- prepínač */

.prepinac { display: flex; background: var(--povrch-2); border-radius: 10px; padding: 2px; margin-top: 14px; }
.prepinac button {
  flex: 1; padding: 7px 0; border: 0; background: none; color: var(--tlmene);
  font-size: 14px; font-weight: 500; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.prepinac button.aktivny { background: var(--modra); color: #fff; }

/* ---------------------------------------------------------- spodná lišta */

nav.lista {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; padding: 8px 0 calc(6px + var(--dolny));
  background: rgba(0,0,0,.86); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--linka);
}
nav.lista a {
  flex: 1; text-align: center; color: var(--tlmene); text-decoration: none;
  font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
nav.lista a.aktivny { color: var(--modra); }
nav.lista svg { width: 25px; height: 25px; }

.pridat {
  position: fixed; right: 18px; bottom: calc(76px + var(--dolny)); z-index: 45;
  width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--modra);
  color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 20px rgba(59,108,240,.4); display: grid; place-items: center;
}
.pridat:active { background: var(--modra-tmava); }

/* ---------------------------------------------------------- panel (formuláre) */

.zatienenie {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.zatienenie.otvorene { opacity: 1; pointer-events: auto; }

.panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: var(--povrch); border-radius: 18px 18px 0 0;
  padding: 10px 18px calc(22px + var(--dolny));
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.32,.72,0,1);
}
.panel.otvoreny { transform: translateY(0); }
.panel .uchyt { width: 38px; height: 5px; border-radius: 3px; background: var(--linka); margin: 0 auto 14px; }
.panel h2 { font-size: 21px; margin: 0 0 14px; font-weight: 600; }

label { display: block; font-size: 13px; color: var(--tlmene); margin: 14px 0 5px; }

input[type=text], input[type=email], input[type=date], input[type=time],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 12px 13px; border-radius: 11px; border: 1px solid var(--linka);
  background: var(--povrch-2); color: var(--text); font-size: 16px; font-family: inherit;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--modra); outline-offset: -1px; border-color: transparent; }

.dvojica { display: flex; gap: 10px; }
.dvojica > * { flex: 1; }

.prepinac-riadok { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 12px; }
.prepinac-riadok span { font-size: 15px; }

.spinac { position: relative; width: 50px; height: 30px; flex: 0 0 50px; }
.spinac input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.spinac i { position: absolute; inset: 0; background: var(--linka); border-radius: 15px; transition: background .2s; pointer-events: none; }
.spinac i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; transition: transform .2s; }
.spinac input:checked + i { background: var(--zelena); }
.spinac input:checked + i::after { transform: translateX(20px); }

.hlavne {
  width: 100%; padding: 15px; border: 0; border-radius: 13px; background: var(--modra);
  color: #fff; font-size: 17px; font-weight: 600; margin-top: 22px; cursor: pointer;
  font-family: inherit;
}
.hlavne:active { background: var(--modra-tmava); }
.hlavne:disabled { opacity: .5; }

.vedlajsie {
  width: 100%; padding: 13px; border: 1px solid var(--linka); border-radius: 13px;
  background: none; color: var(--text); font-size: 16px; margin-top: 9px; cursor: pointer;
  font-family: inherit;
}

.priorita-vyber { display: flex; gap: 8px; }
.priorita-vyber button {
  flex: 1; padding: 11px 0; border-radius: 11px; border: 1px solid var(--linka);
  background: var(--povrch-2); color: var(--tlmene); font-size: 15px; cursor: pointer;
  font-family: inherit;
}
.priorita-vyber button.aktivna { color: #fff; border-color: transparent; }
.priorita-vyber button[data-p="vysoka"].aktivna { background: var(--vysoka); }
.priorita-vyber button[data-p="stredna"].aktivna { background: var(--stredna); color: #1a1a1a; }
.priorita-vyber button[data-p="nizka"].aktivna { background: var(--nizka); }

.zoznam-podulohy { margin-top: 8px; }
.zoznam-podulohy .riadok { display: flex; gap: 8px; margin-bottom: 7px; }
.zoznam-podulohy .riadok input { flex: 1; }
.zoznam-podulohy .riadok button {
  flex: 0 0 44px; border-radius: 11px; border: 1px solid var(--linka);
  background: var(--povrch-2); color: var(--tlmene); font-size: 19px; cursor: pointer;
}

/* ---------------------------------------------------------- stavy */

.prazdno { text-align: center; padding: 60px 24px; color: var(--tlmene); }
.prazdno .velke { font-size: 19px; color: var(--text); margin-bottom: 6px; font-weight: 500; }

.oznam {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(-120%);
  top: calc(var(--horny) + 10px); z-index: 90;
  background: var(--povrch-2); border: 1px solid var(--linka); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-size: 15px; max-width: 88vw;
  transition: transform .25s; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.oznam.vidno { transform: translateX(-50%) translateY(0); }
.oznam.chyba { border-color: var(--vysoka); }

.filtre { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.filtre::-webkit-scrollbar { display: none; }
.filter {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 20px; border: 1px solid var(--linka);
  background: var(--povrch); font-size: 13px; color: var(--tlmene); cursor: pointer;
  display: flex; align-items: center; gap: 6px; font-family: inherit;
}
.filter.zapnuty { color: var(--text); border-color: currentColor; }
.filter .bodka { width: 8px; height: 8px; border-radius: 50%; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--modra); outline-offset: 2px; }
