/* ==========================================================
   Dizajn programa.
   BOJE BRENDA SE NE MENJAJU OVDE, nego u config/brand.php
   (upisuju se kao --brand, --accent, --bg ... u <head>).
   ========================================================== */

:root {
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sb-w: 260px;
  --top-h: 64px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .04);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / .12);
  --ok: #1f8a5b; --ok-soft: #e3f4ec;
  --warn: #b26b00; --warn-soft: #fdf1dc;
  --err: #c0392b; --err-soft: #fbe6e3;
  --info: #2c6cb0; --info-soft: #e5eef9;
  --ease: cubic-bezier(.2,.7,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
    --ok: #5fd39c; --ok-soft: #173326; --warn: #f0b552; --warn-soft: #3a2c12;
    --err: #ff8a7a; --err-soft: #3b1c18; --info: #7fb2ee; --info-soft: #172a40;
  }
}
:root[data-theme="dark"] {
  --shadow: 0 1px 2px rgb(0 0 0 / .3);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
  --ok: #5fd39c; --ok-soft: #173326; --warn: #f0b552; --warn-soft: #3a2c12;
  --err: #ff8a7a; --err-soft: #3b1c18; --info: #7fb2ee; --info-soft: #172a40;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .5em; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.d-block { display: block; }
.ico { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Okvir ---------- */
.app { min-height: 100vh; }
.main { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; }
.content { padding: 28px clamp(16px, 3vw, 40px) 120px; width: 100%; max-width: 1320px; margin: 0 auto; }
.content-narrow { max-width: 820px; }

/* Bočni meni */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px;
  transition: transform .3s var(--ease);
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; color: var(--text); }
.sb-brand:hover { text-decoration: none; }
.sb-logo { width: 40px; height: 40px; border-radius: 12px; }
.sb-brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sb-brand-txt strong { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sb-brand-txt small { color: var(--muted); font-size: 12px; }
.sb-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.sb-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sb-link.is-active { background: var(--brand-soft); color: var(--brand); }
.sb-link.is-soon { opacity: .5; cursor: default; }
.sb-link.is-soon:hover { background: none; color: var(--muted); }
.sb-link em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.sb-sep { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sb-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 10px; }
.sb-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); padding: 4px; border-radius: var(--radius-sm); }
.sb-user:hover { background: var(--surface-2); text-decoration: none; }
.sb-user-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-user-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-txt small { font-size: 12px; color: var(--muted); }
.sb-backdrop { display: none; }

/* Gornja traka */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 3vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.tb-brand { display: flex; }
.tb-logo { width: 34px; height: 34px; border-radius: 10px; }
.tb-search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; height: 42px;
  color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.tb-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tb-search input { flex: 1; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; outline: none; font: inherit; color: var(--text); min-width: 0; height: 100%; }
.tb-search kbd { font: 600 11px var(--font); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.theme-switch { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.theme-switch button {
  border: 0; background: none; color: var(--muted); width: 32px; height: 30px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
}
.theme-switch .ico { width: 17px; height: 17px; }
.theme-switch button.is-on { background: var(--brand-soft); color: var(--brand); }

/* Donja navigacija (telefon) */
.bottom-nav { display: none; }

/* ---------- Elementi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font: 700 14.5px var(--font); cursor: pointer;
  transition: transform .1s, background .15s, box-shadow .15s; white-space: nowrap; text-decoration: none !important;
  box-shadow: 0 1px 0 rgb(255 255 255 / .15) inset, 0 4px 14px color-mix(in srgb, var(--brand) 25%, transparent);
}
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-soft { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.btn-soft:hover { background: color-mix(in srgb, var(--brand-soft) 70%, var(--brand) 12%); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--err-soft); color: var(--err); box-shadow: none; }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { height: 50px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--brand); }
.icon-btn-sm { width: 30px; height: 30px; }
.icon-btn-sm .ico { width: 16px; height: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.link { font-weight: 600; font-size: 14px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); margin: 0 0 4px !important; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.back .ico { width: 18px; height: 18px; }

.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-rev { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.stack > .card:last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inline { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; }
.inline .ico { width: 16px; height: 16px; }

/* Avatar */
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); color: var(--brand);
  font-weight: 800; font-size: 13.5px; letter-spacing: .02em;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; border-radius: 18px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
  transition: transform .15s var(--ease), box-shadow .15s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.kpi-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.kpi-warn .kpi-ico { background: var(--warn-soft); color: var(--warn); }
.kpi-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Bedževi, čipovi */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap; vertical-align: middle;
}
.badge-soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge-mute { opacity: .75; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-weight: 600; font-size: 13.5px; transition: all .15s;
}
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--brand); }
.chip.is-on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Forme */
.form { display: flex; flex-direction: column; gap: 4px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 10px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 13.5px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-height: 44px;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type=file] { font: inherit; color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; flex: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 4px 0 14px; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.input-ico { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.input-ico:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input-ico input { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: none !important; }

.choice-list { display: grid; gap: 8px; margin-bottom: 14px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 2px; }
.choice span { display: flex; flex-direction: column; font-size: 14px; }
.choice small { font-size: 13px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar select { width: auto; min-width: 150px; }

/* Segmentirani izbor */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); transition: all .15s; }
.seg span .ico { width: 15px; height: 15px; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-soft); }
.note-form { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--border); }
.note-form textarea { margin-bottom: 10px; }
.note-form select { width: auto; flex: 1; max-width: 260px; }

