/* Postavitev: ena ozka "telefonska" kolona, spodaj fiksna navigacija s petimi zavihki, vnosi v spodnjih listih. */
:root{
  /* Majina paleta iz index.html: vijolična #7257b7 na lila ozadju #f7f5fc */
  --bg:#F7F5FC; --surface:#FFFFFF; --surface2:#ECE7F7; --ink:#29243C; --muted:#736C83; --line:#DDD4EE;
  --primary:#7257B7; --on-primary:#FFFFFF; --sun:#E9A820; --note:#FFF4DB; --head:#7257B7; --on-head:#FFFFFF; --head-chip:rgba(255,255,255,.18); --head-line:rgba(255,255,255,.4);
  --ok:#1F7A52; --ok-bg:#DDF4E8; --exc:#3D62B8; --exc-bg:#DFE7FA; --abs:#AA3333; --abs-bg:#FFE3E5;
  --shade:rgba(41,36,60,.45);
  --display:"Bricolage Grotesque","Figtree",system-ui,sans-serif;
  --body:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#15121F; --surface:#201C2E; --surface2:#2A2540; --ink:#ECE8F7; --muted:#A49DB8; --line:#3A3353;
  --primary:#A994E6; --on-primary:#1B1430; --sun:#E9A820; --note:#3A3118; --head:#4A3885; --on-head:#FFFFFF; --head-chip:rgba(255,255,255,.14); --head-line:rgba(255,255,255,.3);
  --ok:#5CCB98; --ok-bg:#153B2C; --exc:#8FAEF0; --exc-bg:#1B2A4D; --abs:#F0879B; --abs-bg:#47202A;
  --shade:rgba(0,0,0,.6); color-scheme:dark } }
:root[data-theme="dark"]{
  --bg:#15121F; --surface:#201C2E; --surface2:#2A2540; --ink:#ECE8F7; --muted:#A49DB8; --line:#3A3353;
  --primary:#A994E6; --on-primary:#1B1430; --sun:#E9A820; --note:#3A3118; --head:#4A3885; --on-head:#FFFFFF; --head-chip:rgba(255,255,255,.14); --head-line:rgba(255,255,255,.3);
  --ok:#5CCB98; --ok-bg:#153B2C; --exc:#8FAEF0; --exc-bg:#1B2A4D; --abs:#F0879B; --abs-bg:#47202A;
  --shade:rgba(0,0,0,.6); color-scheme:dark }

*{box-sizing:border-box}
[hidden]{display:none!important}
/* App shell: the page itself never scrolls. #scroll is the only scroller and the tab bar is a normal
   flex child below it, so iOS cannot detach it from the bottom edge (keyboard / standalone-mode bugs). */
html{height:100%;overflow:hidden}
body{background:var(--bg);color:var(--ink);font:16px/1.45 var(--body);
  height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top, 0px);background:var(--head);z-index:10}
#scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
  padding:calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px))}
button,input,select,textarea{font:inherit;color:inherit}
/* iOS zooms the page when a focused field's text is under 16px */
input,select,textarea{font-size:16px}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--sun);outline-offset:2px}
.wrap{max-width:480px;margin:0 auto;display:flex;flex-direction:column;gap:14px}
.num{font-variant-numeric:tabular-nums}

.top{display:flex;align-items:center;gap:10px;background:var(--head);color:var(--on-head);padding:6px 0 18px;
  box-shadow:0 0 0 100vmax var(--head);clip-path:inset(-200px -100vmax 0 -100vmax)}
.top .bf{font-size:30px;line-height:1;flex:none}
.top small{color:var(--on-head);opacity:.9}
.top .chip,.top .icon-btn{background:var(--head-chip);border-color:var(--head-line);color:var(--on-head);flex:none}
.top .who{flex:1;min-width:0}
.top h1{font:700 22px/1.1 var(--display);margin:0}
.top small{font-size:13px}
.chip{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 12px;font-weight:600;font-size:14px;min-height:38px}
.icon-btn{border:1px solid var(--line);background:var(--surface);border-radius:999px;width:38px;height:38px;display:grid;place-items:center;padding:0}
.icon-btn svg{width:20px;height:20px}

.link{background:none;border:0;padding:0;color:var(--primary);font-weight:700;text-decoration:underline;text-underline-offset:3px}

.card{background:var(--surface);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:12px}
.card h2{font:700 19px/1.2 var(--display);margin:0;text-wrap:balance}
.card h2 small{display:block;font:500 13px var(--body);color:var(--muted);margin-bottom:2px;text-transform:uppercase;letter-spacing:.06em}
.sec{font:600 13px var(--body);color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:4px 2px -4px}

