/* Astra održavanje — bez build koraka, radi na svakom shared hostingu. */
:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --panel-2: #eef0f5;
  --fg: #12141a;
  --muted: #5d6475;
  --line: #dfe2ea;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --grid: #e7e9ef;
  --shadow: 0 1px 2px rgba(16, 20, 30, .05), 0 8px 24px rgba(16, 20, 30, .06);
  --radius: 14px;
  --c1: #2563eb; --c2: #e0662d; --c3: #0e9f8e; --c4: #9b51e0; --c5: #d1a10a; --c6: #d6336c;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e13;
    --panel: #151821;
    --panel-2: #1c2030;
    --fg: #eef0f5;
    --muted: #9aa2b5;
    --line: #262b3a;
    --accent: #4f8bff;
    --accent-fg: #0c0e13;
    --ok: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --grid: #1f2433;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    --c1: #4f8bff; --c2: #ff8a4c; --c3: #2dd4bf; --c4: #b98cff; --c5: #f5c542; --c6: #ff6b9a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 32px); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.est { font-style: italic; color: var(--muted); }
.est::before { content: "~"; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--fg); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); font: 700 12px/1 var(--sans); letter-spacing: .04em; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a, .nav button { font: inherit; font-size: 14px; color: var(--muted); padding: 7px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.nav a:hover, .nav button:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--fg); background: var(--panel-2); }
.nav form { margin: 0; }

main { padding: 24px 0 56px; }
.flash { margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.4vw, 24px); box-shadow: var(--shadow); min-width: 0; }
.card h2, .sec-title { margin: 0; font-size: 16px; font-weight: 600; }
.note { margin: 4px 0 16px; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.sec { margin-bottom: 32px; scroll-margin-top: 112px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font: 400 26px/1.2 var(--serif); }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px); padding: clamp(22px, 5vw, 48px); margin-bottom: 16px; border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--panel)), var(--panel));
  box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -8%; bottom: -45%; width: 70%; height: 80%; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); filter: blur(50px); pointer-events: none; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0 0 28px; font: 400 clamp(30px, 6vw, 50px)/1.05 var(--serif); }
