/* =========================================================
   Menssana – dizajn sistem
   ========================================================= */
/* font je na našem serveru – pregledač ne javlja Google-u ko i kada otvara aplikaciju */
@font-face { font-family: 'Montserrat'; src: url('/fonts/montserrat.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --surface-3: #f0eef8;
  --border: #e8e5f2;
  --border-strong: #d9d4ea;
  --text: #1c1830;
  --text-2: #4a4562;
  --muted: #8a86a0;
  --primary: #00897f;
  --primary-2: #00a39a;
  --primary-ink: #ffffff;
  --primary-soft: #e2f4f2;
  --primary-soft-2: #c8ebe7;
  --accent: #cc3366;
  --accent-soft: #fbe6ee;
  --success: #0f9d76;
  --success-soft: #e2f6ef;
  --warning: #c27a06;
  --warning-soft: #fdf2dc;
  --danger: #dc3c4a;
  --danger-soft: #fde7e9;
  --info: #2f74e0;
  --info-soft: #e5efff;
  --shadow-sm: 0 1px 2px rgba(28, 24, 48, .05);
  --shadow: 0 1px 2px rgba(28, 24, 48, .04), 0 6px 20px -6px rgba(28, 24, 48, .10);
  --shadow-lg: 0 24px 60px -12px rgba(28, 24, 48, .28);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --sidebar: 248px;
  --hatch: repeating-linear-gradient(135deg, rgba(120, 112, 150, .10) 0 6px, rgba(120, 112, 150, .03) 6px 12px);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f0d17;
  --surface: #17141f;
  --surface-2: #1c1926;
  --surface-3: #24202f;
  --border: #2a2638;
  --border-strong: #383249;
  --text: #f1eff8;
  --text-2: #c6c1d8;
  --muted: #8d88a3;
  --primary: #2bbfb3;
  --primary-2: #4fd3c8;
  --primary-soft: #0f2d2b;
  --primary-soft-2: #164240;
  --accent: #e0618c;
  --accent-soft: #3a1c2a;
  --success: #34c99b;
  --success-soft: #11291f;
  --warning: #f0b44a;
  --warning-soft: #2e2412;
  --danger: #f06470;
  --danger-soft: #34181c;
  --info: #6aa3ff;
  --info-soft: #152238;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --hatch: repeating-linear-gradient(135deg, rgba(160, 150, 200, .10) 0 6px, rgba(160, 150, 200, .03) 6px 12px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px -4px rgba(0, 137, 127, .5);
}
.brand-mark svg { width: 20px; height: 20px; fill: rgba(255,255,255,.95); stroke: none; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; margin: 2px 0;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a.active svg { stroke: var(--primary); }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; width: 100%; background: none; border: 0; text-align: left; }
.user-chip:hover { background: var(--surface-3); }
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .role { font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 21px; font-weight: 800; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.content { padding: 4px 28px 40px; flex: 1; min-width: 0; }
.icon-btn.menu-btn { display: none; }

/* ---------- Avatars ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff;
  background: var(--primary);
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 14px -4px rgba(0, 137, 127, .55); }
.btn.primary:hover { background: var(--primary-2); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.soft:hover { background: var(--primary-soft-2); }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-xs); }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn svg.i { width: 16px; height: 16px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 650; font-size: 13px; cursor: pointer; color: var(--text-2);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 750; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.kpi .label .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi .label .ico svg { width: 16px; height: 16px; }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12.5px; color: var(--muted); }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); min-width: 260px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.search svg { color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-s { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.input, .field input:not([type=checkbox]):not([type=color]), .field select, .field textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.field input:disabled, .field select:disabled { background: var(--surface-3); color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); }
.readonly { height: 40px; display: flex; align-items: center; padding: 0 12px; background: var(--surface-3); border-radius: var(--radius-sm); font-weight: 650; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
input[type=color] { width: 44px; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 3px; background: var(--surface); cursor: pointer; }
select.input { padding-right: 30px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .strong { font-weight: 700; }
.table .sub { font-size: 12.5px; color: var(--muted); }
.cell-person { display: flex; align-items: center; gap: 10px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; stroke-width: 1.5; margin-bottom: 8px; opacity: .6; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.scheduled { background: var(--info-soft); color: var(--info); }
.badge.arrived { background: var(--warning-soft); color: var(--warning); }
.badge.in_progress { background: var(--primary-soft); color: var(--primary); }
.badge.completed, .badge.paid, .badge.success { background: var(--success-soft); color: var(--success); }
.badge.cancelled, .badge.void { background: var(--surface-3); color: var(--muted); }
.badge.no_show, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; background: rgba(20, 16, 36, .42); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s; overflow-y: auto;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.985); transition: transform .2s; display: flex; flex-direction: column; max-height: none;
}
.modal-backdrop.open .modal { transform: none; }
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 920px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head h3 { font-size: 18px; font-weight: 800; flex: 1; }
.modal-body { padding: 14px 22px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-width: 260px; max-width: 420px;
  background: var(--text); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600;
  animation: toast-in .25s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success svg { color: #4ade80; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(800px 500px at 90% 90%, rgba(229,72,125,.55), transparent 60%),
    linear-gradient(140deg, #00665f 0%, #00897f 45%, #cc3366 100%);
}
.login-art .orb { position: absolute; border-radius: 50%; filter: blur(2px); background: rgba(255,255,255,.12); }
.login-art h2 { font-size: 40px; font-weight: 800; line-height: 1.1; max-width: 460px; letter-spacing: -.03em; }
.login-art p { opacity: .85; max-width: 420px; font-size: 15px; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 28px; font-weight: 800; margin: 18px 0 4px; }
.login-box .stack { gap: 14px; margin-top: 26px; }
.login-err { color: var(--danger); font-weight: 600; min-height: 20px; font-size: 13px; }
.demo-hint { margin-top: 22px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-3); font-size: 12.5px; color: var(--text-2); }

/* ---------- Dashboard ---------- */
.hello { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.hello h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.rooms-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.room-card {
  position: relative; padding: 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.room-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc, var(--primary)); }
.room-card .rc-top { display: flex; align-items: center; gap: 8px; }
.room-card .rc-name { font-weight: 750; flex: 1; }
.room-card .rc-type { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.room-card .rc-state { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.room-card.free .rc-state { color: var(--success); }
.room-card.busy .rc-state { color: var(--accent); }
.room-card.busy { background: linear-gradient(0deg, var(--surface), var(--surface)), var(--hatch); }
.room-card .rc-meta { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(15,157,118,.6); animation: pulse 2s infinite; }
.busy .pulse { background: var(--accent); box-shadow: 0 0 0 0 rgba(229,72,125,.6); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

.agenda { display: flex; flex-direction: column; }
.agenda-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); cursor: pointer; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: var(--surface-2); }
.agenda-time { width: 92px; flex: none; font-weight: 750; font-variant-numeric: tabular-nums; }
.agenda-time small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.agenda-main { flex: 1; min-width: 0; }
.agenda-main .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-main .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-item.done { opacity: .6; }

/* ---------- Planer ---------- */
.planner-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.date-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px; }
.date-nav .icon-btn { width: 32px; height: 32px; }
.date-title { font-weight: 800; font-size: 17px; min-width: 230px; letter-spacing: -.01em; }
.date-title small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.date-input { position: relative; }
.date-input input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.planner-card { overflow: hidden; }
.pg-scroll { overflow: auto; max-height: calc(100vh - 210px); position: relative; }
.pg { --ppm: 1.6px; display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(170px, 1fr)); min-width: max-content; }
.pg-head { display: contents; }
.pg-corner, .pg-room {
  position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border);
  height: 56px;
}
.pg-corner { left: 0; z-index: 6; }
.pg-room { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-left: 1px solid var(--border); }
.pg-room .nm { font-weight: 750; font-size: 13.5px; line-height: 1.2; }
.pg-room .tp { font-size: 11px; color: var(--muted); font-weight: 650; }
.pg-room .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.pg-room .ico svg { width: 15px; height: 15px; }
.pg-times { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.pg-time { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.pg-col {
  position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image:
    linear-gradient(to bottom, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 100% calc(60 * var(--ppm)), 100% calc(30 * var(--ppm));
}
.pg-col.locked { cursor: default; }
.pg-past { position: absolute; left: 0; right: 0; top: 0; background: var(--hatch); opacity: .55; pointer-events: none; }
.pg-ghost {
  position: absolute; left: 4px; right: 4px; border-radius: 8px; pointer-events: none;
  border: 1.5px dashed var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary); font-size: 12px; font-weight: 750; padding: 3px 8px; display: none; z-index: 2;
}
.pg-col:hover .pg-ghost.show { display: block; }
.pg-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 3; pointer-events: none; }
.pg-now-label { position: absolute; right: 6px; transform: translateY(-50%); z-index: 4; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; pointer-events: none; }

.appt {
  position: absolute; left: 4px; right: 4px; z-index: 2; border-radius: 9px; padding: 5px 9px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-left: 4px solid var(--c); cursor: pointer; font-size: 12px; line-height: 1.3;
  transition: box-shadow .15s, transform .1s;
}
.appt:hover { box-shadow: var(--shadow); z-index: 3; transform: translateY(-1px); }
.appt .a-t { font-weight: 800; font-size: 11.5px; color: color-mix(in srgb, var(--c) 70%, var(--text)); font-variant-numeric: tabular-nums; }
.appt .a-n { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .a-s { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .a-st { position: absolute; top: 5px; right: 6px; }
.appt.completed { opacity: .62; }
.appt.in_progress { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); }
.appt.arrived { border-style: solid; }
.appt.masked {
  --c: #8a86a0; background: var(--hatch), var(--surface-2); border-color: var(--border-strong); border-left-color: var(--muted);
  cursor: not-allowed; color: var(--muted);
}
.appt.masked:hover { transform: none; box-shadow: none; }
.appt.short .a-s { display: none; }
.appt.tiny { padding: 2px 8px; }
.appt.tiny .a-n { display: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 10px; border-radius: 3px; }

/* ---------- Booking modal ---------- */
.client-picker { position: relative; }
.cp-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto;
}
.cp-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.cp-item:hover, .cp-item.hl { background: var(--primary-soft); }
.cp-item .t { font-weight: 700; }
.cp-item .s { font-size: 12px; color: var(--muted); }
.cp-selected { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); }
.cp-selected .t { font-weight: 750; }
.cp-selected .s { font-size: 12.5px; color: var(--text-2); }
.cp-new { margin-top: 10px; padding: 14px; border: 1px dashed var(--primary); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 700; cursor: pointer; padding: 6px 0; display: inline-flex; gap: 6px; align-items: center; }
.availability { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 650; font-size: 13px; }
.availability.ok { background: var(--success-soft); color: var(--success); }
.availability.err { background: var(--danger-soft); color: var(--danger); }
.availability.wait { background: var(--surface-3); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 4px 11px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.detail-head { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; font-weight: 650; }
.timeline-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 18px; }