.seg3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.st{border:2px solid var(--line);background:var(--surface);border-radius:14px;padding:12px 4px;font-weight:700;font-size:14.5px;min-height:56px;line-height:1.15}
.st-present.on{background:var(--ok-bg);border-color:var(--ok);color:var(--ok)}
.st-excused.on{background:var(--exc-bg);border-color:var(--exc);color:var(--exc)}
.st-absent.on{background:var(--abs-bg);border-color:var(--abs);color:var(--abs)}
.hint{margin:-4px 2px 0;font-size:13.5px;color:var(--muted)}
.toggle{border:2px solid var(--line);background:var(--surface);border-radius:14px;padding:11px 14px;font-weight:600;text-align:left;display:flex;align-items:center;gap:10px}
.toggle i{width:22px;height:22px;border-radius:7px;border:2px solid var(--muted);flex:none;display:grid;place-items:center;font-style:normal;font-size:14px;line-height:1}
.toggle.on{border-color:var(--primary)}
.toggle.on i{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.lbl{font-weight:600;font-size:14px;display:flex;flex-direction:column;gap:5px}
input[type=text],input[type=date],input[type=time],input[type=file],select,textarea{width:100%;border:1.5px solid var(--line);background:var(--bg);border-radius:12px;padding:11px 12px;min-height:46px}
textarea{min-height:84px;resize:vertical}
.row-btns{display:flex;gap:8px;flex-wrap:wrap}
.btn{border:1.5px solid var(--line);background:var(--surface);border-radius:12px;padding:10px 14px;font-weight:700;min-height:44px;flex:1}
.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.btn.danger{color:var(--abs)}
.btn.small{flex:none;min-height:36px;padding:6px 10px;font-size:13.5px}

.total{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
.total b{font:700 34px/1 var(--display)}
.lines{display:flex;flex-direction:column;border-top:1px solid var(--line)}
.lines div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line);font-size:15px}
.lines div span:first-child{min-width:0}
.lines .sum{font-weight:700;border-bottom:0}
.neg{color:var(--ok)} .pos{color:var(--abs)}

.pill{display:inline-block;border-radius:999px;padding:3px 10px;font-size:12.5px;font-weight:700;white-space:nowrap}
.p-present{background:var(--ok-bg);color:var(--ok)} .p-excused{background:var(--exc-bg);color:var(--exc)}
.p-absent{background:var(--abs-bg);color:var(--abs)} .p-none{background:var(--surface2);color:var(--muted)}
.p-paid{background:var(--ok-bg);color:var(--ok)} .p-open{background:var(--abs-bg);color:var(--abs)}

.item{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0;padding-bottom:0}
.item:first-child{padding-top:0}
.item .main{flex:1;min-width:0}
.item .main b{display:block;overflow-wrap:anywhere}
.item .meta{font-size:13px;color:var(--muted)}
.item .body{font-size:14.5px;margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.item .amt{font-weight:700;white-space:nowrap}
.att{display:inline-flex;align-items:center;gap:6px;margin-top:6px;border:1px solid var(--line);background:var(--bg);border-radius:10px;padding:5px 9px;font-size:13px;font-weight:600;max-width:100%}
.att span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.empty{color:var(--muted);font-size:14.5px;margin:0}

.calbar{display:flex;align-items:center;gap:8px}
.calbar strong{flex:1;text-align:center;font:700 17px var(--display);min-width:0}
.views{display:grid;grid-template-columns:repeat(3,1fr);background:var(--surface2);border-radius:12px;padding:3px}
.views button{border:0;background:none;border-radius:10px;padding:8px;font-weight:700;color:var(--muted);min-height:40px}
.views button.on{background:var(--surface);color:var(--ink)}
.grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.grid .h{font-size:11.5px;font-weight:700;color:var(--muted);text-align:center;text-transform:uppercase;letter-spacing:.04em;padding-bottom:2px}
.day{border:0;border-radius:10px;background:var(--bg);aspect-ratio:1/1.08;padding:4px 2px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;font-weight:700;font-size:15px;min-width:0}
.day.we{color:var(--muted);background:none}
.day.present{background:var(--ok-bg);color:var(--ok)} .day.excused{background:var(--exc-bg);color:var(--exc)} .day.absent{background:var(--abs-bg);color:var(--abs)}
.day.today{box-shadow:inset 0 0 0 2.5px var(--sun)}
.day .marks{display:flex;gap:2px;height:8px}
.day .marks i{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.75}
.day .marks i.c{background:var(--sun);opacity:1}
.legend{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12.5px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:5px}
.legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.wk{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;background:none;padding:10px 0;border-bottom:1px solid var(--line)}
.wk:last-child{border-bottom:0}
.wk .d{width:44px;flex:none;text-align:center;font-size:12px;color:var(--muted);text-transform:uppercase;font-weight:700}
.wk .d b{display:block;font:700 20px/1 var(--display);color:var(--ink)}
.wk.today .d b{color:var(--primary)}
.wk .main{flex:1;min-width:0}
.wk .main p{margin:3px 0 0;font-size:13.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stats div{background:var(--bg);border-radius:12px;padding:8px 10px;font-size:12.5px;color:var(--muted)}
.stats b{display:block;font:700 20px/1.1 var(--display);color:var(--ink)}

.bars{display:flex;flex-direction:column;gap:8px}
.bar{display:grid;grid-template-columns:42px 1fr auto;gap:8px;align-items:center;font-size:13.5px}
.bar .t{background:var(--bg);border-radius:6px;height:14px;overflow:hidden}
.bar .t i{display:block;height:100%;background:var(--primary);border-radius:6px}
.bar.cur .t i{background:var(--sun)}

nav{flex:none;background:var(--surface);border-top:1px solid var(--line);z-index:5;
  padding-left:max(8px, env(safe-area-inset-left, 0px));padding-right:max(8px, env(safe-area-inset-right, 0px))}
nav div{max-width:480px;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr)}
nav button{border:0;background:none;padding:8px 2px 7px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11.5px;font-weight:600;color:var(--muted);min-width:0}
nav button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
nav button.on{color:var(--primary)}

.overlay{position:fixed;inset:0;background:var(--shade);z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--surface);width:100%;max-width:480px;max-height:90%;overflow:auto;border-radius:22px 22px 0 0;
  padding:16px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display:flex;flex-direction:column;gap:12px}
