/* Admin i super admin: svijetlo, čisto, veliki dodirni elementi. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f7f9; --surface: #fff; --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --line-2: #d1d5db;
  --primary: #2447c9; --primary-ink: #fff; --primary-soft: #eef2ff; --ok: #15803d; --ok-soft: #ecfdf3;
  --danger: #b42318; --danger-soft: #fef3f2; --warn-soft: #fff7ed; --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.015em; }
h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.005em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 30px; height: 30px; }
.hide-sm { display: inline; }
[hidden] { display: none !important; }

/* gornja traka */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.mainnav a:hover { background: var(--bg); color: var(--ink); }
.mainnav a.is-active { background: var(--primary-soft); color: var(--primary); }
.logout { margin-left: auto; }

.page { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back .ic { transform: rotate(-90deg); width: 16px; height: 16px; }

/* kartice i dugmad */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font: 600 15px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(17, 24, 39, .12); }
.btn-primary:hover { background: #1d3aa8; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #e0e7ff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg); }
.btn:focus-visible, .icon-btn:focus-visible, .toggle:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 1px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--bg); color: var(--ink); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: #fecdca; }
form.inline { display: inline-flex; gap: 2px; margin: 0; }

/* poruke */
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-weight: 500; animation: flash-in .3s ease both; }
.flash .ic { margin-top: 1px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #abefc6; }
.flash-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecdca; margin-bottom: 14px; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* forme */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 16px 24px; grid-template-columns: 1fr; }
.form-col { display: grid; gap: 16px; align-content: start; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label { font-weight: 600; font-size: 14px; }
.label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 11px; background: #fff; color: var(--ink);
  font: 400 16px/1.35 inherit; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 92px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #e0e7ff; }
.has-error input, .has-error select, .has-error textarea, .has-error .drop { border-color: var(--danger); }
.error { color: var(--danger); font-size: 13.5px; font-weight: 500; }
.hint { color: var(--muted); font-size: 13px; }
.input-suffix, .input-prefix { position: relative; display: flex; align-items: center; }
.input-suffix span { position: absolute; right: 13px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-suffix input { padding-right: 48px; font-variant-numeric: tabular-nums; }
.input-prefix span { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-prefix input { padding-left: 36px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.check span { display: grid; gap: 2px; }
.check small { color: var(--muted); }
.check-sm { padding: 8px 0; border: 0; align-items: center; font-size: 14px; }
.check-sm input { margin: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.narrow { max-width: 460px; }
.row-form { display: flex; gap: 10px; }
.row-form input { flex: 1; }

/* polje za sliku */
.drop { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: 100%; max-width: 320px; border: 1.5px dashed var(--line-2); border-radius: 14px;
  background: #fafafa; cursor: pointer; overflow: hidden; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--primary); background: var(--primary-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.drop-empty { display: grid; gap: 6px; justify-items: center; padding: 18px; color: var(--muted); pointer-events: none; }
.drop-empty strong { color: var(--ink); }
.drop-empty small { font-size: 12.5px; max-width: 220px; }
.drop-logo { width: 104px; height: 104px; border-radius: 50%; flex: none; }
.drop-logo .drop-preview { object-fit: cover; }
.logo-row { display: flex; gap: 16px; align-items: center; }
.logo-help { display: grid; gap: 4px; }

/* boje */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 42px; height: 42px; cursor: pointer; }
.swatch input[type=radio] { position: absolute; opacity: 0; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s; }
.swatch input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.swatch input:focus-visible + span { outline: 3px solid #c7d2fe; outline-offset: 4px; }
.swatch-custom input[type=color] { width: 42px; height: 42px; padding: 3px; border: 2px dashed var(--line-2); border-radius: 50%; overflow: hidden; cursor: pointer; background: none; }
.swatch-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch-custom input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch-custom input[type=radio]:checked ~ input[type=color] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }

/* ponuda */
.cat-card { padding: 0; overflow: hidden; scroll-margin-top: 80px; }
.cat-card.is-muted .cat-head h2 { color: var(--muted); }
.cat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); background: #fcfcfd; }
.rename { flex: 1; min-width: 0; }
.rename summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; cursor: pointer; min-height: 38px; }
.rename summary::-webkit-details-marker { display: none; }
.rename h2 { margin: 0; font-size: 18px; }
.rename .row-form { margin: 8px 0 4px; max-width: 460px; }
.rename[open] .link-sm { display: none; }
.count { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; }
.link-sm { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.link-sm .ic { width: 15px; height: 15px; }
.rename summary:hover .link-sm { color: var(--primary); }
.cat-actions { display: flex; gap: 2px; flex: none; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.item-row:target { animation: hl 1.6s ease; }
@keyframes hl { 0%, 40% { background: #fffbeb; } 100% { background: transparent; } }
.item-row.is-off .item-main strong, .item-row.is-off .price { color: var(--muted); }
.item-row.is-off .thumb img { filter: grayscale(1); opacity: .6; }
.thumb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; background: var(--bg); color: #9ca3af; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-main { display: grid; gap: 2px; min-width: 0; color: var(--ink); text-decoration: none; }
.item-main:hover strong { color: var(--primary); }
.item-main .desc { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font: 600 13px/1 inherit; font-family: inherit; color: var(--muted); white-space: nowrap; }
.toggle .knob { position: relative; width: 36px; height: 22px; border-radius: 999px; background: #d1d5db; transition: background .2s; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle.on { color: var(--ok); border-color: #abefc6; background: var(--ok-soft); }
.toggle.on .knob { background: var(--ok); }
.toggle.on .knob::after { transform: translateX(14px); }
.cat-foot { padding: 12px 20px; }
.pad { padding: 14px 20px 0; margin: 0; }
.add-cat h2 { margin-bottom: 10px; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-on { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--warn-soft); color: #b54708; }
.empty-state { text-align: center; padding: 34px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); margin-bottom: 16px; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin: 8px 0 4px; }
.empty-state p { max-width: 460px; margin: 0 auto; }

/* QR */
.qr-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
.qr-preview { display: grid; place-items: center; background: #eef0f3; }
.qr-preview img { width: 100%; max-width: 330px; height: auto; border-radius: 6px; box-shadow: 0 16px 40px -20px rgba(17, 24, 39, .45); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 14px; }
.mt { margin-top: 22px; }
.downloads { list-style: none; margin: 0 0 12px; padding: 0; }
.downloads li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.downloads li div { display: grid; }

/* super admin */
.super-layout { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 14px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: #fcfcfd; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 8px; }
.secret { display: flex; gap: 14px; align-items: flex-start; background: #fffbeb; border-color: #fde68a; }
.secret p { margin: 6px 0; }
.secret-value { font-size: 18px; padding: 4px 10px; background: #fff; border: 1px solid #fde68a; border-radius: 8px; user-select: all; }

/* prijava */
.auth .page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px; box-shadow: 0 20px 50px -30px rgba(17, 24, 39, .35); }
.auth-card h1 { font-size: 24px; }
.auth-card > p { margin: 6px 0 20px; }
.auth-card.center { text-align: center; }
.auth-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--primary); color: #fff; margin-bottom: 18px; }
.auth-card.center .auth-mark { margin-left: auto; margin-right: auto; }
.auth-mark .ic { width: 24px; height: 24px; }
.auth-foot { font-size: 13px; margin: 18px 0 0; text-align: center; }
.err-code { margin: 0 0 6px; font-size: 44px; font-weight: 700; color: var(--line-2); }
.stack-sm { display: grid; gap: 8px; }

@media (min-width: 860px) {
  .form-grid { grid-template-columns: 1.4fr 1fr; }
  .form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .qr-layout { grid-template-columns: 380px 1fr; }
  .super-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px 0; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 10px 8px; }
  .mainnav::-webkit-scrollbar { display: none; }
  .hide-sm { display: none; }
  .page { padding: 18px 14px 80px; }
  h1 { font-size: 23px; }
  .page-head .btn { width: 100%; }
  .card { padding: 16px; }
  .card.cat-card, .card.table-card { padding: 0; }
  .cat-head { padding: 12px 10px 10px 14px; flex-direction: column; }
  .cat-actions { align-self: flex-end; margin-top: -4px; }
  .item-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "thumb main main" "thumb price price" "avail avail actions"; gap: 4px 12px; padding: 12px 10px 12px 14px; }
  .avail { margin-top: 8px; }
  .row-actions { margin-top: 8px; }
  .thumb { grid-area: thumb; width: 52px; height: 52px; align-self: start; }
  .item-main { grid-area: main; }
  .price { grid-area: price; align-self: start; }
  .item-main .desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .avail { grid-area: avail; justify-self: start; }
  .row-actions { grid-area: actions; justify-self: end; }
  .cat-foot { padding: 12px 14px; }
  .cat-foot .btn { width: 100%; }
  .row-form { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
  .drop { max-width: none; aspect-ratio: 16 / 10; }
  .drop-logo { aspect-ratio: 1; }
  .form-actions .btn { flex: 1 1 100%; }
}
