/* Monly — Horizon dizajn sistem
   Monohromno, hairline granice, Inter Tight, zelena samo za rast. */
@font-face{font-family:'Inter Tight';font-style:normal;font-weight:400 800;font-display:swap;src:url('assets/fonts/inter-var-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Inter Tight';font-style:normal;font-weight:400 800;font-display:swap;src:url('assets/fonts/inter-var-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --ink: #0c0d0f;
  --text: #3a3e45;
  --muted: #6b7079;
  --line: #e6e7e9;
  --soft: #f4f4f5;
  --bg: #ffffff;
  --up: #15803d;
  --down: #b42318;
  --r: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Prijava ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--soft);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 26px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.brand .dot { width: 6px; height: 6px; background: var(--ink); }
.auth h1 { margin-top: 20px; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.auth p.lead { margin-top: 4px; font-size: 12px; color: var(--muted); }
.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 9px 10px;
  font-size: 13px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.btn:hover { opacity: .88; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.wide { width: 100%; margin-top: 18px; }
.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.auth-foot { margin-top: 16px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.form-error {
  margin-top: 12px;
  font-size: 12px;
  color: var(--down);
  border-left: 2px solid var(--down);
  padding-left: 8px;
}

/* ---------- Školjka ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.app > * { min-width: 0; }

.side {
  border-right: 1px solid var(--line);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
}
.role-pill {
  margin: 10px 8px 0;
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.role-pill::before { content: ""; width: 14px; height: 1px; background: var(--line); }

.nav { display: flex; flex-direction: column; gap: 1px; margin-top: 18px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r);
  font-size: 13px;
  color: var(--text);
}
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.nav svg { width: 15px; height: 15px; flex: none; }
.nav .sep { height: 1px; background: var(--line); margin: 9px 8px; }
.badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 12px 6px 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.account .who { min-width: 0; }
.account .who b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account .who small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Gornja traka ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 6;
}
.top h1 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.top .sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 20px 24px 40px; max-width: 1320px; width: 100%; }

/* ---------- Kartice i KPI ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.grid > .w-full { grid-column: span 3; }
.grid > .w-wide { grid-column: span 2; }
.grid > .w-side { grid-column: span 1; }
.grid > .w-quarter { grid-column: span 1; }

/* Četiri tabele u jednom redu: upiti, obavijesti, kupci, prodaje. */
#panel.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#panel.four > .w-full { grid-column: 1 / -1; }
#panel.four > .w-wide { grid-column: span 2; }
#panel.four > .w-side, #panel.four > .w-quarter { grid-column: span 1; }
#panel.four .card-h { gap: 8px; }
#panel.four .card-h h2 { font-size: 13px; }
#panel.four .card-h small { white-space: nowrap; text-align: right; }
#panel.four .rowline { padding: 11px 12px; gap: 8px; }
#panel.four .rowline small { font-size: 11px; line-height: 1.35; }
#panel.four .rowline > .mini-btn { flex: none; padding: 6px 10px; min-height: 36px; font-size: 11px; }
/* U uskoj koloni novac i dugme idu u drugi red — cifra se ne lomi na pola. */
@media (min-width: 981px) {
  #panel.four .rowline { flex-wrap: wrap; row-gap: 6px; }
  #panel.four .rowline > div { flex: 1 1 100%; }
  #panel.four .rowline > .num, #panel.four .rowline > .mini-btn { white-space: nowrap; }
  #panel.four .rowline > .mini-btn { margin-left: auto; }
}

/* Liste ispod oglasa: puna širina, kao tabela „Oglasi firme“. */
.card-h-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.card-h-tools small { white-space: nowrap; }

/* Članovi agencije: uloge, pozivnica i pozivnice na čekanju. */
.team-invite-form { display: grid; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); }
.team-invite-form label { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #8b9099; }
.team-invite-row { display: flex; flex-wrap: wrap; gap: 8px; }
.team-invite-row input { flex: 1 1 240px; min-width: 0; }
.team-hint { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.team-stats { color: #8b9099; }

/* Profil agencije: zaglavlje sa logom, opis i logo u dvije kolone. */
.ag-head { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ag-logo { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); display: grid; place-items: center; font-size: 14px; font-weight: 800; letter-spacing: .5px; flex: none; overflow: hidden; }
.ag-who { min-width: 0; display: grid; gap: 2px; }
.ag-who b { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.ag-who small { font-size: 11.5px; color: var(--muted); }
.ag-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ag-head-r { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-head-note { font-size: 11.5px; color: var(--muted); }
.ag-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 4px 18px; padding: 14px 16px 6px; }
.ag-grid .field { margin-top: 0; }
.ag-side { display: grid; gap: 10px; align-content: start; }
.ag-logo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.ag-logo-row > div { flex: 1 1 100%; min-width: 0; }
.ag-logo-row b { display: block; font-size: 12px; font-weight: 600; }
.ag-logo-row small { display: block; font-size: 11px; color: var(--muted); }
.ag-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px 16px; }
.ag-foot small { flex: 1 1 auto; font-size: 11.5px; color: var(--muted); }
#view-agencija .msgs.tall { height: 300px; min-height: 220px; }
/* Rejting agenta: prosjek ocjena i raspodjela zvjezdica. */
.rate { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; padding: 16px; align-items: center; }
.rate-score { display: grid; gap: 6px; justify-items: start; }
.rate-score > b { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.rate-score > b.is-empty { font-size: 24px; color: #a7abb2; }
.rate-score small { font-size: 11.5px; color: var(--muted); }
.rate-stars { display: inline-flex; gap: 2px; font-size: 13px; }
.rate-stars i { font-style: normal; color: #d6d8dc; }
.rate-stars i.on { color: var(--ink); }
.rate-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.rate-bars li { display: grid; grid-template-columns: 12px minmax(0, 1fr) 26px; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.rate-bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.rate-bar i { display: block; height: 100%; background: var(--ink); }
.rate-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.rate-facts > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.rate-facts > div:last-child { border-right: 0; }
.rate-facts b { display: block; font-size: 15px; font-weight: 700; }
.rate-facts small { display: block; font-size: 11px; color: var(--muted); }
.rate-note { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.55; color: var(--muted); }
@media (max-width: 720px) {
  .rate { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .rate-facts { grid-template-columns: minmax(0, 1fr); }
  .rate-facts > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .rate-facts > div:last-child { border-bottom: 0; }
  .rate-note { padding: 12px 14px 14px; }
}
@media (max-width: 720px) {
  .ag-head { padding: 14px; }
  .ag-head-r { margin-left: 0; width: 100%; justify-content: space-between; }
  .ag-grid { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 4px; }
  .ag-foot { flex-wrap: wrap; padding: 10px 14px 14px; }
  .ag-foot .btn { width: 100%; }
}
.team-hint-box { padding: 12px 16px; border-top: 1px solid var(--line); }
.team-invites { border-top: 1px solid var(--line); }
.team-invites-title { margin: 0; padding: 10px 16px 0; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #8b9099; }
.team-invite { flex-wrap: wrap; row-gap: 6px; }
.team-invite .mini-btn { flex: none; }
.team-invite.is-expired b { color: var(--muted); }
.team-invites-empty { margin: 0; padding: 12px 16px; font-size: 11.5px; color: var(--muted); }
.form-status { margin: 0; font-size: 11.5px; color: var(--muted); }
.form-status.is-error { color: #b42318; }
.tbl-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.tbl-sum b { color: var(--ink); font-weight: 600; }
.tbl-sum .num { color: var(--ink); font-weight: 600; white-space: nowrap; }
.panel-table .cell-actions .mini-btn { padding: 5px 10px; }
.panel-table td.cell-date { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.panel-table td.cell-money { white-space: nowrap; }
.panel-table thead th, .panel-table tbody td { padding-left: 12px; padding-right: 12px; }
.panel-table .chip { padding: 3px 7px; font-size: 11px; }

/* Telefon: red je kartica — naziv, pa oznaka (ili cijena) i datum, „Otvori“ desno. */
@media (max-width: 620px) {
  .panel-table { overflow: visible; }
  .panel-table table { display: block; min-width: 0; }
  .panel-table thead { display: none; }
  .panel-table tbody { display: block; }
  .panel-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  .panel-table tr:last-child { border-bottom: 0; }
  .panel-table tr:hover { background: transparent; }
  .panel-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .panel-table td.name { grid-column: 1 / -1; grid-row: 1; }
  .panel-table td.cell-chip, .panel-table td.cell-money { grid-column: 1; grid-row: 2; }
  .panel-table td.cell-date { grid-column: 2; grid-row: 2; justify-self: end; }
  .panel-table td.cell-actions { grid-column: 1 / -1; grid-row: 3; justify-self: end; }

}

/* Detalj iz kartice: isti list u modalu, bez skrolovanja cijelog panela. */
.detail-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 4px 0 14px; }
.detail-kv small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.detail-kv b { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.detail-text { font-size: 12.5px; line-height: 1.6; color: var(--ink); margin: 0 0 14px; white-space: pre-wrap; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 11px; color: var(--muted); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  min-width: 0;
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.card-h h2 { font-size: 14px; font-weight: 600; letter-spacing: -.1px; }
.card-h small { font-size: 11px; color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
.kpi { padding: 14px 16px 15px; border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi small { display: block; font-size: 11px; color: var(--muted); }
.kpi strong { display: block; margin-top: 6px; font-size: 24px; font-weight: 600; letter-spacing: -.7px; }
.kpi .delta { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.kpi .delta.up { color: var(--up); font-weight: 600; }

/* ---------- Analitika ---------- */
.an-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.an-head .note { font-size: 11px; color: var(--muted); }
.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.an-kpi { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 13px 15px 11px; min-width: 0; }
.an-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.an-kpi small { display: block; font-size: 11px; color: var(--muted); }
.an-kpi strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -.6px; white-space: nowrap; }
.an-kpi .spark { width: 76px; height: 32px; flex: none; }
.an-kpi-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 7px; font-size: 11px; color: var(--muted); }
.an-kpi-foot a { color: var(--ink); font-weight: 600; }
.an-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.an-mt { margin-top: 12px; }
.an-legend { display: flex; gap: 12px; padding: 9px 16px 0; font-size: 11px; color: var(--muted); }
.an-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--ink); }
.an-legend i.prev { background: #b8bcc2; }
.an-svg { padding: 4px 10px 10px; }
.an-empty { margin: 8px; padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; font-size: 12px; color: var(--muted); }
.an-svg-el { width: 100%; height: auto; display: block; }
.an-team-row { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.an-team-row:last-child { border-bottom: 0; }
.an-team-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.an-team-top b { margin-left: auto; font-variant-numeric: tabular-nums; }
.an-team-top .avatar { width: 22px; height: 22px; font-size: 10px; }
.an-track { height: 3px; background: var(--line); margin-top: 7px; }
.an-track i { display: block; height: 100%; background: var(--ink); }
.an-team-sub { margin-top: 5px; font-size: 11px; color: var(--muted); }
@media (max-width: 1000px) {
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-charts { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .an-kpis { grid-template-columns: 1fr; }
}

/* ---------- Tabela ---------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 660px; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #8b9099;
  background: #fafafa;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead th:first-child { border-top-left-radius: var(--r); }
thead th:last-child { border-top-right-radius: var(--r); }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #fafafa; }
.r { text-align: right; }
td.name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
td.name small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.name { font-weight: 500; }
td.thumb { width: 96px; padding-right: 0; }
.tbl-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfbfc, #f3f4f5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #9aa0a8;
}
.tbl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
tbody tr:hover .tbl-thumb { border-color: #d6d8dc; }
td.price { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
td.views-cell { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* Tabela u kartici panela: bez vodoravnog skrolanja i bez kolone pregleda. */
table.tbl-card { min-width: 0; }
.tbl-card thead th, .tbl-card tbody td { padding-left: 12px; padding-right: 12px; }
.tbl-card td.thumb { width: 72px; }
.tbl-card .tbl-thumb { width: 52px; height: 38px; border-radius: 5px; }
.tbl-card td.name { font-size: 13px; }
.tbl-card td.name small { font-size: 11px; }
.tbl-card td.price { font-size: 13px; }
.tbl-card .chip { padding: 3px 7px; font-size: 11px; }
.tbl-card .tbl-actions .mini-btn { padding: 4px 8px; font-size: 11px; }
td.views-cell b { display: inline-block; margin-right: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 3px 7px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.chip.live::before { background: var(--up); }
.chip.st-live { background: #f2f8f4; border-color: #dbeade; color: #15803d; font-weight: 600; }
.chip.st-live::before { background: #15803d; }
.chip.st-closed { background: var(--soft); border-color: #e0e1e4; color: var(--ink); font-weight: 600; }
.chip.st-closed::before { background: var(--ink); }
.chip.st-off { color: var(--muted); }
.chip.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.dark::before { background: #fff; }
.mini-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
}
.mini-btn:hover { border-color: #c9cbcf; }
.mini-btn[disabled] { opacity: .4; cursor: default; }

/* ---------- Liste ---------- */
.rowline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.rowline:last-child { border-bottom: 0; }
.rowline small { display: block; font-size: 11px; color: var(--muted); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.skeleton { padding: 30px 16px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Panel bar ---------- */
.panelbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panelbar .note { font-size: 11px; color: var(--muted); }
.panelbar .mini-btn { margin-left: auto; }

/* ---------- Poruke ---------- */
.msg {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  height: calc(100vh - 152px);
  min-height: 520px;
}
.threads { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.threads-h { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.tlist { overflow-y: auto; }
.thread {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 11px 12px;
}
.thread:hover { background: #fafafa; }
.thread.on { background: var(--soft); }
.thread .who { min-width: 0; }
.thread b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.thread time { font-size: 10px; color: var(--muted); }
.thread .unread { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin: 5px 0 0 auto; }

.conv { display: flex; flex-direction: column; min-height: 0; }
/* Nazad na listu razgovora — postoji samo u prikazu na telefonu. */
.conv-back { display: none; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.conv-h { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.conv-h b { display: block; font-size: 13px; font-weight: 600; }
.conv-h small { display: block; font-size: 11px; color: var(--muted); }
.conv-h .act { margin-left: auto; display: flex; gap: 6px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.bubble {
  max-width: 74%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 11px;
  font-size: 13px;
  background: #fff;
}
.bubble.me { align-self: flex-end; background: var(--ink); border-color: var(--ink); color: #fff; }
.bubble time { display: block; margin-top: 4px; font-size: 10px; opacity: .55; text-align: right; }
.bubble-who { display: block; font-size: 11px; font-weight: 600; opacity: .62; margin-bottom: 3px; }
.msgs.tall { min-height: 340px; max-height: 58vh; }
.day { align-self: center; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 4px 0; }
.composer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.composer input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 10px;
  font-size: 13px;
}
.composer input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- Obavijesti ---------- */
.notif { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif:hover { background: #fafafa; }
.notif.unread { background: #fcfcfc; }
.notif .ico {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  flex: none;
}
.notif .ico svg { width: 14px; height: 14px; }
.notif .body { min-width: 0; }
.notif b { display: block; font-size: 13px; font-weight: 600; }
.notif p { font-size: 12px; color: var(--text); margin-top: 1px; }
.notif time { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.group-h {
  padding: 12px 16px 6px;
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

/* ---------- Editor panela ---------- */
.editor {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 356px;
  z-index: 30;
  background: #fff;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.ed-note { padding: 12px 16px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.editor-body { flex: 1; overflow-y: auto; }
.ed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ed-row .nm { flex: 1; min-width: 0; }
.ed-row.off .nm { color: var(--muted); text-decoration: line-through; }
.ed-row .ord { display: flex; gap: 4px; }
.ed-row .ord button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r);
  font-size: 11px;
  line-height: 1;
}
.ed-row .ord button[disabled] { opacity: .35; cursor: default; }
.ed-sec { padding: 14px 16px 16px; font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.ed-sec .seg { display: flex; margin-top: 8px; }
.ed-sec .seg button { flex: 1; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.editor-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.editor-foot .btn { flex: 1; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 13, 15, .32);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.modal-card .card-h { position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-body { padding: 16px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Kompaktna gustoća ---------- */
.grid.compact .kpi { padding: 10px 14px 11px; }
.grid.compact .kpi strong { font-size: 21px; margin-top: 4px; }
.grid.compact .card-h { padding: 9px 14px; }
.grid.compact th, .grid.compact td { padding: 7px 14px; }
.grid.compact .rowline { padding-top: 8px; padding-bottom: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 8px);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  padding: 9px 14px;
  border-radius: var(--r);
  opacity: 0;
  pointer-events: none;
  transition: .18s;
  z-index: 60;
  max-width: 90vw;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responzivno ---------- */
@media (max-width: 1120px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(3), .kpi:nth-child(4) { border-top: 1px solid var(--line); }
  .grid > .w-side { grid-column: span 3; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    overflow: hidden;
  }
  .nav { flex-direction: row; overflow-x: auto; margin-top: 10px; gap: 2px; scrollbar-width: none; max-width: 100%; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 7px 9px; font-size: 12px; }
  .nav svg { display: none; }
  .nav .sep { display: none; }
  .account { display: none; }
  .top { padding: 11px 14px; gap: 10px; }
  .top > div:first-child { min-width: 0; }
  .top h1, .top .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .btn { padding: 7px 10px; font-size: 11.5px; white-space: nowrap; }
  .content { padding: 14px 14px 32px; }
  .grid { grid-template-columns: 1fr; }
  .grid > .w-full, .grid > .w-wide, .grid > .w-side { grid-column: span 1; }
  /* Telefon: lista razgovora i razgovor se smjenjuju preko cijele širine,
     umjesto da prazan panel stoji ispod liste i troši pola ekrana. */
  .msg { display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 420px; }
  .msg > * { min-height: 0; }
  .threads { max-height: none; flex: 1; min-height: 0; border-right: 0; border-bottom: 0; }
  .conv { min-height: 0; flex: 1; }
  .msg:not(.has-conv) .conv { display: none; }
  .msg.has-conv .threads { display: none; }
  .msg.has-conv .conv-back { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 720px) {
  .editor { width: 100%; }
  .panelbar .note { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .kpi { border-right: 0; border-top: 1px solid var(--line); }
  .kpi:first-child { border-top: 0; }
  .form-2 { grid-template-columns: 1fr; }
  .bubble { max-width: 86%; }
  .msg { height: calc(100dvh - 250px); }
}

/* Grid djeca po defaultu ne mogu biti uža od svog sadržaja; bez ovoga lista
   razgovora izlazi iz okvira na uskim ekranima i odsijeca vrijeme poruke. */
.msg > * { min-width: 0; }



.mini-select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  font: inherit;
  font-size: 11.5px;
  padding: 5px 6px;
  color: var(--ink);
  max-width: 150px;
}

.tbl-actions { display: flex; gap: 6px; justify-content: flex-end; opacity: .8; transition: opacity .12s ease; }
tbody tr:hover .tbl-actions { opacity: 1; }
.tbl-actions .mini-btn { white-space: nowrap; padding: 5px 10px; color: var(--text); }
.tbl-actions .mini-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Filteri oglasa ---------- */
.list-filters {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.list-filters input,
.list-filters select {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 8px;
  font-size: 12px;
  background: #fff;
  min-width: 0;
}
.list-filters input { flex: 1 1 220px; }
.list-filters select { flex: 0 0 auto; }
.list-filters input:focus,
.list-filters select:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ---------- Fotografije u modalu ---------- */
.lf-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.lf-photos img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.lf-photos .hint { font-size: 11px; color: var(--muted); }
.lf-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lf-upload input[type="file"] { font-size: 11px; max-width: 100%; }
.lf-close { display: flex; gap: 8px; flex-wrap: wrap; }
.lf-close input { flex: 1 1 160px; border: 1px solid var(--line); border-radius: var(--r); padding: 7px 8px; font-size: 12px; min-width: 0; }
.lf-close input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ---------- Mobilni prikaz (telefon na desktopu) ---------- */
.phone {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 13, 15, .55);
}
.phone-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 100%;
}
.phone-h { display: flex; align-items: baseline; gap: 10px; }
.phone-h b { font-size: 13px; font-weight: 600; }
.phone-h small { font-size: 11px; color: var(--muted); }
.phone-h .mini-btn { margin-left: auto; align-self: center; }
.phone-frame {
  width: 390px;
  max-width: calc(100vw - 60px);
  height: min(844px, calc(100vh - 150px));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.phone-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.phone-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phone-foot span { font-size: 11px; color: var(--muted); }
.phone-foot .mini-btn { margin-left: auto; }

/* ---------- Paket, uplata i fakture ---------- */
.plan-cur { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plan-cur b { font-size: 16px; font-weight: 600; display: block; }
.plan-cur small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 48ch; }
.plan-meta { font-size: 11.5px; color: var(--muted); margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.plan-price { text-align: right; }
.plan-price strong { font-size: 22px; font-weight: 600; display: block; }
.plan-price small { font-size: 11px; color: var(--muted); }
.plan-cycle { display: inline-flex; gap: 4px; margin-top: 12px; width: 100%; }
.plan-cycle button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font: inherit; font-size: 11px; color: var(--text); cursor: pointer; }
.plan-cycle button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.plan-status { padding: 12px 18px; font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-actions { display: flex; align-items: center; gap: 10px; padding: 0 18px 4px; flex-wrap: wrap; }
.plan-hint { font-size: 11px; color: var(--muted); padding: 10px 18px 16px; margin: 0; line-height: 1.55; }
.doc { border-top: 1px solid var(--line); padding: 14px 18px; }
.doc:first-of-type { border-top: 0; }
.doc-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc-h b { font-size: 13px; font-weight: 600; }
.doc-h small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.doc-h strong { font-size: 15px; font-weight: 600; white-space: nowrap; }
.bank { margin: 12px 0 4px; border: 1px solid var(--line); border-radius: var(--r); }
.bank-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 12px; }
.bank-row:first-child { border-top: 0; }
.bank-row span { color: var(--muted); min-width: 96px; }
.bank-row b { font-weight: 500; word-break: break-all; }
.bank-row .mini-btn { margin-left: auto; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:first-of-type { border-top: 0; }
.doc-row > div { flex: 1 1 200px; }
.doc-row b { font-size: 12.5px; font-weight: 600; }
.doc-row small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.doc-row .mini-btn { margin-left: auto; }
@media (max-width: 720px) {
  .plan-price { text-align: left; }
  .bank-row span { min-width: 78px; }
  .doc-row .mini-btn { margin-left: 0; }
}

/* Na telefonu je važnije da akcije budu vidljive bez vodoravnog skrolanja
   nego broj pregleda, pa se ta kolona sklanja. */
@media (max-width: 720px) {
  table { min-width: 0; }
  .hide-sm { display: none; }
  th, td { padding: 8px 10px; }
  .tbl-actions { flex-direction: column; align-items: flex-end; gap: 4px; }
  .tbl-actions .mini-btn { padding: 4px 7px; font-size: 11px; }
  /* Navigacija na telefonu se prelama u dva reda da nijedna stavka ne bude odsječena. */
  .nav { flex-wrap: wrap; gap: 4px 10px; }
  /* Zaglavlje razgovora na telefonu: akcije idu u drugi red, preko cijele širine. */
  .conv-h { flex-wrap: wrap; }
  .conv-h .act { margin-left: 0; width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .conv-h .mini-select { flex: 1 1 auto; max-width: 100%; }
  .list-filters { padding: 8px 10px; }
  .list-filters input { flex: 1 1 100%; }
  #deviceBtn { display: none; }
}

/* Horizon: aktivnost oglasa (dani na portalu, pregledi danas) i isticanje */
td.live-cell { white-space: nowrap; font-size: 11.5px; color: var(--muted); }
td.live-cell b { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
td.live-cell small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.boost-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--ink); border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.mini-btn.is-boost { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.mini-btn.is-boost:hover { background: var(--ink); color: #fff; }
.boost-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.boost-day { display: grid; gap: 3px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.boost-day:hover:not(:disabled) { border-color: var(--ink); }
.boost-day:disabled { opacity: .55; cursor: default; }
.boost-day b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.boost-day small { font-size: 11px; color: var(--muted); }
.boost-note { margin: 0 0 12px; font-size: 12px; line-height: 1.55; color: var(--muted); }
/* ---------- Telefon: zaglavlje, navigacija i tabele ---------- */
@media (max-width: 720px) {
  body { font-size: 13px; }
  .side { padding: 10px 12px 12px; }
  .nav { flex-wrap: wrap; overflow: visible; gap: 2px 4px; margin-top: 8px; }
  .nav a { padding: 6px 8px; font-size: 11.5px; border-radius: 3px; }
  /* Naslov lijevo, akcije desno — jedan red. Sekundarni linkovi se sklanjaju
     da „Sačuvano“, „Novi oglas“ i avatar ostanu uz naslov bez prelamanja. */
  .top { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 10px 12px; }
  .top > div:first-child { flex: 1 1 auto; min-width: 0; }
  .top h1 { font-size: 16px; letter-spacing: -.2px; }
  .top .sub { font-size: 11px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-r { flex: 0 0 auto; margin-left: auto; gap: 6px; }
  .top-r .mini-btn:not([hidden]) { display: flex; padding: 6px 8px; min-height: 36px; font-size: 11px; }
  .top-r [hidden] { display: none; }
  /* Sekundarni linkovi se sklanjaju poslije pravila za prikaz, da ne troše
     širinu naslova na telefonu. */
  .top-r > a.mini-btn[href="monly-pocetna.html"], #publicProfileLink, #deviceBtn { display: none; }
  .top .btn { padding: 6px 10px; min-height: 36px; font-size: 11.5px; white-space: nowrap; }
  .top .avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 10px; }
  .content { padding: 12px 12px 28px; }
  .panelbar { gap: 6px 8px; }
  .panelbar .note { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { border-top: 0; border-right: 1px solid var(--line); padding: 11px 12px 12px; }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi strong { font-size: 20px; margin-top: 4px; }
  .kpi small { font-size: 11px; }
  .card-h { padding: 10px 12px; }
  .card-h h2 { font-size: 13px; }
  .an-kpis { grid-template-columns: 1fr 1fr; }
  .an-kpi { padding: 11px 12px 9px; }
  .an-kpi strong { font-size: 19px; }
  .an-kpi .spark { width: 56px; height: 26px; }
  .form-2 { grid-template-columns: 1fr; }
  .rowline { padding: 10px 12px; gap: 8px; }
}

/* Tabela oglasa na telefonu: svaki oglas je kartica, ništa se ne odsijeca. */
@media (max-width: 620px) {
  #listingsBody .table-scroll { overflow: visible; }
  #listingsBody table { display: block; min-width: 0; }
  #listingsBody thead { display: none; }
  #listingsBody tbody { display: block; }
  #listingsBody tr {
    display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 3px 10px;
    padding: 12px; border-bottom: 1px solid var(--line);
  }
  #listingsBody tr:last-child { border-bottom: 0; }
  #listingsBody td { display: block; min-width: 0; border: 0; padding: 0; }
  #listingsBody td.thumb { grid-row: 1 / 4; width: auto; }
  #listingsBody .tbl-thumb { width: 62px; height: 46px; }
  #listingsBody td.name { font-size: 13px; line-height: 1.35; }
  #listingsBody td.name small { margin-top: 2px; font-size: 11px; }
  #listingsBody td.price { text-align: left; font-size: 13px; }
  #listingsBody td:nth-of-type(4) { justify-self: start; }
  #listingsBody td:last-child { grid-column: 1 / -1; margin-top: 8px; }
  #listingsBody .tbl-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 6px; opacity: 1; }
  #listingsBody .tbl-actions .mini-btn { padding: 5px 9px; font-size: 11px; }
  #listingsBody .chip { font-size: 11px; }
  #listingsBody .live-cell { display: none; }
}

/* Telefon: panel ne razvlači kolone do pune visine ekrana, pa sadržaj kreće odmah. */
@media (max-width: 980px) {
  #appView { align-content: start; grid-template-rows: auto auto; }
  .role-pill { margin-top: 4px; }
  .side .brand { margin-bottom: 2px; }
}

/* Sve tabele u karticama panela na telefonu: svaki red je kartica. */
@media (max-width: 620px) {
  .card .table-scroll { overflow: visible; }
  .card .table-scroll table { display: block; min-width: 0; }
  .card .table-scroll thead { display: none; }
  .card .table-scroll tbody { display: block; }
  .card .table-scroll tr {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px;
    padding: 12px; border-bottom: 1px solid var(--line);
  }
  .card .table-scroll tr:last-child { border-bottom: 0; }
  .card .table-scroll td { display: block; min-width: 0; border: 0; padding: 0; text-align: left; }
  .card .table-scroll td.thumb { width: auto; padding: 0 0 6px; }
  .card .table-scroll .tbl-thumb { width: 52px; height: 38px; }
  .card .table-scroll td.price { text-align: left; }
  .card .table-scroll .tbl-actions { justify-content: flex-start; flex-wrap: wrap; opacity: 1; }
}

/* Akcije u kartici oglasa ostaju u jednom redu i na telefonu. */
@media (max-width: 620px) {
  .card .table-scroll .tbl-actions { flex-direction: row; align-items: center; }
}

/* ---------- Prijava: pamćenje e-maila, prikaz lozinke, vrsta računa ---------- */
.pw { position: relative; display: block; }
.pw input { padding-right: 70px; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; padding: 5px 8px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.pw-eye:hover { color: var(--ink); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; flex-wrap: wrap; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); cursor: pointer; }
.check-inline input { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }
.auth-note { margin-top: 14px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.modal-note { margin: 0 0 4px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.acct {
  position: relative; display: grid; gap: 2px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
}
.acct input { position: absolute; opacity: 0; pointer-events: none; }
.acct b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.acct small { font-size: 11px; line-height: 1.35; color: var(--muted); }
.acct.is-on { border-color: var(--ink); background: var(--soft); }

/* ---------- Brojevi računa u jednom redu ---------- */
.counts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 12px;
}
.count { padding: 11px 14px 12px; border-right: 1px solid var(--line); min-width: 0; }
.count:last-of-type { border-right: 0; }
.count small { display: block; font-size: 11px; color: var(--muted); }
.count b { display: block; margin-top: 2px; font-size: 19px; font-weight: 600; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.count span { display: block; margin-top: 1px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-line { grid-column: 1 / -1; margin: 0; padding: 8px 14px 9px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.45; color: var(--muted); }

@media (max-width: 720px) {
  .auth-row { justify-content: flex-start; }
  .acct-grid { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .count { padding: 8px 8px 9px; }
  .count small { font-size: 10px; }
  .count b { font-size: 15px; }
  .count span { display: none; }
  .acct-line { font-size: 11px; padding: 7px 10px; }
}

/* Pregled dokumenta prije štampe: isti list na papiru, Monly okvir bez sjena. */
body.is-invoice-preview #printSheet { background: rgba(12, 13, 15, .55); }
.inv-preview-bar button { border-radius: 4px; color: var(--ink); font: 600 11px 'Inter Tight', system-ui, sans-serif; letter-spacing: .02em; padding: 8px 14px; }
.inv-preview-bar button:hover, .inv-preview-bar button:focus-visible { background: var(--soft); }
.inv-preview-bar button.is-secondary { color: #fff; border-color: rgba(255, 255, 255, .65); }
.inv-preview-bar button.is-secondary:hover { background: rgba(255, 255, 255, .12); }
.inv-preview-card { border-radius: 4px; border: 1px solid var(--line); box-shadow: none; }

/* ---------- Projekti (novogradnja firme) ---------- */
.proj-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.proj-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-pick {
  display: block;
  flex: 1 1 208px;
  min-width: 190px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 9px 10px;
}
.proj-pick:hover { background: var(--soft); }
.proj-pick.is-on { border-color: var(--ink); background: var(--soft); }
.proj-pick b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.1px; }
.proj-pick small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.proj-pick span { display: block; font-size: 11.5px; color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.proj-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.proj-subh { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.proj-status { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.proj-status.is-error { color: var(--down); }
.proj-status.is-ok { color: var(--up); }
.units-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 620px; }
.units-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 0 6px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.units-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.units-table tr:last-child td { border-bottom: 0; }
.units-table .u-in {
  width: 100%;
  min-width: 54px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 4px 6px;
  font-size: 12px;
}
.units-table .u-in:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.units-table select.u-in { min-width: 96px; }
.units-table [data-price] { white-space: nowrap; font-size: 12px; }
@media (max-width: 640px) {
  .proj-pick { flex: 1 1 100%; }
  .units-table { min-width: 560px; }
}

/* ---------- Telefon: zone dodira najmanje 36 px ---------- */
@media (max-width: 720px) {
  .nav a, .top .btn, .mini-btn, .btn { min-height: 44px; display: inline-flex; align-items: center; }
  .nav a { padding: 7px 10px; }
  .mini-btn, .btn { padding: 7px 10px; }
  .tbl-actions .mini-btn, #listingsBody .tbl-actions .mini-btn { min-height: 44px; padding: 7px 9px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; }
}

/* Telefon: i sitne tekstualne radnje u prijavi imaju punu zonu dodira. */
@media (max-width: 720px) {
  .linkbtn, .pw-eye { min-height: 44px; display: inline-flex; align-items: center; }
  .check-inline { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Telefon: logo u bočnoj traci panela je link — puna zona dodira. */
@media (max-width: 720px) {
  .side .brand { min-height: 36px; display: inline-flex; align-items: center; }
}

/* ---------- Telefon: oglasi u panelu su kompaktne kartice, ne rasklopljena tabela ---------- */
@media (max-width: 620px) {
  #panel .table-scroll, #listingsBody .table-scroll { overflow: visible; }
  #panel table.tbl-card, #listingsBody table { display: block; min-width: 0; }
  #panel table.tbl-card thead, #listingsBody thead { display: none; }
  #panel table.tbl-card tbody, #listingsBody tbody { display: block; }
  #panel table.tbl-card tr,
  #listingsBody tr {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas: 'thumb name price' 'thumb status acts';
    align-items: center;
    column-gap: 10px;
    row-gap: 5px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }
  #panel table.tbl-card tr:last-child, #listingsBody tr:last-child { border-bottom: 0; }
  #panel table.tbl-card td, #listingsBody td { display: block; min-width: 0; border: 0; padding: 0; }
  #panel table.tbl-card td.thumb, #listingsBody td.thumb { grid-area: thumb; width: auto; align-self: center; }
  #panel table.tbl-card .tbl-thumb, #listingsBody .tbl-thumb { width: 48px; height: 40px; border-radius: 5px; font-size: 10px; }
  #panel table.tbl-card td.name, #listingsBody td.name { grid-area: name; font-size: 13px; line-height: 1.32; }
  #panel table.tbl-card td.name small, #listingsBody td.name small { margin-top: 2px; font-size: 11px; line-height: 1.35; }
  #panel table.tbl-card td.price, #listingsBody td.price { grid-area: price; justify-self: end; text-align: right; font-size: 13px; }
  #panel table.tbl-card td:has(.chip), #listingsBody td:has(.chip) { grid-area: status; justify-self: start; }
  #panel table.tbl-card td:has(.tbl-actions), #listingsBody td:has(.tbl-actions) { grid-area: acts; justify-self: end; grid-column: auto; margin-top: 0; }
  #panel table.tbl-card td:last-child { grid-area: acts; justify-self: end; margin-top: 0; }
  #panel table.tbl-card .tbl-actions, #listingsBody .tbl-actions { flex-wrap: nowrap; gap: 5px; justify-content: flex-end; opacity: 1; }
  #panel table.tbl-card .chip, #listingsBody .chip { padding: 3px 7px; font-size: 11px; }
  #listingsBody .live-cell { display: none; }
}

/* ---------- Desktop: kartica sa oglasima ide do kraja reda ---------- */
@media (min-width: 981px) {
  .grid > .w-full:has(.tbl-card) { grid-column: span 3; }
}

/* Telefon: red oglasa je fleksibilna kartica — logo i opis u jednom redu, status pa dugmad desno. */
@media (max-width: 620px) {
  #panel table.tbl-card tr, #listingsBody tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; }
  #panel table.tbl-card td.thumb, #listingsBody td.thumb { flex: 0 0 44px; align-self: center; }
  #panel table.tbl-card td.name, #listingsBody td.name { flex: 1 1 140px; min-width: 0; }
  #panel table.tbl-card td.price, #listingsBody td.price { flex: 0 0 auto; margin-left: auto; }
  #panel table.tbl-card td:has(.chip), #listingsBody td:has(.chip) { flex: 0 0 auto; }
  #panel table.tbl-card td:has(.tbl-actions), #listingsBody td:has(.tbl-actions) { flex: 0 0 auto; margin-left: auto; }
  #listingsBody td:last-child { margin-left: auto; grid-column: auto; }
  #panel table.tbl-card .tbl-thumb, #listingsBody .tbl-thumb { width: 44px; height: 40px; }
  #panel table.tbl-card .tbl-actions, #listingsBody .tbl-actions { flex-wrap: nowrap; gap: 5px; justify-content: flex-end; opacity: 1; }
  #panel table.tbl-card .tbl-actions .mini-btn, #listingsBody .tbl-actions .mini-btn { padding: 5px 8px; font-size: 11px; }
  #panel .tbl-sum { flex-wrap: wrap; gap: 4px 12px; padding: 10px 12px; }
}

/* ---------- Telefon: Prodaje, Kupci, Obavijesti i Poruke kao uredne kartice ---------- */
@media (max-width: 620px) {
  #panel .rowline { padding: 12px; gap: 10px; align-items: center; min-height: 52px; }
  #panel .rowline > div { min-width: 0; }
  #panel .rowline b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
  #panel .rowline small { margin-top: 2px; font-size: 11px; line-height: 1.35; }
  #panel .rowline > .num, #panel .rowline > span:last-child { flex: none; white-space: nowrap; }
  #panel .rowline .chip { flex: none; }
  #panel .list-filters { flex-wrap: wrap; gap: 8px; }
  #panel .list-filters input { flex: 1 1 100%; }
  #panel .list-filters select { flex: 1 1 auto; min-width: 0; }
  #panel .thread { min-height: 56px; padding: 10px 12px; gap: 10px; }
  #panel .thread .avatar { flex: none; }
  #panel .thread .who { min-width: 0; }
  #panel .thread .who b, #panel .thread .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Tablet: kartice pune širine ne ostavljaju praznu kolonu ---------- */
@media (max-width: 1180px) {
  #panel.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .grid > .w-wide, .grid > .w-side { grid-column: span 3; }
  #panel.four { grid-template-columns: 1fr; }
  #panel.four > .w-full, #panel.four > .w-wide, #panel.four > .w-side, #panel.four > .w-quarter { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .detail-kv { grid-template-columns: 1fr; }
  #panel.four .rowline > .mini-btn { padding: 8px 12px; }
}

/* ---------- Tablet i telefon: iste zone dodira kao na telefonu ---------- */
@media (max-width: 980px) {
  .nav a, .top .btn, .mini-btn, .btn, .side .brand { min-height: 36px; display: inline-flex; align-items: center; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 36px; }
  .card-h .linkbtn, #panel .linkbtn { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: flex-end; }
}

/* Telefon: poruke bez razgovora ne ostavljaju prazan ekran od 440 px */
@media (max-width: 620px) {
  .msg .conv { min-height: 200px; }
  .msg .threads { max-height: none; }
}

/* ---------- Agenti agencije: broj prodaja desno, ostatak statistike u drugom redu ---------- */
#panel .agm { align-items: center; }
#panel .agm-num { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; }
#panel .agm-num b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#panel .agm-num small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#panel .agm b .chip { margin-left: 6px; vertical-align: 1px; }
#panel .agm-rank { color: var(--muted); font-weight: 500; margin-right: 3px; font-variant-numeric: tabular-nums; }

/* v86 — iskorištenost paketa: brojka, traka i „koliko još ostaje“ */
.quota-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.quota { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 13px; background: #fff; }
.quota-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; color: var(--muted); }
.quota-h small { font-size: 10px; font-weight: 500; }
.quota-num { display: flex; align-items: baseline; gap: 4px; margin: 6px 0 8px; }
.quota-num b { font-size: 22px; line-height: 1; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.quota-num span { font-size: 11.5px; color: var(--muted); }
.quota-bar { height: 4px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.quota.is-warn .quota-bar i { background: #b45309; }
.quota.is-full .quota-bar i { background: #b91c1c; }
.quota.is-full .quota-h small { color: #b91c1c; }
.quota-note { display: block; margin-top: 7px; font-size: 10.5px; line-height: 1.35; color: var(--muted); }
@media (max-width: 520px) { .quota-grid { grid-template-columns: 1fr 1fr; } }

/* v87 — „Sačuvano“ ostaje vidljivo i u mobilnom prikazu panela (mini-btn se tamo skriva). */
@media (max-width: 720px) {
  .top-r #panelSavedLink { display: inline-flex; padding: 6px 9px; font-size: 11px; gap: 4px; }
  .top-r #panelSavedLink .saved-label { display: inline; }
}

/* v89 — „Danas“: akcioni centar na vrhu Pregleda. Zadatak nestaje kad se
   riješi; brojevi računa ostaju ispod kao kontekst, bez nove liste za čišćenje. */
.today { margin: 0 0 16px; border: 1px solid var(--line, #e6e7e9); border-radius: var(--r, 4px); background: #fff; overflow: hidden; }
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line, #e6e7e9); }
.today-head h2 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted, #6b7079); }
.today-head small { font-size: 11.5px; color: var(--muted, #6b7079); }
.today-list { display: grid; }
.today-task { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line, #e6e7e9); color: inherit; text-decoration: none; transition: background .12s; }
.today-task:last-child { border-bottom: 0; }
.today-task:hover { background: #fafafa; }
.today-task:focus-visible { outline: 2px solid var(--ink, #0c0d0f); outline-offset: -2px; }
.today-tag { flex: none; min-width: 72px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #6b7079); }
.today-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.today-body b { font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--ink, #0c0d0f); }
.today-body small { font-size: 11.5px; color: var(--muted, #6b7079); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-go { flex: none; font-size: 11.5px; font-weight: 600; color: var(--ink, #0c0d0f); }
@media (max-width: 720px) {
  .today-task { flex-wrap: wrap; gap: 5px 10px; padding: 12px 14px; }
  .today-tag { min-width: 0; }
  .today-body { flex: 1 1 100%; order: 2; }
  .today-go { order: 3; margin-left: auto; }
  .today-head { padding: 12px 14px; }
}

/* v90 — kvota paketa u Pregledu i kebab akcije u tabelama. */
.panel-quota { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:0 0 16px; padding:11px 14px; border:1px solid var(--line); border-radius:4px; background:#fff; }
.panel-quota[hidden] { display:none; }
.panel-quota .pq-id b { display:block; font-size:12.5px; color:var(--ink); }
.panel-quota .pq-id small { font-size:11px; color:var(--muted); }
.panel-quota .pq-bar { flex:1; min-width:120px; height:6px; border-radius:3px; background:var(--soft); overflow:hidden; }
.panel-quota .pq-bar i { display:block; height:100%; background:var(--ink); }
.panel-quota .pq-num { font-size:11.5px; color:var(--muted); white-space:nowrap; }
.panel-quota .pq-num b { color:var(--ink); font-size:12.5px; }
.panel-quota a { font-size:11.5px; font-weight:600; color:var(--ink); text-decoration:none; border-bottom:1px solid var(--ink); white-space:nowrap; }
.row-actions { position:relative; display:inline-block; }
.row-menu { position:absolute; right:0; top:30px; z-index:6; width:172px; padding:5px; background:#fff; border:1px solid var(--line); border-radius:4px; text-align:left; }
.row-menu[hidden] { display:none; }
.row-menu a, .row-menu button { display:block; width:100%; text-align:left; padding:7px 8px; border:0; border-radius:3px; background:#fff; color:var(--text); font:inherit; font-size:12px; text-decoration:none; cursor:pointer; }
.row-menu a:hover, .row-menu button:hover { background:var(--soft); color:var(--ink); }
.row-menu-note { display:block; padding:7px 8px; font-size:11px; color:var(--muted); }
.tbl-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); font-size:11.5px; color:var(--muted); }
.row-menu.is-floating { position:fixed; right:auto; top:0; left:0; }

/* KPI kartice na telefonu: broj (npr. 430.000 KM) i mini-grafikon ne staju
   zajedno u dvije kolone, pa je grafikon izlazio 2px preko ivice i pravio
   horizontalni skrol. Grafikon se sklanja — isti podatak je u grafikonima ispod. */
@media (max-width: 480px) {
  .an-kpi .spark { display: none; }
  .an-kpi strong { font-size: 18px; }
}

/* Telefon: u zaglavlju panela ostaje opis taba, a ime računa se sklanja
   (vidi se u avataru) — podnaslov se više ne siječe na „… · Test M…“. */
@media (max-width: 720px) {
  .top .sub .sub-user { display: none; }
}
