/* IMANJE PLANNER — mobile-first, minimalno boja, velika dodirna polja. */
:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #1c1c1a;
  --muted: #6b6b66;
  --line: #e2e2dd;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --hitno: #c0392b;
  --visoko: #d97706;
  --normalno: #b8a219;
  --nisko: #4b8b5f;
  --radius: 12px;
  --tap: 46px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a; --card: #212327; --ink: #eceae5; --muted: #9b9a94;
    --line: #33363b; --accent: #4e9b74; --accent-ink: #0f120f;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 84px;
}
h1, h2, h3 { margin: 0 0 .4rem; line-height: 1.2; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
a { color: var(--accent); }

header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: .7rem 1rem; display: flex; align-items: center; gap: .6rem;
}
header.top .who { margin-left: auto; font-size: .8rem; color: var(--muted); }

main { padding: 1rem; max-width: 760px; margin: 0 auto; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem; margin-bottom: .7rem;
}
.card.tight { padding: .6rem .75rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .85rem; }
.right { margin-left: auto; }
.stack > * + * { margin-top: .5rem; }

button, .btn {
  min-height: var(--tap); padding: .6rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.small { min-height: 36px; padding: .3rem .7rem; font-size: .85rem; font-weight: 500; }
button.link { border: none; background: none; color: var(--accent); min-height: 32px; padding: .2rem; }
button:disabled { opacity: .5; }

input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: .8rem; color: var(--muted); margin: .5rem 0 .15rem; }

.pill {
  display: inline-block; padding: .12rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; border: 1px solid var(--line); white-space: nowrap;
}
.p-hitno    { background: var(--hitno);    color: #fff; border-color: transparent; }
.p-visoko   { background: var(--visoko);   color: #fff; border-color: transparent; }
.p-normalno { background: var(--normalno); color: #1c1c1a; border-color: transparent; }
.p-nisko    { background: var(--nisko);    color: #fff; border-color: transparent; }
.st { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.big-count { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.tile .lbl { font-size: .78rem; color: var(--muted); }

nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding: .25rem; padding-bottom: calc(.25rem + env(safe-area-inset-bottom));
}
nav.tabs button {
  flex: 1; border: none; background: none; min-height: 54px; padding: .2rem;
  font-size: .68rem; font-weight: 600; color: var(--muted); display: grid; gap: 2px; justify-items: center;
}
nav.tabs button .ico { font-size: 1.15rem; }
nav.tabs button[aria-current="true"] { color: var(--accent); }

.item { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.item:last-child { border-bottom: none; }
.item .t { font-weight: 600; }

dialog {
  border: none; border-radius: 14px; padding: 0; width: min(94vw, 460px);
  background: var(--card); color: var(--ink);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .body { padding: 1rem; }
dialog h2 { margin-bottom: .2rem; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 999px;
  font-size: .88rem; z-index: 50; max-width: 90vw;
}
.thumbs { display: flex; gap: .4rem; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 1.4rem .6rem; }
.fab {
  position: fixed; right: 16px; bottom: 88px; z-index: 31;
  width: 58px; height: 58px; border-radius: 50%; font-size: 1.7rem; font-weight: 400;
  background: var(--accent); color: var(--accent-ink); border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}

/* Poveznica na drugi zapis (rad, problem). Namjerno diskretna - klikaju se naslovi. */
.veza { color: var(--accent); cursor: pointer; }
.veza:active { opacity: .6; }
dialog h3 { margin: .9rem 0 .2rem; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* Stanje u kojem zapis trenutno jest: oznaceno, ne ugaseno do neprepoznatljivosti. */
button.trenutno { border-color: var(--accent); color: var(--accent); opacity: 1; font-weight: 700; }
.item.gotov .t { text-decoration: line-through; opacity: .65; }
details.card summary { cursor: pointer; }

/* Kucice na vikend ploci su prekidaci, pa moraju izgledati i ponasati se kao gumbi. */
.tile.klik {
  text-align: left; width: 100%; font: inherit; font-weight: 400;
  min-height: 0; padding: .75rem; cursor: pointer;
  display: block; color: var(--ink);
}
.tile.klik[aria-expanded="true"] {
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.tile .strelica { color: var(--muted); font-size: .7rem; }
.tile.klik .big-count { margin: .1rem 0; }

/* Naslov grupe po hitnoci unutar popisa. */
.grupa {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin: .8rem 0 .1rem; padding-top: .5rem; border-top: 1px solid var(--line);
}
.card > .grupa:first-of-type { border-top: none; padding-top: 0; margin-top: .3rem; }

/* Hitnost kucice. Crveno blago pulsira - ali samo crveno, i samo dok stvarno gori;
   da sve treperi, oko bi to za dva dana prestalo primjecivati. */
.tile.pozor-visoko { border-color: var(--visoko); box-shadow: inset 3px 0 0 var(--visoko); }
.tile.pozor-hitno  { border-color: var(--hitno);  box-shadow: inset 3px 0 0 var(--hitno);
  animation: pozor 2.4s ease-in-out infinite; }
.tile.pozor-hitno .big-count { color: var(--hitno); }
.tile.pozor-visoko .big-count { color: var(--visoko); }
@keyframes pozor {
  0%, 100% { box-shadow: inset 3px 0 0 var(--hitno); }
  50%      { box-shadow: inset 3px 0 0 var(--hitno), 0 0 0 3px color-mix(in srgb, var(--hitno) 25%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .tile.pozor-hitno { animation: none; } }

/* Potpis autora: diskretan, ali ne skriven. */
.potpis { display: inline-block; opacity: .5; color: var(--ink); transition: opacity .2s; }
.potpis:hover, .potpis:focus { opacity: .9; }