/* ---------- Checkout ---------- */
.items-table td, .items-table th { padding: 8px 6px; }
.items-table input, .items-table select { height: 36px; }
.sum-box { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.sum-row { display: flex; justify-content: space-between; font-weight: 650; }
.sum-row.total { font-size: 22px; font-weight: 800; padding-top: 10px; border-top: 1px dashed var(--border-strong); letter-spacing: -.02em; }
.sum-row.disc { color: var(--accent); }

/* ---------- Invoice ---------- */
.invoice { background: #fff; color: #1c1830; padding: 36px 40px; border-radius: 12px; border: 1px solid var(--border); font-size: 13px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid #1c1830; }
.inv-brand { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: #00897f; }
.inv-title { font-size: 20px; font-weight: 800; text-align: right; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.inv-parties h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a86a0; margin-bottom: 6px; }
.invoice table { width: 100%; border-collapse: collapse; }
.invoice th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8a86a0; border-bottom: 1px solid #e8e5f2; padding: 8px 6px; }
.invoice td { padding: 10px 6px; border-bottom: 1px solid #f0eef8; }
.inv-sum { margin-left: auto; width: 300px; margin-top: 16px; }
.inv-sum div { display: flex; justify-content: space-between; padding: 5px 0; }
.inv-sum .grand { font-size: 18px; font-weight: 800; border-top: 2px solid #1c1830; margin-top: 6px; padding-top: 10px; }
.inv-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid #e8e5f2; color: #8a86a0; font-size: 12px; display: flex; justify-content: space-between; }
.void-stamp { display: inline-block; border: 3px solid #dc3c4a; color: #dc3c4a; font-weight: 900; padding: 4px 14px; transform: rotate(-6deg); font-size: 18px; letter-spacing: .1em; border-radius: 6px; }

/* ---------- Finance ---------- */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .bl-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 5px; }
.bar-item .bl-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-item .bl-val { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap .bar { fill: var(--primary); }
.chart-wrap .bar:hover { fill: var(--primary-2); }
.chart-wrap .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-wrap .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 7px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 650; white-space: nowrap; transform: translate(-50%, -110%); display: none; z-index: 5;
}
.doc-row td { vertical-align: top; }
.doc-services { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--surface-3); color: var(--text-2); }
.rank.r1 { background: #fff1c7; color: #a06a00; }
.rank.r2 { background: #eceef3; color: #5b6170; }
.rank.r3 { background: #fbe3d3; color: #a2501c; }
:root[data-theme="dark"] .rank.r1 { background: #3a2e0e; color: #f0c45a; }
:root[data-theme="dark"] .rank.r2 { background: #2b2d34; color: #c7cbd6; }
:root[data-theme="dark"] .rank.r3 { background: #3a2417; color: #f0a070; }

/* ---------- Entity cards ---------- */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.entity { padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.entity:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.entity.inactive { opacity: .55; }
.entity .e-top { display: flex; gap: 12px; align-items: center; }
.entity .e-name { font-weight: 750; font-size: 15px; }
.entity .e-sub { font-size: 12.5px; color: var(--muted); }
.entity .e-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.entity .e-meta span { display: flex; align-items: center; gap: 7px; }
.entity .e-meta svg { width: 14px; height: 14px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }

/* ---------- Print ---------- */
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .invoice { border: 0; padding: 0; }
  @page { margin: 16mm; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- Sidebar: uvlačenje (PC/tablet) i izvlačenje (mobilni) ---------- */
.sidebar { transition: width .22s ease, transform .25s ease; }
/* dugme za uvlačenje: jezičak koji izlazi iz ivice menija, iste boje i ivice kao meni */
.sb-toggle {
  position: absolute; top: 36px; right: -17px; z-index: 45;
  width: 17px; height: 34px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-left: 0; border-radius: 0 9px 9px 0;
  transition: color .15s, width .15s, right .15s;
}
.sb-toggle:hover { color: var(--primary); width: 20px; right: -20px; }
.sb-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sb-toggle svg.i { width: 13px; height: 13px; stroke-width: 2.4; transition: transform .22s; }
.sb-close, .sb-backdrop { display: none; }
.brand-text { min-width: 0; }

@media (min-width: 768px) {
  .app.collapsed { --sidebar: 76px; }
  .app.collapsed .sb-toggle svg.i { transform: rotate(180deg); }
  .app.collapsed .brand { justify-content: center; padding: 22px 0 18px; }
  .app.collapsed .brand-text,
  .app.collapsed .nav a span,
  .app.collapsed .user-chip .meta,
  .app.collapsed .user-chip > svg.i { display: none; }
  .app.collapsed .nav { padding: 6px 10px; overflow-x: hidden; }
  .app.collapsed .nav a { justify-content: center; padding: 11px 0; }
  .app.collapsed .nav-group { padding: 0; margin: 12px 8px; height: 1px; background: var(--border); }
  .app.collapsed .nav-group span { display: none; }
  .app.collapsed .sidebar-foot { padding: 14px 10px; }
  .app.collapsed .user-chip { justify-content: center; padding: 8px 0; }
}

@media (max-width: 767px) {
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); box-shadow: var(--shadow-lg); z-index: 60; }
  .app.nav-open .sidebar { transform: none; }
  .sb-toggle { display: none; }
  .sb-close { display: inline-grid; margin-left: auto; background: var(--surface-3); }
  .app.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(20, 16, 36, .45); backdrop-filter: blur(2px); }
  .icon-btn.menu-btn { display: inline-grid; }
}

@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .date-title { min-width: 0; }
}
@media (max-width: 640px) {
  .content { padding: 4px 16px 32px; }
  .topbar { padding: 0 16px; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .search { min-width: 0; flex: 1; }
  .kpi .value { font-size: 21px; }
  .inv-parties { grid-template-columns: 1fr; }
  .invoice { padding: 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
.grid-5 .kpi .value { font-size: 22px; }
.field .search input { border: 0; height: 36px; padding: 0; box-shadow: none; background: transparent; }
@media (max-width: 640px) {
  .topbar h1 { font-size: 17px; white-space: nowrap; }
  .topbar .sub { display: none; }
  #quickBook span { display: none; }
  #quickBook { padding: 0 12px; }
  .hello h2 { font-size: 22px; }
  .agenda-item { flex-wrap: wrap; padding: 12px 16px; }
  .agenda-item > div:last-child { width: auto !important; }
}
/* čist prelaz pri uvlačenju menija */
.nav { overflow-x: hidden; scrollbar-width: thin; }
.nav a span, .nav-group, .brand-name, .brand-sub, .user-chip .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text { overflow: hidden; }
@media (min-width: 768px) { .app.collapsed .nav { scrollbar-width: none; } }
/* 24h izbor vremena */
.time24 {
  display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.time24:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.field .time24 select, .time24 select {
  flex: 1; height: 34px; border: 0; background: transparent; box-shadow: none; padding: 0 4px;
  font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; cursor: pointer; outline: none;
}
.time24 span { font-weight: 800; color: var(--muted); }

/* ---------- A4 izveštaj (PDF / štampa) ---------- */
.report { font-family: var(--font); color: #1c1830; font-size: 10.5px; line-height: 1.45; background: #fff; }
.report h2 { font-size: 12.5px; font-weight: 800; margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1.5px solid #00897f; color: #1c1830; break-after: avoid; }
.rp-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 3px solid #1c1830; }
.rp-brand { font-size: 24px; font-weight: 800; color: #00897f; letter-spacing: -.02em; }
.rp-sub, .rp-muted { color: #8a86a0; font-size: 9.5px; }
.rp-meta { text-align: right; }
.rp-title { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 4px; }
.rp-kpi { border: 1px solid #e3dff0; border-radius: 8px; padding: 10px 12px; border-top: 3px solid #00897f; }
.rp-kpi .l { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: #8a86a0; font-weight: 700; }
.rp-kpi .v { font-size: 16px; font-weight: 800; margin: 2px 0; }
.rp-kpi .h { font-size: 9px; color: #8a86a0; }
.rp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.rp-table { width: 100%; border-collapse: collapse; }
.rp-table thead th { background: #00897f; color: #fff; font-weight: 700; text-align: left; padding: 5px 7px; font-size: 9.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-table td { padding: 4px 7px; border-bottom: 1px solid #eeebf6; vertical-align: top; }
.rp-table tbody tr:nth-child(even) td { background: #f7f5fd; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-table tr { break-inside: avoid; }
.rp-table tfoot td { font-weight: 800; border-top: 1.5px solid #1c1830; border-bottom: 0; padding-top: 6px; }
.rp-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-table .b { font-weight: 700; }
.rp-bar { display: inline-block; width: 52px; height: 6px; background: #eeebf6; border-radius: 3px; margin-right: 6px; vertical-align: middle; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-bar.wide { width: 100%; margin: 0; }
.rp-bar i { display: block; height: 100%; background: #00897f; border-radius: 3px; }
.rp-empty { color: #8a86a0; font-style: italic; padding: 6px 0; }
.rp-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid #e3dff0; display: flex; justify-content: space-between; color: #8a86a0; font-size: 9px; }
@media print { body.printing #print-root .report { width: 100%; } }
