/* ==========================================================================
   Administratorski panel i instalacija
   ========================================================================== */
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/manrope-latin-wght-normal.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; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/manrope-latin-ext-wght-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --accent: #A34A3A;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, #fff);
  --bg: #F4F3F0;
  --surface: #FFFFFF;
  --surface-2: #FAF9F7;
  --ink: #1C1A20;
  --ink-2: #4A4550;
  --muted: #847E89;
  --line: #E6E2DC;
  --line-2: #EFECE7;
  --sidebar: #17151B;
  --sidebar-ink: #D9D5DE;
  --success: #2F7A4F;
  --warn: #A86A12;
  --danger: #B3362B;
  --info: #2F5D8A;
  --new: #C2402E;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 21, 27, .05), 0 6px 24px -12px rgba(23, 21, 27, .12);
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 16px; }
.right { text-align: right; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Shell ------------------------------------------------------------------ */
.admin-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); color: var(--sidebar-ink); padding: 20px 14px 24px; display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; scrollbar-color: #3a3640 transparent; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.sidebar-brand img { max-height: 34px; width: auto; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .02em; flex-shrink: 0; }
.sidebar-brand strong { display: block; font-size: 14px; line-height: 1.2; }
.sidebar-brand small { display: block; font-size: 11px; color: #8E8895; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #6F6976; padding: 6px 10px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--sidebar-ink); font-weight: 550; font-size: 13.5px; transition: background .15s, color .15s; border: 0; background: none; width: 100%; font: inherit; cursor: pointer; text-align: left; }
.nav-link .icon { width: 17px; height: 17px; opacity: .8; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active .icon { color: var(--accent); opacity: 1; filter: brightness(1.6) saturate(.8); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--new); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; font-size: 12.5px; color: #A8A2AF; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(244,243,240,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar .crumbs a { text-decoration: none; }
.topbar .crumbs a:hover { color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; }
.content { padding: 26px 28px 60px; max-width: 1440px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 25px; font-weight: 750; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 720px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; font-size: 13.5px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: #CFC9C1; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #FBEDEB; border-color: #F0C9C4; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-icon { padding: 7px; }
.inline-form { display: inline; margin: 0; }

/* Cards & layout ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 720; display: flex; gap: 10px; align-items: center; }
.card-head .num { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.card-body { padding: 20px; }
.card-body.tight { padding: 12px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.split > aside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 18px; }
.split > aside .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 18px; }

/* Stats ------------------------------------------------------------------- */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.stat-label .icon { width: 16px; height: 16px; color: var(--accent); }
.stat-value { font-size: 30px; font-weight: 780; letter-spacing: -.02em; line-height: 1.1; }
.stat-note { font-size: 12px; color: var(--muted); }
.stat.highlight { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.highlight .stat-label, .stat.highlight .stat-note { color: #B6B0BC; }
a.stat:hover { border-color: #CFC9C1; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 36px; gap: 12px; align-items: center; font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* Badges ------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: #EEECE8; color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-new { background: #FCE9E5; color: var(--new); }
.badge-info { background: #E7EFF7; color: var(--info); }
.badge-warn { background: #FBF0DD; color: var(--warn); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: #E4F2E9; color: var(--success); }
.badge-muted { background: #EEECE8; color: #77717C; }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--new); display: inline-block; box-shadow: 0 0 0 3px #FCE9E5; }

/* Alerts ------------------------------------------------------------------ */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 11px; border: 1px solid; font-size: 13.5px; margin-bottom: 16px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: #ECF6F0; border-color: #CBE6D5; color: #1F5A39; }
.alert-error { background: #FCEEEC; border-color: #F2CDC7; color: #8E2A21; }
.alert-info { background: #EDF3F9; border-color: #CFDDEC; color: #24496D; }
.alert-warn { background: #FCF4E6; border-color: #F0DDB6; color: #7A4E0E; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* Forms ------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field .req { color: var(--danger); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=tel], .field input[type=number], .field input[type=date], .field input[type=datetime-local], .field input[type=search], .field select, .field textarea, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid #DAD5CE; border-radius: 9px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea, textarea.input { min-height: 92px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 220px; }
textarea.xtall { min-height: 420px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.field .help { font-size: 12px; color: var(--muted); margin: 0; }
.field-error { color: var(--danger); font-size: 12.5px; margin: 2px 0 0; font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.input-color { display: flex; gap: 8px; align-items: center; }
.input-color input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid #DAD5CE; border-radius: 9px; background: #fff; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: #D5D0C9; position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.fieldset legend { padding: 0 6px; font-weight: 700; font-size: 13px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 20; margin-top: 22px; padding: 14px 18px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -8px 30px -18px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sticky-actions .note { color: var(--muted); font-size: 12.5px; margin-right: auto; }

/* Tabs -------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab.active, .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.tab .tab-err { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: middle; }

/* Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFBF9; }
.table tr.is-new td { background: #FFF8F6; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--new); }
.table .row-link { font-weight: 700; text-decoration: none; }
.table .row-link:hover { color: var(--accent); }
.table .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.sort-link { text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }

/* Filters ----------------------------------------------------------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 150px; flex: 1 1 150px; }
.filters .field.grow { flex: 2 1 240px; }
.filters .btns { display: flex; gap: 8px; }
.status-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 650; text-decoration: none; color: var(--ink-2); background: #fff; }
.chip b { font-weight: 800; color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.active b { color: #fff; }

/* Pagination -------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; display: inline-grid; place-items: center; border: 1px solid var(--line); text-decoration: none; font-weight: 650; font-size: 13px; background: #fff; }
.pagination a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination span { border: 0; background: none; }

/* Empty ------------------------------------------------------------------- */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; margin: 0 auto 10px; color: #C5BFB7; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* Detail / karton --------------------------------------------------------- */
.profile-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 22px; align-items: start; }
.profile-title { display: flex; gap: 14px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.profile-title h1 { font-size: 22px; font-weight: 780; }
.profile-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.profile-meta span { display: inline-flex; gap: 6px; align-items: center; }
.profile-meta .icon { width: 15px; height: 15px; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 7px; color: var(--ink-2); }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 22px 22px; }
.contact-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--surface-2); }
.contact-tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.contact-tile .k .icon { width: 14px; height: 14px; }
.contact-tile .v { font-weight: 700; font-size: 14px; word-break: break-word; }
.contact-tile .v a { text-decoration: none; }
.contact-tile .v a:hover { color: var(--accent); text-decoration: underline; }
.contact-tile .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.contact-tile .acts .btn { padding: 4px 9px; font-size: 12px; }
.kv { display: grid; grid-template-columns: minmax(160px, 34%) minmax(0, 1fr); border-top: 1px solid var(--line-2); }
.kv > div { padding: 11px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.kv > .k { color: var(--muted); font-size: 13px; font-weight: 650; padding-right: 16px; }
.kv > .v { font-size: 14px; word-break: break-word; }
.kv > .v.empty-v { color: #A7A1AC; font-style: italic; }
.kv .v p:last-child { margin-bottom: 0; }
.kv .v a { color: var(--info); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .tag { background: #fff; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { position: relative; padding: 7px 0 7px 26px; }
.tree > li::before { content: ""; position: absolute; left: 6px; top: 16px; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.tree ul { list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; border-left: 2px solid var(--line); }
.tree ul li { padding-left: 22px; }
.tree ul li::before { content: ""; position: absolute; left: 0; top: 17px; width: 14px; height: 2px; background: var(--line); }
.tree .label { font-weight: 700; }
.tree .note { display: block; color: var(--muted); font-size: 12.5px; }
.tree .tag { margin-left: 6px; font-size: 11px; padding: 1px 7px; }
.mat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mat-table td { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.mat-table td:last-child { text-align: right; }
.ans-have { color: var(--success); font-weight: 700; }
.ans-not { color: var(--muted); font-weight: 700; }
.ans-help { color: var(--warn); font-weight: 700; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.file-thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: #EAE6E0; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { font-weight: 700; word-break: break-word; }
.file-meta { font-size: 12px; color: var(--muted); }
.ref-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.ref-card + .ref-card { margin-top: 10px; }
.ref-card a { font-weight: 700; color: var(--info); word-break: break-all; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.feature-item { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 650; font-size: 13px; background: #fff; }
.feature-item .icon { color: var(--success); width: 16px; height: 16px; }

/* Timeline ---------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--line-2); margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.timeline li.t-system::before { border-color: #BDB7AF; }
.timeline .t-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.timeline .t-type { font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.timeline .t-body { margin-top: 4px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.timeline form { margin-left: auto; }

/* Repeater ---------------------------------------------------------------- */
.repeater { display: flex; flex-direction: column; gap: 10px; }
.rep-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.rep-row .rep-handle { color: #B5AEA6; padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; }
.rep-fields { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.rep-fields.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); }
.rep-fields.three { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 150px; }
.rep-tools { display: flex; flex-direction: column; gap: 4px; }
.rep-tools .btn { padding: 5px; }
.rep-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 13px; }

/* Media ------------------------------------------------------------------- */
.media-field { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px dashed #D6D0C8; border-radius: 12px; background: var(--surface-2); }
.media-preview { width: 86px; height: 64px; border-radius: 9px; background: #EAE6E0 center/cover no-repeat; flex-shrink: 0; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-info { min-width: 0; flex: 1; font-size: 12.5px; color: var(--muted); }
.media-info strong { display: block; color: var(--ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gallery-field { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-item { position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: #EAE6E0; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.gallery-item button .icon { width: 12px; height: 12px; }
.gallery-add { width: 96px; height: 72px; border: 1px dashed #CFC8BF; border-radius: 10px; background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 16px; }
.media-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.media-card:hover { border-color: #CFC9C1; box-shadow: var(--shadow); }
.media-card .thumb { aspect-ratio: 4/3; background: #EEEAE4; display: grid; place-items: center; color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; }
.media-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-card .meta { padding: 9px 11px; font-size: 12px; color: var(--muted); }
.media-card .meta strong { display: block; color: var(--ink); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone { border: 2px dashed #D6D0C8; border-radius: 14px; padding: 22px; text-align: center; background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* Modal ------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20,18,24,.55); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-box { width: min(980px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
.modal-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 16px; margin-right: auto; }
.modal-body { overflow-y: auto; }
.modal-tools { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; align-items: center; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 16px 18px; }
.picker-item { border: 2px solid transparent; border-radius: 11px; overflow: hidden; background: #F1EEE9; cursor: pointer; padding: 0; text-align: left; font: inherit; }
.picker-item .thumb { aspect-ratio: 4/3; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.picker-item img { width: 100%; height: 100%; object-fit: cover; }
.picker-item span { display: block; padding: 6px 8px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; }
.picker-item:hover, .picker-item.selected { border-color: var(--accent); }

/* Toast ------------------------------------------------------------------- */
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 200; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 650; font-size: 13.5px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.5); transform: translateY(20px); opacity: 0; transition: all .25s; pointer-events: none; }
.toast.show { transform: none; opacity: 1; }

/* Login & install --------------------------------------------------------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--sidebar); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); opacity: .6; }
.auth-side h2 { font-size: 34px; line-height: 1.15; max-width: 420px; font-weight: 760; letter-spacing: -.02em; position: relative; z-index: 1; }
.auth-side p { color: #A8A2AF; max-width: 400px; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 26px; font-weight: 780; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }

.install-wrap { min-height: 100vh; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.install-side { background: var(--sidebar); color: var(--sidebar-ink); padding: 34px 26px; }
.install-side h2 { color: #fff; font-size: 18px; margin-bottom: 4px; }
.install-side p { color: #8E8895; font-size: 13px; }
.install-steps { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.install-steps li a, .install-steps li span { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 13.5px; color: #8E8895; }
.install-steps .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #4A4550; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.install-steps .done a { color: var(--sidebar-ink); }
.install-steps .done .n { background: var(--success); border-color: var(--success); color: #fff; }
.install-steps .current span, .install-steps .current a { background: rgba(255,255,255,.08); color: #fff; }
.install-steps .current .n { border-color: var(--accent); background: var(--accent); color: #fff; }
.install-main { padding: 48px 40px; display: flex; justify-content: center; }
.install-card { width: min(760px, 100%); }
.install-card h1 { font-size: 28px; font-weight: 780; margin-bottom: 8px; letter-spacing: -.02em; }
.install-card > p.lead { color: var(--muted); margin-bottom: 24px; font-size: 15px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); align-items: start; }
.check-list li:last-child { border-bottom: 0; }
.check-list .ok { color: var(--success); }
.check-list .bad { color: var(--danger); }
.check-list .opt { color: var(--warn); }
.check-list .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.check-list .val { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: right; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > aside { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 90; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 50px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-page, .install-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 24px; min-height: 0; }
  .auth-side h2 { font-size: 24px; }
  .install-side { padding: 20px; }
  .install-steps { flex-direction: row; overflow-x: auto; margin-top: 14px; }
  .install-steps li a, .install-steps li span { white-space: nowrap; padding: 8px 10px; }
  .install-main { padding: 26px 16px; }
  .rep-fields.two, .rep-fields.three { grid-template-columns: minmax(0, 1fr); }
  .profile-head { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); padding: 0 18px 18px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv > .k { padding: 10px 0 0; border-bottom: 0; font-size: 12px; }
  .kv > .v { padding-top: 2px; }
  /* Tabele postaju kartice na mobilnom */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.responsive td { padding: 4px 0; border: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
  .table.responsive td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding-top: 2px; }
  .table.responsive td.primary-cell { grid-template-columns: minmax(0, 1fr); font-size: 15px; }
  .table.responsive td.primary-cell::before { display: none; }
  .table.responsive td.actions { justify-content: flex-start; grid-template-columns: none; display: flex; padding-top: 8px; }
  .table.responsive td.actions::before { display: none; }
  .table.responsive tr.is-new { box-shadow: inset 3px 0 0 var(--new); background: #FFF8F6; }
  .table.responsive tr.is-new td { background: transparent; box-shadow: none; }
  .bar-row { grid-template-columns: 100px 1fr 30px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 24px; }
  .page-head h1 { font-size: 21px; }
  .file-row { grid-template-columns: 44px minmax(0, 1fr); }
  .file-row .file-acts { grid-column: 1 / -1; }
}
@media print {
  .sidebar, .topbar, .page-actions, .sticky-actions, aside, .no-print { display: none !important; }
  .admin-shell { display: block; }
  .card { box-shadow: none; }
  body { background: #fff; }
}
