/* =========================================================
   Centar za pse Baranja · Zadaci
   Vizualni identitet usklađen s centarzapse.com:
   šljiva ljubičasta #620062, Raleway, bijele kartice, crno-bijeli logo
   ========================================================= */

/* Raleway (SIL Open Font License, vidi OFL.txt), lokalno, bez Google Fonts */
@font-face {
  font-family: "Raleway";
  src: url("raleway.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --plum: #620062;
  --plum-700: #4a004a;
  --plum-100: #f5ebf5;
  --plum-50: #fbf7fb;

  /* Površine i tekst */
  --bg: #f7f4f7;
  --surface: #ffffff;
  --surface-2: #faf8fa;
  --ink: #2a1f2a;
  --ink-soft: #4d434d;
  --muted: #857b85;
  --line: #ece5ec;
  --line-strong: #dcd2dc;

  /* Uloge */
  --accent: var(--plum);
  --accent-hover: var(--plum-700);
  --today: var(--plum);
  --late: #c2412d;
  --late-soft: #fbece9;
  --ok: #3d7a52;
  --warn: #9a6a12;
  --warn-soft: #f8efdc;
  --gold: #c99a2e;
  --on-accent: #ffffff;

  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(42, 31, 42, .05), 0 6px 20px rgba(98, 0, 98, .06);
  --shadow-lift: 0 10px 30px rgba(98, 0, 98, .22);
  --font: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151016;
    --surface: #1f1820;
    --surface-2: #261e27;
    --ink: #f0e9f0;
    --ink-soft: #d2c6d2;
    --muted: #a597a5;
    --line: #322832;
    --line-strong: #43374a;
    --accent: #cf8fcf;
    --accent-hover: #e0a8e0;
    --today: #e0a8e0;
    --plum-100: #33203a;
    --plum-50: #1c141e;
    --late: #ef8a73;
    --late-soft: #3a211d;
    --ok: #7cc495;
    --warn: #e2b452;
    --warn-soft: #3a2f1a;
    --on-accent: #1a121b;
    --shadow: none;
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  font-feature-settings: "lnum" 1;
  padding-bottom: calc(150px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--plum-100); }

/* ---------- Zaglavlje ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand .sep { width: 1px; height: 26px; background: var(--line-strong); }
.brand .app { font-weight: 700; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who .me { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; color: var(--ink-soft); }
.who .me .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--plum-100); }
@media (prefers-color-scheme: dark) { .brand img { filter: invert(1); } }

main { max-width: 720px; margin: 0 auto; padding: 22px 16px; }

/* ---------- Donja navigacija ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(42, 31, 42, .04);
}
.tabs a {
  position: relative; flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; text-decoration: none; color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.tabs a.active { color: var(--accent); }
.tabs a.active::before { content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }

.fab {
  position: fixed; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 11;
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  display: grid; place-items: center; font-size: 32px; font-weight: 300; line-height: 1;
  box-shadow: var(--shadow-lift); transition: transform .15s, background .15s;
}
.fab:active { transform: scale(.94); }
.fab:hover { background: var(--accent-hover); }

/* ---------- Ikone ---------- */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }
.tabs svg.ic { width: 24px; height: 24px; stroke-width: 1.7; }

