/* =====================================================================
   Sučelje „B”: traka s ikonama + ladica s padajućim izbornicima.
   Boje dolaze iz postavki općine (--green, --green-2, --green-soft).
   ===================================================================== */
:root { --rail: 84px; --drawer: 340px; --mnav: 64px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- traka ---------- */
.rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 1400; background: var(--green); color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.rail-brand { width: 48px; height: 56px; background: #fff; border-radius: 9px; padding: 4px; margin-bottom: 10px; display: grid; place-items: center; flex: none; }
.rail-brand img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rail .ri, .rail .admin-tab, .rail .nav-top, .rail .admin-link.ri {
  all: unset; box-sizing: border-box; position: relative; width: 72px; padding: 9px 2px 7px; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 11.5px/1.1 var(--font, "Source Sans 3", sans-serif);
  color: rgba(255, 255, 255, 0.84); text-align: center; text-decoration: none; flex: none; }
.rail .ri .ico, .rail .admin-tab .ico, .rail .nav-top .ico { width: 22px; height: 22px; }
.rail .ri:hover, .rail .admin-tab:hover, .rail .nav-top:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.rail .ri:focus-visible, .rail .admin-tab:focus-visible, .rail .nav-top:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.rail .ri[aria-selected="true"], .rail > nav > .admin-tab[aria-selected="true"], .rail .nav-group.has-active > .nav-top, .rail .nav-top[aria-expanded="true"], .rail .ri.on { background: rgba(255, 255, 255, 0.18); color: #fff; }
.rail .ri.cta { background: #fff; color: var(--green); }
.rail .ri.cta:hover { background: #fff; }
.rail .bd { position: absolute; top: 4px; right: 9px; background: #facc15; color: #1d2521; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 0 5px; line-height: 16px; }
.rail .sp, .rail .spacer { flex: 1 0 8px; }
.rail .av { width: 38px; height: 38px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; font-weight: 700; font-size: 13.5px; flex: none; cursor: default; margin-top: 4px; }
.rail [hidden] { display: none !important; }
.m-only { display: none !important; }

/* ---------- ladica ---------- */
.drawer { position: fixed; left: var(--rail); top: 0; bottom: 0; width: var(--drawer); z-index: 1300; background: #fff;
  box-shadow: 4px 0 18px rgba(20, 30, 25, 0.12); display: none; flex-direction: column; }
body.drawer-open .drawer { display: flex; }
.drawer[hidden] { display: none !important; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 16px 12px 8px 18px; flex: none; }
.drawer-h h2 { margin: 0; font-size: 20px; flex: 1; }
.drawer-x { all: unset; cursor: pointer; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.drawer-x:hover { background: var(--bg); color: var(--ink); }
.drawer-b { flex: 1; min-height: 0; overflow-y: auto; }
.drawer .panel { background: none; box-shadow: none; border-radius: 0; padding: 0 18px 16px; max-height: none; overflow: visible; }
.drawer .group { padding: 12px 0; }
.drawer .group h3 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 700; }
.drawer .group.coll:not(.closed) > h3, .drawer .group.coll:not(.closed) > .group-head h3 { color: var(--green); }
.drawer .coll-btn { padding: 4px 0; }
.drawer .coll-car { order: 3; margin-left: auto; font-size: 12px; color: var(--muted); }
.drawer .coll-on { order: 2; margin-left: auto; background: var(--green-soft); color: var(--green); font-weight: 700; }
.drawer .coll-btn:has(.coll-on) > .coll-car { margin-left: 8px; }
.drawer .row { padding: 3px 0; }
.drawer-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-tabs .tab { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 13.5px; }
.drawer-tabs .tab[aria-selected="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- stranice s kartom ---------- */
body.ui-b.page-map { display: block; }
body.ui-b .map-wrap { position: fixed; left: var(--rail); top: 0; right: 0; bottom: 0; }
.map-search { position: absolute; top: 14px; left: 16px; z-index: 1050; width: min(480px, calc(100% - 140px)); margin: 0; max-width: none; transition: left .15s; }
body.drawer-open .map-search { left: calc(var(--drawer) + 16px); }
.map-search input { height: 46px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16); padding: 0 50px 0 20px; font-size: 15.5px; }
.map-search input:focus { box-shadow: 0 0 0 2px var(--green), 0 2px 10px rgba(0, 0, 0, 0.16); background: #fff; }
.map-search .search-btn { top: 6px; right: 6px; width: 34px; height: 34px; }
.map-search .search-results { top: 54px; }
.map-tools { position: absolute; right: 14px; top: 14px; z-index: 1050; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.map-tools .mt-logo { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); padding: 6px 12px; display: flex; align-items: center; }
.map-tools .mt-logo img { height: 38px; width: auto; display: block; }
.tool-g { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); display: flex; flex-direction: column; overflow: hidden; }
.tool-b { all: unset; box-sizing: border-box; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; color: var(--ink); border-bottom: 1px solid var(--line); }
.tool-b:last-child { border-bottom: 0; }
.tool-b:hover { background: var(--bg); color: var(--green); }
.tool-b:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.tool-b[aria-pressed="true"] { color: var(--green); background: var(--green-soft); }
body.ui-b:has(.object-card:not([hidden])) .map-tools .mt-logo { display: none; }
body.ui-b:not(:has(.map-tools .tool-g)) .object-card { right: 14px; }
body.ui-b .object-card { top: 14px; right: 74px; max-height: calc(100% - 110px); border-top-color: var(--green); }
body.ui-b .demo-badge { top: auto; bottom: 16px; right: auto; left: 16px; transition: left .15s; }
body.ui-b.drawer-open .demo-badge { left: calc(var(--drawer) + 16px); }
body.ui-b .tool-hint { top: 72px; }
body.ui-b .locate-btn { bottom: 80px; }
body.ui-b .statusbar { bottom: 16px; }
body.ui-b .login-over { position: absolute; z-index: 1200; left: 50%; transform: translateX(-50%); }

/* ---------- uprava i konzola ---------- */
body.ui-b.page-admin .admin-top { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); padding: 12px 0; z-index: 1400; background: var(--green); color: #fff; border: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; overflow-y: auto; overflow-x: hidden; }
body.ui-b.page-admin .admin-top .brand-tag, body.ui-b.page-admin .admin-top .logo, body.ui-b.page-admin #userEmail { display: none !important; }
body.ui-b.page-admin .admin-top nav { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; overflow: visible; flex: 1 0 auto; }
body.ui-b.page-admin .admin-top nav[hidden] { display: none; }
body.ui-b.page-admin .admin-main { margin-left: var(--rail); max-width: none; padding: 24px 28px 40px; }
body.ui-b.page-admin .admin-main > section { max-width: 1500px; }
body.ui-b .nav-group { position: static; }
body.ui-b .nav-menu { position: fixed; left: var(--rail); top: 0; bottom: 0; width: 300px; min-width: 0; z-index: 1350; border: 0; border-radius: 0; padding: 18px 12px; gap: 2px;
  box-shadow: 4px 0 18px rgba(20, 30, 25, 0.14); background: #fff; color: var(--ink); overflow-y: auto; }
body.ui-b .nav-menu h2 { font-size: 20px; margin: 0 6px 6px; display: flex; align-items: center; }
body.ui-b .nav-menu .nm-lead { color: var(--muted); font-size: 13.5px; margin: 0 6px 10px; }
body.ui-b .nav-menu .admin-tab, body.ui-b .nav-menu .admin-link { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; border-radius: 10px; font-weight: 600; color: var(--ink); width: 100%; }
body.ui-b .nav-menu .admin-tab:hover, body.ui-b .nav-menu .admin-link:hover { background: var(--bg); }
body.ui-b .nav-menu .admin-tab[aria-selected="true"] { background: var(--green-soft); color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
body.ui-b .nav-menu small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
body.ui-b .nav-menu .admin-link { color: var(--green); }
body.ui-b .nav-menu [hidden] { display: none !important; }
body.ui-b .nav-menu .nm-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.page-konzola.ui-b { --green: #15231f; --green-2: #2a3c36; --green-soft: #e5ebe8; }
.page-konzola.ui-b .rail-brand.konz { font-size: 26px; color: #c2410c; }
.page-konzola.ui-b .admin-main .btn-primary { background: #00463b; }

/* ---------- mobitel: traka postaje donja navigacija, ladica list odozdo ---------- */
@media (max-width: 720px) {
  .m-only { display: flex !important; }
  .d-only { display: none !important; }
  .rail, body.ui-b.page-admin .admin-top { top: auto; right: 0; width: auto; height: var(--mnav); flex-direction: row; justify-content: space-around; align-items: stretch;
    padding: 0 4px env(safe-area-inset-bottom); background: #fff; color: var(--muted); border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06); overflow: visible; }
  body.ui-b.page-admin .admin-top nav { flex-direction: row; flex: 1; justify-content: space-around; align-items: stretch; gap: 0; }
  .rail-brand, .rail .sp, .rail .spacer, .rail .av { display: none !important; }
  .rail .ri, .rail .admin-tab, .rail .nav-top, .rail .admin-link.ri { width: auto; flex: 1; min-width: 0; padding: 8px 0 6px; border-radius: 0; color: var(--muted); font-size: 11px; justify-content: center; }
  .rail .ri:hover, .rail .admin-tab:hover, .rail .nav-top:hover { background: none; color: var(--green); }
  .rail .ri[aria-selected="true"], .rail > nav > .admin-tab[aria-selected="true"], .rail .nav-group.has-active > .nav-top, .rail .nav-top[aria-expanded="true"], .rail .ri.on { background: none; color: var(--green); }
  .rail .ri[aria-selected="true"] .ico, .rail > nav > .admin-tab[aria-selected="true"] .ico, .rail .nav-group.has-active > .nav-top .ico, .rail .nav-top[aria-expanded="true"] .ico, .rail .ri.on .ico { background: var(--green-soft); border-radius: 999px; padding: 3px 14px; width: 52px; height: 28px; box-sizing: border-box; }
  .rail .ri.cta { background: none; color: var(--green); }
  .rail .ri.cta .ico { width: 50px; height: 50px; padding: 13px; margin-top: -24px; border-radius: 999px; background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); box-sizing: border-box; }
  .rail .bd { top: 4px; right: auto; left: calc(50% + 6px); }
  body.ui-b .nav-group { display: flex; flex: 1; }
  body.ui-b .nav-group > .nav-top { flex: 1; }
  .drawer, body.ui-b .nav-menu { left: 0; right: 0; top: auto; bottom: var(--mnav); width: auto; max-height: 64vh; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18); }
  .drawer::before, body.ui-b .nav-menu::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; background: #cfd6d2; margin: 8px auto 0; flex: none; }
  .drawer-h { padding-top: 6px; }
  body.ui-b .map-wrap { left: 0; bottom: var(--mnav); }
  .map-search, body.drawer-open .map-search { left: 10px; right: 10px; top: 10px; width: auto; }
  .map-tools { top: 66px; right: 10px; }
  .map-tools .mt-logo, .map-tools .d-only { display: none !important; }
  body.ui-b .statusbar { bottom: 10px; right: 10px; }
  body.ui-b .locate-btn { bottom: 64px; right: 10px; }
  body.ui-b .object-card { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 58%; }
  body.ui-b .demo-badge, body.ui-b.drawer-open .demo-badge { top: 64px; bottom: auto; left: 10px; }
  body.ui-b.page-admin .admin-main { margin-left: 0; padding: 14px 12px calc(var(--mnav) + 20px); }
  #toasts { top: 70px; }
}
@media print {
  .rail, .drawer, .map-search, .map-tools, body.ui-b.page-admin .admin-top { display: none !important; }
  body.ui-b .map-wrap { position: relative; left: 0; height: 180mm; }
  body.ui-b.page-admin .admin-main { margin-left: 0; }
}
@media (max-width: 720px) {
  .rail .mo-1 { order: 1 !important; } .rail .mo-2 { order: 2 !important; } .rail .mo-3 { order: 3 !important; } .rail .mo-4 { order: 4 !important; } .rail .mo-5 { order: 5 !important; }
}