.hero-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px clamp(24px, 6vw, 72px); }
.lbl { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.odo { display: flex; align-items: flex-end; gap: 5px; font: 400 clamp(28px, 7vw, 46px)/1 var(--serif); font-variant-numeric: tabular-nums; }
.odo .dg { display: inline-grid; place-items: center; width: 1.02em; height: 1.36em; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); box-shadow: inset 0 -8px 12px color-mix(in srgb, var(--fg) 5%, transparent); }
.odo .sep { width: 4px; }
.odo .unit { font: 15px var(--sans); color: var(--muted); margin-left: 6px; padding-bottom: 6px; }
.due { flex: 1 1 260px; max-width: 440px; }
.due-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.due-big { font: 400 30px/1.2 var(--serif); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.due-big small { font: 15px var(--sans); color: var(--muted); }
.meter { height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--fg) 10%, transparent); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.due-foot { margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* section pills */
.pills { position: sticky; top: 56px; z-index: 10; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; margin-bottom: 16px; background: var(--bg); }
.pills button { flex: none; font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; }
.pills button[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* stats */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin-bottom: 32px; }
.stat .val { margin-top: 4px; font: 400 26px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.stat .val small { font: 13px var(--sans); color: var(--muted); margin-left: 4px; }

/* charts */
.chart { position: relative; min-height: 250px; }
.chart svg { display: block; overflow: visible; }
.chart .tick text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .tick line { display: none; }
.tip { position: absolute; z-index: 5; pointer-events: none; max-width: 16rem; padding: 6px 10px; border-radius: 10px; font-size: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tip .t { color: var(--muted); }
.tip .k { font-weight: 600; font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.areas { display: grid; gap: 8px; }
.area { display: grid; grid-template-columns: minmax(8.5rem, 11rem) 1fr 2rem; align-items: center; gap: 10px; width: 100%; padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.area .nm { display: flex; align-items: center; gap: 8px; }
.area .bar { height: 14px; border-radius: 7px; }
.area .n { text-align: right; font-variant-numeric: tabular-nums; }
.area:hover .bar { filter: brightness(1.12); }

/* timeline */
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.search { flex: 1 1 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl li { position: relative; display: grid; grid-template-columns: 16px 7.5rem 1fr auto; gap: 2px 14px; padding: 10px 0; align-items: start; }
.tl li::before { content: ""; width: 12px; height: 12px; margin: 5px 0 0 2px; border-radius: 50%; background: var(--dot, var(--muted)); box-shadow: 0 0 0 3px var(--panel); position: relative; z-index: 1; grid-row: span 2; }
.tl .d { font-weight: 600; font-variant-numeric: tabular-nums; }
.tl .k { grid-column: 2; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl .it { grid-column: 3; grid-row: 1; }
.tl .ar { grid-column: 3; font-size: 13px; color: var(--muted); }
.tl .ed { grid-column: 4; grid-row: 1 / span 2; font-size: 13px; }
.tl .cost { color: var(--fg); font-weight: 500; }
@media (max-width: 560px) {
  .tl li { grid-template-columns: 16px 1fr auto; }
  .tl .d, .tl .k, .tl .it, .tl .ar { grid-column: 2; grid-row: auto; }
  .tl .ed { grid-column: 3; grid-row: 1; }
  .tl li::before { grid-row: span 4; }
}
.empty { padding: 12px 0 0 28px; color: var(--muted); font-size: 13px; }

/* forms */
.form { display: grid; gap: 16px; max-width: 640px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); }
.err { font-size: 13px; color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: var(--accent-fg); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: var(--panel); color: var(--fg); border-color: var(--line); }
.btn.danger { background: none; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--fg); font-size: 14px; }
.check input { width: auto; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(100%, 400px); }
.auth h1 { margin: 12px 0 4px; font: 400 30px/1.2 var(--serif); }

@media (prefers-reduced-motion: no-preference) {
  .meter i { transition: width .9s cubic-bezier(.2, .8, .2, 1); }
  .rise { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ===== Garaža (više auta) ===== */
.brand-mark svg { width: 18px; height: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.page-head h1 { margin: 0; font: 400 clamp(28px, 5vw, 40px)/1.1 var(--serif); }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.cars { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 36px; }
.car-card { display: flex; flex-direction: column; overflow: hidden; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); color: var(--fg); transition: transform .15s ease, box-shadow .15s ease; }
.car-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16,20,30,.06), 0 16px 40px rgba(16,20,30,.12); }
.car-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--car, var(--accent)), color-mix(in srgb, var(--car, var(--accent)) 35%, #0c0e13)); display: grid; place-items: center; overflow: hidden; }
.car-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.car-cover .ini { font: 500 64px/1 var(--serif); color: rgba(255,255,255,.92); letter-spacing: .02em; }
.car-cover .ini-car { position: absolute; right: -6%; bottom: -8%; width: 70%; opacity: .16; color: #fff; }
.car-cover .plate { position: absolute; left: 12px; bottom: 12px; padding: 3px 8px 3px 6px; border-radius: 6px; background: #fff; color: #111; font: 600 12px/1.2 var(--sans); letter-spacing: .06em; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: inline-flex; gap: 6px; align-items: center; }
.car-cover .plate::before { content: "SRB"; padding: 1px 3px; border-radius: 3px; background: #1d4ed8; color: #fff; font-size: 9px; }
.car-cover .owner { position: absolute; right: 12px; top: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; backdrop-filter: blur(6px); }
.car-body { padding: 16px 18px 18px; display: grid; gap: 12px; }
.car-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.car-title h3 { margin: 0; font: 500 21px/1.2 var(--serif); }
.car-title .km { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.car-sub { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.mini-due .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.mini-due .meter { height: 6px; }
.car-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.add-card { display: grid; place-items: center; gap: 8px; min-height: 260px; border: 2px dashed var(--line); border-radius: calc(var(--radius) + 4px); color: var(--muted); text-align: center; padding: 24px; }
.add-card:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.add-card .plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-size: 28px; line-height: 1; }

/* status čipovi */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.ok::before { background: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.pill.warn::before { background: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.pill.bad::before { background: var(--bad); }
.pill.plain::before { display: none; }

/* podmeni auta */
.car-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.car-head .avatar { width: 48px; height: 48px; border-radius: 14px; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--car, var(--accent)); color: #fff; font: 500 20px/1 var(--serif); }
.car-head .avatar img { width: 100%; height: 100%; object-fit: cover; }
.car-head h1 { margin: 0; font: 400 clamp(24px, 4.5vw, 34px)/1.1 var(--serif); }
.car-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.subnav a { flex: none; padding: 10px 14px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--fg); text-decoration: none; }
.subnav a.active { color: var(--fg); border-color: var(--car, var(--accent)); font-weight: 500; }

/* podsetnici */
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rem { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.rem.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.rem.bad { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.rem .t { font-weight: 600; }
.rem .meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.rem .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; align-items: center; }
.rem form { margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }

/* troškovi */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: 10px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.hbar .track { height: 14px; border-radius: 7px; background: var(--panel-2); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 7px; background: var(--car, var(--accent)); }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.top-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.top-list li:last-child { border-bottom: 0; }
.top-list .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* tabela (admin) */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.copy { display: flex; gap: 6px; align-items: center; }
.copy input { font-size: 13px; padding: 7px 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches label { display: block; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--fg); }
.swatches input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .03em; background: var(--panel-2); color: var(--muted); }
.badge.admin { background: color-mix(in srgb, var(--accent) 15%, var(--panel)); color: var(--accent); }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h2 { font: 400 24px/1.2 var(--serif); margin: 0 0 6px; }

/* ===== Galerija ===== */
.gallery { columns: 3 260px; column-gap: 12px; }
.gallery figure { break-inside: avoid; margin: 0 0 12px; position: relative; border-radius: 14px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.gallery img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.gallery figcaption { padding: 8px 12px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.gallery .cover-badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; backdrop-filter: blur(6px); }
.uploader { display: grid; place-items: center; gap: 8px; padding: 26px 18px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.uploader:hover, .uploader.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--fg); }
.uploader input { display: none; }
.uploader .big { font-size: 15px; font-weight: 600; color: var(--fg); }
.up-progress { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin-top: 10px; }
.up-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.lightbox { position: fixed; inset: 0; z-index: 100; height: 100vh; height: 100dvh; background: rgba(5,6,10,.95); display: flex; flex-direction: column; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; }
.lightbox[hidden] { display: none !important; }
.lightbox .stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; }
/* slika uvek cela na ekranu: najviše širina ekrana i visina ekrana bez donje trake */
.lightbox img { display: block; width: auto; height: auto; max-width: calc(100vw - 16px); max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px - env(safe-area-inset-bottom)); object-fit: contain; border-radius: 6px; }
.lightbox .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); color: #e5e7eb; font-size: 14px; }
.lightbox .lb-btn { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(20, 22, 28, .45); border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: background .15s, transform .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.lightbox .lb-btn svg { width: 22px; height: 22px; display: block; }
.lightbox .lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lightbox .lb-btn:active { transform: scale(.94); }
.lightbox .lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lightbox .nav { top: 50%; margin-top: -24px; }
.lightbox .prev { left: max(12px, env(safe-area-inset-left)); }
.lightbox .next { right: max(12px, env(safe-area-inset-right)); }
.lightbox .close { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 42px; height: 42px; }
.lightbox .close svg { width: 18px; height: 18px; }
.lightbox .lb-count { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-variant-numeric: tabular-nums; font-size: 13px; }
@media (max-width: 560px) {
  .lightbox .nav { width: 42px; height: 42px; margin-top: -21px; background: rgba(20, 22, 28, .35); }
  .lightbox .nav svg { width: 20px; height: 20px; }
}
.photo-acts { display: flex; gap: 6px; }
.photo-acts form { margin: 0; }
.photo-acts button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.photo-acts button:hover { color: var(--fg); }
.photo-acts .del:hover { color: var(--bad); }

/* ===== Registarske tablice ===== */
.lp { --h: 30px; display: inline-flex; align-items: stretch; height: var(--h); background: #fbfbf7; color: #111; border: calc(var(--h) * .055) solid #1a1a1a; border-radius: calc(var(--h) * .14); overflow: hidden; vertical-align: middle; box-shadow: 0 1px 2px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.6); font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif; font-weight: 500; line-height: 1; white-space: nowrap; user-select: all; }
.lp-sm { --h: 24px; } .lp-md { --h: 30px; } .lp-lg { --h: 44px; }
.lp-band { width: calc(var(--h) * .5); background: #003399; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: calc(var(--h) * .06) 0 calc(var(--h) * .07); gap: calc(var(--h) * .04); font-size: calc(var(--h) * .27); font-weight: 600; letter-spacing: .02em; }
.lp-stars { width: calc(var(--h) * .42); height: calc(var(--h) * .42); margin-bottom: auto; }
.lp-main { display: flex; align-items: center; gap: calc(var(--h) * .14); padding: 0 calc(var(--h) * .22) 0 calc(var(--h) * .2); font-size: calc(var(--h) * .78); letter-spacing: .03em; transform: translateY(calc(var(--h) * .02)); }
.lp-crest { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--h) * .02); height: 100%; }
.lp-crest svg { width: calc(var(--h) * .3); height: auto; }
.lp-crest-code { font-size: calc(var(--h) * .2); letter-spacing: .02em; }
.car-cover .lp { position: absolute; left: 12px; bottom: 12px; }

/* ===== Značka marke ===== */
.emblem { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.emblem img { width: 82%; height: 82%; object-fit: contain; }
.emblem-text { background: linear-gradient(145deg, #e9ecf2, #b9c0cc); color: #1f2430; font: 700 calc(var(--s) * .34)/1 var(--sans); letter-spacing: .04em; border-color: #9aa3b2; }
.car-title .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.car-head .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }

/* brzi unos km */
.km-quick { display: flex; gap: 6px; margin-top: 12px; max-width: 280px; }
.km-quick input { padding: 7px 10px; font-size: 14px; border-radius: 999px; }
.km-quick .btn { flex: none; }

/* =====================================================================
   NOĆNA GARAŽA — uvek tamna tema
   Grafitno-crna kao lak noću, crveno samo kao LED svetlo (aktivno/važno),
   Barlow (uski, tehnički) kao na instrument tabli.
   ===================================================================== */
:root {
  --bg: #0E1116;
  --panel: #161A21;
  --panel-2: #1D222B;
  --fg: #ECEEF1;
  --muted: #8C95A4;
  --line: #262C36;
  --grid: #1F242D;
  --accent: #E01E37;          /* DNA LED crvena */
  --accent-fg: #ffffff;
  --glow: rgba(224, 30, 55, .55);
  --steel: #C9CED6;           /* felne / instrument */
  --ok: #3CCB7F;
  --warn: #F5A524;
  --bad: #FF4D5E;
  --shadow: none;
  --radius: 12px;
  --c1: #E01E37; --c2: #F5A524; --c3: #2BC4A5; --c4: #8C7CF0; --c5: #4DA3FF; --c6: #C9CED6;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Barlow Condensed", "Barlow", "Arial Narrow", sans-serif;
  color-scheme: dark;
}
body { background: var(--bg); font-size: 15.5px; letter-spacing: .005em; }
::selection { background: var(--accent); color: #fff; }

/* naslovi: uski i čvrsti */
.hero h1, .page-head h1, .sec-head h2, .car-head h1, .auth h1,
.stat .val, .due-big, .car-title h3, .empty-state h2, .pub-hero h1 { font-weight: 600; letter-spacing: .01em; }
.hero h1 { font-size: clamp(34px, 7vw, 58px); }
.sec-head h2 { font-size: 28px; }

/* površine: tanka ivica + odsjaj gornje ivice, bez mekih senki */
.card, .car-card, .hero { background: var(--panel); border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035); }
.card { border-radius: var(--radius); }

/* gornja traka i meni */
.topbar { background: rgba(14, 17, 22, .86); border-bottom-color: var(--line); }
.brand-mark { background: none; color: var(--fg); border: 1px solid var(--line); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px 1px var(--glow); }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .02em; }
.nav a, .nav button { border-radius: 8px; position: relative; }
.nav a.active { background: none; color: var(--fg); }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--glow); }

/* dugmad */
.btn { background: var(--accent); color: #fff; border-radius: 10px; letter-spacing: .01em; }
.btn:hover { filter: none; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 18px -2px var(--glow); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: #3a4250; box-shadow: none; background: var(--panel-2); }
.btn.danger { background: transparent; }
input, select, textarea, .search { background: #10141A; border-color: var(--line); color: var(--fg); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(224, 30, 55, .35); }
input[type="checkbox"] { accent-color: var(--accent); }
.flash { background: rgba(60, 203, 127, .08); border-color: rgba(60, 203, 127, .35); }

/* zaglavlje pregleda: slika automobila u pozadini + crveno svetlo */
.hero { border-radius: 16px; background: linear-gradient(160deg, #1A1F27, #12161C); }
.hero::after { content: ""; position: absolute; left: clamp(22px, 5vw, 48px); bottom: 0; width: 140px; height: 3px; right: auto; top: auto; border-radius: 3px; filter: none;
  background: var(--accent); box-shadow: 0 0 14px 2px var(--glow), 0 0 40px 6px rgba(224, 30, 55, .25); }
.hero.has-photo { min-height: 340px; display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center 60%; }
.hero.has-photo .eyebrow { color: rgba(236, 238, 241, .75); }
.eyebrow { text-transform: none; letter-spacing: .02em; font-size: 14px; }

/* kilometraža kao na instrument tabli */
.odo { font-family: var(--serif); font-weight: 600; gap: 4px; }
.odo .dg { background: #07090C; color: #F4F6F8; border: 1px solid #2A303A; border-radius: 6px; box-shadow: inset 0 -10px 14px rgba(255, 255, 255, .03), inset 0 2px 6px rgba(0, 0, 0, .8);
  text-shadow: 0 0 10px rgba(255, 255, 255, .18); }
.odo .unit { color: var(--muted); }

/* merač do servisa: srebro, pa žuto/crveno kad se približi */
.meter { background: #0A0D11; border: 1px solid var(--line); height: 8px; }
.meter i { background: linear-gradient(90deg, #8C95A4, var(--steel)); }
.meter.warn i { background: var(--warn); box-shadow: 0 0 10px rgba(245, 165, 36, .5); }
.meter.bad i { background: var(--bad); box-shadow: 0 0 10px var(--glow); }

/* podmeni automobila: crveni LED ispod aktivnog */
.subnav { border-bottom-color: var(--line); }
.subnav a.active { color: var(--fg); border-color: var(--accent); box-shadow: 0 6px 10px -8px var(--glow); }
.car-head .avatar { border-radius: 12px; border: 1px solid var(--line); }

/* garaža */
.car-card { border-radius: 14px; }
.car-card:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 0 0 1px #313846, 0 16px 40px -12px rgba(0, 0, 0, .8); }
.car-cover { background: linear-gradient(135deg, #1D222B, #0E1116); }
.car-cover .ini { font-family: var(--serif); font-weight: 600; color: rgba(236, 238, 241, .9); }
.car-cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(14, 17, 22, .65)); pointer-events: none; }
.car-cover .lp, .car-cover .owner { z-index: 1; }
.add-card { border-color: var(--line); border-radius: 14px; }
.add-card:hover { border-color: var(--accent); color: var(--fg); box-shadow: 0 0 24px -10px var(--glow); }
.add-card .plus { background: var(--panel-2); color: var(--fg); }

/* čipovi, oznake, tabele */
.pill { background: var(--panel-2); border-color: var(--line); }
.chip { background: var(--panel-2); border-color: var(--line); }
.chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pills { background: var(--bg); }
.pills button { background: var(--panel); border-color: var(--line); }
.pills button[aria-current="true"] { background: var(--fg); color: var(--bg); }
.badge.admin { background: rgba(224, 30, 55, .14); color: #FF8A97; }
.tl li::before { box-shadow: 0 0 0 3px var(--panel); }
.lp { box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.emblem { background: #F4F6F8; border-color: #2A303A; }
.emblem-text { background: linear-gradient(145deg, #2A303A, #1A1F27); color: var(--fg); border-color: #3A4250; }
.uploader { border-color: var(--line); }
.uploader:hover, .uploader.drag { border-color: var(--accent); background: rgba(224, 30, 55, .05); }
.gallery figure { border-color: var(--line); background: var(--panel); border-radius: 12px; }

/* prijava */
.auth { background: radial-gradient(60% 50% at 50% 100%, rgba(224, 30, 55, .12), transparent 70%), var(--bg); }

@media (prefers-reduced-motion: reduce) {
  .car-card, .btn { transition: none; }
}

/* Podaci o vozilu */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; margin: 0; }
.facts dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8b93a1); }
.facts dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.facts-notes { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); color: var(--muted, #8b93a1); font-size: 14px; line-height: 1.6; }
.equip { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.equip summary { cursor: pointer; font-weight: 600; list-style: none; }
.equip summary::-webkit-details-marker { display: none; }
.equip summary::after { content: ' ▾'; color: var(--muted); }
.equip[open] summary::after { content: ' ▴'; }
.equip h3 { margin: 16px 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); font-size: 13px; }

/* Padajući meniji na telefonu */
.dd { display: none; position: relative; }
.dd > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dd > summary::-webkit-details-marker { display: none; }
.dd-panel { display: grid; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .85); }
.dd-panel a, .dd-panel button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 8px; color: var(--fg); font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; }
.dd-panel a:hover, .dd-panel button:hover { background: #1D222B; text-decoration: none; }
.dd-panel a.active { background: #1D222B; box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.dd-panel form { margin: 0; }
.dd[open] .dd-caret { transform: rotate(225deg); margin-top: 4px; }

/* meni auta */
.subnav-m { margin-bottom: 20px; }
.subnav-m > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.subnav-m .dd-label { font-weight: 600; font-size: 16px; }
.subnav-m .dd-hint { margin-left: auto; color: var(--muted); font-size: 13px; }
.subnav-m .dd-caret { width: 8px; height: 8px; margin: -4px 4px 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.subnav-m[open] > summary { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.subnav-m .dd-panel { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px); grid-template-columns: 1fr 1fr; }

/* glavni meni */
.menu-m { margin-left: auto; }
.menu-m > summary { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); }
.menu-m > summary svg { width: 20px; height: 20px; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; }
.menu-m[open] > summary { border-color: var(--accent); }
.menu-m .dd-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 30; }
.menu-m .dd-panel button { color: var(--bad); }

@media (max-width: 720px) {
  .subnav, .topbar .nav { display: none; }
  .dd { display: block; }
}

/* Donja traka (telefon) */
.bottombar { display: none; }
@media (max-width: 720px) {
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: #0E1116; border-top: 1px solid var(--line); }
  .bottombar > a, .bottombar summary { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .02em; text-decoration: none; }
  .bottombar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottombar .bb-more svg { fill: currentColor; stroke: none; }
  .bottombar > a.active, .bottombar summary.active, .bottombar .bb-more[open] summary { color: var(--fg); }
  .bottombar > a.active svg { stroke: var(--accent); filter: drop-shadow(0 0 6px var(--glow)); }
  .bottombar .dd { display: block; position: static; }
  .bb-add summary { padding: 0; }
  .bb-add .plus { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -22px; border-radius: 50%; background: var(--accent); color: #fff;
    box-shadow: 0 0 0 5px var(--bg), 0 8px 22px -4px var(--glow); transition: transform .15s; }
  .bb-add .plus svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .bb-add[open] .plus { transform: rotate(45deg); }
  body:has(.bottombar) main { padding-bottom: 96px; }
  body:has(.form-page) .bottombar { display: none; }
  body:has(.form-page) main { padding-bottom: 24px; }
}
/* listovi koji izlaze odozdo */
.sheet[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(5, 7, 10, .6); }
.sheet .sheet-panel { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 41; padding: 8px; animation: sheet-up .18s ease-out; }
.sheet-title { padding: 8px 12px 10px; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.sheet-panel a { display: flex; align-items: center; gap: 14px; padding: 12px; }
.sheet-panel a small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 1px; }
.sheet-panel a strong { font-weight: 600; }
.sheet-panel .si { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: #1D222B; font-size: 19px; }
@keyframes sheet-up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
:target { scroll-margin-top: 72px; }

/* Poruka posle akcije */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(520px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 16px; border-radius: 12px; background: #1A1F27; border: 1px solid #313846;
  border-left: 3px solid var(--ok); box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .8); animation: toast-in .2s ease-out; transition: opacity .25s, transform .25s; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
.toast-msg { flex: 1; font-size: 15px; }
.toast form { margin: 0; }
.toast-undo { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.toast-undo:hover { background: rgba(224, 30, 55, .1); }
.toast-x { font: 22px/1 var(--sans); color: var(--muted); background: none; border: 0; padding: 4px 8px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }
@media (max-width: 720px) { body:has(.bottombar) .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* Dugme Sačuvaj uvek vidljivo na telefonu */
@media (max-width: 720px) {
  .form-page > .actions { position: sticky; bottom: 0; z-index: 5; margin: 4px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(22, 26, 33, .85), #161A21 30%); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .form-page > .actions .btn { flex: 1; justify-content: center; text-align: center; min-height: 46px; }
  input, select, textarea { font-size: 16px; } /* iOS ne zumira polje pri dodiru */
}

/* Dnevnik: godine, detalji na dodir */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.tl li.yr { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 0 8px 30px; }
.tl li.yr::before { display: none; }
.tl li.yr:first-child { padding-top: 4px; }
.yr-y { font: 600 22px/1 var(--serif); letter-spacing: .02em; }
.yr-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tl-sticky li.yr { position: sticky; top: 56px; z-index: 3; background: var(--panel); box-shadow: 0 1px 0 var(--line); }
.tl li.row { cursor: pointer; border-radius: 10px; transition: background .12s; }
.tl li.row:hover { background: rgba(255, 255, 255, .02); }
.tl li.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl li.row[aria-expanded="true"] { background: rgba(255, 255, 255, .03); }
.tl .clip, .tl .has-note { color: var(--steel, var(--fg)); }
.tl .more { display: none; grid-column: 3 / -1; padding: 6px 0 4px; }
.tl li.row[aria-expanded="true"] .more { display: block; }
.more-notes { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--fg); white-space: normal; }
.more-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.more-files a { padding: 6px 10px; border-radius: 8px; background: #1D222B; border: 1px solid var(--line); font-size: 13px; color: var(--fg); }
.more-edit { display: none; }
@media (min-width: 721px) {
  .tl li.row[data-more="0"] { cursor: default; }
  .tl li.row[data-more="0"] .more { display: none !important; }
}
@media (max-width: 720px) {
  .tools { flex-wrap: nowrap; flex-direction: column; align-items: stretch; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; scroll-padding: 0 16px; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip-row .chip { flex: none; }
  .tl li.row { grid-template-columns: 16px auto 1fr; gap: 2px 10px; padding: 12px 8px 12px 0; }
  .tl li.row::before { grid-row: 1 / span 3; }
  .tl li.row .d { grid-column: 2; grid-row: 1; font-size: 13px; }
  .tl li.row .k { grid-column: 3; grid-row: 1; }
  .tl li.row .it { grid-column: 2 / -1; grid-row: 2; font-weight: 500; }
  .tl li.row .ar { grid-column: 2 / -1; grid-row: 3; }
  .tl li.row .ed { display: none; }
  .tl li.row .more { grid-column: 2 / -1; grid-row: 4; }
  .more-edit { display: inline-flex; }
  .tl li.yr { padding-left: 28px; }
}

/* Sklopive sekcije pregleda */
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary.sec-head { display: flex; align-items: center; gap: 12px; }
details.fold > summary h2 { margin-right: auto; }
.fold-caret { width: 9px; height: 9px; margin: -4px 6px 0 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; }
details.fold[open] > summary .fold-caret { transform: rotate(225deg); margin-top: 4px; }
@media (min-width: 721px) {
  details.fold > summary { cursor: default; pointer-events: none; }
  details.fold > summary a { pointer-events: auto; }
  .fold-caret { display: none; }
}
@media (max-width: 720px) {
  .pills { display: none; }
  details.fold { margin-bottom: 10px; }
  details.fold > summary.sec-head { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  details.fold[open] > summary.sec-head { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; }
  details.fold[open] > summary + .card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
  details.fold > summary h2 { font-size: 17px; }
  .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 10px; margin: 0 -14px 18px; padding: 0 14px 4px; scroll-padding: 0 14px; }
  .stats::-webkit-scrollbar { display: none; }
  .stats > .stat { flex: 0 0 72%; scroll-snap-align: start; }
}

/* Izbor delova u formi */
.parts-pick { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #10141A; }
.parts-pick > summary { cursor: pointer; font-size: 14px; font-weight: 500; list-style: none; }
.parts-pick > summary::-webkit-details-marker { display: none; }
.parts-pick > summary::after { content: " ▾"; color: var(--muted); }
.parts-pick[open] > summary::after { content: " ▴"; }
.parts-pick[open] > summary { margin-bottom: 10px; }
.parts-pick .presets { max-height: 260px; overflow-y: auto; }
.parts-pick .chip { text-align: left; }
.parts-pick .chip[hidden] { display: none; }
.parts-search { margin-bottom: 10px; padding: 9px 14px; }

@media (max-width: 720px) {
  .sec-head { flex-wrap: wrap; align-items: center; }
  .sec-head > .actions { width: 100%; }
  .sec-head > .actions .btn { flex: 1; justify-content: center; text-align: center; }
  .grid.sec { gap: 0; }
  .grid.sec > details.fold { margin-bottom: 10px; }
}

/* Kartica auta u garaži: podaci na dnu */
.car-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0; margin-top: 2px; border-top: 1px solid var(--line); padding-top: 14px; }
.car-facts .cf { display: grid; align-content: start; gap: 3px; padding: 0 12px; min-width: 0; border-left: 1px solid var(--line); }
.car-facts .cf:first-child { padding-left: 0; border-left: 0; }
.car-facts .cf:last-child { padding-right: 0; }
.cf-l { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cf-v { display: flex; align-items: flex-start; gap: 7px; font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.cf-v.num { font-variant-numeric: tabular-nums; }
.cf-s { font-size: 13px; color: var(--muted); }
.cf-s.warn { color: var(--warn); }
.cf-s.bad { color: var(--bad); }
.cf-v .dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 6px rgba(60, 203, 127, .6); }
.cf-v .dot.warn { background: var(--warn); box-shadow: 0 0 6px rgba(245, 165, 36, .6); }
.cf-v .dot.bad { background: var(--bad); box-shadow: 0 0 6px rgba(255, 77, 94, .6); }

/* Galerija kao mreža */
.gallery { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-flow: dense; gap: 10px; }
.gallery figure { margin: 0; aspect-ratio: 1; border-radius: 12px; }
.gallery figure.feat { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease, filter .25s; }
.gallery figure:hover img { transform: scale(1.03); filter: brightness(1.05); }
.gallery figcaption { display: none; }
.gallery .cover-badge { z-index: 1; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.lb-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lb-act { font: inherit; font-size: 13px; color: #e5e7eb; background: rgba(255, 255, 255, .1); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.lb-act:hover { background: rgba(255, 255, 255, .18); }
.lb-act.del { color: #FF8A97; }
.lb-act[hidden] { display: none; }
@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 -14px; }
  .gallery figure { border-radius: 0; border: 0; }
  .gallery figure.feat { border-radius: 0; }
  .gallery .cover-badge { left: 6px; top: 6px; padding: 2px 7px; font-size: 10px; }
}
.lightbox { z-index: 80; }

/* Dodavanje slika: galerija ili kamera */
.uploader { cursor: default; }
.up-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.up-btns .btn { position: relative; cursor: pointer; min-width: 140px; justify-content: center; }
.up-btns input { display: none; }
.up-btns .cam, .up-hint { display: none; }
.up-hint.desk { display: block; }
@media (pointer: coarse) {
  .up-btns .cam, .up-hint { display: inline-flex; }
  .up-hint.desk { display: none; }
}
#dodaj:target .uploader { border-color: var(--accent); }

/* PWA: instalirana aplikacija */
.dd-panel .install { color: var(--fg); font-weight: 600; }
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}
[data-install][hidden] { display: none !important; }
