/* Kancelarija — boje i font kao na hairlovers.rs (roze #cd2d91, Nunito Sans). */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/nunito-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/nunito-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pink: #cd2d91;
  --pink-600: #b02079;
  --pink-50: #fdf0f7;
  --pink-100: #fadbec;
  --ink: #111116;
  --bg: #f7f6f9;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #3a3842;
  --muted: #6f6c78;
  --line: #e9e6ee;
  --soft: #f3f1f6;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --ok: #19a75b;
  --warn: #c2410c;
  --warn-soft: #fff1e6;
  --ring: 0 0 0 4px rgb(205 45 145 / 16%);
  --shadow-sm: 0 1px 2px rgb(17 17 22 / 5%);
  --shadow: 0 1px 2px rgb(17 17 22 / 4%), 0 8px 24px -8px rgb(17 17 22 / 10%);
  --shadow-lg: 0 24px 64px -12px rgb(17 17 22 / 30%);
  --r: 16px;
  --r-lg: 22px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --c-violet: #8b5cf6; --c-sky: #0ea5e9; --c-amber: #f59e0b; --c-rose: #cd2d91;
  --c-teal: #14b8a6; --c-green: #19a75b; --c-slate: #64748b; --c-orange: #f97316;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pink: #e04aa6; --pink-600: #ec6bb9; --pink-50: #2a1422; --pink-100: #3b1830;
    --bg: #0f0f12; --card: #17171b; --text: #f4f4f5; --text-2: #d4d4d8; --muted: #a1a1aa;
    --line: #27272c; --soft: #202026; --danger: #f87171; --danger-soft: #3a1d22;
    --ok: #34d399; --warn: #fb923c; --warn-soft: #3a2414;
    --ring: 0 0 0 4px rgb(224 74 166 / 25%);
    --shadow-sm: none; --shadow: 0 0 0 1px rgb(255 255 255 / 2%); --shadow-lg: 0 24px 64px rgb(0 0 0 / 60%);
    --c-violet: #a78bfa; --c-sky: #38bdf8; --c-amber: #fbbf24; --c-rose: #e04aa6;
    --c-teal: #2dd4bf; --c-green: #34d399; --c-slate: #94a3b8; --c-orange: #fb923c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15.5px/1.5 "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.boot { padding: 60px 16px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
