/* ============================================================ DIZAJN SISTEM
   Tokeni → komponente → layout → stranice. Tamna tema je podrazumijevana. */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f16;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(124,108,242,.10), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(57,135,229,.08), transparent 60%);
  --surface: #131824;
  --surface-2: #192031;
  --surface-3: #212a3d;
  --border: #252e42;
  --border-strong: #34405a;
  --text: #e9ebf2;
  --text-2: #b4bccd;
  --muted: #8790a5;
  --accent: #7c6cf2;
  --accent-2: #3987e5;
  --accent-soft: rgba(124,108,242,.16);
  --accent-grad: linear-gradient(135deg, #7c6cf2, #3987e5);
  --good: #2fb36b; --good-soft: rgba(47,179,107,.15);
  --warn: #e3a417; --warn-soft: rgba(227,164,23,.15);
  --bad: #e5534b; --bad-soft: rgba(229,83,75,.15);
  --info: #3987e5; --info-soft: rgba(57,135,229,.15);
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --ring: 0 0 0 3px rgba(124,108,242,.35);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f9;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(124,108,242,.08), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceef5;
  --border: #e2e5ee;
  --border-strong: #cdd2df;
  --text: #151a26;
  --text-2: #3d4558;
  --muted: #6b7386;
  --accent: #6250d6;
  --accent-2: #2a78d6;
  --accent-soft: rgba(98,80,214,.10);
  --accent-grad: linear-gradient(135deg, #6250d6, #2a78d6);
  --good: #12823f; --good-soft: rgba(18,130,63,.10);
  --warn: #a36a00; --warn-soft: rgba(227,164,23,.16);
  --bad: #c42e2e; --bad-soft: rgba(196,46,46,.10);
  --info: #2a78d6; --info-soft: rgba(42,120,214,.10);
  --shadow: 0 8px 30px rgba(20,26,38,.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
}

* { box-sizing: border-box; }
svg.ico { width: 18px; height: 18px; flex: none; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  color: var(--text); font: 14px/1.5 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; font-weight: 700; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; font-size: 15px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active .ico { color: var(--accent); }
.nav .ico { width: 18px; height: 18px; flex: none; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: calc(60px + var(--sat)); padding-top: var(--sat) !important; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { padding-left: 34px; }
.topbar .search .ico { position: absolute; left: 10px; top: 9px; width: 16px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar-biz { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.content { padding: 24px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.demo-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 12px; font-weight: 600; padding: 5px; letter-spacing: .02em; }
.verify-banner { background: var(--info-soft); color: var(--text-2); font-size: 13px; padding: 8px 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.verify-banner .ico { width: 16px; height: 16px; color: var(--info); }
.mobile-only { display: none !important; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; }

/* ------------------------------------------------------------ kartice */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 18px 0; }

.kpi { cursor: default; position: relative; transition: border-color .15s; }
.kpi.link { cursor: pointer; }
.kpi.link:hover { border-color: var(--border-strong); }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.kpi .value { font-size: 24px; font-weight: 650; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .foot { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.kpi-sm .value { font-size: 20px; }

/* ------------------------------------------------------------ dugmad i forme */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn .ico { width: 16px; height: 16px; }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.btn-group .btn { border: 0; border-radius: 0; background: transparent; height: 34px; }
.btn-group .btn.on { background: var(--accent-soft); color: var(--text); }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); min-width: 0; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 14px;
}
textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
input[type=color] { padding: 2px; width: 44px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-error { color: var(--bad); font-size: 12px; font-weight: 500; }
.invalid { border-color: var(--bad) !important; }
.input-group { display: flex; gap: 8px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 0; }
legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ------------------------------------------------------------ tabele */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl th.r, .tbl td.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--border-strong); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* ------------------------------------------------------------ bedževi, statusi */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 650; font-size: 12px; color: var(--text-2); flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }

/* ------------------------------------------------------------ tabovi */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 550; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ modal, drawer, toast */
.overlay { position: fixed; inset: 0; background: rgba(5,7,12,.6); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px - var(--sat) - var(--sab));
  display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .14s; }
.modal.wide { width: min(920px, 100%); }
.modal.narrow { width: min(440px, 100%); }
.modal-head { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--surface-3); border: 1px solid var(--border-strong); border-left: 3px solid var(--good); border-radius: 10px; padding: 11px 14px;
  box-shadow: var(--shadow); font-size: 13.5px; animation: pop .15s; }
.toast.error { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--info); }
.dropdown { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow);
  min-width: 220px; padding: 6px; }
.dropdown .item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.dropdown .item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown .sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown .head { padding: 6px 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ico { width: 34px; height: 34px; color: var(--border-strong); margin-bottom: 8px; }
.empty h3 { color: var(--text-2); margin-bottom: 4px; }
.loading { display: grid; place-items: center; padding: 50px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; border: 1px solid var(--border); }
.alert.warning { background: var(--warn-soft); border-color: transparent; }
.alert.critical { background: var(--bad-soft); border-color: transparent; }
.alert.info { background: var(--info-soft); border-color: transparent; }
.alert .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.alert.warning .ico { color: var(--warn); } .alert.critical .ico { color: var(--bad); } .alert.info .ico { color: var(--info); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { border-left: 2px solid var(--border); padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
.timeline .ev { position: relative; font-size: 13px; }
.timeline .ev::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--accent); }

/* ------------------------------------------------------------ grafikoni */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg.donut { width: 150px; height: 150px; flex: none; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px;
  font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); }
.chart .tip .t { color: var(--muted); margin-bottom: 3px; }
.chart .tip .r { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

/* ------------------------------------------------------------ kalendar */
.cal-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar select, .page-actions select, .toolbar select { width: auto; max-width: 220px; }
.cal-toolbar .title { font-size: 16px; font-weight: 620; min-width: 190px; }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 210px); }
.cal-grid { display: grid; position: relative; min-width: 100%; }
.cal-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); display: grid; }
.cal-head .col-h { padding: 10px 8px; font-size: 12.5px; font-weight: 600; text-align: center; border-left: 1px solid var(--border); display: flex; flex-direction: column;
  align-items: center; gap: 2px; min-width: 0; }
