* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #1f2933;
  background: #f4f6f9;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #1f2933; color: #fff; padding: 0 24px; height: 56px;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.topbar .links { display: flex; gap: 18px; }
.topbar .links a { color: #cbd2d9; }
.topbar .links a:hover { color: #fff; text-decoration: none; }
.topbar .logout { margin-left: 10px; display: flex; align-items: center; gap: 12px; }
.topbar .gear { margin-left: auto; font-size: 18px; text-decoration: none; }
.topbar .gear:hover { text-decoration: none; }
.topbar .backbtn { background: rgba(255,255,255,.12); border: none; color: #fff; font-size: 24px; line-height: 1; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; padding: 0 0 3px; display: flex; align-items: center; justify-content: center; flex: none; }
.topbar .backbtn:hover { background: rgba(255,255,255,.24); }
.topbar .whoami { color: #9aa5b1; font-size: 14px; }

.container { max-width: 960px; margin: 0 auto; padding: 24px; }

h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 28px 0 12px; }

.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head h1, .section-head h2 { margin: 0; }

/* Gumbi */
button, .btn {
  display: inline-block; cursor: pointer; border: none;
  background: #2563eb; color: #fff; padding: 9px 16px;
  border-radius: 6px; font-size: 14px; font-weight: 600;
}
button:hover, .btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.ghost { background: #e4e7eb; color: #1f2933; }
.btn.ghost:hover { background: #cbd2d9; }
button.danger { background: #e12d39; }
button.danger:hover { background: #cf1124; }

/* Tablice */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #eef1f5; font-size: 14px; }
th { background: #f9fafb; color: #616e7c; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }

/* Analitika: široka tablica sa svim statusima -> vodoravni scroll */
.tablescroll { overflow-x: auto; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); -webkit-overflow-scrolling: touch; }
.tablescroll table { box-shadow: none; }
.tablescroll th, .tablescroll td { white-space: nowrap; }
th.stcol { color: #8a6d0b; }
th.stcol.s-klijent { color: #0f7a43; }
th.stcol.s-support { color: #1d4ed8; }
th.stcol.s-izgubljen, th.stcol.s-los_lead { color: #b42318; }

/* Ciljevi u analitici (na vrhu) */
.goals { background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.goals > summary { cursor: pointer; font-weight: 700; font-size: 15px; color: #1f2933; }
.goals-form { margin-top: 12px; }
.gcell { white-space: nowrap; vertical-align: top; }
.gtop { display: flex; align-items: center; gap: 3px; }
.grem { font-size: 12px; font-weight: 600; color: #b42318; margin-top: 4px; }
.grem.done { color: #0f7a43; }
.gnum { font-weight: 700; }
.gnum.met { color: #0f7a43; }
.gnum.miss { color: #b42318; }
.gsep { color: #9aa5b1; margin: 0 3px; }
.ginput { width: 58px; padding: 5px 6px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; }
.goals-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.period-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.period-tabs .btn.on { background: #2563eb; color: #fff; border-color: #2563eb; }
.saved-goals { background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.saved-goals h3 { margin: 0 0 10px; font-size: 15px; color: #1f2933; }
.perf-h { font-size: 17px; margin: 18px 0 10px; color: #1f2933; }

/* Statistika na ploči */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.stat {
  flex: 1; min-width: 120px; background: #fff; padding: 16px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 4px;
}
.stat:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.stat .num { font-size: 28px; font-weight: 700; color: #1f2933; }
.stat .lbl { font-size: 13px; color: #616e7c; text-transform: capitalize; }
.stat.big { background: #1f2933; }
.stat.big .num, .stat.big .lbl { color: #fff; }

/* Statusne oznake */
.badge { padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.s-novi        { background: #e3edff; color: #1d4ed8; }  /* plava — nov kontakt */
.s-kontaktiran { background: #ece3fb; color: #7c3aed; }  /* ljubičasta — javili smo se */
.s-pregovori   { background: #fde8c4; color: #b45309; }  /* narančasta — pregovori */
.s-klijent     { background: #ccf3d7; color: #15803d; }  /* zelena — postao klijent */
.s-izgubljen   { background: #f7d9d9; color: #b91c1c; }  /* crvena — izgubljen */
/* Sales funnel — SEMAFOR: sve u tijeku = žuto, Naš klijent = zeleno, Izgubljen = crveno */
.s-ne_javlja_se { background: #e7e9ee; color: #5b6472; }  /* sivo — probali smo, nitko se nije javio */
.s-nekontaktiran,
.s-prvi_kontakt,
.s-sastanak,
.s-sastanak_obavljen,
.s-ponuda { background: #fdf1c2; color: #8a6d0b; }  /* žuto — u tijeku */
.s-klijent { background: #c6f7d0; color: #0f7a43; }  /* zeleno — Naš klijent */
.s-nije_klijent { background: #e4e7eb; color: #52606d; }  /* sivo — maknut iz "Naš klijent" */
.s-support { background: #dbeafe; color: #1d4ed8; }  /* plavo — support (post-prodaja) */
.s-izgubljen, .s-los_lead { background: #f8d3d3; color: #b42318; }  /* crveno — izgubljen / loš lead */

/* Veliki, istaknuti status na kartici klijenta */
.statusbig { display: inline-block; padding: 10px 22px; border-radius: 26px; font-size: 17px; font-weight: 800; margin-bottom: 16px; text-transform: capitalize; }
.clientbig { display: inline-block; background: #0f7a43; color: #fff; font-weight: 800; font-size: 18px; padding: 9px 20px; border-radius: 26px; margin: 0 0 16px 8px; letter-spacing: .5px; box-shadow: 0 2px 8px rgba(15,122,67,.35); }
.cats-title { font-size: 13px; font-weight: 700; color: #3e4c59; margin-bottom: 8px; }
.cats-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-form { display: inline; margin: 0; }
/* ON/OFF prekidač: Naš klijent DA/NE */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: relative; width: 50px; height: 28px; background: #cbd2d9; border-radius: 999px; transition: background .2s; flex: none; }
.switch .slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + .slider { background: #147d64; }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { outline: 2px solid #147d64; outline-offset: 2px; }
.switch-txt { font-weight: 700; font-size: 14px; color: #8a96a3; letter-spacing: .3px; }
.switch-txt.on { color: #147d64; }
.cat-btn { background: #eef1f5; color: #1f2933; border: 1px solid #d7dde3; padding: 9px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.cat-btn:hover { background: #e2e7ec; text-decoration: none; }
.cat-btn.cat-on { background: #c6f7d0; color: #0f7a43; border-color: #0f7a43; }
.dur-lbl { display: block; margin: 10px 0; font-size: 13px; color: #616e7c; }
.dur-lbl select { margin-left: 6px; }
/* Upsell: obavezan izbor smjera (klijent zvao nas / mi zvali klijenta) */
.dir-lbl { font-size: 13px; font-weight: 600; color: #3e4c59; margin-bottom: 7px; }
.dir-lbl .req { color: #e12d39; }
.dir-choice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.dir-opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid #dce1e7; border-radius: 10px; cursor: pointer; font-weight: 600; color: #1f2933; }
.dir-opt:hover { border-color: #93b4f5; background: #f4f8ff; }
.dir-opt:has(input:checked) { border-color: #147d64; background: #e7f5f0; }
.dir-opt input { width: 18px; height: 18px; accent-color: #147d64; flex: none; }
.dirtag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.dirtag.in { background: #e0e8ff; color: #1e40af; }
.dirtag.out { background: #e7f5f0; color: #147d64; }

/* Forme */
.form, .filters, .note-form { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.form label, .login-box label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: #3e4c59; }
.form .row { display: flex; gap: 16px; }
.form .row label { flex: 1; }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #cbd2d9;
  border-radius: 6px; font-size: 14px; font-family: inherit; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2563eb; }
.form .actions { display: flex; gap: 10px; margin-top: 8px; }

.filters { display: flex; gap: 10px; align-items: center; margin: 16px 0; padding: 14px; }
.filters input[type=text] { flex: 2; margin: 0; }
.filters select { flex: 1; margin: 0; }
.filters button, .filters .btn { flex-shrink: 0; }

/* Detalj kupca */
.card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.kv { display: flex; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv span { width: 130px; color: #616e7c; }


/* AI prijedlog maila na kartici klijenta */
.mailbox { border: 1px solid var(--line, #d8dde5); border-radius: 10px; padding: 14px; margin: 14px 0; background: #fbfcfe; }
.mailbox h3 { margin: 0 0 4px; }
.mailbox input[type=text], .mailbox textarea { width: 100%; margin: 4px 0 10px; }
.mailbox textarea { font-family: inherit; line-height: 1.5; }
.mailbox label { display: block; margin-top: 6px; }
.mail-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-form { margin-bottom: 16px; }
.note-form textarea { margin-bottom: 10px; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { background: #fff; padding: 14px; border-radius: 8px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.note-meta { font-size: 12px; color: #616e7c; margin-bottom: 6px; }
.note-body { font-size: 14px; white-space: pre-wrap; }

.muted { color: #9aa5b1; }
.error { background: #ffe3e3; color: #a4262c; padding: 10px 14px; border-radius: 6px; font-size: 14px; }

/* Prijava */
.login-box { max-width: 360px; margin: 60px auto; background: #fff; padding: 32px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.login-box h1 { text-align: center; }
.login-box button { width: 100%; margin-top: 8px; }

/* --- v2 dodatci --- */
.topbar .links a.on { color: #fff; }
.stat .sub { font-size: 12px; color: #9aa5b1; }
.quick { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 8px 0; cursor: pointer; }
label.check input { width: auto; margin: 0; }
fieldset.cats { border: 1px solid #cbd2d9; border-radius: 8px; padding: 12px 16px; margin: 4px 0 16px; }
fieldset.cats legend { font-weight: 600; font-size: 14px; padding: 0 6px; color: #3e4c59; }

button.small, .btn.small { padding: 5px 10px; font-size: 12px; }
tr.off { opacity: .5; }
.rowactions { display: flex; align-items: center; gap: 10px; }

.callbtn {
  display: inline-block; background: #147d64; color: #fff; padding: 13px 20px;
  border-radius: 8px; font-weight: 700; font-size: 16px; margin-bottom: 16px;
}
.callbtn:hover { background: #0e6650; text-decoration: none; }

/* Kontakti (osobe u firmi) */
.contacts-head { font-size: 13px; font-weight: 700; color: #3e4c59; margin-bottom: 6px; }
.contact-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f5; }
.contact-info { flex: 1; min-width: 0; }
.contact-top { font-size: 15px; }
.contact-role { display: inline-block; font-size: 12px; font-weight: 600; color: #52606d; background: #eef2f7; border-radius: 99px; padding: 1px 8px; margin-left: 4px; }
.primary-badge { display: inline-block; font-size: 11px; font-weight: 800; color: #0f7a43; background: #ecfdf3; border-radius: 99px; padding: 1px 8px; }
.contact-sub { font-size: 13px; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.contact-actions { display: flex; gap: 4px; margin-left: auto; }
.contact-actions button { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 7px; color: #52606d; }
.contact-actions form:last-child button { color: #b42318; }
.contact-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.contact-add input { flex: 1; min-width: 130px; padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; }
.contact-add button { flex: none; }
/* Dodatni brojevi po kontaktu */
.contact-phones { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; align-items: center; }
.cphone { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; background: #f5f7fa; border-radius: 99px; padding: 1px 4px 1px 9px; }
.cphone button { background: none; border: none; cursor: pointer; font-size: 12px; color: #b42318; padding: 0 3px; line-height: 1; }
.cphone-add { display: inline-flex; gap: 4px; }
.cphone-add input { width: 118px; padding: 3px 8px; border: 1px solid #cbd2d9; border-radius: 99px; font-size: 13px; }
.cphone-add button { background: #eef2f7; border: 1px solid #cbd2d9; border-radius: 99px; cursor: pointer; font-size: 13px; color: #3e4c59; padding: 0 9px; }

/* Zadaci (tasks) */
.navbadge { display: inline-block; min-width: 16px; padding: 0 5px; background: #e02424; color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; text-align: center; line-height: 16px; }
.taskadd { margin-bottom: 4px; }
.task-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.task-form input[type=text] { flex: 1; min-width: 180px; padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; }
.task-form select, .task-form input[type=date], .task-form input[type=time] { padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; }
.task-form button { flex: none; }
.tasklist { margin: 6px 0; }
.task { display: flex; align-items: flex-start; gap: 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 11px 14px; margin: 8px 0; }
.task.done { opacity: .6; }
.task.done .task-title { text-decoration: line-through; }
.task-check button { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; padding: 0; color: #2563eb; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 15px; }
.task-meta { font-size: 12px; color: #616e7c; margin-top: 3px; }
.task-del { margin-left: auto; }
.task-del button { background: none; border: none; color: #b42318; cursor: pointer; font-size: 14px; padding: 2px 6px; }
/* Pretraživo polje firme/klijenta u formi za novi zadatak (tab Zadaci) */
.task-form .task-cust { flex: 1; min-width: 160px; }

/* Značajke (On/Off) po korisniku */
.features .feat-cols { display: flex; gap: 28px; flex-wrap: wrap; }
.feat-group { min-width: 210px; }
.feat-title { font-weight: 800; font-size: 13px; color: #3e4c59; margin: 8px 0 6px; }
/* Kill-switch značajki po firmi (superadmin /companies) */
.cofeat > summary { cursor: pointer; color: #2563eb; font-size: 13px; }
.cofeat[open] { flex-basis: 100%; margin: 6px 0; }
.cofeat-form { margin-top: 8px; padding: 12px 14px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; }
.cofeat-form .feat-cols { display: flex; gap: 28px; flex-wrap: wrap; }

.loadmore { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.loadmore .muted { margin-right: auto; }
.loadmore label { display: inline-flex; align-items: center; gap: 4px; }
.loadmore select { padding: 5px 8px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; background: #fff; }

.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.btn.disabled { opacity: .45; pointer-events: none; }
.perform { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.perform label { font-size: 13px; color: #616e7c; display: flex; align-items: center; gap: 6px; }
.perform input[type=number] { width: 72px; margin: 0; }
.perform button { flex: none; padding: 8px 12px; }

@media (max-width: 640px) {
  .apptrow { flex-direction: column; align-items: stretch; }
  .apptrow input[type=date], .apptrow select, .apptrow button { width: 100%; min-width: 0; }
  .note-status { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .note-status select { width: 100%; }
  /* Razmak da plutajući "+" (FAB) ne prekriva gumbe paginacije; + veći tap-targeti. */
  .pager { gap: 10px; position: relative; z-index: 46; margin-bottom: 64px; }
  .pager .muted { order: 3; width: 100%; text-align: center; }
  .pager .btn { padding: 12px 16px; }
  .perform { margin-left: 0; width: 100%; justify-content: space-between; align-items: center; }
  .perform input[type=number] { width: 96px; height: 46px; font-size: 16px; }
  .perform button { padding: 12px 20px; font-size: 15px; }
  .calhead, .weeknav { flex-wrap: wrap; }
  .modal-box { padding: 16px; }
}

/* Istaknuti sljedeći termin */
.next { display: flex; align-items: center; gap: 12px; background: #147d64; color: #fff; border-radius: 10px; padding: 13px 16px; margin-bottom: 16px; }
.next .ico { font-size: 22px; }
.next .lbl { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .5px; }
.next .val { font-size: 16px; font-weight: 700; }

/* Vremenska crta (timeline) */
details.history { margin-top: 16px; }
details.history > summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 13px 15px; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); list-style: none; }
details.history > summary::-webkit-details-marker { display: none; }
details.history > summary::before { content: '▸  '; color: #8a96a3; }
details.history[open] > summary::before { content: '▾  '; }
details.history[open] > summary { margin-bottom: 14px; }

.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: #dde2e8; }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-dot { position: absolute; left: -32px; top: 0; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #fff; border: 2px solid #dde2e8; }
.tl-dot.note { border-color: #93b4f5; }
.tl-dot.status { border-color: #c4b0f0; }
.tl-dot.appointment { border-color: #7fd6a8; }
.tl-dot.created { border-color: #cbd2d9; }
.tl-card { background: #fff; border-radius: 10px; padding: 11px 13px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tl-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #8a96a3; margin-bottom: 5px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 10px; font-weight: 700; flex: none; letter-spacing: .3px; }
.tl-body { font-size: 14px; line-height: 1.45; }
.tl-body + .tl-body { margin-top: 7px; padding-top: 7px; border-top: 1px dashed #eef1f5; }
.tl-body .badge { font-size: 11px; padding: 2px 8px; }
.loadmore-link { display: inline-block; margin-top: 4px; color: #2563eb; font-weight: 600; font-size: 14px; }

/* Donja sticky navigacija — samo mobitel */
.tabbar { display: none; }
/* Veliki plutajući "+" gumb — samo mobitel */
.fab { display: none; }

/* Kalendar */
.calhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.calhead h1 { margin: 0; }
.calviews, .weeknav { display: flex; gap: 8px; }
.weeknav { margin: 14px 0; }
.cal-day-h { font-weight: 700; font-size: 14px; color: #3e4c59; margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 2px solid #e4e7eb; }
.cal-day-h.today { color: #147d64; border-color: #147d64; }
.cal-day-h.overdue { color: #b91c1c; border-color: #f3b0b0; }
.cal-item { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 11px 13px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: opacity .2s ease, transform .2s ease; }
.cal-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.cal-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; }
.cal-link:hover { text-decoration: none; }
.cal-doneform { flex: none; margin: 0; }
.cal-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #cbd2d9; background: #fff; cursor: pointer; color: #b8c1cc; font-size: 15px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; transition: all .15s; }
.cal-check::before { content: '✓'; }
.cal-check:hover { border-color: #147d64; color: #147d64; }
.cal-item.done { opacity: .45; transform: scale(.98); }
.cal-item.done .cal-check { background: #147d64; border-color: #147d64; color: #fff; }
.cal-item.overdue { border-left: 4px solid #e12d39; }
.cal-item.overdue .cal-time { color: #e12d39; }
.cal-item.reminder { border-left: 4px solid #d97706; }
.cal-item.reminder.overdue { border-left-color: #e12d39; }
.cal-time { font-weight: 700; font-size: 15px; color: #1f2933; min-width: 46px; }
.cal-info { flex: 1; display: flex; flex-direction: column; }
.cal-info b { color: #1f2933; }
.cal-info small { color: #8a96a3; font-size: 12px; }
.cal-empty { color: #cbd2d9; font-size: 13px; padding: 0 0 6px; }

/* Poziv (call) */
.tl-dot.call { border-color: #4fc0b5; }
.note-btns { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.note-status { font-size: 13px; color: #616e7c; margin: 8px 0; }
.note-status select { width: auto; margin: 0 0 0 6px; display: inline-block; }
button.callog { background: #147d64; }
button.callog:hover { background: #0e6650; }
button.ghost-btn { background: #e4e7eb; color: #1f2933; }
button.ghost-btn:hover { background: #cbd2d9; }

/* Analitika */
.daylabel { align-self: center; font-weight: 600; color: #3e4c59; }
.daylabel.today { color: #147d64; }
b.big { font-size: 17px; }

/* --- Analitika v2: timske kartice + čista tablica --- */
.sec-h { margin: 22px 0 10px; font-size: 17px; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tcard { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.tc-label { font-size: 13px; color: #52606d; font-weight: 600; }
.tc-num { font-size: 26px; font-weight: 800; margin: 4px 0 8px; line-height: 1; }
.tc-num .muted { font-size: 15px; font-weight: 600; }
.tc-bar { height: 8px; background: #e4e7eb; border-radius: 99px; overflow: hidden; }
.tc-fill { height: 100%; background: #2563eb; border-radius: 99px; transition: width .3s; }
.tc-fill.met { background: #0f7a43; }
.tc-fill.miss { background: #f0a020; }
.tc-rem { font-size: 12px; color: #7b8794; margin-top: 5px; }
table.perf td .goalline { font-size: 12px; font-weight: 700; margin-top: 2px; }
.goalline.met { color: #0f7a43; }
.goalline.miss { color: #b42318; }
td.conv { font-weight: 800; color: #2563eb; }
.goalchip { display: inline-flex; align-items: center; gap: 5px; background: #eef2ff; color: #3730a3; border-radius: 99px; padding: 3px 10px; font-size: 13px; font-weight: 600; margin: 0 5px 4px 0; white-space: nowrap; }
.goalchip b { font-weight: 800; }

/* Pregled ciljeva — kartica po razdoblju (Mjesec/Kvartal/Godina) + napredak */
.goal-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.gp-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.07); overflow: hidden; }
.gp-head { font-weight: 800; font-size: 15px; padding: 10px 14px; background: #f5f7fa; color: #1f2933; border-bottom: 1px solid #e9edf2; }
.gp-empty { padding: 12px 14px; color: #9aa5b1; font-size: 13px; }
.gp-who-block { padding: 11px 14px; border-bottom: 1px solid #f0f2f5; }
.gp-who-block:last-child { border-bottom: 0; }
.gp-who2 { font-weight: 700; color: #3e4c59; font-size: 13px; margin-bottom: 7px; }
.gp-goal { margin: 8px 0; }
.gp-goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: #3e4c59; }
.gp-val { font-weight: 800; white-space: nowrap; color: #52606d; }
.gp-val.met { color: #0f7a43; }
.gp-bar { height: 6px; background: #e4e7eb; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.gp-fill { height: 100%; border-radius: 99px; background: #2563eb; transition: width .3s; }
.gp-fill.met { background: #0f7a43; }

/* Postavljanje ciljeva — selektor razdoblja + kartice */
.set-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.sp-lab { font-weight: 700; color: #1f2933; }
.chipbtn { display: inline-block; padding: 6px 14px; border-radius: 99px; background: #e4e7eb; color: #1f2933; font-weight: 700; font-size: 14px; text-decoration: none; }
.chipbtn:hover { background: #cbd2d9; }
.chipbtn.on { background: #2563eb; color: #fff; }
.setblock { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 14px 16px; margin: 12px 0; }
.setblock-h { font-weight: 800; font-size: 15px; margin-bottom: 4px; color: #1f2933; }
details.setblock > summary.setblock-h { cursor: pointer; margin-bottom: 0; }
details.setblock[open] > summary.setblock-h { margin-bottom: 10px; }
.glog td { vertical-align: middle; }
.glog-del { color: #b42318; font-weight: 700; }
.glog-set { color: #0f7a43; font-weight: 700; }
.goals-set, .metrics-set { margin-top: 16px; }
.goals-set summary, .metrics-set summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 14px; margin: 8px 0 12px; }
.metric-grid .check { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.arr-badge { display: inline-flex; align-items: center; background: #ecfdf3; color: #027a48; border-radius: 99px; padding: 4px 11px; font-weight: 700; font-size: 13px; margin-left: 8px; }
.arr-input { width: 100%; padding: 10px; font-size: 18px; border: 1px solid #cbd2d9; border-radius: 8px; margin-bottom: 12px; box-sizing: border-box; }

/* Snimanje poziva */
.recorder label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #3e4c59; }
.rectimer { text-align: center; font-size: 26px; font-weight: 700; margin: 14px 0 10px; font-variant-numeric: tabular-nums; color: #1f2933; }
.recbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 18px; font-size: 18px; font-weight: 700; background: #e12d39; color: #fff; border: none; border-radius: 12px; cursor: pointer; }
.recbtn:hover { background: #cf1124; }
.recbtn.recording { background: #1f2933; animation: recpulse 1.1s infinite; }
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
#recPreview { margin-top: 14px; }
#recPreview audio { width: 100%; margin-bottom: 8px; }

.rec-list { list-style: none; padding: 0; margin: 0; }
.rec-list li { background: #fff; border-radius: 10px; padding: 13px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rec-list audio { width: 100%; margin: 10px 0 8px; }
.small { font-size: 12px; }

/* Transkript snimke */
.transcript { background: #f6f8fb; border: 1px solid #e6eaf0; border-radius: 8px; padding: 8px 12px; margin: 4px 0 10px; }
.transcript summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #3e4c59; }
.transcript .tr-text { margin: 8px 0 2px; white-space: pre-wrap; line-height: 1.5; color: #1f2933; font-size: 14px; }
.tr-pending { margin: 4px 0 10px; }

/* Snimanje + termin unutar kartice klijenta */
.recbtn-sm { background: #e12d39; color: #fff; }
.recbtn-sm:hover { background: #cf1124; }
.recbtn-sm.recording { background: #1f2933; animation: recpulse 1.1s infinite; }
.rectimer-sm { align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; color: #e12d39; }
.apptbox { margin-top: 16px; margin-bottom: 24px; }
.apptcur { font-size: 15px; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { background: #eef1f5; color: #1f2933; border: 1px solid #dce1e7; border-radius: 20px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { background: #e0e8ff; border-color: #93b4f5; }
.apptrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.apptrow input, .apptrow select { margin: 0; }
.apptrow input[type=date] { flex: 1; min-width: 150px; }
.apptrow select { flex: 0 0 auto; width: auto; min-width: 92px; }
.tl-audio { display: block; width: 100%; margin-top: 8px; height: 36px; }

/* Prozorčić (modal) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 460px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-box h3 { margin: 0 0 12px; font-size: 18px; }
.modal-box textarea { width: 100%; margin-bottom: 12px; }
.chip-edit { padding: 8px 12px; }
.chip-custom { background: #e0e8ff; border-color: #93b4f5; color: #2b4acb; }
.preset-list { list-style: none; padding: 0; margin: 0 0 14px; }
.preset-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.preset-add .row { display: flex; gap: 12px; }

/* "Više" izbornik */
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-list a { display: flex; align-items: center; gap: 14px; background: #fff; padding: 16px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); font-size: 16px; font-weight: 600; color: #1f2933; }
.menu-list a:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.menu-list a .ic { font-size: 22px; }

/* Osobne bilješke / skripte */
.pages-layout { display: flex; gap: 16px; align-items: flex-start; }
.pages-list { flex: 0 0 220px; }
.pages-editor { flex: 1; min-width: 0; }
.newpage { display: flex; gap: 6px; margin-bottom: 12px; }
.newpage input { margin: 0; }
.newpage button { flex: none; }
.pglist { list-style: none; padding: 0; margin: 0; }
.pglist li { margin-bottom: 4px; }
.pglist li a { display: block; padding: 9px 11px; background: #fff; border-radius: 8px; color: #1f2933; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pglist li.on a, .pglist li a:hover { background: #e3edff; text-decoration: none; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.pages-editor textarea { width: 100%; font-family: inherit; line-height: 1.5; }
@media (max-width: 640px) { .pages-layout { flex-direction: column; } .pages-list { flex: none; width: 100%; } }

.pushstatus { font-size: 14px; margin: 6px 0 12px; }
.howto { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.howto li { margin-bottom: 8px; }

@media (max-width: 640px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid #e4e7eb; box-shadow: 0 -2px 10px rgba(0,0,0,.07);
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 1px 9px; font-size: 10px; white-space: nowrap; color: #8a96a3; text-decoration: none; }
  .tabbar a .ic { font-size: 20px; line-height: 1; filter: grayscale(.4); opacity: .75; }
  .tabbar a.on { color: #2563eb; font-weight: 600; }
  .tabbar a.on .ic { filter: none; opacity: 1; }

  .fab {
    display: flex; position: fixed; right: 16px; bottom: 74px; z-index: 45;
    width: 58px; height: 58px; border-radius: 50%; background: #2563eb; color: #fff;
    font-size: 32px; line-height: 1; align-items: center; justify-content: center;
    box-shadow: 0 5px 16px rgba(37,99,235,.5);
  }
  .fab:hover { background: #1d4ed8; text-decoration: none; }
}

/* --- Mobitel --- */
@media (max-width: 640px) {
  .container { padding: 16px 12px 90px; }
  .topbar { gap: 12px; padding: 8px 14px; height: auto; padding-top: calc(8px + env(safe-area-inset-top)); }
  .topbar .links { display: none; }   /* na mobitelu koristi se donji bar */
  .topbar .logout { margin-left: auto; }
  .topbar .whoami { display: none; }
  .form .row { flex-direction: column; gap: 0; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input[type=text], .filters select, .filters button, .filters .btn { width: 100%; flex: none; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .tablescroll table { display: table; }   /* wrapper je jedini scroller */
  h1 { font-size: 21px; }
  .stat { min-width: calc(50% - 12px); }
  button, .btn { padding: 12px 16px; font-size: 15px; }
}

/* --- Izbornik s LIJEVE strane (desktop). Mobitel i dalje koristi donju traku. --- */
@media (min-width: 641px) {
  body { padding-left: 216px; }

  .topbar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 216px; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 4px;
    height: auto; padding: 12px 12px; overflow-y: auto;
  }
  .topbar .backbtn { align-self: flex-start; margin-bottom: 6px; }
  .topbar .brand { font-size: 22px; padding: 0 10px 10px; }

  .topbar .links { flex-direction: column; gap: 2px; flex: 1; }
  .topbar .links a {
    padding: 8px 10px; border-radius: 8px; font-size: 15px;
    display: flex; align-items: center; gap: 8px;
  }
  .topbar .links a:hover { background: rgba(255,255,255,.08); }
  .topbar .links a.on { background: rgba(255,255,255,.14); font-weight: 600; }

  .topbar .gear { margin-left: 0; padding: 9px 10px; border-radius: 8px; }
  .topbar .gear:hover { background: rgba(255,255,255,.08); }

  .topbar .logout {
    margin-left: 0; flex-direction: column; align-items: stretch; gap: 8px;
    margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12);
  }
  .topbar .whoami { font-size: 13px; line-height: 1.35; }
  .topbar .logout button { width: 100%; }
}

/* Uređivanje AI uputa */
textarea.upute { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.55; margin-bottom: 10px; }

.mailopt { padding-left: 11px; padding-right: 11px; text-decoration: none; }

.mailweb { display: flex; align-items: center; gap: 7px; margin: -4px 0 10px; cursor: pointer; }
.mailweb input { width: auto; margin: 0; }

/* Osobni potpis */
textarea.potpis { width: 100%; font-family: inherit; line-height: 1.5; margin-bottom: 10px; }
