/* ARM4CAD 3D - raspored kao Geoportal: tamna traka s podacima, ribbon s ikonama, lijevo stablo + svojstva, desno 3D i tablica.
   Svijetla tema i plavi akcent kao CIVIL4CAD 3D viewer. */
:root {
  --bg: #f3f5f7; --panel: #ffffff; --line: #d9dee4; --text: #1f2a37; --muted: #6b7785;
  --accent: #1f6fb2; --accent-soft: #e6f0f8; --warn-bg: #fff6dd; --warn-line: #e6c65c; --err: #b3261e;
  --top: #2d2b45; --top-text: #e8e9f3; --top-muted: #aeb1c9; --glava: #f7f8fa;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.4 "Segoe UI", system-ui, Arial, sans-serif; color: var(--text); background: var(--bg);
       display: grid; grid-template-rows: 40px auto 1fr 26px; grid-template-columns: 300px 1fr; overflow: hidden; }

button { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
         border-radius: 4px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
button:hover { background: var(--accent-soft); border-color: var(--accent); }
button:disabled { color: var(--muted); cursor: default; background: var(--panel); border-color: var(--line); }
input[type=text], input[type=number], select { font: inherit; color: var(--text); padding: 3px 5px; border: 1px solid var(--line);
         border-radius: 4px; background: var(--panel); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
svg.ik { display: block; }

/* ---------- traka s podacima projekta ---------- */
#traka { grid-column: 1 / 3; display: flex; align-items: center; gap: 10px; padding: 0 12px; min-width: 0;
         background: var(--top); color: var(--top-text); }
#traka .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .3px; color: #fff; white-space: nowrap; text-decoration: none; }
.znakApp { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); }
.znakApp svg { width: 16px; height: 16px; }
.cip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px;
       background: rgba(255,255,255,.10); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cip svg { width: 15px; height: 15px; color: var(--top-muted); }
