/* NKK Koeru jaoskond — kujundus „Hele" (0.2.0): õhuline, ümar, värviline päis, hõljuv menüü. */
:root { --aktsent: #0f8a6c; --aktsent2: #1766b4; --tume: #0b6b54; --hele: #e4f6f0; --taust: #f4f6fb; --kaart: #fff; --joon: #e1e6ef; --v2li: #eef2f8;
  --tekst: #141a2a; --tuhm: #6b7386; --viga: #b3261e; --vari: 0 6px 18px rgba(20, 26, 42, .07); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.4 "Avenir Next", -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tekst); background: var(--taust); }
#juur { max-width: 720px; margin: 0 auto; padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }

/* päis */
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 -16px 14px; padding: calc(16px + env(safe-area-inset-top)) 18px 18px;
  background: linear-gradient(160deg, var(--aktsent), var(--aktsent2)); color: #fff; border-radius: 0 0 26px 26px; }
header h1 { font-size: 21px; line-height: 1.15; margin: 0; }
header .tere { font-size: 13px; opacity: .85; }
header button.kes { flex: none; max-width: 48%; font-size: 13px; min-height: 36px; padding: 6px 12px; border: 0; background: rgba(255, 255, 255, .22); color: #fff; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h2 { font-size: 13px; margin: 24px 4px 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--tuhm); }

/* nupud ja väljad */
button, input, select { font: inherit; }
button { border: 0; background: var(--kaart); border-radius: 999px; padding: 10px 16px; min-height: 44px; color: var(--tekst); box-shadow: inset 0 0 0 1px var(--joon); cursor: pointer; }
button.pea { background: var(--aktsent); color: #fff; font-weight: 700; box-shadow: none; }
button.ohtlik { color: var(--viga); }
button:disabled { opacity: .5; }
input, select { border: 1px solid transparent; border-radius: 14px; padding: 10px 12px; min-height: 46px; width: 100%; background: var(--v2li); color: var(--tekst); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--aktsent); outline-offset: 1px; }
.kaart input, .kaart select { background: var(--v2li); }
label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--tuhm); }
.teade { background: var(--hele); color: var(--tume); border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.teade.viga { background: #fbe9e7; color: var(--viga); }

/* kaardid */
.kaart { border-radius: 22px; padding: 14px; margin: 10px 0; background: var(--kaart); box-shadow: var(--vari); }
.kaart.kirjas { background: var(--hele); box-shadow: none; }
.kaart .nimi { font-weight: 650; overflow-wrap: anywhere; }
.kaart.kirjas .nimi::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--aktsent); color: #fff; font-size: 13px; vertical-align: 1px; }
.kaart .kuup { color: var(--tuhm); font-size: 13px; margin-top: 2px; }
.kaart.kirjas .kuup { color: var(--tume); font-weight: 600; }
.rida { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.rida > button.pea { flex: 1; }
.rida > button.ohtlik { margin-left: auto; min-height: 36px; padding: 6px 10px; background: transparent; box-shadow: none; font-size: 14px; }
.samm { display: flex; align-items: center; gap: 2px; background: var(--v2li); border-radius: 999px; padding: 2px; }
.kaart.kirjas .samm { background: #fff; }
.samm button { width: 42px; min-height: 42px; padding: 0; font-size: 22px; background: transparent; box-shadow: none; }
.samm input.tunnid { width: 54px; min-height: 42px; text-align: center; font-weight: 700; padding: 8px 2px; background: transparent; border-radius: 10px; }
.samm input.tunnid[aria-invalid="true"] { outline: 2px solid var(--viga); }
.samm .yhik { font-weight: 700; margin-right: 2px; }
.sammuviga { color: var(--viga); font-size: 14px; margin-top: 6px; }
.sammuviga:empty { display: none; }
.pakkumised button { display: block; width: 100%; text-align: left; margin-top: 6px; border-radius: 14px; }
.nimed button { display: block; width: 100%; text-align: left; margin: 8px 0; border-radius: 18px; padding: 14px 16px; box-shadow: var(--vari); }
.kaks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kaks select { background: var(--kaart); box-shadow: var(--vari); }

/* kuu kokkuvõte sisestuse kohal */
.kuukaart { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; background: var(--kaart); border-radius: 22px; padding: 16px 18px; margin: 12px 0 0; box-shadow: 0 10px 26px rgba(20, 26, 42, .12); }
.kuukaart .arv { font-size: 34px; font-weight: 800; line-height: 1; }
.kuukaart .all { color: var(--tuhm); font-size: 14px; }
@supports selector(:has(*)) {
  header:has(~ .v-sisesta) { padding-bottom: 58px; }
  .v-sisesta .kuukaart { margin-top: -56px; position: relative; }
}

/* nädalad */
.n2dal { display: block; width: 100%; text-align: left; margin: 16px 0 0; background: transparent; box-shadow: none; padding: 8px 4px; min-height: 40px; font-size: 13px; font-weight: 700; color: var(--tuhm); border-radius: 12px; }
.n2dal::before { content: "▸ "; color: var(--aktsent); }
.n2dal[aria-expanded="true"]::before { content: "▾ "; }
.n2dal[aria-expanded="false"] { background: #e9edf5; padding: 10px 14px; margin-top: 8px; }

/* minu tunnid */
.summa { font-size: 52px; font-weight: 800; line-height: 1; margin: 0 4px; }
svg.tulbad { display: block; width: 100%; max-width: 520px; margin: 14px 0 0; }
svg.tulbad rect { fill: #dbe3ee; }
svg.tulbad rect.nyyd { fill: var(--aktsent); }
svg.tulbad text { font-size: 8px; font-weight: 700; fill: var(--tekst); }
svg.tulbad text.kuut2ht { font-size: 6.5px; font-weight: 500; fill: var(--tuhm); }

/* tabelid: eraldi piirjooned (kokkusulatatud piirjoon ei liigu külmutatud lahtriga kaasa) */
.kerib { width: fit-content; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; background: var(--kaart); box-shadow: var(--vari); }
table { border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { border-bottom: 1px solid var(--joon); padding: 8px 10px; text-align: center; white-space: nowrap; background: var(--kaart); }
th:first-child, td:first-child { text-align: left; font-weight: 600; position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--joon); }
thead th { background: var(--v2li); vertical-align: bottom; position: sticky; top: 0; z-index: 2; border-bottom: 2px solid var(--aktsent); }
thead th:first-child { z-index: 3; background: var(--v2li); }
thead th.synd { white-space: normal; min-width: 84px; max-width: 120px; font-weight: 500; text-align: left; font-size: 12px; }
thead th.synd .kp { display: block; font-weight: 800; font-size: 13px; color: var(--tume); }
tbody tr:nth-child(even) td { background: #f8fafd; }
td.kokku, th.kokku { font-weight: 800; }
td.on i { display: inline-block; min-width: 30px; padding: 2px 6px; border-radius: 999px; background: var(--aktsent); color: #fff; font-style: normal; font-weight: 700; }
tbody tr:hover td { background: #fff6cf; }
/* Koond: pealkiri ja kerimisnooled ühel real */
.pealrida { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.nooled { display: flex; gap: 8px; margin-bottom: 6px; }
.nooled[hidden] { display: none; }
.nooled button { width: 44px; min-height: 40px; padding: 0 0 3px; font-size: 24px; line-height: 1; font-weight: 700; color: var(--tume); background: var(--kaart); box-shadow: var(--vari); }
.nooled button:disabled { opacity: .35; cursor: default; }
/* Koond: päiserida püsib paigal ainult siis, kui tabel kerib oma kastis. */
.kerib.koond { max-height: calc(100vh - 250px); overflow: auto; border-bottom: 1px solid var(--joon); }
@media (min-width: 900px) {
  #juur.lai { max-width: none; padding-left: 24px; padding-right: 24px; }
  #juur.lai header { margin-left: -24px; margin-right: -24px; padding-left: 26px; padding-right: 26px; }
  #juur.lai .kaks { max-width: 480px; }
  #juur.lai thead th.synd { min-width: 96px; }
}

/* alumine menüü: hõljub, alati kõige peal */
nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10; display: flex; gap: 2px; width: min(696px, calc(100% - 24px));
  background: var(--kaart); border-radius: 26px; padding: 6px; box-shadow: 0 10px 30px rgba(20, 26, 42, .18); }
nav button { flex: 1; min-width: 0; min-height: 54px; padding: 6px 2px; font-size: 11px; line-height: 1.2; color: var(--tuhm); background: transparent; box-shadow: none; border-radius: 20px; }
nav button[aria-current="page"] { background: var(--aktsent); color: #fff; font-weight: 700; }
svg.ik { display: block; width: 22px; height: 22px; margin: 0 auto 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
footer { color: var(--tuhm); font-size: 12px; margin: 26px 4px 8px; }

/* sisenemine */
#juur.sisene { max-width: none; min-height: 100vh; padding: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--aktsent), var(--aktsent2)); }
.sisenevorm { width: 100%; max-width: 400px; padding: 28px; color: #fff; }
.sisenevorm .mark { width: 64px; height: 64px; border-radius: 20px; background: #fff; color: var(--aktsent); display: grid; place-items: center; margin-bottom: 18px; }
.sisenevorm .mark svg.ik { width: 34px; height: 34px; margin: 0; }
.sisenevorm h1 { font-size: 32px; line-height: 1.1; margin: 0; }
.sisenevorm .lause { opacity: .85; margin: 8px 0 22px; }
.sisenevorm label { color: #fff; opacity: .9; }
.sisenevorm input { min-height: 52px; background: rgba(255, 255, 255, .18); color: #fff; padding: 0 16px; }
.sisenevorm input:focus { outline-color: #fff; }
.sisenevorm button.pea { width: 100%; min-height: 52px; margin-top: 14px; background: #fff; color: #0f6c8a; font-size: 17px; }
.sisenevorm .teade.viga { background: rgba(255, 255, 255, .92); }