.sheet .head{display:flex;align-items:center;gap:10px}
.sheet .head h2{flex:1;font:700 20px/1.2 var(--display);margin:0;min-width:0}
.sheet form{display:flex;flex-direction:column;gap:12px}
.sheet img{border-radius:12px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end} /* fields line up even when one label wraps */
@media (prefers-reduced-motion:no-preference){ .sheet{animation:up .18s ease-out} @keyframes up{from{transform:translateY(24px);opacity:.6}} }

/* ---------- dodatki za pravo aplikacijo ---------- */
html{-webkit-text-size-adjust:100%}
body{margin:0}
:root[data-theme="dark"]{color-scheme:dark}
a{color:var(--primary)}
.top .chip{cursor:default}
a.att{color:inherit;text-decoration:none}
a.att:hover{background:var(--surface2)}
.btn:disabled,.st:disabled,.toggle:disabled{opacity:.55;cursor:default}
.btn.link-btn{flex:none}
.item .acts{display:flex;flex-direction:column;gap:6px;align-items:flex-end;flex:none}
.err{color:var(--abs);font-weight:600}
.okc{color:var(--ok);font-weight:600}
.spin{width:36px;height:36px;border-radius:50%;border:4px solid var(--surface2);border-top-color:var(--primary);margin:6px auto;animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:3s}}
.center{text-align:center}