/* Obaveštenja */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.alert-err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-info { background: var(--info-soft); }
.dupes { margin: 6px 0 8px; padding-left: 18px; }

.toast {
  position: fixed; z-index: 100; left: 50%; top: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px;
  max-width: calc(100vw - 32px); animation: toast-in .35s var(--ease);
}
.toast-ok .ico:first-child { color: var(--ok); }
.toast-err .ico:first-child { color: var(--err); }
.toast-x { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; display: grid; padding: 2px; }
.toast-x .ico { width: 16px; height: 16px; }
.toast.is-out { opacity: 0; transform: translate(-50%, -12px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -14px); } }

/* Tabela */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.table-compact td { padding: 9px 14px; }
.table tr.is-dim { opacity: .5; }
.t-right { text-align: right !important; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--err); font-weight: 700; }
.cust { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.cust:hover { text-decoration: none; }
.cust > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cust strong { font-weight: 700; }
.cust .badge { align-self: flex-start; margin-top: 3px; }
.tel { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-act { text-align: right; white-space: nowrap; width: 1%; }

.pager { display: flex; justify-content: center; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.pg { min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.pg:hover { border-color: var(--brand); text-decoration: none; }
.pg.is-cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pg.is-dis { opacity: .4; pointer-events: none; }
.pg .ico { width: 18px; height: 18px; }

/* Liste, vremenska linija */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; color: var(--text); }
a.list-row:hover { background: var(--surface-2); text-decoration: none; }
.list-main { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.list-main strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small { font-size: 12.5px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--border); }
.tl-dot { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tl-dot .ico { width: 17px; height: 17px; }
.tl-poziv .tl-dot { background: var(--ok-soft); color: var(--ok); }
.tl-viber .tl-dot, .tl-poruka .tl-dot { background: var(--brand-soft); color: var(--brand); }
.tl-email .tl-dot { background: var(--info-soft); color: var(--info); }
.tl-body { flex: 1; min-width: 0; padding-top: 6px; }
.tl-body p { margin: 4px 0; white-space: pre-line; word-wrap: break-word; }
.tl-title { font-weight: 700; color: var(--text); }
.tl-body small { font-size: 12.5px; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bars a { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; color: var(--text); font-size: 14px; }
.bars a:hover { background: var(--surface-2); text-decoration: none; }
.bars span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }

/* Profil kupca */
.profile { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.profile-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-id p { margin: 4px 0 0; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-mini { display: flex; align-items: center; gap: 16px; }
.dl { margin: 0; display: grid; gap: 0; }
.dl > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; word-break: break-word; }
.note-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.danger-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.howto { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }

/* Prazno stanje */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin: 6px 0; font-size: 18px; }
.empty .btn { margin-top: 12px; }
.empty-sm { padding: 18px 10px; font-size: 14px; }
.empty-ico { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-sm .empty-ico { width: 44px; height: 44px; border-radius: 14px; }
.empty-ico .ico { width: 24px; height: 24px; }

.sticky-actions { position: sticky; top: calc(var(--top-h) + 8px); z-index: 5; display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }

/* Prijava */
body.bare { min-height: 100vh; background:
  radial-gradient(900px 500px at 10% -10%, var(--brand-soft), transparent 60%),
  radial-gradient(700px 500px at 110% 110%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.auth-card-wide { max-width: 560px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card > p { margin-bottom: 22px; }
.auth-brand { margin-bottom: 20px; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; }
.auth-foot { margin-top: 18px; }

/* Logo za tamnu temu */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline; }
}

.only-mobile { display: none !important; }

/* ---------- Tablet / telefon ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols-rev { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / .4); animation: fade .2s; }
  .topbar { gap: 8px; padding: 0 12px; }
  .tb-search { height: 40px; }
  .theme-switch button { width: 28px; }
  .content { padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }

  .bottom-nav {
    display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); justify-content: space-around; align-items: center;
  }
  .bottom-nav > a, .bottom-nav > button, .bottom-nav > span {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
    font: 600 11px var(--font); color: var(--muted); background: none; border: 0; cursor: pointer;
  }
  .bottom-nav > a:hover { text-decoration: none; color: var(--brand); }
  .bottom-nav .is-soon { opacity: .4; }
  .bottom-nav .bn-plus { flex: none; width: 52px; height: 52px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); justify-content: center; margin-top: -22px; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 40%, transparent); }
  .bottom-nav .bn-plus .ico { width: 24px; height: 24px; }

  /* tabela → kartice */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { border: 0; padding: 2px 0; text-align: left !important; }
  .table-cards td[data-l] { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
  .table-cards td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 13px; font-weight: 600; }
  .table-cards td.td-main { margin-bottom: 8px; padding-right: 90px; }
  .table-cards td.td-act { position: absolute; top: 14px; right: 10px; width: auto; }
  .table-cards td[data-l="Izvor"], .table-cards td[data-l="Dug"]:has(.muted) { display: none; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .profile-actions .btn { flex: 1; }
  .dl > div { grid-template-columns: 110px 1fr; }
  .toolbar select { flex: 1 1 140px; min-width: 0; }
  .sticky-actions { top: calc(var(--top-h) + 4px); }
}

@media (max-width: 480px) {
  .kpi { padding: 14px; }
  .kpi-val { font-size: 26px; }
  .page-head .btn span { display: none; }
  .page-head .btn { width: 42px; padding: 0; }
  .theme-switch button[data-theme-set="system"] { display: none; }
  .auth-card { padding: 26px 20px; }
}

@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ==========================================================
   Etapa 2: magacin
   ========================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -6px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }

.chip b { margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); color: var(--text); font-size: 12px; }
.chip.is-on b { background: rgb(255 255 255 / .25); color: inherit; }
.chip-alert:not(.is-on) b { background: var(--warn-soft); color: var(--warn); }

.prod-ava { background: linear-gradient(135deg, var(--accent-soft), var(--brand-soft)); }
.prod-ava .ico { width: 17px; height: 17px; }
.avatar-lg.prod-ava .ico { width: 28px; height: 28px; }

.stock { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock small { font-weight: 600; font-size: 11px; opacity: .75; }
.stock-ok { background: var(--ok-soft); color: var(--ok); }
.stock-low { background: var(--warn-soft); color: var(--warn); }
.stock-out { background: var(--err-soft); color: var(--err); }
.kpi-val .stock { font-size: inherit; padding: 0 12px; }
.kpi small { font-size: 12.5px; }
.kpi-val-sm { font-size: 20px; }
.kpi-val-sm .badge { font-size: 16px; padding: 4px 12px; }

.card-pad { padding: 16px 20px; }
.card-flush > .card-head.card-pad { margin: 0; border-bottom: 1px solid var(--border); }
.split-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); }

/* mali iskačući prozor (popis, izlaz) */
.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-body {
  position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 280px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-lg);
  animation: fade .15s;
}
.pop-up .pop-body { left: 0; right: auto; top: auto; bottom: calc(100% + 6px); }
.pop-body .field { margin-bottom: 10px; }

/* promet */
.moves .list-row { align-items: flex-start; }
.mv { flex: none; min-width: 54px; text-align: center; padding: 3px 8px; border-radius: 10px; font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mv-in { background: var(--ok-soft); color: var(--ok); }
.mv-out { background: var(--err-soft); color: var(--err); }

/* stavke prijema / prenosa */
.lines { display: grid; gap: 10px; margin-bottom: 14px; }
.line { display: grid; grid-template-columns: minmax(200px, 2.4fr) 0.8fr 1fr 1fr 1fr 40px; gap: 10px; align-items: center; }
.lines-3 .line { grid-template-columns: minmax(200px, 2.4fr) 1.4fr 0.8fr 40px; }
.line-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lf > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.transfer-head { display: flex; align-items: flex-end; gap: 14px; }
.transfer-head .field { flex: 1; margin: 0; }
.transfer-arrow { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: none; }
.mag-row { padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.mag-row:last-of-type { border-bottom: 0; }
.grow { flex: 1; }

@media (max-width: 1100px) {
  .line, .lines-3 .line { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--border); border-radius: 14px; position: relative; }
  .line .lf-prod { grid-column: 1 / -1; padding-right: 40px; }
  .line [data-line-del] { position: absolute; top: 8px; right: 8px; }
  .line-head { display: none !important; }
}
@media (max-width: 900px) {
  .pop-body { position: fixed; left: 16px !important; right: 16px !important; top: auto !important; bottom: calc(90px + env(safe-area-inset-bottom)) !important; width: auto; }
  .transfer-head { flex-direction: column; align-items: stretch; }
  .transfer-arrow { transform: rotate(90deg); align-self: center; }
  .table-cards td[data-l="Cena"]:has(.muted) { display: none; }
}
.cols-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .cols-even { grid-template-columns: 1fr; } }

/* ==========================================================
   Etapa 3: porudžbine
   ========================================================== */
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 60%, var(--text)); border-color: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .badge { white-space: normal; }
.bars-row { display: grid; grid-template-columns: 70px 1fr 36px; align-items: center; gap: 10px; padding: 4px; font-size: 13.5px; }
.bars-row b { text-align: right; }

.items-cell div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.stack-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-kpis > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.mini-kpis strong { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* forma porudžbine */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% - 22px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.ac-list li { padding: 9px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; }
.ac-list li small { color: var(--muted); font-size: 12.5px; }
.ac-list li.is-cur, .ac-list li:hover { background: var(--brand-soft); }
.ac-info { min-height: 20px; margin-top: 6px; }
.lines-op .line { grid-template-columns: minmax(220px, 2.6fr) 0.7fr 0.9fr 0.7fr 0.9fr 40px; }
.op-iznos { text-align: right; font-weight: 700; padding-right: 6px; }
.op-warn { color: var(--warn); font-weight: 600; font-size: 12.5px; }
.op-total { display: flex; justify-content: flex-end; align-items: flex-end; gap: 20px; border-top: 1px dashed var(--border); margin-top: 14px; padding-top: 14px; flex-wrap: wrap; }
.op-popust { margin: 0; max-width: 160px; }
.op-sum { display: flex; flex-direction: column; align-items: flex-end; }
.op-sum strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.seg-lg span { padding: 10px 16px; font-size: 14px; }
.seg-lg { margin-bottom: 16px; }
.sticky-bottom { position: sticky; bottom: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); padding: 12px 0; flex-wrap: wrap; align-items: center; }

/* detalj */
.next-step { border: 2px solid var(--brand); background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.next-step .row-between { align-items: center; }
.next-info { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.next-info strong { font-size: 16px; }
.next-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.next-fields input { width: 180px; }
.totals { border-top: 1px solid var(--border); display: grid; gap: 4px; justify-content: end; }
.totals > div { display: flex; justify-content: space-between; gap: 40px; min-width: 260px; font-variant-numeric: tabular-nums; }
.totals .tot-main { font-size: 18px; font-weight: 800; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 2px; }
.pay-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.pay-form .row-between input { min-width: 0; }
.timeline-sm .tl-item { padding-bottom: 12px; }
.timeline-sm .tl-dot { width: 30px; height: 30px; border-radius: 10px; }
.timeline-sm .tl-item:not(:last-child)::before { left: 14px; top: 32px; }
.timeline-sm .tl-body { padding-top: 3px; }

@media (max-width: 1100px) {
  .lines-op .line { grid-template-columns: 1fr 1fr 1fr; }
  .lines-op .op-iznos { grid-column: 1 / -1; text-align: right; }
}
@media (max-width: 900px) {
  .items-cell div { max-width: 60vw; }
  .table-cards td.items-cell { display: block; }
  .table-cards td.items-cell::before { display: block; margin-bottom: 2px; }
  .next-step .btn-lg { width: 100%; }
  .next-fields, .next-fields input { width: 100%; }
  .totals { justify-content: stretch; }
  .totals > div { min-width: 0; }
  .sticky-bottom { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sticky-bottom .check { width: 100%; }
}
.kpi-hero { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: var(--brand-ink); border-color: transparent; }
.kpi-hero .kpi-ico { background: rgb(255 255 255 / .18); color: inherit; }
.kpi-hero .kpi-lbl, .kpi-hero .muted { color: inherit; opacity: .8; }
.kpi-val-md { font-size: 24px; }
.toolbar input[type=date] { width: auto; flex: 0 1 170px; }
@media (max-width: 900px) { .toolbar input[type=date] { flex: 1 1 140px; } }
.timeline-sm .tl-body small { display: block; }

/* ---------- Brend: široki logo ---------- */
.sb-brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px 22px; }
.sb-logo { width: auto; height: 46px; max-width: 200px; border-radius: 0; object-fit: contain; object-position: left center; }
.sb-brand-sub { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; padding-left: 2px; }
.tb-logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--border); }
.auth-logo { width: auto; height: 64px; border-radius: 0; }
.auth-brand { margin-bottom: 26px; }
img.logo-light, img.logo-dark { flex: none; }

/* ==========================================================
   Etapa 4: levak (upiti, forme)
   ========================================================== */
.sb-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.leads-alert { border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.leads-alert h2 { display: flex; align-items: center; gap: 10px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.funnel { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.fn-step { flex: 1; min-width: 110px; background: var(--surface-2); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; }
.fn-step strong { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fn-win { background: var(--brand); color: var(--brand-ink); }
.fn-arrow { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-weight: 800; }
.fn-arrow small { font-size: 13px; color: var(--text); }
.fn-table { border-top: 1px solid var(--border); }
.seg-sm { margin: 0; gap: 4px; }
.seg-a { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--muted); }
.seg-a:hover { text-decoration: none; color: var(--text); }
.seg-a.is-on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.form-card .card-head { align-items: flex-start; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px !important; }
.builder { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.builder summary { cursor: pointer; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; list-style: none; }
.builder summary::-webkit-details-marker { display: none; }
.builder[open] summary { margin-bottom: 12px; }
.builder .ico { width: 17px; height: 17px; color: var(--accent); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 16px; padding: 8px; border: 1px solid var(--border); }
.qr svg { width: 100%; height: 100%; display: block; }

.field-matrix { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.fm-row { display: grid; grid-template-columns: 1fr 90px 90px 100px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.fm-row:last-child { border-bottom: 0; }
.fm-row span:not(:first-child) { text-align: center; }
.fm-head { background: var(--surface-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.next-actions input[name=napomena] { margin-bottom: 12px; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .fm-row { grid-template-columns: 1fr 64px 64px 72px; padding: 9px 10px; }
  .fn-arrow { display: none; }
  .fn-table { display: none; }
}

/* ==========================================================
   Etapa 5: podsetnici, zvonce
   ========================================================== */
.bell { position: relative; }
.bell-btn { position: relative; }
.bell-n { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.bell-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: fade .15s; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.bell-list { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow: auto; }
.bell-list a { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 12px; color: var(--text); }
.bell-list a:hover { background: var(--surface-2); text-decoration: none; }
.bell-list li.is-new a { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.bell-list strong { font-size: 14px; }
.bell-list span { font-size: 13px; color: var(--muted); }
.bell-list small { font-size: 12px; color: var(--muted); }
.bell-empty { padding: 16px; text-align: center; }
.bell-foot { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.bell-foot p { margin: 6px 0 0; }
.dot-ok { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: 600 13px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

.progress-card .big { font-size: 22px; font-weight: 800; }
.bar-lg { height: 10px; margin-top: 10px; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 20px 0 10px; }
.group-title .ico { width: 18px; height: 18px; color: var(--accent); }
.tasks { display: grid; gap: 10px; margin-bottom: 14px; }
.task { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); position: relative; }
.task.prio-1::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.task.is-late { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
.task-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.task-ico.tl-poziv { background: var(--ok-soft); color: var(--ok); }
.task-ico.tl-naplata { background: var(--warn-soft); color: var(--warn); }
.task-ico.tl-upit { background: var(--accent-soft); color: var(--accent); }
.task-ico .ico { width: 19px; height: 19px; }
.task-body { flex: 1; min-width: 0; }
.task-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.task-top strong { font-size: 15.5px; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.task-desc { color: var(--muted); font-size: 14px; margin: 6px 0 10px; white-space: pre-line; }
.task-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.task-done { display: inline-block; margin-right: 10px; }
.task-done > summary { list-style: none; }
.task-done > summary::-webkit-details-marker { display: none; }
.task-done[open] { display: block; margin-right: 0; }
.task-done[open] > summary { display: none; }
.btn-ok { background: var(--ok); color: #fff; box-shadow: none; }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 85%, #000); }
.task-form { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; gap: 10px; margin-top: 6px; }
.task-form .seg { margin: 0; }
.inline-sel { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.inline-sel select { width: auto; min-height: 36px; padding: 4px 34px 4px 10px; }
.task-mini { display: inline-flex; gap: 12px; vertical-align: middle; }
.today-card h2 { display: flex; align-items: center; gap: 8px; }
.today-card h2 .ico { color: var(--accent); }
.today-card .tl-dot { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.today-card .tl-dot .ico { width: 16px; height: 16px; }
.mini-task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.quick-rem { display: grid; gap: 8px; margin-top: 10px; }
.quick-rem select { width: auto; flex: 1; }
.set-row { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 14px; }
@media (max-width: 900px) {
  .bell-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--top-h) + 6px); width: auto; }
  .task { padding: 14px; gap: 10px; }
  .task-ico { display: none; }
  .set-row { grid-template-columns: 1fr 90px; }
}

/* ==========================================================
   Etapa 6: seminari
   ========================================================== */
.sem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.sem-card { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); color: var(--text); transition: transform .15s var(--ease), box-shadow .15s; }
.sem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.sem-date { flex: none; width: 62px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; line-height: 1.1; }
.sem-date b { font-size: 26px; font-weight: 800; }
.sem-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sem-date small { font-size: 11px; opacity: .75; margin-top: 3px; }
.sem-date-lg { width: 72px; height: 72px; }
.sem-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sem-body .row-between { flex-wrap: nowrap; align-items: flex-start; }
.sem-fill { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 14px; flex-wrap: wrap; }
.inline-form { margin: 0; }
.inline-form select { min-height: 34px; padding: 4px 32px 4px 10px; font-size: 13.5px; width: auto; max-width: 180px; }
.att { display: inline-flex; gap: 4px; margin: 0; }
.att-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.att-btn .ico { width: 16px; height: 16px; }
.att-btn.is-yes { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-btn.is-no { background: var(--err-soft); border-color: transparent; color: var(--err); }
.pop-sum { cursor: pointer; }
.totals-wide { justify-content: stretch; border-top: 0; padding: 0 0 10px; }
.totals-wide > div { min-width: 0; }
.lines-pak .line { grid-template-columns: minmax(160px, 1.4fr) 0.6fr 1.6fr 40px; }
@media (max-width: 1100px) { .lines-pak .line { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .sem-grid { grid-template-columns: 1fr; } .table.prijave td[data-l] { align-items: center; } }

/* ==========================================================
   Etapa 7: statistika i grafikoni
   ========================================================== */
.graf-wrap { width: 100%; }
.graf { width: 100%; height: auto; display: block; overflow: visible; }
.g-grid { stroke: var(--border); stroke-width: 1; }
.g-base { stroke: color-mix(in srgb, var(--muted) 50%, transparent); stroke-width: 1; }
.g-ax { fill: var(--muted); font: 600 11px var(--font); }
.g-bar { fill: var(--brand); transition: opacity .15s; }
.g-bar2 { fill: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.g-bar:hover, .g-bar2:hover { opacity: .75; }
.g-legend { display: flex; gap: 16px; justify-content: flex-end; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.g-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.g-l1 { background: var(--brand); }
.g-l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hbars a, .hbars li > div { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) auto; gap: 12px; align-items: center; padding: 7px 6px; border-radius: 10px; color: var(--text); font-size: 14px; }
.hbars a:hover { background: var(--surface-2); text-decoration: none; }
.hb-name { display: flex; flex-direction: column; min-width: 0; }
.hb-name, .hb-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-name small { color: var(--muted); font-size: 12px; }
.hb-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.hbars b { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.hbars b small { color: var(--muted); font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); flex: none; }
.donut-leg { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: grid; gap: 6px; }
.donut-leg li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; }
.donut-leg i { width: 12px; height: 12px; border-radius: 4px; }
.donut-leg b { font-variant-numeric: tabular-nums; }
.donut-leg small { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }

.delta { font-weight: 800; font-size: 12.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); margin-right: 4px; white-space: nowrap; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--err); background: var(--err-soft); }
.kpi-hero .delta { background: rgb(255 255 255 / .16); color: inherit; }
.share-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.share-cell .bar { flex: 1; }
.kpis-info { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .hbars a, .hbars li > div { grid-template-columns: minmax(0, 1fr) auto; } .hb-bar { grid-column: 1 / -1; order: 3; } .donut { width: 120px; height: 120px; } .g-ax { font-size: 15px; } }
.graf-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 900px) { .graf { min-width: 620px; } .g-ax { font-size: 11px; } }

/* ---- Aplikacija i obaveštenja ---- */
.sb-app { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sb-app svg { width: 18px; height: 18px; }
.sb-app:hover, .sb-app.is-active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 13px; margin-right: 6px; vertical-align: 2px; }
.dev-status { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.dev-status li { display: flex; align-items: center; gap: 10px; }
.dev-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: none; }
.dev-status li.is-ok .dot { background: var(--ok); }
.dev-status li.is-no .dot { background: var(--warn); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.howto-steps ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.check-row { align-items: flex-start; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--border); }
.check-row:last-of-type { border-bottom: 0; }
.check-row input { margin-top: 3px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); }
.card-link { color: inherit; }
.card-link:hover { text-decoration: none; border-color: var(--brand); }
.app-traka { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; margin: 0 0 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.app-traka span { flex: 1; }
.app-traka .icon-btn { font-size: 20px; line-height: 1; }
@media (display-mode: standalone) { .only-browser { display: none !important; } }
button.tab { background: none; border: 0; border-bottom: 2px solid transparent; font-family: inherit; cursor: pointer; border-radius: 0; }
button.tab.is-on { border-bottom-color: var(--brand); color: var(--brand); }
.card-flush > .card-head { padding: 16px 16px 4px; }

/* ---- Pomoć ---- */
.hlp-hero { text-align: center; padding: 8px 0 18px; }
.hlp-hero h1 { margin: 0 0 6px; }
.hlp-search { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 16px auto 14px; padding: 0 16px; height: 54px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow, none); }
.hlp-search:focus-within { border-color: var(--brand); }
.hlp-search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.hlp-search input { flex: 1; border: 0; background: none; outline: none; font: 500 17px var(--font); color: var(--text); min-width: 0; height: 100%; padding: 0; box-shadow: none; }
.hlp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; color: var(--text); }
.chip svg { width: 16px; height: 16px; }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.hlp-group { margin: 22px 0; scroll-margin-top: 80px; }
.hlp-h { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 10px; }
.hlp-h svg { width: 20px; height: 20px; color: var(--accent); }
.hlp { border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.hlp:last-child { border-bottom: 0; }
.hlp summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; font-weight: 700; font-size: 15px; cursor: pointer; }
.hlp summary::-webkit-details-marker { display: none; }
.hlp summary svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .2s; }
.hlp[open] summary svg { transform: rotate(90deg); }
.hlp summary:hover { background: var(--surface-2); }
.hlp-body { padding: 0 18px 16px; }
.hlp-body ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 9px; font-size: 15px; line-height: 1.55; }
.hlp-tip { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.kbtn { display: inline-block; padding: 0 8px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .9em; line-height: 1.6; white-space: nowrap; }
.sb-app + .sb-app2 { margin-top: 0; }
.hlp-search input[type=search], .hlp-search input[type=search]:focus { border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; padding: 0; height: 100%; }
.kpis-sm { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 720px) { .kpis-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.demo-hint { margin-top: 14px; padding: 14px 18px; text-align: center; }
.auth-logo { max-width: 100%; object-fit: contain; }
