:root {
  --ink: #06142b; --navy: #0b2447; --navy-2: #123461; --orange: #ff8a1f; --orange-2: #ffb066;
  --paper: #f6f3ec; --paper-2: #ebe6da; --text: #0d1b33; --muted: #4a5a76; --line: rgba(13,27,51,.14);
  --ok: #2e7d32; --warn: #b26a00; --bad: #c62828; --card: #fff; --radius: 12px;
  --row: 13px; /* visina 15-min reda (telefon) */
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
@media (min-width: 760px) { :root { --row: 15px; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.rs-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.rs-brand img { height: 36px; width: auto; display: block; }
.rs-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rs-nav a { color: rgba(255,255,255,.85); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.rs-nav a.active, .rs-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.rs-main { max-width: 1180px; margin: 0 auto; padding: 12px 16px 80px; }
.rs-muted { color: var(--muted); }
.rs-small { font-size: 13px; }
h1 { font-size: 22px; margin: 6px 0 12px; }
h2 { font-size: 18px; margin: 18px 0 8px; }
h3 { font-size: 15px; margin: 12px 0 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 9px; cursor: pointer; min-height: 36px; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--navy-2); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.accent { background: var(--orange); color: var(--ink); border-color: var(--orange); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: rgba(198,40,40,.4); }
.btn.sm { padding: 4px 8px; min-height: 30px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.grid3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.kpi { font-size: 22px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
.field input[type=checkbox], .field input[type=radio], label input[type=checkbox] { width: auto; padding: 0; margin: 0 6px 0 0; vertical-align: -2px; }
.chip.busy:not(.on) { text-decoration: line-through; }
.chip.busy.on { background: var(--bad); border-color: var(--bad); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > .field { flex: 1 1 140px; }
.err { color: var(--bad); font-size: 14px; margin: 6px 0; }
.note { background: #fff7e8; border: 1px solid #f3d7a6; border-radius: 9px; padding: 8px 10px; font-size: 14px; margin: 8px 0; }
.note.bad { background: #fdecec; border-color: #f2b8b8; }
.note.ok { background: #eaf6ea; border-color: #b9dcb9; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--paper-2); color: var(--text); white-space: nowrap; }
.tag.ok { background: #e3f2e3; color: var(--ok); } .tag.warn { background: #fff1d6; color: var(--warn); } .tag.bad { background: #fde3e3; color: var(--bad); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
.tablewrap { width: 100%; overflow-x: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 14px; }
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; min-width: 44px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip[disabled] { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* ---------- kalendar ---------- */
.cal-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.cal-bar .date-title { font-weight: 700; font-size: 16px; margin-right: auto; min-width: 150px; }
.cal-bar input[type=date] { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fff; }
.cal { position: relative; display: grid; grid-template-columns: 34px repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; }
@media (min-width: 760px) { .cal { grid-template-columns: 52px repeat(6, minmax(0, 1fr)); } }
.cal-head { position: sticky; top: var(--top-h, 52px); z-index: 5; background: var(--navy); color: #fff; text-align: center; font-size: 12px; font-weight: 600; padding: 6px 0; border-left: 1px solid rgba(255,255,255,.1); }
.cal-head .long { display: none; } @media (min-width: 760px) { .cal-head .long { display: inline; } .cal-head .short { display: none; } }
.cal-times { position: relative; }
.cal-time { position: absolute; left: 0; right: 0; font-size: 10px; color: var(--muted); text-align: right; padding-right: 4px; transform: translateY(-6px); }
@media (min-width: 760px) { .cal-time { font-size: 12px; } }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: pointer; }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(13,27,51,.08); pointer-events: none; }
.cal-line.hour { border-top-color: rgba(13,27,51,.18); }
.cal-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(13,27,51,.05) 0 6px, transparent 6px 12px); pointer-events: none; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 3; pointer-events: none; }
.cal-hover { position: absolute; left: 2px; right: 2px; border: 2px dashed var(--orange); border-radius: 6px; pointer-events: none; z-index: 2; }
.blk { position: absolute; left: 2px; right: 2px; border-radius: 6px; color: #fff; font-size: 10px; line-height: 1.15; padding: 2px 3px; overflow: hidden; z-index: 2; box-shadow: 0 1px 0 rgba(0,0,0,.15); cursor: pointer; border: 0; text-align: left; }
@media (min-width: 760px) { .blk { font-size: 12px; padding: 3px 6px; } }
.blk .l1 { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.blk .l2 { opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.blk.mine { outline: 3px solid var(--orange); outline-offset: -3px; }
.blk.st-cancelled { opacity: .35; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px) !important; }
.blk.st-no_show { opacity: .55; }
.blk .badge { position: absolute; top: 1px; right: 2px; font-size: 10px; background: rgba(0,0,0,.35); border-radius: 4px; padding: 0 3px; }
.blk.ev { opacity: .92; }
.blk.trn-open { opacity: .55; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.4) 0 5px, transparent 5px 10px) !important; }
.blk.trn-claimed { opacity: 1; }
.pos { position: absolute; left: 2px; right: 2px; z-index: 3; border-radius: 5px; font-size: 10px; line-height: 1.15; padding: 2px 3px; overflow: hidden; background: rgba(255,255,255,.92); color: var(--ink); border: 1px solid rgba(0,0,0,.15); }
.pos.free { background: rgba(255,255,255,.55); color: var(--muted); font-style: italic; }
@media (min-width: 760px) { .pos { font-size: 11px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; margin: 10px 0; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* sedmica */
.week { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 11px; }
.week .wh { background: var(--navy); color: #fff; text-align: center; padding: 5px 0; font-weight: 600; cursor: pointer; }
.week .wh.today { background: var(--orange); color: var(--ink); }
.week .wt { color: var(--muted); text-align: right; padding-right: 3px; height: 22px; line-height: 22px; border-top: 1px solid var(--line); }
.week .wc { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; padding: 3px 2px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); height: 22px; cursor: pointer; }
.week .wc span { border-radius: 2px; background: #eef0f3; }
.week .wc span.m { outline: 2px solid var(--orange); }

/* bočni panel i modal */
.rs-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; z-index: 40; box-shadow: -8px 0 30px rgba(0,0,0,.18); overflow-y: auto; padding: 14px 16px 40px; }
.rs-panel .close, .rs-modal .close { float: right; }
.rs-modal { position: fixed; inset: 0; background: rgba(6,20,43,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow-y: auto; }
.rs-modal .box { background: #fff; border-radius: 14px; padding: 16px; width: min(560px, 100%); }
.rs-toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100vw - 32px); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; font-size: 14px; margin: 8px 0; }
.kv div:nth-child(odd) { color: var(--muted); }
.sum { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.sum.total { font-weight: 700; border-bottom: 0; font-size: 17px; }
.dash { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); margin-bottom: 10px; }
@media (min-width: 760px) { .dash { grid-template-columns: repeat(4, 1fr); } }
.dash .card { margin: 0; padding: 10px 12px; }
.dash .lbl { font-size: 12px; color: var(--muted); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.big-q { font-size: 17px; font-weight: 700; margin: 8px 0; }
.rs-proba { background: #ffde59; color: #3a2a00; text-align: center; font-size: 13px; font-weight: 600; padding: 4px 12px; }