/* ---------- Naslovi stranica ---------- */
.pagehead { margin: 0 0 18px; }
.ph-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ph-row .btn { flex: none; }
.pagehead h1 {
  margin: 0; color: var(--accent); font-size: 30px; font-weight: 700; line-height: 1.15;
  text-transform: uppercase; letter-spacing: .02em; display: flex; align-items: center; gap: 10px;
}
.pagehead p { margin: 5px 0 0; font-size: 15px; font-weight: 500; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.back:hover { color: var(--accent); }
.muted { color: var(--muted); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 6px; flex: none; }
.pagehead .dot { width: 14px; height: 14px; margin: 0; }

/* ---------- Filteri ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 16px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-soft);
}
.chips a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips a .av-xs { width: 20px; height: 20px; margin-left: -7px; }

/* ---------- Grupe i zadaci ---------- */
.group { margin-bottom: 26px; }
.group h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px 2px; display: flex; align-items: center; gap: 8px; }
.group.late h2 { color: var(--late); }
.group.person h2 { text-transform: none; letter-spacing: 0; font-size: 17px; color: var(--ink); gap: 10px; }
.group.person h2 .pn { flex: none; }
.count { font-weight: 700; font-size: 11.5px; background: var(--plum-100); color: var(--accent); border-radius: 999px; padding: 2px 9px; letter-spacing: 0; }
.progress { flex: 1; max-width: 160px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress b { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.progress.big { max-width: none; height: 8px; }
.psub { font-size: 13px; color: var(--muted); margin: -4px 0 10px 2px; display: flex; align-items: center; gap: 5px; font-weight: 500; }
.psub .ic { width: 14px; height: 14px; }
.daybar { display: flex; align-items: center; gap: 12px; margin: -6px 0 22px; font-size: 14px; font-weight: 600; color: var(--muted); }

ul.tasks { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
ul.tasks li { position: relative; display: flex; align-items: stretch; border-top: 1px solid var(--line); transition: background .15s; }
ul.tasks li:first-child { border-top: 0; }
ul.tasks li:hover { background: var(--plum-50); }
.chk { margin: 0; display: flex; align-items: center; padding-left: 14px; }
.chk button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; transition: .15s; }
.chk button:hover { border-color: var(--accent); color: var(--accent); }
.chk svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
li.done .chk button { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.body { flex: 1; min-width: 0; padding: 13px 14px 13px 12px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.title { font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
li.done .title { text-decoration: line-through; text-decoration-color: var(--line-strong); color: var(--muted); font-weight: 500; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); font-weight: 500; }
.meta i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.due.today, dd.today { color: var(--today); font-weight: 700; }
.due.late, dd.late { color: var(--late); font-weight: 700; }
.rep { color: var(--accent); font-weight: 600; }
.rowav { display: flex; align-items: center; padding-right: 14px; }
li.urgent::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--late); }
.prio { color: var(--late); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.prio .ic { width: 13px; height: 13px; }
.cl, .live { display: inline-flex; align-items: center; gap: 4px; }
.cl .ic, .live .ic { width: 14px; height: 14px; }
.cl.full { color: var(--ok); }
.live { color: var(--late); font-weight: 700; }
.dogtag { background: var(--plum-100); color: var(--accent); border-radius: 5px; padding: 1px 8px; font-weight: 700; font-size: 12px; }

.empty { padding: 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1.5px dashed var(--line-strong); font-weight: 500; }
.empty.big { padding: 52px 20px; font-size: 16px; }
.quicktpl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 24px; font-size: 14px; font-weight: 500; }

/* ---------- Kartice, forme, gumbi ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 14px; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; font-weight: 500; }
input, select, textarea {
  font: 500 16px/1.4 var(--font); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 12px; width: 100%; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 400; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type=color] { padding: 4px; height: 46px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--plum-100); background: var(--surface); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 15px/1 var(--font); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  border-radius: var(--radius-sm); padding: 12px 20px; min-height: 46px;
  background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--plum-100); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--late); border-color: var(--late-soft); background: var(--late-soft); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn.small { min-height: 0; padding: 8px 13px; font-size: 13.5px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn .ic { margin-right: 1px; }
form.danger { text-align: center; margin: 8px 0 24px; }

.flash { background: var(--plum-100); color: var(--accent); font-weight: 600; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border-left: 4px solid var(--accent); }
.flash.bad, .error { background: var(--late-soft); color: var(--late); border-left: 4px solid var(--late); }
.error { font-weight: 600; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.addproj summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.addproj[open] summary { margin-bottom: 16px; }

.quickadd { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-bottom: 22px; }
.quickadd select { width: auto; }

/* ---------- Projekti i rutine ---------- */
.projects { display: grid; gap: 10px; margin-bottom: 16px; }
.project {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 15px 18px; text-decoration: none; transition: border-color .15s;
}
.project:hover { border-color: var(--line-strong); }
.project i { grid-row: span 2; width: 5px; border-radius: 3px; }
.pname { font-weight: 700; font-size: 17px; }
.pmeta { font-size: 14px; color: var(--muted); font-weight: 500; }
.pmeta b { color: var(--today); }
.project.archived { opacity: .55; }
.tplrow { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 16px 2px; margin-bottom: 12px; background: var(--surface-2); }
.tplrow .check { align-self: end; min-height: 46px; }
.apply { border: 1.5px solid var(--accent); }
.apply h2 { display: flex; align-items: center; gap: 8px; color: var(--accent); }

/* ---------- Detalj zadatka ---------- */
.detail h1 { margin: 0 0 16px; font-size: 24px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.detail.isdone h1 { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.detail.isurgent { border-color: var(--late); box-shadow: 0 0 0 1px var(--late), var(--shadow); }
.urgentbar { display: inline-flex; align-items: center; gap: 5px; color: #fff; background: var(--late); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; margin-bottom: 12px; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0 0 16px; font-size: 15px; }
.detail dt { color: var(--muted); font-weight: 500; }
.detail dd { margin: 0; font-weight: 600; }
.detail dd a { color: var(--accent); }
.withav { display: flex; align-items: center; gap: 8px; }
.notes { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; }

.checklist { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0 8px; overflow: hidden; }
.clh { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.clh b { color: var(--ink-soft); }
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li { border-top: 1px solid var(--line); }
.checklist form { margin: 0; }
.checklist button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 12px 14px; font: 500 15px/1.4 var(--font); color: var(--ink); cursor: pointer; min-height: 50px; }
.checklist button:hover { background: var(--plum-50); }
.checklist .box { width: 24px; height: 24px; flex: none; border: 2px solid var(--line-strong); border-radius: 7px; display: grid; place-items: center; color: transparent; transition: .15s; }
.checklist .box svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.checklist li.on .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.checklist li.on .it { text-decoration: line-through; color: var(--muted); }
.checklist .it { flex: 1; }
.itby { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Vrijeme */
.timerbar {
  position: sticky; top: calc(59px + env(safe-area-inset-top)); z-index: 9;
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  background: #620062; color: #fff; font-weight: 600; font-size: 14px;
}
.timerbar a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.timerbar a::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #ff7a6a; flex: none; animation: pulse 1.6s infinite; }
.timerbar .ic { display: none; }
.timerbar .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timerbar b { font-variant-numeric: tabular-nums; margin-left: auto; }
.timerbar form { margin: 0; }
.tstop { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 7px 12px; font: 700 13px var(--font); cursor: pointer; }
.tstop .ic { display: inline; width: 13px; height: 13px; fill: currentColor; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.timerbox { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.timerbox .btn { flex: 1; }
.timerbox .btn .ic { fill: currentColor; }
.timerbox.running .btn { flex: none; }
.big-elapsed { flex: 1; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.manual summary, .hist summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 14px; }
.manual[open] summary { margin-bottom: 14px; }
.hist summary { list-style: none; }
.hist summary::-webkit-details-marker { display: none; }
.hist summary h2 { display: inline; margin: 0; color: var(--ink); }
.hist summary h2::after { content: ' ›'; color: var(--muted); }
.hist[open] summary h2::after { content: ' ˅'; }
.hist[open] .history { margin-top: 12px; }
.entries { list-style: none; margin: 14px 0 0; padding: 0; }
.entries li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.entries .en { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; font-weight: 600; }
.entries small { color: var(--muted); font-weight: 500; }
.entries form { margin: 0; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 7px; border-radius: 6px; }
.x:hover { color: var(--late); background: var(--late-soft); }
.x-sp { width: 32px; }

/* Komentari i povijest */
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-of-type { border-top: 0; padding-top: 0; }
.comment > div { flex: 1; min-width: 0; }
.cm { font-size: 14px; margin-bottom: 2px; }
.commentform { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.commentform textarea { min-height: 46px; }
.history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history .muted { white-space: nowrap; }
.h-complete span:first-child { color: var(--ok); font-weight: 600; }

/* ---------- Avatari ---------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; flex: none; background: var(--line); letter-spacing: .02em; }
.av-xs { width: 22px; height: 22px; font-size: 9.5px; }
.av-sm { width: 32px; height: 32px; font-size: 12px; }
.av-md { width: 44px; height: 44px; font-size: 16px; }
.av-lg { width: 92px; height: 92px; font-size: 32px; }
.av-none { color: var(--muted); }

/* ---------- Psi ---------- */
.dogs { display: grid; gap: 10px; margin-bottom: 16px; }
.dog { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; transition: border-color .15s; }
.dog:hover { border-color: var(--line-strong); }
.dav { width: 52px; height: 52px; border-radius: 14px; flex: none; background: #f5ebf5 url("logo-dog.png") center 55% / 80% auto no-repeat; font-size: 0 !important; color: transparent !important; }
.dbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dname { font-weight: 700; font-size: 17px; }
.dname small { font-weight: 500; color: var(--muted); font-size: 14px; }
.dmeta { font-size: 13px; color: var(--muted); font-weight: 500; }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 999px; min-width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; font-weight: 700; padding: 0 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.stats b { display: block; font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stats span { display: block; font-size: 12px; line-height: 1.3; color: var(--muted); font-weight: 600; margin-top: 2px; }
.owner { margin: 0 0 8px; font-weight: 600; }
.owner a { color: var(--accent); }
.logform { margin-bottom: 8px; }
.logform textarea { margin-bottom: 12px; }
.logs { list-style: none; margin: 8px 0 0; padding: 0; }
.logs li { display: flex; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.logs .lb { flex: 1; min-width: 0; }
.logs .lh { font-size: 14px; margin-bottom: 3px; }
.logs form { margin: 0; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; }
.stars i { color: var(--line-strong); font-style: normal; }

/* ---------- Izvještaj ---------- */
.report { display: grid; gap: 12px; margin-bottom: 16px; }
.rep-card { margin: 0; }
.rep-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rep-head b { font-size: 17px; }
.bar { display: block; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.rep-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 16px; text-align: center; }
.rep-stats b { display: block; font-size: 19px; font-weight: 700; }
.rep-stats span { font-size: 11.5px; color: var(--muted); line-height: 1.3; display: block; font-weight: 600; }
.rep-stats .bad b { color: var(--late); }
.projrep, .toplist { list-style: none; margin: 0; padding: 0; }
.projrep li { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; font-weight: 600; }
.projrep .pv { color: var(--muted); white-space: nowrap; }
.toplist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.toplist li:first-child { border-top: 0; }
.toplist a { text-decoration: none; }
.toplist b { color: var(--accent); white-space: nowrap; }

/* ---------- Tim i profil ---------- */
.users { list-style: none; margin: 0; padding: 0; }
.users li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.users li:first-child { border-top: 0; padding-top: 0; }
.users li:last-child { padding-bottom: 0; }
.users li .ui { flex: 1; min-width: 0; }
.users li.inactive { opacity: .5; }
.users .muted { font-size: 13.5px; font-weight: 500; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px; border-radius: 5px; background: var(--plum-100); color: var(--accent); vertical-align: 2px; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.avrow { display: flex; align-items: center; gap: 18px; }
.avrow .btn { margin: 0 6px 6px 0; }
.avform label.btn { display: inline-flex; flex-direction: row; font-size: 15px; color: var(--accent); margin-bottom: 6px; cursor: pointer; }
.prio-check .ic { color: var(--late); }
.install-hint p { margin: 0 0 10px; font-size: 15px; }

/* ---------- Prijava ---------- */
.login { max-width: 400px; margin: 6vh auto 0; text-align: center; }
.login .lockup { width: 170px; height: auto; display: block; margin: 0 auto 4px; }
.login h1 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .22em; }
.login p { margin: 0 0 26px; }
.login .form { text-align: left; }
.login .btn { width: 100%; }
@media (prefers-color-scheme: dark) { .login .lockup { filter: invert(1); } }

/* ---------- Mobitel ---------- */
@media (max-width: 520px) {
  main { padding: 18px 12px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .row3 { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .row3 label:last-child { grid-column: span 2; }
  .quickadd { grid-template-columns: 1fr 1fr; }
  .quickadd input { grid-column: span 2; }
  .pagehead h1 { font-size: 25px; }
  .history li { flex-direction: column; gap: 0; }
  .rep-stats { grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .projrep li { grid-template-columns: 90px 1fr auto; }
  .stats b { font-size: 19px; }
  .who .me > span:not(.av) { display: none; }
  .brand img { height: 36px; }
  .timerbar { top: calc(55px + env(safe-area-inset-top)); }
}

@media (display-mode: standalone) {
  .top { padding-top: calc(10px + env(safe-area-inset-top)); }
}

/* ===================== Verzija 3 ===================== */

/* Zvono obavijesti */
.bell { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink-soft); text-decoration: none; }
.bell .ic { width: 22px; height: 22px; }
.bell.on, .bell:hover { background: var(--plum-100); color: var(--accent); }
.bell b { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--late); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }

/* Smjena i upozorenja na Danas */
.shift { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin: -4px 0 14px; }
.shift.on { border-color: var(--ok); background: linear-gradient(0deg, rgba(61,122,82,.06), rgba(61,122,82,.06)), var(--surface); }
.sh-i { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--plum-100); color: var(--accent); flex: none; }
.shift.on .sh-i { background: rgba(61,122,82,.14); color: var(--ok); }
.sh-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sh-t b { font-size: 15px; }
.sh-t span { font-size: 13px; color: var(--muted); font-weight: 500; }
.shift .btn { flex: none; }
.probbtn { color: var(--late); border-color: var(--late-soft); }
.probbtn:hover { background: var(--late-soft); }
.alertbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-weight: 700; text-decoration: none; font-size: 14px; }
.alertbar span { flex: 1; }
.alertbar.urgent { background: var(--late-soft); color: var(--late); }

/* Više: pločice */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 3px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; min-height: 112px; transition: border-color .15s; }
.tile:hover { border-color: var(--line-strong); }
.tile .ic { width: 26px; height: 26px; color: var(--accent); margin-bottom: 8px; }
.tile b { font-size: 15.5px; line-height: 1.25; }
.tile span { font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.3; }
.tile em { font-style: normal; color: var(--late); font-weight: 700; }

/* Obavijesti */
.notifs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.notifs li { border-top: 1px solid var(--line); }
.notifs li:first-child { border-top: 0; }
.notifs a { display: flex; gap: 12px; padding: 13px 16px; text-decoration: none; align-items: flex-start; }
.notifs .ic { color: var(--muted); margin-top: 3px; }
.notifs span { display: flex; flex-direction: column; }
.notifs b { font-weight: 500; line-height: 1.35; }
.notifs small { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.notifs li.unread { background: var(--plum-50); }
.notifs li.unread b { font-weight: 700; }
.notifs li.unread .ic { color: var(--accent); }

/* Rad bez signala i poruke */
.netbar { position: sticky; top: calc(59px + env(safe-area-inset-top)); z-index: 9; padding: 8px 16px; font-size: 13.5px; font-weight: 600; text-align: center; background: var(--plum-100); color: var(--accent); }
.netbar.off { background: #3a2f3a; color: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 30; max-width: calc(100% - 32px); background: #2a1f2a; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--late); }

/* Naplata */
.billing h2 { display: flex; align-items: center; gap: 8px; }
.lock { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.bill-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.bill-sum div { display: flex; flex-direction: column; }
.bill-sum span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bill-sum b { font-size: 17px; }
b.ok { color: var(--ok); }
b.due { color: var(--late); }
.billing .flash { margin: 12px 0 0; }
h3.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 20px 0 8px; }
.inst, .pays { list-style: none; margin: 0; padding: 0; }
.inst li { display: grid; grid-template-columns: 1fr auto 70px; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; align-items: center; }
.inst em { font-style: normal; font-size: 12px; font-weight: 700; text-align: right; color: var(--muted); }
.inst li.paid em { color: var(--ok); }
.inst li.late em, .inst li.late b { color: var(--late); }
.pays li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pays li span { flex: 1; display: flex; flex-direction: column; }
.pays small { color: var(--muted); font-size: 12.5px; }
.pays form { margin: 0; }
.payform { margin-top: 4px; }
.instrow label { margin-bottom: 8px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stats .bad b { color: var(--late); }
.billlist { display: grid; gap: 10px; margin-bottom: 18px; }
.billrow { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; }
.billrow .bl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.billrow .bl small { color: var(--muted); font-size: 13px; }
.billrow .br { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.billrow .br b { font-size: 17px; }
.billrow .br small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.billrow .br em { font-style: normal; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--late); border-radius: 5px; padding: 1px 6px; margin-top: 3px; }

/* Radno vrijeme i povijest */
.monthnav, .daynav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.monthnav b { font-size: 17px; }
.daynav .dn { flex: 1; display: flex; flex-direction: column; align-items: center; }
.daynav .dn b { font-size: 15px; }
.daynav input[type=date] { width: auto; min-height: 0; padding: 4px 8px; text-align: center; border: 0; background: transparent; font-weight: 600; color: var(--muted); }
.btn.disabled { opacity: .35; pointer-events: none; }
.users.hours li.sel { background: var(--plum-50); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.users.hours .ui { text-decoration: none; }
.hrs { font-size: 16px; white-space: nowrap; }
.shifts { list-style: none; margin: 0; padding: 0; }
.shifts li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.shifts li:first-child { border-top: 0; }
.shifts .sd { width: 92px; display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.shifts .st { flex: 1; display: flex; flex-direction: column; font-weight: 600; font-variant-numeric: tabular-nums; }
.shifts small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.shifts li.warn .st small:first-of-type { color: var(--late); font-weight: 700; }
.shifts a.x { text-decoration: none; font-size: 17px; }
.timeline { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.timeline li { display: flex; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline time { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; width: 44px; flex: none; padding-top: 1px; }
.timeline a { flex: 1; min-width: 0; text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.timeline b { font-weight: 600; }
.toplist small { font-size: 13px; }

/* Prijava problema */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.form .pill { margin: 0; display: inline-flex; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer; background: var(--surface); }
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill input:focus-visible + span { box-shadow: 0 0 0 3px var(--plum-100); }
.photo-in { position: relative; }
.photo-in input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.ph-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--accent); text-align: center; }
.ph-btn .ic { width: 28px; height: 28px; }
.ph-btn b { font-size: 15px; color: var(--ink); }
.ph-btn small { color: var(--muted); font-weight: 500; }
.photo-in.has .ph-btn { padding: 10px; }
.ph-prev { display: block; max-height: 260px; width: 100%; object-fit: cover; border-radius: var(--radius-sm); margin-top: 8px; }
.urgent-check .ic { color: var(--late); }
.problem { padding: 16px 18px; }
.problem.isurgent { border-color: var(--late); box-shadow: 0 0 0 1px var(--late), var(--shadow); }
.problem.closed { opacity: .7; }
.pr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pr-head > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.pr-head small { font-size: 12.5px; }
.pr-st { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.problem.isurgent .pr-st { background: var(--late); color: #fff; }
.pr-st.st-resolved { background: rgba(61,122,82,.14); color: var(--ok); }
.pr-st.st-task { background: var(--plum-100); color: var(--accent); }
.problem h3 { margin: 0 0 6px; font-size: 17px; }
.problem p { margin: 0 0 10px; color: var(--ink-soft); }
.pr-photo { display: block; margin: 6px 0 12px; }
.pr-photo img { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pr-actions form { margin: 0; }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline select { min-height: 0; padding: 7px 10px; font-size: 14px; width: auto; }

/* Priručnik */
.msearch { margin-bottom: 18px; }
.mlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mlist a { display: flex; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); text-decoration: none; align-items: flex-start; }
.mlist a:first-child { border-top: 0; }
.mlist a[hidden] { display: none; }
.mlist .ic { color: var(--accent); margin-top: 2px; }
.mlist span { display: flex; flex-direction: column; min-width: 0; }
.mlist b { font-weight: 600; }
.mlist small { color: var(--muted); font-size: 13px; }
.article h1 { font-size: 24px; margin: 10px 0 14px; color: var(--accent); }
.prose { font-size: 16px; line-height: 1.6; }
.prose h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose ul.num { list-style: decimal; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.small { font-size: 13px; }
.manlink { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 10px 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--plum-50); text-decoration: none; }
.manlink .ic { color: var(--accent); width: 22px; height: 22px; }
.manlink span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.manlink small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.manlink i { font-style: normal; color: var(--muted); font-size: 20px; }
code { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }

/* @spominjanje */
.commentform { position: relative; }
.mentionbox { position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5; list-style: none; margin: 0; padding: 4px; min-width: 220px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); }
.mentionbox li { padding: 9px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.mentionbox li:hover { background: var(--plum-100); color: var(--accent); }

@media (max-width: 520px) {
  .shift { flex-wrap: wrap; }
  .shift .btn { width: 100%; }
  .ph-row .probbtn { padding: 7px 10px; font-size: 12.5px; }
  .bill-sum b { font-size: 15px; }
  .netbar, .timerbar { top: calc(55px + env(safe-area-inset-top)); }
}
.comment > form { margin: 0; align-self: flex-start; }

/* ===================== Verzija 4 ===================== */

/* Vremenska prognoza */
.wx { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; margin-bottom: 18px; }
.wxi { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.wxi.wx-sun { color: #d79a1e; }
.wxi.wx-partly { color: #b98a2a; }
.wxi.wx-rain, .wxi.wx-storm { color: #3f74b5; }
.wxi.wx-snow { color: #6aa3d8; }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-now > .wxi { width: 42px; height: 42px; }
.wx-t { display: flex; flex-direction: column; line-height: 1.1; }
.wx-t b { font-size: 28px; font-weight: 700; }
.wx-t span { font-size: 13px; color: var(--muted); font-weight: 600; }
.wx-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.wx-meta b { color: var(--ink); font-size: 14px; }
.wx-tip { margin: 10px 0 8px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; background: rgba(61,122,82,.1); color: var(--ok); }
.wx-tip.wet { background: rgba(63,116,181,.1); color: #2f5f99; }
.wx-tip.hot { background: var(--warn-soft); color: var(--warn); }
.wx-strip { list-style: none; margin: 0 -16px; padding: 4px 12px 2px; display: flex; overflow-x: auto; scrollbar-width: none; }
.wx-strip::-webkit-scrollbar { display: none; }
.wx-strip li { flex: none; width: 54px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 10px; }
.wx-strip li.now { background: var(--plum-50); }
.wx-strip span { font-size: 12px; color: var(--muted); font-weight: 600; }
.wx-strip b { font-size: 14px; font-weight: 700; }
.wx-strip small { font-size: 11px; font-weight: 700; color: #3f74b5; min-height: 14px; }
.wx-strip li.wet { background: rgba(63,116,181,.08); }
@media (prefers-color-scheme: dark) {
  .wx-tip.wet { color: #8fb6e6; background: rgba(63,116,181,.18); }
  .wx-strip small { color: #8fb6e6; }
  .wxi.wx-rain, .wxi.wx-storm { color: #8fb6e6; }
}

/* Obračun plaće */
.payrows { display: grid; gap: 12px; margin-bottom: 16px; }
.pay { margin: 0; }
.pay .rep-head > div { flex: 1; min-width: 0; }
.paytotal { font-size: 20px; color: var(--accent); white-space: nowrap; }
.paylines { list-style: none; margin: 0; padding: 0; }
.paylines li { display: grid; grid-template-columns: 1fr auto 110px; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; align-items: center; }
.paylines li span:nth-child(2) { color: var(--muted); font-variant-numeric: tabular-nums; }
.paylines b { text-align: right; }
.paylines small { color: var(--warn); font-weight: 700; }
.due { color: var(--late); font-weight: 700; }
.rates { list-style: none; margin: 0 0 6px; padding: 0; }
.rates li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.rates li:first-child { border-top: 0; }
.rates li > span:not(.av) { flex: 1; font-weight: 600; color: var(--ink); font-size: 15px; }
.form .rate { flex-direction: row; align-items: center; gap: 6px; margin: 0; width: 140px; }
.rate input { text-align: right; }
.rate i { font-style: normal; color: var(--muted); font-size: 13px; white-space: nowrap; }
