/* =========================================================
   v7 — mobilni header, karusel firmi, nazad na vrh,
   ekrani (prezentacija), paneli (admin / geometar / korisnik)
   ========================================================= */

/* ---------- Mobilni header ---------- */
@media (max-width: 1140px) {
  .header-actions { margin-left: auto; }
}
@media (max-width: 860px) {
  .topbar { display: none; }
  .header-actions .user-only { gap: 6px !important; }
}

/* ---------- Usluge: velika ikonica u pozadini ---------- */
.svc { overflow: hidden; isolation: isolate; }
.svc svg.lucide.bg-ic { position: absolute; right: -28px; bottom: -34px; width: 170px; height: 170px; stroke-width: 1; color: #fff; opacity: 0; margin: 0; transform: scale(.7) rotate(-12deg); transition: opacity .35s, transform .45s cubic-bezier(.2,.8,.2,1); z-index: -1; pointer-events: none; }
.svc:hover svg.lucide.bg-ic { opacity: .13; transform: none; color: #fff; }

/* ---------- Karusel istaknutih firmi ---------- */
.fcar-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.fcar-ctrl { display: flex; gap: 8px; }
.fcar-ctrl button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: .2s; }
.fcar-ctrl button:hover { background: var(--bordo); border-color: var(--bordo); color: #fff; }
.fcar-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 6px; scrollbar-width: none; }
.fcar-track::-webkit-scrollbar { display: none; }
.fcard { flex: 0 0 calc((100% - 40px) / 3); scroll-snap-align: start; position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.fcard:hover { color: #fff; }
.fcard-img { position: absolute; inset: 0; background: center/cover; z-index: -2; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.fcard:hover .fcard-img { transform: scale(1.07); }
.fcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 14, 30,0) 25%, rgba(8, 14, 30,.55) 55%, rgba(10, 18, 40,.96) 100%); transition: background .3s; }
.fcard:hover::before { background: linear-gradient(180deg, rgba(20, 33, 61,.15) 0%, rgba(14, 24, 50,.7) 45%, rgba(10, 18, 40,.98) 100%); }
.fcard-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.fcard-logo { width: 58px; height: 58px; border-radius: 6px; background: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: var(--bordo); font-size: 15px; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.fcard-flag { background: var(--red); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; padding: 4px 9px; border-radius: 3px; }
.fcard-body { padding: 22px; }
.fcard h4 { font-size: 18px; margin: 0 0 6px; display: flex; gap: 6px; align-items: center; line-height: 1.25; }
.fcard h4 .verified svg.lucide { fill: #fff; stroke: var(--red); }
.fcard .meta-line { color: #c3cde0; }
.fcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fcard-tags span { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 3px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); }
.fcard-cta { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.18); font-weight: 700; font-size: 14px; max-height: 0; opacity: 0; overflow: hidden; transition: .35s; }
.fcard:hover .fcard-cta, .fcard:focus .fcard-cta { max-height: 60px; opacity: 1; }
.fcard-cta svg.lucide { transition: transform .3s; }
.fcard:hover .fcard-cta svg.lucide { transform: translateX(4px); }
.fcar-dots { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.fcar-dots button { width: 8px; height: 8px; border-radius: 8px; border: 0; background: var(--line-2); cursor: pointer; padding: 0; transition: .25s; }
.fcar-dots button.active { width: 28px; background: var(--red); }
@media (max-width: 1140px) { .fcard { flex-basis: calc((100% - 20px) / 2); } }
@media (max-width: 600px) { .fcard { flex-basis: 82%; aspect-ratio: 4/5; } .fcar-ctrl { display: none; } .fcard-cta { max-height: 60px; opacity: 1; } }

/* ---------- Nazad na vrh ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 1450; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--bordo); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(14px); transition: .3s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--red); }
.to-top svg.ring { position: absolute; inset: -4px; width: 60px; height: 60px; transform: rotate(-90deg); }
.to-top svg.ring circle { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 176; stroke-dashoffset: 176; transition: stroke-dashoffset .1s linear; }
@media (max-width: 860px) { .to-top { bottom: 92px; right: 14px; width: 46px; height: 46px; } .to-top svg.ring { width: 54px; height: 54px; } }

/* ---------- Ekrani (prezentacija prototipa) ---------- */
.screens-btn { position: fixed; left: 22px; bottom: 22px; z-index: 1460; height: 48px; padding: 0 18px; border-radius: 30px; border: 0; background: #0b1426; color: #fff; font: inherit; font-weight: 700; font-size: 13.5px; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; box-shadow: var(--shadow-lg); }
.screens-btn:hover { background: var(--red); }
.screens { position: fixed; left: 22px; bottom: 82px; z-index: 1460; width: min(560px, calc(100vw - 28px)); max-height: 70vh; overflow-y: auto; background: #fff; border-radius: 10px; box-shadow: 0 30px 80px rgba(8, 14, 30,.35); padding: 20px; display: none; }
.screens.open { display: block; }
.screens h5 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin: 14px 0 8px; }
.screens h5:first-of-type { margin-top: 0; }
.screens-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.screens-grid a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 5px; font-size: 13px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); }
.screens-grid a:hover, .screens-grid a.active { border-color: var(--red); color: var(--red); background: var(--brand-50); }
.screens-grid svg.lucide { width: 15px; height: 15px; color: var(--red); }
.screens-note { font-size: 12px; color: var(--muted); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
body.demo .demo-bar { display: none !important; }
@media (max-width: 860px) { .screens-btn { bottom: 92px; left: 14px; height: 44px; padding: 0 14px; } .screens { bottom: 146px; left: 14px; } .screens-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Paneli: mobilna navigacija ---------- */
.dash-mnav { display: none; }
@media (max-width: 860px) {
  .dash-mnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 6px; scrollbar-width: none; }
  .dash-mnav::-webkit-scrollbar { display: none; }
  .dash-mnav a { flex-shrink: 0; display: inline-flex; gap: 6px; align-items: center; padding: 9px 13px; border-radius: 30px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-2); }
  .dash-mnav a svg.lucide { width: 15px; height: 15px; }
  .dash-mnav a.active { background: var(--bordo); color: #fff; border-color: var(--bordo); }
}

/* ---------- Paneli: komponente ---------- */
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
.ph p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .input { height: 38px; width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .row { gap: 4px; }
.pager button { min-width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; font: inherit; font-weight: 700; }
.pager button.active { background: var(--bordo); color: #fff; border-color: var(--bordo); }
.tbl .cell-user { display: flex; gap: 10px; align-items: center; }
.tbl .cell-user b { display: block; }
.tbl input[type=checkbox] { accent-color: var(--red); width: 16px; height: 16px; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tbl .acts .icon-btn { width: 34px; height: 34px; }
.tbl .acts .icon-btn svg.lucide { width: 16px; height: 16px; }
.tbl tbody tr:hover { background: #f9fafc; }
.mini-thumb { width: 48px; height: 36px; border-radius: 4px; background: center/cover; flex-shrink: 0; }
.tabs-sm { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs-sm a { padding: 12px 12px; font-size: 13.5px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-sm a.active { color: var(--bordo); border-color: var(--red); }
.tabs-sm a span { font-family: var(--mono); font-size: 11px; background: var(--brand-50); color: var(--red); padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; font-size: 14.5px; }
.set-row span { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #cfd6e2; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch i::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--red); }
.switch input:checked + i::before { transform: translateX(18px); }
.mod-item { display: flex; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.mod-item:last-child { border-bottom: 0; }
.mod-item .mod-img { width: 96px; height: 72px; border-radius: 5px; background: center/cover; flex-shrink: 0; }
.mod-item > div:nth-child(2) { flex: 1; min-width: 0; }
.mod-item .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.report-type { width: 42px; height: 42px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-50); color: var(--red); flex-shrink: 0; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }

/* XML čarobnjak */
.wiz { display: flex; gap: 0; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.wiz div { flex: 1; padding: 14px 18px; display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; color: var(--muted); border-right: 1px solid var(--line); }
.wiz div:last-child { border-right: 0; }
.wiz div span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; }
.wiz div.done { color: var(--ink); }
.wiz div.done span { background: var(--bordo); border-color: var(--bordo); color: #fff; }
.wiz div.cur { color: var(--red); background: var(--brand-50); }
.wiz div.cur span { border-color: var(--red); }
.map-arrow { color: var(--muted); text-align: center; }

/* Editor objave */
.editor-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.title-input { width: 100%; border: 0; outline: 0; font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; padding: 4px 0; color: var(--ink); background: transparent; }
.ed-toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f8f9fc; }
.ed-toolbar button { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.ed-toolbar button:hover { background: #fff; color: var(--red); }
.ed-toolbar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.ed-area { min-height: 320px; border: 1px solid var(--line); border-radius: 0 0 6px 6px; padding: 20px; font-size: 16px; line-height: 1.7; outline: 0; background: #fff; }
.seo-prev { border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: #fff; font-family: Arial, sans-serif; }
.seo-prev .u { font-size: 12px; color: #202124; }
.seo-prev .t { font-size: 18px; color: #1a0dab; margin: 4px 0; line-height: 1.3; }
.seo-prev .d { font-size: 13px; color: #4d5156; line-height: 1.5; }
.cover-pick { aspect-ratio: 16/9; border-radius: 6px; background: center/cover; position: relative; }
.cover-pick .btn { position: absolute; bottom: 10px; right: 10px; }
.char-count { font-family: var(--mono); font-size: 11px; color: var(--muted); float: right; }

/* Medija */
.media-layout { display: grid; grid-template-columns: 230px 1fr 260px; min-height: 520px; }
.folder-tree { border-right: 1px solid var(--line); padding: 14px 10px; font-size: 14px; }
.folder-tree a { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 4px; color: var(--ink-2); }
.folder-tree a svg.lucide { width: 16px; height: 16px; color: var(--bordo); }
.folder-tree a.active, .folder-tree a:hover { background: var(--brand-50); color: var(--bordo); }
.folder-tree a.sub { padding-left: 30px; font-size: 13px; }
.folder-tree a span { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.media-main { padding: 16px; }
.media-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.media-grid2 .mf { aspect-ratio: 1; border-radius: 6px; background: center/cover; position: relative; cursor: pointer; border: 2px solid transparent; }
.media-grid2 .mf.sel { border-color: var(--red); }
.media-grid2 .mf small { position: absolute; left: 6px; right: 6px; bottom: 6px; background: rgba(255,255,255,.92); border-radius: 3px; font-family: var(--mono); font-size: 10px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-info { border-left: 1px solid var(--line); padding: 16px; font-size: 13px; }
.media-info .prev { aspect-ratio: 4/3; border-radius: 6px; background: center/cover; margin-bottom: 12px; }
.media-info dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; }
.media-info dt { color: var(--muted); }
.media-info dd { margin: 0; font-weight: 600; text-align: right; }
.quota { height: 8px; background: var(--brand-50); border-radius: 8px; overflow: hidden; margin: 8px 0 4px; }
.quota i { display: block; height: 100%; background: var(--red); }

/* Baneri */
.slot-pos { font-family: var(--mono); font-weight: 600; color: var(--red); }
.ctr { font-family: var(--mono); }

/* Uloge */
.role-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.role-card { padding: 16px; cursor: pointer; }
.role-card.active { border-color: var(--red); box-shadow: inset 0 3px 0 var(--red); }
.role-card b { display: block; font-size: 14.5px; margin-top: 8px; }
.role-card span { font-size: 12.5px; color: var(--muted); }

/* Podešavanja: tema */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.color-field { border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: flex; gap: 12px; align-items: center; }
.color-field input[type=color] { width: 46px; height: 46px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; }
.color-field b { display: block; font-size: 13.5px; }
.color-field code { font-size: 12px; color: var(--muted); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { display: flex; gap: 0; border-radius: 6px; overflow: hidden; border: 2px solid var(--line); cursor: pointer; padding: 0; background: none; }
.preset.active { border-color: var(--ink); }
.preset i { width: 26px; height: 34px; display: block; }
.theme-preview { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.theme-preview .tp-top { background: var(--bordo); color: #fff; padding: 14px 16px; font-family: var(--display); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.theme-preview .tp-body { padding: 16px; background: var(--bg); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Firma: radno vreme, licence */
.hours-edit { display: grid; gap: 6px; }
.hours-edit > div { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.hours-edit .input { height: 38px; }
.check-grid { display: grid; gap: 4px; }
.check-grid .check { align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; }
.check-grid .check:has(input:checked) { border-color: var(--red); background: var(--brand-50); }
.check-grid .check input { margin-top: 3px; }

/* Tokeni */
.token-balance { background: var(--bordo); color: #fff; border-radius: 8px; padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.token-balance b { font-family: var(--display); font-size: 40px; line-height: 1; }
.token-balance span { color: #c3cde0; font-size: 13px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pack { padding: 20px; text-align: center; position: relative; }
.pack .p-amount { font-size: 30px; }
.pack.best { border-color: var(--red); box-shadow: inset 0 3px 0 var(--red); }

/* Bezbednost */
.qr { width: 132px; height: 132px; background:
  conic-gradient(from 90deg at 18% 18%, #0d1526 25%, transparent 0) 0 0/33% 33%,
  repeating-linear-gradient(90deg, #0d1526 0 6px, #fff 6px 12px),
  repeating-linear-gradient(0deg, transparent 0 6px, rgba(255,255,255,.8) 6px 12px);
  border: 8px solid #fff; outline: 1px solid var(--line); border-radius: 4px; flex-shrink: 0; }
.session { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.session:last-child { border-bottom: 0; }
.session > svg.lucide { width: 28px; height: 28px; color: var(--bordo); }
.session > div { flex: 1; }
.session b { display: block; font-size: 14px; }
.session span { font-size: 12.5px; color: var(--muted); }

/* Sačuvani geometri */
.saved-card { display: flex; gap: 14px; align-items: center; padding: 16px; }

@media (max-width: 1140px) {
  .editor-wrap { grid-template-columns: 1fr; }
  .media-layout { grid-template-columns: 200px 1fr; }
  .media-info { display: none; }
  .role-cards { grid-template-columns: repeat(3, 1fr); }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .kpi-row, .packs { grid-template-columns: 1fr; }
  .media-layout { grid-template-columns: 1fr; }
  .folder-tree { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 4px; }
  .folder-tree a { white-space: nowrap; }
  .folder-tree a.sub { padding-left: 10px; }
  .role-cards { grid-template-columns: 1fr 1fr; }
  .theme-grid { grid-template-columns: 1fr; }
  .wiz { flex-direction: column; }
  .wiz div { border-right: 0; border-bottom: 1px solid var(--line); }
  .hours-edit > div { grid-template-columns: 90px 1fr 1fr; }
  .hours-edit > div label { grid-column: 1 / -1; }
  .mod-item { flex-wrap: wrap; }
  .tbl td, .tbl th { padding: 10px 12px; }
}
