/* Paradox Media — Template Gallery. Dark-only, house brand kit
   (page #0d0d0d, surface #1a1a19, lime #a6e22e). Sidebar layout. */

:root {
  color-scheme: dark;
  --page:        #0d0d0d;
  --surface:     #1a1a19;
  --surface-2:   #222221;
  --ink:         #ffffff;
  --ink-2:       #c3c2b7;
  --muted:       #898781;
  --grid:        #2c2c2a;
  --border:      rgba(255,255,255,0.10);
  --accent:      #a6e22e;
  --accent-bright:#c4f53d;
  --accent-ink:  #0a0c08;
  --good:        #0ca30c;
  --warning:     #fab219;
  --critical:    #d03b3b;
  --gold:        #c9a35a;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.hidden { display: none !important; }
.mut { color: var(--muted); font-size: .82rem; }
code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
a { color: inherit; text-decoration: none; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 30px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-size: 1.25rem; font-weight: 700; }
.login-sub { color: var(--ink-2); font-size: .85rem; }
.login-card input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); padding: 11px 13px; font-size: .95rem;
}
.login-card button {
  background: var(--accent); border: 0; border-radius: 8px; color: var(--accent-ink);
  padding: 11px; font-size: .95rem; font-weight: 700; cursor: pointer;
}
.login-card button:hover { background: var(--accent-bright); }
.logo-login { height: 26px; align-self: flex-start; }
.login-error { color: #e66767; font-size: .82rem; min-height: 1em; }

/* ---------- shell + sidebar ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--surface);
  border-right: 1px solid var(--grid);
  padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand .logo { height: 22px; display: block; }
.side-label { color: var(--muted); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin: 10px 4px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group {
  color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; margin: 12px 4px 4px;
}
.side-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; font-size: .89rem; color: var(--ink-2);
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.on { background: var(--surface-2); color: var(--accent); font-weight: 700; }
.side-item em { font-style: normal; color: var(--warning); font-size: .66rem; margin-left: auto; }
.side-item.page { font-weight: 600; }
.side-cat { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.side-item.cat { flex: 1; font-weight: 700; color: var(--ink); }
.ccount { margin-left: auto; color: var(--muted); font-size: .72rem; font-weight: 600; }
.chev {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: .8rem; padding: 6px 8px; border-radius: 6px; transition: transform .15s;
}
.chev:hover { color: var(--ink); background: var(--surface-2); }
.chev.open { transform: rotate(90deg); }
.side-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 10px; border-left: 1px solid var(--grid); padding-left: 6px; }
.side-item.sub { font-size: .85rem; padding: 5px 9px; }
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.s-provjeren { background: var(--good); }
.s-nacrt { background: var(--warning); }
.side-sep { border-top: 1px solid var(--grid); margin: 12px 4px; }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.who { color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; }
button.ghost {
  background: transparent; border: 1px solid var(--border); color: var(--ink-2);
  border-radius: 8px; padding: 7px 12px; font-size: .82rem; cursor: pointer;
}
button.ghost:hover { border-color: var(--ink-2); }
button.ghost.small { padding: 4px 10px; font-size: .74rem; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 30px 34px 70px; }
.view { max-width: 1060px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 1.5rem; }
.intro { color: var(--ink-2); font-size: .92rem; max-width: 740px; }
.pill {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 11px; color: var(--accent); font-size: .84em; white-space: nowrap;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 12px;
}
.card h2 { font-size: 1.05rem; }
.card h3 { font-size: .92rem; margin-top: 6px; }
.card ul, .card ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; color: var(--ink-2); }
.card p { font-size: .92rem; color: var(--ink-2); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .cols2 { grid-template-columns: 1fr; } }
.tag { font-size: .68rem; font-weight: 800; letter-spacing: .06em; border-radius: 5px; padding: 2px 7px; margin-right: 5px; }
.tag-ok { background: rgba(166,226,46,.16); color: var(--accent); }
.tag-ai { background: rgba(57,135,229,.18); color: #7db4f2; }
.bigsteps li { margin-bottom: 8px; }

/* routing / status tables */
.rt { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rt th { text-align: left; color: var(--muted); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; padding: 6px 10px; border-bottom: 1px solid var(--grid); }
.rt td { padding: 8px 10px; border-bottom: 1px solid var(--grid); color: var(--ink-2); vertical-align: top; }
.rt tr:last-child td { border-bottom: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dot-ok { background: var(--good); }
.dot-warn { background: var(--warning); }
.dot-bad { background: var(--critical); }

/* ---------- grids ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid.home { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid.browse { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.catcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s;
  display: flex; flex-direction: column;
}
.catcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb.tall { aspect-ratio: 4 / 4.4; }
.sc-num { display: block; text-align: center; font-size: 3rem; font-weight: 900; color: rgba(20,20,20,.75); }
.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s;
  display: flex; flex-direction: column;
}
.tcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb { aspect-ratio: 5 / 4; background: var(--surface-2); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.tbody { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 5px; }
.trow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trow strong { font-size: 1rem; }
.ttype { color: var(--muted); font-size: .74rem; letter-spacing: .03em; }
.tbody p { color: var(--ink-2); font-size: .82rem; line-height: 1.45; }
.badge { font-size: .66rem; font-weight: 800; letter-spacing: .05em; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.b-provjeren { background: rgba(12,163,12,.15); color: #4ecb4e; }
.b-nacrt { background: rgba(250,178,25,.14); color: var(--warning); }
.b-penzija { background: var(--surface-2); color: var(--muted); }

/* ---------- template detail ---------- */
.backlink { color: var(--muted); font-size: .84rem; }
.backlink:hover { color: var(--ink); }
.dhead { display: flex; align-items: center; gap: 12px; }
.mlede { color: var(--ink-2); font-size: .98rem; max-width: 740px; }
.view h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.exfig {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.exfig img { width: 100%; display: block; }
.exfig figcaption { padding: 8px 11px; color: var(--muted); font-size: .74rem; }
.drivelink { color: var(--accent); font-weight: 700; }
.drivelink:hover { color: var(--accent-bright); }
.btnlink { display: inline-block; text-align: center; }
a.btnlink:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- catalog (45 formata) ---------- */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.fmt {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.fmt-n {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font-size: .8rem; font-weight: 800; color: var(--accent);
}
.fmt strong { font-size: .9rem; }
.fmt p { color: var(--ink-2); font-size: .82rem; margin: 3px 0; }
.dgrid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .dgrid { grid-template-columns: 1fr; } }
.dgrid p { color: var(--ink-2); font-size: .92rem; }
.dschematic { position: relative; aspect-ratio: 5 / 4; max-width: 340px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); margin-top: 6px; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); font-size: .88rem; margin-top: 6px; }
.prompt {
  display: flex; align-items: flex-start; gap: 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 6px;
}
.prompt code { background: none; padding: 0; color: var(--accent-bright); font-size: .84rem; flex: 1; white-space: pre-wrap; }

/* ---------- schematic previews ---------- */
.sc { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; }
.sc-photo { background: linear-gradient(135deg, #3d4a56, #23303c 55%, #17222c); }
.sc-photo.sky { background: linear-gradient(180deg, #4b6f8c, #2c4a63 60%, #1d3446); }
.sc-photo.blur { background: linear-gradient(135deg, #46525e, #2a3742); }
.sc-dark { background: linear-gradient(160deg, #191d22, #101318); }
.sc-drama { background: linear-gradient(160deg, #2b1616, #140d0d); }
.sc-paper { background: linear-gradient(160deg, #efe9dc, #e2d9c6); }
.sb { display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,.82); margin: 3px 0; }
.sb.big { height: 11px; }
.sb.serif { background: rgba(255,255,255,.92); }
.sb.gold { background: var(--gold); }
.sb.dark { background: rgba(20,20,20,.78); }
.sb.ital { transform: skewX(-12deg); }
.sc-bottom { margin-top: auto; }
.sc-top { margin-bottom: auto; }
.sc-center { margin: auto 0; }
.sc-cta { display: inline-block; width: 34%; height: 13px; border-radius: 7px; background: var(--accent); margin-top: 6px; }
.sc-cta.wide { width: 88%; display: block; }
.sc-chip { position: absolute; top: 10px; left: 12px; width: 26px; height: 12px; border-radius: 6px; background: rgba(255,255,255,.85); }
.sc-chip.in { position: static; margin-bottom: 5px; }
.sc-bigword { position: absolute; top: 16%; left: 0; right: 0; text-align: center; font-weight: 900; font-size: 2rem; letter-spacing: .04em; color: rgba(255,255,255,.16); }
.sc-head { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); width: 42%; aspect-ratio: 3/4; border-radius: 46% 46% 8% 8%; background: linear-gradient(180deg, #6d7d8b, #46525e); }
.sc-photo-top { height: 47%; border-radius: 8px; background: linear-gradient(135deg, #4a5b68, #2b3a46); }
.sc-panel { flex: 1; background: #efe9dc; border-radius: 8px; margin-top: 8px; padding: 10px; display: flex; flex-direction: column; }
.sc-panel .sb { background: rgba(20,20,20,.72); }
.sc-check { display: flex; align-items: center; gap: 6px; }
.sc-check b { color: #2e7d32; font-size: .62rem; }
.sc-check .sb { flex: none; }
.sc-card { margin: auto 14px; background: rgba(250,248,243,.96); border-radius: 10px; padding: 12px; }
.sc-rule { display: block; width: 26%; height: 3px; background: var(--gold); border-radius: 2px; margin-top: 5px; }
.sc-chev { position: absolute; right: 14px; bottom: 10px; color: rgba(255,255,255,.85); font-weight: 800; font-size: 1.1rem; }
.sc-split { background: var(--surface-2); flex-direction: row; align-items: center; gap: 8px; }
.sc-half { flex: 1; border-radius: 8px; padding: 10px; height: 72%; display: flex; flex-direction: column; justify-content: flex-end; }
.sc-half.ref { background: linear-gradient(135deg, #3a4652, #242f39); outline: 1px dashed rgba(255,255,255,.3); }
.sc-half.out { background: linear-gradient(135deg, #44525f, #2b3843); }
.sc-arrow { color: var(--accent); font-weight: 800; }
.sc-video { background: linear-gradient(150deg, #232a31, #14191e); }
.sc-face { position: absolute; right: 14%; bottom: 12%; width: 30%; aspect-ratio: 3/4; border-radius: 46% 46% 10% 10%; background: linear-gradient(180deg, #7d8b98, #515e6a); }
.sc-overlay { position: absolute; left: 12px; top: 22%; width: 46%; background: rgba(20,24,28,.85); border: 1px solid rgba(166,226,46,.5); border-radius: 8px; padding: 8px; }
.sc-cap { position: absolute; left: 20%; right: 20%; bottom: 8px; }
.sc-strip { display: flex; gap: 5px; margin-bottom: 8px; }
.sc-strip i { flex: 1; aspect-ratio: 4/3; border-radius: 5px; background: linear-gradient(135deg, #4a5b68, #303e4a); }
.sc-strip.brand i { background: linear-gradient(135deg, #3c4750, #262f37); border: 1px solid rgba(166,226,46,.35); }
.sc-play { position: absolute; right: 12px; top: 10px; color: rgba(255,255,255,.55); font-size: .8rem; }
.sc-boxed { margin: auto 18%; background: rgba(10,12,8,.72); border-radius: 8px; padding: 10px; }
.sc-wave { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: auto; }
.sc-wave i { flex: 1; background: var(--accent); opacity: .65; border-radius: 2px; }
.sc-wave i:nth-child(odd) { height: 55%; }
.sc-wave i:nth-child(even) { height: 95%; }
.sc-wave i:nth-child(3n) { height: 30%; }
.sc-diag { position: absolute; left: -10%; right: -10%; height: 16px; background: linear-gradient(90deg, transparent, rgba(255,120,60,.5), transparent); transform: rotate(-14deg); top: 34%; }
.sc-diag.d2 { top: 52%; transform: rotate(-10deg); opacity: .5; }
.sc-coverpair { background: var(--surface-2); justify-content: center; gap: 8px; }
.sc-coverbar { position: relative; height: 44%; border-radius: 8px; background: linear-gradient(135deg, #3d4a56, #26323d); display: flex; align-items: center; }
.sc-avatar { position: absolute; left: 50%; bottom: -14px; transform: translateX(-58%); width: 34px; height: 34px; border-radius: 50%; background: #efe9dc; border: 2px solid var(--surface-2); }
.sc-right { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 34%; }
.sc-note { margin-top: auto; text-align: center; color: var(--muted); font-size: .64rem; letter-spacing: .03em; }

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--grid); }
  .main { padding: 20px 16px 50px; }
}