.small-ic { width: 13px; height: 13px; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- brend ---------- */
.logo { display: block; line-height: 0; }
.logo img { width: 132px; height: auto; display: block; }
.logo-sm img { width: 96px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.brand-sub {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-left: 2px;
}

/* ---------- dugmad ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-weight: 700; font-size: 14.5px; white-space: nowrap;
  text-decoration: none; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 6px 16px -6px rgb(205 45 145 / 55%); }
.btn.primary:hover { background: var(--pink-600); border-color: var(--pink-600); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; height: 32px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn .ic { width: 18px; height: 18px; }

/* ---------- polja ---------- */
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); outline: none; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
select.input {
  appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea.input { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--pink); box-shadow: var(--ring); }
.input::placeholder { color: var(--muted); opacity: .8; }
label.field, div.field { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.error { color: var(--danger); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }

/* ---------- prijava ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 110% -10%, rgb(205 45 145 / 14%), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgb(205 45 145 / 9%), transparent 60%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow-lg); display: grid; gap: 18px;
}
.auth-card .brand { align-items: center; margin-bottom: 4px; }
.auth-card .logo img { width: 180px; }
.auth-card h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; text-align: center; }
.auth-card p { margin: 0; text-align: center; }
.auth-card .btn.primary { height: 50px; font-size: 16px; }
.auth-card .actions { display: grid; }

/* ---------- raspored (računar) ---------- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--card); border-right: 1px solid var(--line); padding: 22px 14px 16px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 0 10px 22px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 12px;
  border: 0; background: transparent; cursor: pointer; text-align: left; text-decoration: none; color: var(--text-2);
  font-weight: 600; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--soft); color: var(--text); }
.nav-item.active { background: var(--pink-50); color: var(--pink); font-weight: 800; }
.nav-item.muted { color: var(--muted); }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--soft); color: var(--muted); font-variant-numeric: tabular-nums;
}
.nav-item.active .count { background: var(--pink); color: #fff; }
.side h3 { margin: 18px 12px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.side .spacer { flex: 1; min-height: 16px; }
.side .me { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 2px; }
.dot { width: 10px; height: 10px; border-radius: 99px; flex: none; }
.avatar {
  width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--pink), #8b2bb5); color: #fff; font-size: 11.5px; font-weight: 800;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

.content { min-width: 0; }
.main { padding: 36px 40px 80px; }
.main-inner { max-width: 780px; margin: 0 auto; }
.topbar, .tabbar { display: none; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 {
  margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; flex: 1; min-width: 0;
  overflow-wrap: anywhere; display: flex; align-items: center; gap: 12px;
}
.head h1 .dot { width: 14px; height: 14px; }
.head h2 { flex: 1; }
.section-title { margin: 28px 4px 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* ---------- kartice i stavke ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.add-row { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.composer .input { border-color: transparent; background: var(--soft); border-radius: 999px; padding: 0 18px; }
.composer .input:focus { background: var(--card); border-color: var(--pink); }
.items { list-style: none; margin: 0; padding: 6px; }
.item { display: flex; align-items: flex-start; gap: 14px; padding: 12px; border-radius: 12px; transition: background .12s; }
@media (hover: hover) { .item:hover { background: var(--soft); } }
.item .body { flex: 1; min-width: 0; cursor: pointer; padding-top: 1px; }
.item .text { overflow-wrap: anywhere; white-space: pre-wrap; font-weight: 600; color: var(--text); }
.item.done .text { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--muted); align-items: center; }
.item .tools { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.item:hover .tools, .item:focus-within .tools, .item:active .tools { opacity: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px;
  background: var(--soft); color: var(--text-2); font-size: 12px; font-weight: 700;
}
.chip.me { background: var(--pink-50); color: var(--pink); }
.chip.late { background: var(--danger-soft); color: var(--danger); }
.chip.today { background: var(--warn-soft); color: var(--warn); }
.chip.list .dot { width: 8px; height: 8px; }
.check {
  appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 99px; flex: none;
  border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); cursor: pointer; display: grid; place-items: center;
  background: var(--card); transition: background .15s, border-color .15s, transform .1s;
}
.check:hover { border-color: var(--pink); background: var(--pink-50); }
.check:active { transform: scale(.9); }
.check:checked { background: var(--ok); border-color: var(--ok); }
.check:checked::after {
  content: ""; width: 10px; height: 5.5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg);
}
.section-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 18px; border: 0; border-top: 1px solid var(--line);
  background: transparent; cursor: pointer; color: var(--muted); font-weight: 800; font-size: 13.5px;
}
.section-toggle:hover { color: var(--text); }
.section-toggle .ic { width: 16px; height: 16px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); font-weight: 600; display: grid; justify-items: center; gap: 10px; }
.empty-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--pink-50); color: var(--pink); }
.empty-ic .ic { width: 24px; height: 24px; }

/* ---------- pregled spiskova ---------- */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.list-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); text-decoration: none; transition: transform .12s, border-color .12s;
}
.list-card:hover { border-color: color-mix(in srgb, var(--pink) 35%, var(--line)); transform: translateY(-1px); }
.list-card:active { transform: scale(.985); }
.list-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.list-card-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.list-card-name { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.progress { height: 5px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 5px; }
.progress-bar { display: block; height: 100%; border-radius: 99px; }
.chev { color: var(--muted); width: 18px; height: 18px; }

/* ---------- dijalozi ---------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; background: var(--card); color: var(--text);
  width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop .18s ease-out; }
dialog::backdrop { background: rgb(17 17 22 / 50%); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg { padding: 24px; display: grid; gap: 16px; }
.dlg h2 { margin: 0; font-size: 20px; font-weight: 800; }
.dlg .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg .actions .left { margin-right: auto; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button {
  width: 34px; height: 34px; border-radius: 99px; border: 3px solid var(--card); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); transition: transform .1s;
}
.colors button:hover { transform: scale(1.08); }
.colors button.on { box-shadow: 0 0 0 2px var(--text); }
.secret {
  font: 800 19px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; padding: 16px; border-radius: 14px;
  background: var(--pink-50); color: var(--pink); text-align: center; user-select: all; overflow-wrap: anywhere;
}

/* ---------- podešavanja / admin ---------- */
.panel { padding: 22px; display: grid; gap: 14px; margin-bottom: 16px; }
.panel h2 { margin: 0; font-size: 17px; font-weight: 800; }
.profile { display: flex; align-items: center; gap: 16px; }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 800; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td > .chip + .chip { margin-left: 4px; }
.table .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.check-label input { width: 18px; height: 18px; accent-color: var(--pink); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 700; z-index: 60; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
}

/* ---------- boje spiskova ---------- */
.bg-violet { background: var(--c-violet); } .bg-sky { background: var(--c-sky); } .bg-amber { background: var(--c-amber); }
.bg-rose { background: var(--c-rose); } .bg-teal { background: var(--c-teal); } .bg-green { background: var(--c-green); }
.bg-slate { background: var(--c-slate); } .bg-orange { background: var(--c-orange); }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; }
.w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; }
.w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; }
.w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

/* ---------- telefon ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .layout { display: block; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 20; min-height: 56px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px 16px;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line);
  }
  .topbar > .btn.icon:first-child { margin-left: -8px; }
  .topbar-title { flex: 1; min-width: 0; font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line);
  }
  .tab {
    display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted);
    font-size: 11.5px; font-weight: 800;
  }
  .tab-ic { position: relative; width: 56px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background .15s; }
  .tab.active { color: var(--pink); }
  .tab.active .tab-ic { background: var(--pink-50); }
  .badge {
    position: absolute; top: -2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
    background: var(--pink); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
    border: 2px solid var(--card);
  }
  .main { padding: 18px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); }
  .head h1 { font-size: 26px; }
  .view-spisak .head { display: none; }
  .view-spisak .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
  /* polje za unos na dohvat palca, iznad tabova */
  .composer {
    position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 24;
    padding: 10px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); border-bottom: 0;
  }
  .composer .input { background: var(--card); border-color: var(--line); height: 48px; }
  .add-btn { width: 48px; height: 48px; padding: 0; flex: none; }
  .add-label { display: none; }
  .item { padding: 13px 10px; }
  .item .tools { opacity: 1; }
  .list-grid { grid-template-columns: 1fr; gap: 10px; }
  .dlg .row, .form-grid { grid-template-columns: 1fr; }
  /* dijalog kao donji list (bottom sheet) */
  dialog {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; border-bottom: 0;
    max-height: 92dvh; padding-bottom: var(--safe-b);
  }
  dialog[open] { animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
  .dlg { padding: 10px 18px 20px; }
  .dlg::before { content: ""; justify-self: center; width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin-bottom: 4px; }
  .dlg .actions .btn { flex: 1; }
  .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .panel { padding: 18px; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { *, dialog[open] { animation: none !important; transition: none !important; } }
.no-ring:focus { box-shadow: none; }