.cal-head .col-h .muted { font-weight: 500; font-size: 11.5px; }
.cal-head .col-h.today { color: var(--accent); }
.cal-body { display: grid; position: relative; }
.cal-times { position: relative; border-right: 1px solid var(--border); }
.cal-times .t { position: absolute; right: 8px; font-size: 11px; color: var(--muted); transform: translateY(-50%); }
.cal-col { position: relative; border-left: 1px solid var(--border); }
.cal-col .slot { position: absolute; left: 0; right: 0; border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); cursor: pointer; }
.cal-col .slot.hour { border-top-color: var(--border); }
.cal-col .slot:hover { background: var(--accent-soft); }
.cal-col .closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--surface-3) 60%, transparent) 6px 7px);
  pointer-events: none; }
.cal-col.drop-target { background: var(--accent-soft); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.appt {
  position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; z-index: 2;
  background: color-mix(in srgb, var(--c, var(--accent)) 22%, var(--surface)); border-left: 3px solid var(--c, var(--accent)); color: var(--text);
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.appt:hover { z-index: 3; box-shadow: var(--shadow); }
.appt .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .s { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.st-pending { border-left-style: dashed; }
.appt.st-completed { opacity: .78; }
.appt.inactive { opacity: .45; text-decoration: line-through; background: var(--surface-2); }
.appt.dragging { opacity: .5; }
.appt .prep { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, transparent 0 4px, color-mix(in srgb, var(--c) 18%, transparent) 4px 6px); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-grid .dow { padding: 8px; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); text-align: center; }
.month-grid .day { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; cursor: pointer; min-width: 0; }
.month-grid .day:nth-child(7n) { border-right: 0; }
.month-grid .day.other { background: color-mix(in srgb, var(--surface-2) 50%, transparent); color: var(--muted); }
.month-grid .day.today .dn { background: var(--accent); color: #fff; border-radius: 6px; padding: 0 6px; }
.month-grid .dn { font-size: 12px; font-weight: 600; display: inline-block; margin-bottom: 4px; }
.month-grid .chip { font-size: 11px; padding: 1px 6px; border-radius: 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 2px solid var(--c); }
.month-grid .more { font-size: 11px; color: var(--muted); }

.conflict-box { background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.conflict-box ul { margin: 4px 0 0; padding-left: 18px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slot-chips button { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 12.5px; }
.slot-chips button:hover, .slot-chips button.on { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------------ autentifikacija i onboarding */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--sat)) 24px calc(24px + var(--sab)); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; padding-bottom: 6px; }
.auth-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.wizard { width: min(880px, 100%); margin: 30px auto; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps .st { flex: 1; min-width: 90px; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--border); }
.steps .st.on { color: var(--text); border-top-color: var(--accent); }
.steps .st.done { border-top-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.hours-row { display: grid; grid-template-columns: 130px 70px repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.hours-row input[type=time] { padding: 0 6px; }
.hours-row .hr-times { display: contents; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; position: relative; }
.photo img { width: 100%; height: 130px; object-fit: cover; display: block; }
.photo .cap { padding: 6px 8px; font-size: 11.5px; }
.photo.sel { outline: 2px solid var(--accent); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare img { width: 100%; border-radius: 10px; max-height: 70vh; object-fit: contain; background: #000; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }

/* ------------------------------------------------------------ responsive */
.bottom-nav { display: none; }
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { padding-top: calc(16px + var(--sat)); padding-bottom: calc(16px + var(--sab)); height: 100%; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 90; transform: translateX(-100%); transition: transform .2s; background: var(--surface); }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .topbar { padding-left: calc(12px + var(--sal)); padding-right: calc(12px + var(--sar)); gap: 8px; }
  .topbar .btn.ghost.icon { width: 40px; height: 40px; }
  .topbar .search { display: none; }
  .topbar-biz { max-width: 50vw; }
  .content { padding: 16px calc(16px + var(--sar)) calc(84px + var(--sab)) calc(16px + var(--sal)); }
  .g2, .g3, .span2 { grid-template-columns: 1fr; grid-column: auto; }
  .form-grid, .form-grid.g3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--border); padding: 6px var(--sar) max(6px, calc(var(--sab) - 14px)) var(--sal); }
  .bottom-nav a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px;
    font-size: 11px; color: var(--muted); padding: 4px 2px; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav .ico { width: 20px; height: 20px; }
  .dash-split, .inv-grid { grid-template-columns: 1fr !important; }
  .hours-row { grid-template-columns: 1fr 60px; }
  .hours-row .hr-times { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .modal { max-height: calc(100vh - 20px); max-height: calc(100dvh - 16px - var(--sat)); border-radius: 16px 16px 0 0; width: 100%; }
  .overlay { padding: calc(8px + var(--sat)) 0 0; align-items: end; }
  .modal-foot { padding-bottom: calc(12px + var(--sab)); }
  .toasts { left: 16px; right: 16px; bottom: calc(76px + var(--sab)); max-width: none; }
  /* iPhone zumira ekran kada je tekst u polju manji od 16px — zato 16px na telefonu */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 20px; }
  .page-head .sub { display: none; }
  .cal-toolbar { gap: 6px; }
  .cal-toolbar select { flex: 1 1 140px; max-width: none; }
  .cal-scroll { max-height: calc(100dvh - 300px - var(--sab)); min-height: 360px; }
  .tabs button { padding: 10px 12px; }
  .kv { grid-template-columns: 110px 1fr; }
  .card { padding: 14px; border-radius: 12px; }
  .kpi .value { font-size: 20px; margin-top: 4px; }
  .kpi .label { font-size: 12px; }
  .kpi .foot { font-size: 11px; margin-top: 4px; }
  .grid { gap: 10px; }
  .dropdown { max-width: calc(100vw - 16px); }
  .month-grid .day { min-height: 70px; }
  .month-grid .chip { display: none; }
  .month-grid .day .count { display: block; }
}
@media (min-width: 901px) { .month-grid .day .count { display: none; } }
@media (max-width: 520px) {
  .g4, .g-auto { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 19px; }
  .card { padding: 14px; }
  .page-head h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media print { .sidebar, .topbar, .bottom-nav, .toolbar .btn, .tabs, .demo-banner { display: none !important; } .app { display: block; } .card { break-inside: avoid; } }

/* Instalirana aplikacija (PWA): bez „gumenog“ povlačenja i označavanja teksta pri dugom pritisku na dugmad */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  .btn, .nav a, .bottom-nav a, .tabs button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