.toasts{position:fixed;left:0;right:0;bottom:calc(76px + env(safe-area-inset-bottom, 0px));z-index:40;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;padding:0 16px}
.toast{background:var(--ink);color:var(--bg);border-radius:12px;padding:10px 14px;font-size:14.5px;font-weight:600;max-width:440px;box-shadow:0 6px 24px rgba(0,0,0,.25);pointer-events:auto;overflow-wrap:anywhere}
.toast.bad{background:var(--abs);color:#fff}
@media (prefers-reduced-motion:no-preference){.toast{animation:up .18s ease-out}}

.login{min-height:calc(100dvh - 90px);display:flex;flex-direction:column;justify-content:center;gap:14px}
.login .bf-big{font-size:56px;line-height:1;text-align:center}
.login h1{font:700 26px/1.15 var(--display);margin:0;text-align:center}
.login p.sub{margin:-6px 0 0;text-align:center;color:var(--muted);font-size:14.5px}
input[type=password]{width:100%;border:1.5px solid var(--line);background:var(--bg);border-radius:12px;padding:11px 12px;min-height:46px}
input:disabled{opacity:.6}

.pcheck{border-radius:14px;padding:12px;border:2px solid var(--line);display:flex;flex-direction:column;gap:6px}
.pcheck.ok{background:var(--ok-bg);border-color:var(--ok)}
.pcheck.bad{background:var(--abs-bg);border-color:var(--abs)}
.pcheck .lines{border-top-color:currentColor}
.pcheck .lines div{border-bottom-color:rgba(127,127,127,.3);padding:5px 0}
.pcheck p{margin:0;font-size:14px}
.sug{border:1.5px solid var(--line);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:10px}
.sug.done{background:var(--ok-bg);border-color:var(--ok)}
.sug .kind{font:600 12.5px var(--body);color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.sug form{gap:10px}
.sum-box{background:var(--bg);border-radius:12px;padding:10px 12px;font-size:14.5px;overflow-wrap:anywhere}
.log{display:flex;flex-direction:column;border-top:1px solid var(--line);max-height:240px;overflow:auto}
.log div{padding:7px 0;border-bottom:1px solid var(--line);font-size:13.5px;overflow-wrap:anywhere}
.log small{display:block;color:var(--muted);font-size:12px}
a.btn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:var(--ink)}
.hint.err{color:var(--abs)}
.sheet:focus{outline:none}

/* ---------- napoved plenic ---------- */
.card.warn{background:var(--abs-bg);border:2px solid var(--abs)}
.card.warn h2{color:var(--abs)}
.card.warn .empty{color:var(--ink)}
.day.pred{outline:2px dashed var(--primary);outline-offset:-3px}
.legend i.pred-key{background:none;border:2px dashed var(--primary);border-radius:3px}
.pill.p-pred{background:none;border:1.5px dashed var(--primary);color:var(--primary);padding:1.5px 8px}

/* ---------- interesne dejavnosti in vrste obvestil ---------- */
.acts{display:flex;flex-direction:column;gap:8px}
.act{display:flex;flex-direction:column;gap:5px;min-width:0}
.act-h{overflow-wrap:anywhere}
.act-n{font-weight:700}
.eq{align-self:flex-start;max-width:100%;background:var(--note);border:1.5px solid var(--sun);border-radius:10px;padding:4px 10px;font-size:14px;font-weight:600;overflow-wrap:anywhere}
.act.muted,.acts.muted{opacity:.6}
.act.muted .eq,.acts.muted .eq{background:none;border-color:var(--line);border-style:dashed}
.act em{font-style:normal;font-weight:600;color:var(--muted)}
.pill.p-act{background:var(--note);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--sun)}
.pill.p-notice{background:var(--surface2);color:var(--primary)}
.pill.p-ntype{background:var(--surface2);color:var(--primary);margin-bottom:4px}
.pill.muted{opacity:.55}
.wk-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px;min-width:0}
.wk-tags .pill{max-width:100%;overflow:hidden;text-overflow:ellipsis;font-size:12px;padding:2px 8px}
.day .nis{font-size:10px;line-height:1;height:12px;display:flex;align-items:center;gap:1px;font-weight:700}
.day .nis b{font-size:10px}
.day .marks i.a{border-radius:2px;background:var(--primary);opacity:1}
.legend i.act-key{border-radius:2px;background:var(--primary);width:8px;height:8px}
.ni-big{font-size:20px;line-height:1.2;flex:none;width:28px;text-align:center}
.nrow{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;background:none;padding:8px 0;border-bottom:1px solid var(--line)}
.nrow:last-child{border-bottom:0;padding-bottom:0}
.nrow .nt{flex:1;min-width:0;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nrow .meta{font-size:13px;color:var(--muted);flex:none}
.tchips{display:flex;flex-wrap:wrap;gap:6px}
.tchip{border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 12px;font-weight:600;font-size:14px;min-height:38px;display:inline-flex;align-items:center;gap:6px}
.tchip.on{background:var(--surface2);border-color:var(--primary);color:var(--primary)}
.slot{border:1.5px solid var(--line);border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:10px}
.slot-top{display:flex;gap:10px;align-items:flex-end}
.slot-top .lbl{flex:1;min-width:0}
.acts-admin{display:flex;flex-direction:column;gap:10px}
.acts-admin .item .meta{display:block;overflow-wrap:anywhere}

.row-acts{display:flex;flex-direction:column;gap:6px;flex:none}

/* iOS home-screen mode with a translucent status bar reports a dynamic viewport that is shorter than the
   screen by the status-bar height, which leaves a gap under the tab bar and under sheets. 100vh is the
   full screen there (no browser toolbars in standalone), so use it for the shell and the overlay. */
@media (display-mode: standalone){
  body{height:100vh}
  .overlay{inset:0 0 auto 0;height:100vh}
  nav{padding-bottom:min(env(safe-area-inset-bottom, 0px), 10px)}
}
.pack-custom{display:flex;gap:8px;align-items:center}
.pack-custom input{flex:1;min-width:0;width:auto}
.toggle .tsize{margin-left:auto;font-weight:600;font-size:13.5px;color:var(--muted)}