.cip .n { color: var(--top-muted); font-size: 11.5px; }
.cip b { color: #fff; font-weight: 600; }
.projektCip { min-width: 0; cursor: text; }
.projektCip input { width: 210px; min-width: 0; padding: 2px 0; border: 0; background: transparent; color: #fff; font-weight: 600; }
.projektCip input:focus { outline: none; }
.projektCip:hover, .projektCip:focus-within { background: rgba(255,255,255,.19); }
.projektCip:focus-within { box-shadow: 0 0 0 2px #7fb6e6; }
#podaci { margin-left: auto; display: flex; gap: 6px; }
/* birac jezika: dva gumba u jednom okviru, odabrani je svijetao */
#jezik { display: flex; flex: none; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.10); }
#jezik button { padding: 4px 8px; border: 0; border-radius: 0; background: transparent; color: var(--top-muted); font-size: 11.5px; font-weight: 600; }
#jezik button:hover { color: #fff; background: rgba(255,255,255,.10); }
#jezik button[aria-pressed=true] { color: var(--top); background: #fff; }
#btnMenu { display: none; padding: 5px 6px; background: transparent; border-color: transparent; color: #fff; }
#btnMenu:hover { background: rgba(255,255,255,.16); }
#btnMenu svg { width: 20px; height: 20px; }

/* ---------- ribbon ---------- */
/* kartice (ARM4CAD, Konstrukcija, Pogled) i ispod njih paneli odabrane kartice; ostali paneli imaju atribut hidden */
#ribbon { grid-column: 1 / 3; display: flex; flex-direction: column; min-width: 0; background: var(--panel); border-bottom: 1px solid var(--line); }
#rbKartice { display: flex; gap: 2px; padding: 0 8px; background: var(--glava); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
#rbKartice button { flex: none; padding: 5px 14px 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
                    font-size: 12px; font-weight: 600; letter-spacing: .2px; color: var(--muted); }
#rbKartice button:hover { color: var(--text); background: transparent; }
#rbKartice button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); background: var(--panel); }
#rbPloca { display: flex; align-items: stretch; min-width: 0; padding: 0 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.grupa[hidden] { display: none; }
.grupa { flex: none; display: flex; flex-direction: column; padding: 5px 8px 3px; border-right: 1px solid var(--line); }
.grupa:last-of-type { border-right: 0; }
.grupa .gumbi { flex: 1; display: flex; align-items: flex-start; gap: 2px; }
.grupa .gn { margin-top: 1px; text-align: center; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.rb { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 50px; height: 56px; padding: 4px 6px;
      border-color: transparent; background: transparent; font-size: 11px; line-height: 1.15; }
.rb svg { width: 22px; height: 22px; flex: none; color: #44546a; }
.rb span { max-width: 68px; white-space: normal; text-align: center; }
.rb:hover svg, .rb[aria-pressed=true] svg { color: var(--accent); }
.rb[aria-pressed=true] { background: var(--accent-soft); border-color: #b9d4ea; color: var(--accent); }
.rb:disabled { background: transparent; border-color: transparent; opacity: .45; }
.rb:disabled svg { color: var(--muted); }
.klizac { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 122px; height: 56px; padding: 0 6px; font-size: 11px; color: var(--muted); }
.klizac b { color: var(--text); font-weight: 600; }
.klizac input { width: 100%; margin: 0; accent-color: var(--accent); }

/* ---------- lijevo: stablo + svojstva ---------- */
aside { min-height: 0; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); overflow: hidden; }
aside section { display: flex; flex-direction: column; min-height: 0; }
#stabloOkvir { flex: 0 1 auto; max-height: 46%; border-bottom: 1px solid var(--line); }
#svojstva { flex: 1 1 0; }
h2 { flex: none; margin: 0; padding: 7px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted);
     background: var(--glava); border-bottom: 1px solid var(--line); }
h3 { font-size: 12.5px; font-weight: 600; margin: 12px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); }
#stablo { overflow-y: auto; padding: 4px 0; }
#svojstva .sadrzaj { overflow-y: auto; padding: 8px 12px 14px; }

.cvor { display: flex; align-items: center; gap: 5px; height: 25px; padding: 0 10px 0 6px; border-left: 3px solid transparent;
        cursor: pointer; white-space: nowrap; user-select: none; }
.cvor.r1 { padding-left: 20px; }
.cvor.r2 { padding-left: 38px; }
.cvor:hover { background: #f1f5f9; }
.cvor:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cvor .strelica { flex: none; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 3px; color: var(--muted); }
.cvor .strelica svg { width: 12px; height: 12px; transition: transform .12s ease; }
.cvor .strelica:hover { background: #dbe3ec; color: var(--text); }
.cvor.otvoren > .strelica svg { transform: rotate(90deg); }
.cvor .strelica.prazna { visibility: hidden; }
.cvor .iko { flex: none; color: #44546a; }
.cvor .iko svg { width: 16px; height: 16px; }
.cvor .boja { flex: none; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px; }
.cvor .br { flex: none; min-width: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cvor .ime { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cvor .desno { flex: none; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cvor .oko { flex: none; width: 20px; height: 20px; padding: 0; margin-left: 2px; border: 0; border-radius: 3px; background: none; color: #8a96a4;
             display: flex; align-items: center; justify-content: center; opacity: 0; }
.cvor .oko svg { width: 15px; height: 15px; }
.cvor:hover .oko, .cvor:focus-within .oko, .cvor .oko.ne { opacity: 1; }
.cvor .oko:hover { background: #dbe3ec; color: var(--text); border: 0; }
.cvor .oko.ne { color: var(--accent); }
.cvor.skriven .ime, .cvor.skriven .desno, .cvor.skriven .br { color: #a3adb9; }
.cvor.skriven .iko, .cvor.skriven .boja { opacity: .35; }
.cvor.r0 .ime { font-weight: 700; }
.cvor.aktivan { background: var(--accent-soft); border-left-color: var(--accent); }
.cvor.aktivan .ime { font-weight: 600; }
.cvor.aktivan .iko { color: var(--accent); }
.cvor.odabran { background: var(--accent-soft); box-shadow: inset 0 0 0 1px #b9d4ea; }
.cvor.prikazan .ime, .cvor.prikazan .iko { color: var(--accent); }
.cvor.prikazan .ime { font-weight: 600; }

.polje { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.polje .l { flex: 1; min-width: 0; }
.polje .j { width: 26px; color: var(--muted); font-size: 11.5px; }
.polje input[type=number], .polje select { width: 84px; }
.polje input[type=text] { width: 150px; }
.polje[hidden] { display: none; }
label.kvacica { display: flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; }
/* popis stavki (polja, oslonci): listanje strelicama, ispod su polja prikazane stavke */
.popis { padding: 5px 8px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--glava); }
.popisNav { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.popisNav b { flex: 1; min-width: 0; text-align: center; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.popisNav button { padding: 2px 8px; font-size: 12px; }
.popisNav .korak { width: 26px; padding: 2px 0; font-size: 15px; line-height: 1.2; }
#smjestaj { margin: 6px 0 2px; }
#smjestaj h3 { margin-top: 4px; }
.polje.par select { width: 84px; }
.polje.par select.os { width: 58px; }
.polje.par select[hidden] { display: block; visibility: hidden; }
.sudUvod { margin: 7px 10px 6px; }
.uvozD { display: flex; flex-direction: column; gap: 8px; }
.uvozD p, .uvozD ul { margin: 0; }
.uvozD ul { padding-left: 18px; }
.uvozRadnje { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.uvozRadnje button { padding: 7px 12px; }
.pomoc.prazno { margin: 12px 0; font-size: 12.5px; }
#veze { margin: 6px 0 2px; }
#veze h3 { margin-top: 4px; }
.veza { padding: 5px 8px 6px; border: 1px solid var(--line); border-left: 3px solid #3c9a5f; border-radius: 5px; background: var(--glava); font-size: 12px; }
.veza + .veza { margin-top: 5px; }
.veza.ne { border-left-color: var(--warn-line); background: var(--warn-bg); }
.vezaN { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.vezaE { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; white-space: normal; text-align: left; }
.vezaE:hover { background: none; text-decoration: underline; }
.vezaK { color: var(--muted); }
.vezaS { margin-left: auto; color: #2d7a49; font-size: 11.5px; white-space: nowrap; }
.veza.ne .vezaS { color: #8a6500; }
.veza ul { margin: 4px 0 0; padding-left: 16px; }
.veza li + li { margin-top: 2px; }
.veza li.rucno { color: var(--err); }
.veza .uskladi { margin-top: 6px; padding: 3px 10px; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.vezeD { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vezeD p { margin: 0; }
.vezeD .veza + .veza { margin-top: 0; }
.vezeD .glavni { align-self: flex-start; }
.vezeZbroj { font-weight: 600; }
.zauzima { color: var(--muted); font-size: 11.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.napomena { color: var(--muted); font-size: 11.5px; margin: 12px 0 0; }
#upoz { margin: 8px 0 0; padding: 6px 8px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 4px; font-size: 12px; }
#upoz.greska { border-color: var(--err); background: #fdecea; color: var(--err); }
#upoz div + div { margin-top: 4px; }

/* ---------- desno: 3D + tablica ---------- */
main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#pogled { position: relative; flex: 1; min-height: 0; }
canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#poruka { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
          padding: 20px; color: var(--muted); background: rgba(243,245,247,.94); }
#poruka[hidden] { display: none; }
/* alat Priljubi: uputa na vrhu 3D prikaza i oznake hvatista preko platna (crta ih scena.js) */
#savjet { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 260px); padding: 6px 12px; border-radius: 6px;
          background: rgba(31,42,55,.92); color: #fff; font-size: 12.5px; text-align: center; pointer-events: none; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
#savjet[hidden] { display: none; }
#hvatiste { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
#hvatiste path { fill: none; stroke: #e8590c; stroke-width: 2; stroke-linejoin: round; }
#hvatiste .hvCrta { stroke-width: 1.4; stroke-dasharray: 6 4; }
#hvatiste .hvOd { fill: #e8590c; stroke: #fff; stroke-width: 1.5; }
#hvatiste .hvNad { fill: rgba(255,255,255,.75); }
/* kocka pogleda: CSS 3D, okrece je kamera (kocka.js); stranica 52 px */
#kocka { position: absolute; top: 8px; right: 10px; width: 112px; height: 112px; perspective: 600px; user-select: none; touch-action: none; cursor: grab; }
#kocka[hidden] { display: none; }
#kocka:active { cursor: grabbing; }
.kockaSvijet { position: absolute; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; }
.kockaLice { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
             font: 700 7.5px/1 "Segoe UI", Arial, sans-serif; letter-spacing: .2px; color: #4b5563; background: #fafbfc; border: 1px solid #9aa5b1;
             backface-visibility: hidden; cursor: pointer; }
.kockaLice:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.kockaPrsten { position: absolute; left: -50px; top: -50px; width: 100px; height: 100px; border-radius: 50%; border: 10px solid rgba(150,160,174,.5);
               transform: translateY(27px) rotateX(90deg); transform-style: preserve-3d; pointer-events: none; }
.kockaPrsten span { position: absolute; font: 700 10px/1 "Segoe UI", Arial, sans-serif; color: #374151; transform: translate(-50%, -50%) rotate(var(--zakret, 0deg)); }
.kockaPrsten .kS { left: 40px; top: -5px; }
.kockaPrsten .kJ { left: 40px; top: 85px; }
.kockaPrsten .kI { left: 85px; top: 40px; }
.kockaPrsten .kZ { left: -5px; top: 40px; }

/* AI pomocnik: polje za naredbu ispod 3D prikaza i iznad njega odgovor (koraci, Primijeni / Ponisti) */
#naredba { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-top: 1px solid var(--line); }
#naredba .nIkona svg { width: 20px; height: 20px; color: var(--accent); }
#naredba input { flex: 1; min-width: 0; padding: 6px 9px; }
#naredba button { flex: none; padding: 6px 14px; }
#naredba #naredbaGlas { padding: 5px 8px; display: flex; align-items: center; }
#naredbaGlas svg { width: 18px; height: 18px; }
#naredbaGlas.slusa { color: #fff; background: var(--err); border-color: var(--err); animation: slusam 1.2s ease-in-out infinite; }
@keyframes slusam { 50% { box-shadow: 0 0 0 5px rgba(179, 38, 30, .25); } }
@media (prefers-reduced-motion: reduce) { #naredbaGlas.slusa { animation: none; } }
#naredbaOdgovor { padding: 8px 12px; max-height: 190px; overflow: auto; background: #f4f8fc; border-top: 1px solid #b9d4ea; font-size: 12.5px; }
#naredbaOdgovor[hidden] { display: none; }
#naredbaOdgovor.greska { background: #fdecea; border-top-color: var(--err); }
#naredbaOdgovor p { margin: 0 0 5px; }
#naredbaOdgovor ol, #naredbaOdgovor ul { margin: 0 0 6px; padding-left: 20px; }
#naredbaOdgovor ul { color: var(--err); }
#naredbaOdgovor .gumbiRed { display: flex; gap: 6px; }
#naredbaOdgovor .gumbiRed button { padding: 4px 12px; }
#dolje { height: 262px; display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line); }
#dolje[hidden] { display: none; }
.kartice { display: flex; align-items: center; gap: 4px; padding: 5px 10px 0; border-bottom: 1px solid var(--line); background: var(--glava); }
.kartice button { border-bottom: 0; border-radius: 4px 4px 0 0; color: var(--muted); margin-bottom: -1px; background: transparent; border-color: transparent; }
.kartice button.aktivna { color: var(--text); font-weight: 600; border-color: var(--line); border-bottom: 1px solid var(--panel); background: var(--panel); }
#sazetak { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartice #btnSakrij { margin: 0 0 3px 6px; padding: 1px 7px; border-radius: 4px; font-size: 12px; }
.kartice #btnSakrij:hover { background: #dbe3ec; color: var(--text); }
#tablica { flex: 1; min-height: 0; overflow: auto; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 3px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; font-size: 11.5px; z-index: 1; }
th.l, td.l { text-align: left; }
tbody tr.poz { cursor: pointer; }
tbody tr.poz:hover { background: var(--accent-soft); }
tbody tr.odabran { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--line); }
td .boja { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
td .opis { color: var(--muted); margin-left: 8px; font-size: 11.5px; }
td.skicaCel { padding: 0 9px; }
svg.skica { display: block; color: var(--text); overflow: visible; }
svg.skica text { font: 9.5px "Segoe UI", system-ui, Arial, sans-serif; fill: var(--muted); }
.znak { color: #9a6a00; font-weight: 600; cursor: help; }
h4 { margin: 10px 10px 4px; font-size: 12.5px; }

footer { grid-column: 1 / 3; display: flex; align-items: center; gap: 18px; padding: 0 12px; background: var(--panel);
         border-top: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
footer b { color: var(--text); font-weight: 600; }
footer .desno { margin-left: auto; }

/* ---------- pregled ispisa iskaza (A4) ---------- */
#izvjestaj { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #80858d; }
#izvjestaj[hidden] { display: none; }
.izvAlati { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; background: var(--top); color: #fff; }
.izvAlati .naslov { margin-right: auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.izvAlati select { max-width: 46vw; }
.izvAlati button.glavni { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.izvAlati button.glavni:hover { background: #185a92; }
.izvAlati button:focus-visible, .izvAlati select:focus { outline: 2px solid #9fcbee; outline-offset: 1px; }
#izvPlatno { flex: 1; min-height: 0; overflow: auto; padding: 20px; }
.list { display: flex; flex-direction: column; width: 210mm; min-height: 297mm; margin: 0 auto 20px; padding: 14mm;
        background: #fff; color: #111; font-size: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.izvGlava { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 5px; margin-bottom: 8px; border-bottom: 1.5px solid #111; }
.izvGlava .n { font-size: 14px; font-weight: 700; }
.izvGlava .p { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.izvDno { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; border-top: 1px solid #111; font-size: 10px; color: #444; }
.list .podnaslov { margin: 6px 0 5px; font-weight: 600; }
.list .legenda { margin: 0 0 14px; font-size: 10.5px; color: #444; }
.list table { margin-bottom: 12px; }
.list th, .list td { position: static; padding: 3px 6px; border: 1px solid #333; background: #fff; color: #111; white-space: normal; }
.list th { font-size: 10.5px; text-align: center; white-space: nowrap; }
.list td.l { text-align: left; }
.list td.c { text-align: center; }
.list td.oblik { padding: 2px 6px; }
.list td.oblik svg { margin: 0 auto; }
.list td.nap { min-width: 120px; overflow-wrap: anywhere; }
.list .sitno { font-size: 10.5px; color: #444; }
.list tr.skupina td { text-align: center; font-weight: 600; background: #eef0f3; overflow-wrap: anywhere; }
.list tr.zbroj td { font-weight: 600; }
.list svg.skica text { fill: #111; }
.list tr, .izvDno, .list .legenda { break-inside: avoid; }
.list tr.skupina { break-after: avoid; }

@media (max-width: 860px) {
  #izvPlatno { padding: 0; }
  .list { width: 100%; min-width: 640px; min-height: 0; margin-bottom: 8px; padding: 8mm 5mm; box-shadow: none; }
  .izvAlati .naslov { display: none; }
  .izvAlati select { margin-right: auto; }
}

/* Ispis: samo listovi iskaza, A4; zaglavlje tablice se ponavlja na svakoj stranici */
@page { size: A4; margin: 14mm; }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  body { display: block; }
  body > *:not(#izvjestaj) { display: none !important; }
  #izvjestaj { position: static; display: block; background: none; }
  .izvAlati { display: none; }
  #izvPlatno { overflow: visible; padding: 0; }
  .list { display: block; width: auto; min-width: 0; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .list + .list { break-before: page; }
  .izvDno { margin-top: 10px; }
  .list thead { display: table-header-group; }
  .list tr.skupina td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- racun u traci, dijalog, obavijest (js/oblak.js) ---------- */
body.bezOblaka .oblak { display: none; }
.gumbiRed { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gumbiRed button { padding: 7px 12px; }

/* ---- projekt otvoren poveznicom samo za gledanje: bez alata za izmjene; stablo zauzima cijeli lijevi stupac ---- */
body.pregled .uredi { display: none !important; }
body.pregled #stabloOkvir { max-height: none; flex: 1 1 0; border-bottom: 0; }

/* ---- dok se provjerava prijava nista se ne vidi; ako posluzitelj ne odgovara, samo poruka ---- */
body.provjera > *, body.nedostupno > *:not(#nedostupno) { display: none !important; }
body.nedostupno { display: block; }
#nedostupno { max-width: 460px; margin: 18vh auto 0; padding: 24px 28px; font-size: 15px; line-height: 1.5; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#nedostupno[hidden] { display: none; }
#nedostupno p { margin: 0 0 10px; }
#nedostupno a { color: var(--accent); }
.cip.stanje { font-size: 11.5px; color: var(--top-text); }
.cip.stanje.ok { color: #b9ecc8; }
.cip.stanje.upoz { color: #ffe08a; }
.cip.stanje[hidden] { display: none; }
#racun { position: relative; flex: none; }
#racun[hidden] { display: none; }
#btnPrijava, #btnRacun { height: 28px; padding: 0 10px; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.10); color: #fff; }
#btnPrijava:hover, #btnRacun:hover { background: rgba(255,255,255,.22); }
#btnPrijava:focus-visible, #btnRacun:focus-visible { outline: 2px solid #9fcbee; outline-offset: 1px; }
#btnRacun { display: inline-flex; align-items: center; gap: 7px; padding: 0 9px 0 4px; border-radius: 15px; }
#btnRacun[hidden], #btnPrijava[hidden] { display: none; }
#btnRacun .avatar { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%;
                    background: var(--accent); font-size: 10px; font-weight: 700; }
#btnRacun .ime { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
#btnRacun .znacka { padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.2); font-size: 9.5px; font-weight: 700; letter-spacing: .5px; }
#btnRacun .znacka[hidden] { display: none; }
#racunIzbornik { position: absolute; z-index: 30; top: 34px; right: 0; min-width: 220px; padding: 4px; background: var(--panel); color: var(--text);
                 border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.22); }
#racunIzbornik[hidden] { display: none; }
#racunIzbornik .tko { display: flex; flex-direction: column; padding: 7px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
#racunIzbornik .tko span { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
#racunIzbornik button { display: block; width: 100%; padding: 6px 10px; border-color: transparent; text-align: left; }

dialog#dijalog { width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 8px;
                 color: var(--text); background: var(--panel); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
dialog#dijalog[open] { display: flex; flex-direction: column; }
dialog#dijalog.sirok { width: min(860px, calc(100vw - 24px)); }
dialog#dijalog::backdrop { background: rgba(31,42,55,.45); }
.dGlava { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); background: var(--glava); }
.dGlava h2 { flex: 1; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
#dZatvori { padding: 2px 8px; border-color: transparent; background: transparent; color: var(--muted); }
#dZatvori:hover { background: #dbe3ec; color: var(--text); }
#dTijelo { min-height: 0; overflow: auto; padding: 14px 16px 16px; }
#dTijelo h3 { margin: 16px 0 6px; padding-top: 10px; }
.dKartice { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.dKartice button { margin-bottom: -1px; border-color: transparent; border-radius: 4px 4px 0 0; background: transparent; color: var(--muted); }
.dKartice button.aktivna { border-color: var(--line); border-bottom-color: var(--panel); background: var(--panel); color: var(--text); font-weight: 600; }
.napomenaD { margin: 0 0 12px; }
.pomoc { color: var(--muted); font-size: 11.5px; }
p.pomoc { margin: 8px 0 0; }
.obr { display: flex; flex-direction: column; gap: 9px; }
.obr .red { display: flex; flex-direction: column; gap: 3px; }
.obr .red .n { font-size: 12px; color: var(--muted); }
.obr input, .obr select { width: 100%; padding: 6px 8px; }
.obr input:disabled { background: var(--glava); color: var(--muted); }
.obr .poruka { padding: 6px 8px; border: 1px solid var(--err); border-radius: 4px; background: #fdecea; color: var(--err); font-size: 12px; }
.obr .poruka[hidden] { display: none; }
button.glavni { padding: 7px 12px; border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
button.glavni:hover { background: #185a92; border-color: #185a92; }
button.glavni:disabled { opacity: .6; background: var(--accent); color: #fff; border-color: var(--accent); }
.obr.uRedu { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.obr.uRedu .red { flex: 1 1 180px; }
.obr.uRedu .poruka { order: 3; flex: 1 1 100%; }
.obr.uRedu button.glavni { flex: none; }
.dPopis { overflow-x: auto; }
.dPopis table th { position: static; }
#dTijelo td { padding: 5px 9px; }
#dTijelo td.radnje { text-align: right; }
#dTijelo td.radnje button { margin-left: 4px; padding: 3px 9px; }
#dTijelo td select { padding: 3px 5px; }
button.veznik { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-align: left; white-space: normal; overflow-wrap: anywhere; }
button.veznik:hover { background: none; text-decoration: underline; }
#dTijelo td:has(> button.veznik) { min-width: 9em; white-space: normal; }
button.opasno { color: var(--err); }
button.opasno:hover { border-color: var(--err); background: #fdecea; }
.oznaka { margin-left: 7px; padding: 1px 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 600; }
.prazno { margin: 14px 0; color: var(--muted); }
.poveznica { margin-top: 12px; padding: 9px 10px; border: 1px solid #b9d4ea; border-radius: 6px; background: var(--accent-soft); }
.poveznica .n { margin-bottom: 6px; font-size: 12px; }
.poveznica .redak { display: flex; gap: 6px; }
.poveznica input { flex: 1; min-width: 0; padding: 5px 7px; font-family: Consolas, monospace; font-size: 12px; }

#obavijest { position: fixed; z-index: 2147483000; left: 50%; bottom: 40px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 24px));
             padding: 9px 14px; border-radius: 6px; background: #1f2a37; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#obavijest.greska { background: #8f1d17; }
#obavijest[hidden] { display: none; }

/* Srednja sirina: manje podataka u traci */
@media (max-width: 1080px) {
  #cipElementi, #cipSipke { display: none; }
  #btnRacun .ime { max-width: 90px; }
  .projektCip input { width: 150px; }
}

/* Uski ekran (mobitel): stablo i svojstva su ladica preko prikaza (gumb u traci), ribbon se pomice vodoravno */
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  #traka, #ribbon, footer { grid-column: 1; }
  #traka { gap: 6px; padding: 0 8px; }
  #btnMenu { display: inline-flex; }
  .projektCip, .cip.stanje { display: none; }
  #btnRacun .ime, #btnRacun .znacka { display: none; }
  #btnRacun { padding: 0 4px; }
  #cipMasa .n { display: none; }
  .grupa { padding: 3px 5px 2px; }
  #rbKartice button { padding: 5px 10px 4px; }
  #savjet { max-width: calc(100% - 20px); top: auto; bottom: 10px; }
  .rb { min-width: 46px; height: 52px; padding: 3px 4px; }
  aside { position: fixed; z-index: 20; top: 40px; bottom: 26px; left: 0; width: min(320px, 88vw);
          transform: translateX(-105%); transition: transform .18s ease; box-shadow: 4px 0 14px rgba(0,0,0,.18); font-size: 14px; }
  body.izbornik aside { transform: none; }
  .cvor { height: 30px; }
  #dolje { height: 38vh; }
  .kartice { overflow-x: auto; }
  #sazetak { display: none; }
  footer { gap: 10px; padding: 0 8px; font-size: 11.5px; }
}
