/* Eventamo. Boje glavne palete dolaze iz postavki kroz --primary* varijable. */
:root {
  --ink: #1e1c18;
  --ink-2: #4a463f;
  --muted: #6b665d;
  --line: #e3e0d9;
  --line-2: #d2cdc3;
  --bg: #f5f5f2;
  --surface: #ffffff;
  --ok: #2f6f3a;
  --ok-bg: #e9f3ea;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --danger: #a3261f;
  --danger-bg: #fbeceb;
  --radius: 8px;
  --radius-lg: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--primary-strong); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.012em; margin: 0; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 650; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 650; margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { max-width: 70ch; margin: -6px 0 22px; }
.text-danger { color: var(--danger); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Zaglavlje ---------- */
.topbar { display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand img { height: 30px; width: auto; }
.brand span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-right: 9px; vertical-align: 1px; }
.brand img + span::before { display: none; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: var(--radius); font-weight: 500; }
.mainnav a:hover { background: var(--bg); }
.mainnav a.on { color: var(--ink); background: var(--primary-wash); box-shadow: inset 0 -2px 0 var(--primary); border-radius: var(--radius) var(--radius) 0 0; }
.userbox { display: flex; align-items: center; gap: 10px; }
.uname { color: var(--muted); font-size: 14px; }

.eventbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 18px 28px 0; }
.eventbar-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.eventbar-title .crumb { width: 100%; font-size: 13px; color: var(--muted); text-decoration: none; }
.eventbar-title .crumb::before { content: "‹ "; }
.eventbar-meta { color: var(--muted); }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--ink-2); padding: 10px 16px; font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--primary); }

.page { max-width: 1180px; margin: 0 auto; padding: 28px; }
.page-wide { max-width: none; padding: 16px 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

/* ---------- Gumbi i polja ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; line-height: 1; padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); border-color: transparent; color: var(--ink); }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: transparent; }
.btn-warn { background: var(--warn-bg); border-color: #e8c77f; color: var(--warn); }
.btn-small { padding: 7px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font-family: inherit; font-weight: 400; font-size: 15px; color: var(--ink); padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
}
input, select, textarea { font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input[type=color] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex: none; }
input:disabled { background: var(--bg); color: var(--muted); }
select.btn-small { width: auto; padding: 6px 10px; font-size: 13px; font-weight: 600; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label > input, label > select, label > textarea, label > .with-btn { margin-top: 5px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
label.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.with-btn { display: flex; gap: 8px; }
.stack { display: grid; gap: 12px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid-form .span2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.row-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-form input[type=text], .row-form input[type=file] { flex: 1; min-width: 180px; width: auto; }
.row-form.compact { gap: 6px; flex-wrap: nowrap; }
.row-form.compact input, .row-form.compact select { min-width: 0; padding: 6px 9px; font-size: 14px; }
form.inline { display: inline; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }

/* ---------- Paneli i liste ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 20px; }
.panel.narrow { max-width: 620px; }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash a { color: inherit; font-weight: 700; margin-left: 6px; }
.empty { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); margin-bottom: 20px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 8px auto 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 20px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fbfbf9; }
td.actions, .actions { white-space: nowrap; text-align: right; }
.actions .btn { margin-left: 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--bg); color: var(--ink-2); margin-left: 6px; vertical-align: 1px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 0; flex: none; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.creds-box pre { background: var(--bg); padding: 14px 16px; border-radius: var(--radius); font: 14px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; margin: 0 0 12px; }
.logo-prev { background: var(--bg); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; display: inline-block; }
.logo-prev img { max-height: 48px; display: block; }
.palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.pal { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); font-weight: 500; color: var(--ink); cursor: pointer; }
.pal input[type=radio] { accent-color: var(--primary); margin: 0; }
.pal .sw { width: 20px; height: 20px; border-radius: 50%; }

/* ---------- Prijava ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius-lg); padding: 32px 30px; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.login-brand img { height: 40px; }
.login-sub { color: var(--muted); margin: 6px 0 24px; }

/* ---------- Događaji ---------- */
.event-list { display: grid; gap: 10px; margin-bottom: 24px; }
.event-row { display: grid; grid-template-columns: 76px 1fr 200px auto; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px; }
.event-row.is-past { opacity: .6; }
.event-date { text-align: center; border-right: 1px solid var(--line); padding-right: 16px; }
.event-date .d { display: block; font-size: 28px; font-weight: 700; line-height: 1; color: var(--primary-strong); letter-spacing: -0.03em; }
.event-date .m { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.event-title { font-size: 17px; font-weight: 650; color: var(--ink); text-decoration: none; }
.event-title:hover { color: var(--primary-strong); }
.event-progress .bar { display: block; height: 6px; border-radius: 3px; background: var(--bg); margin-top: 6px; overflow: hidden; }
.event-progress .bar span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.hall-choice { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 11px 14px; cursor: pointer; font-weight: 400; color: var(--ink); }
.radio-card input { accent-color: var(--primary); margin-top: 4px; }
.radio-card span { display: grid; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-wash); }
.dims { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.stat .n { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat-warn .n { color: var(--warn); }

/* ---------- Gosti ---------- */
.guests-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.guests-side .panel { padding: 18px 20px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; width: auto; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--ink-2); padding: 6px 11px; border-radius: 6px; cursor: pointer; }
.seg button span { color: var(--muted); font-weight: 500; margin-left: 3px; }
.seg button.on { background: var(--primary-soft); color: var(--primary-ink); }
.guests-table td:first-child { min-width: 160px; }
.guests-table .btn-x { font-size: 18px; line-height: 1; padding: 4px 9px; }
.group-row { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; }
.group-form { display: flex; gap: 6px; align-items: center; flex: 1; }
.group-form input[type=text] { padding: 6px 9px; font-size: 14px; }
.group-form.add { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Ispisi ---------- */
.print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.print-card { display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; text-decoration: none; color: var(--ink); }
.print-card:hover { border-color: var(--primary); }
.print-card strong { font-size: 16px; }
.print-card span { color: var(--muted); font-size: 14px; }
.print-card em { font-style: normal; font-size: 12px; color: var(--primary-strong); font-weight: 600; }
.print-all { background: var(--primary-wash); border-color: var(--primary-soft); }

/* ---------- Editor sale ---------- */
.editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 60px - 32px - 132px); min-height: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.page-full .editor { flex: 1; height: auto; min-height: 0; border: 0; border-radius: 0; }
.ed-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.ed-panel-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.ed-panel { min-width: 0; }
.seg-full { display: flex; }
.seg-full button { flex: 1; white-space: nowrap; padding: 7px 6px; }
.ed-tpl { font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ed-tpl a { margin-left: auto; }
.ed-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.ed-add .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ed-add select { grid-column: 1 / -1; padding: 7px 9px; font-size: 13px; }
.ed-add .btn:last-of-type { grid-column: auto; }
.save-state:empty { display: none; }
.ed-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ed-hist { display: flex; gap: 2px; margin-right: auto; }
.ed-hist .btn { padding: 6px 7px; font-size: 13px; }
.ed-hist .btn:disabled { opacity: .4; }
.save-state { font-size: 12px; color: var(--muted); line-height: 1.3; }
.save-state.dirty { color: var(--warn); }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--danger); }
.save-state.warn { color: var(--warn); }
.save-state.busy { color: var(--muted); }
.ed-guests { flex: 1 1 55%; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.ed-guests input[type=search], .ed-filter select { padding: 7px 10px; font-size: 14px; }
.ed-filter { display: flex; gap: 8px; align-items: center; }
.ed-filter select { flex: 1; min-width: 0; }
.ed-filter label.check { white-space: nowrap; }
.ed-props { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; }
.editor[data-mode=seat] .ed-props { flex: 0 1 45%; }
.ed-props label { margin-bottom: 8px; }
.ed-props .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-props .pair-label { grid-template-columns: 70px 1fr; }
.tbl-sub-inline { color: var(--primary-ink); }
.tbl-sub { display: block; font-size: 13px; font-weight: 500; color: var(--primary-ink); margin-top: 2px; }
.ed-props h3 { font-size: 15px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.ed-props input, .ed-props select { padding: 7px 9px; font-size: 14px; }
.ed-hint { color: var(--muted); font-size: 13px; margin: 0; }
.ed-hint.active { color: var(--primary-ink); background: var(--primary-soft); padding: 8px 10px; border-radius: var(--radius); font-weight: 600; }
.rot { display: flex; gap: 4px; align-items: center; margin-bottom: 12px; }
.rot input { width: 64px; text-align: center; }
.prop-actions { display: flex; gap: 8px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }

.ed-canvas { position: relative; background: #eceae4; min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.ed-canvas .zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; }
.ed-canvas .zoom .btn { background: rgba(255,255,255,.95); }
#hallSvg { width: 100%; flex: 1; min-height: 0; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#hallSvg.panning { cursor: grabbing; }
#hallSvg .floor { fill: #fdfcfa; }
#hallSvg .grid { stroke: #efece6; stroke-width: 2; }
#hallSvg .grid-m { stroke: #e2ded5; stroke-width: 3; }
#hallSvg .walls { fill: none; stroke: #3a352d; stroke-width: 10; }
#hallSvg .dim { font-size: 30px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; font-family: var(--font); }
#hallSvg text { font-family: var(--font); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
#hallSvg .hatch-line { stroke: #e2ddd3; stroke-width: 5; }
#hallSvg [data-kind] { cursor: move; }
#hallSvg[data-mode=seat] [data-kind=element] { cursor: default; }
#hallSvg[data-mode=seat] [data-kind=table] { cursor: pointer; }

#hallSvg .el rect { fill: #f1eee8; stroke: #8f887b; stroke-width: 1.25px; vector-effect: non-scaling-stroke; }
#hallSvg .el .hatch { fill: url(#hatch); stroke: none; }
#hallSvg .el-podij rect:first-child, #hallSvg .el-dj rect:first-child { fill: #e9e5dd; }
#hallSvg .el-sank rect:first-child { fill: #ebe5d9; }
#hallSvg .el-ulaz rect { fill: #fff; stroke-dasharray: 6 4; }
#hallSvg .el-label { fill: #4f4a42; font-weight: 600; letter-spacing: .01em; }
#hallSvg .tbl .top { fill: var(--primary-wash); stroke: #3a352d; stroke-width: 5; }
#hallSvg .tbl-label { fill: var(--ink); font-weight: 700; }
#hallSvg .tbl-count { fill: var(--muted); font-weight: 500; }
#hallSvg .tbl-title { fill: var(--primary-ink); font-weight: 600; }
#hallSvg .seat circle { fill: #fff; stroke: #6b655a; stroke-width: 3; }
#hallSvg .seat.occ circle { stroke: rgba(0,0,0,.35); }
#hallSvg .seat-ini { fill: #fff; font-size: 17px; font-weight: 700; }
#hallSvg[data-mode=edit] .seat { pointer-events: none; }
#hallSvg[data-mode=seat] .seat { cursor: pointer; }
#hallSvg[data-mode=seat] .seat:hover circle { stroke: var(--primary); stroke-width: 7; }
#hallSvg .seat.hl circle { stroke: var(--ink); stroke-width: 9; }
#hallSvg .sel .top { stroke: var(--primary); stroke-width: 9; stroke-dasharray: 22 12; }
#hallSvg .el.sel rect:first-child { stroke: var(--primary); stroke-width: 2.5px; stroke-dasharray: 8 5; }

.ed-legend { order: -1; display: flex; flex-wrap: wrap; gap: 6px 16px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 14px; font-size: 12px; }
.ed-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.ed-legend b { color: var(--muted); font-weight: 600; }

.glist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.gitem { width: 100%; display: flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; text-align: left; padding: 7px 8px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; }
.gitem:hover { background: var(--bg); }
.gitem.on { background: var(--primary-soft); border-color: var(--primary); }
.gitem .gname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gitem .gseat { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gitem .tag { margin-left: 0; }
.tag-diet { background: var(--danger-bg); color: var(--danger); }
.gempty { padding: 10px 4px; }

.seatlist { list-style: none; margin: 0 0 14px; padding: 0; }
.seatlist li { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--bg); font-size: 14px; }
.seatlist li.hl { background: var(--primary-soft); }
.seatlist .no { width: 22px; text-align: right; color: var(--muted); font-size: 12px; flex: none; }
.seatlist .x { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.seatlist .x:hover { color: var(--danger); background: var(--danger-bg); }
.linkish { font: inherit; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.linkish:hover:not(:disabled) { color: var(--primary-strong); text-decoration: underline; }
.linkish:disabled { cursor: default; }
.fill { margin-bottom: 12px; }

/* ---------- Klijentski dio: lijevi izbornik, cijela širina ---------- */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.side-brand { padding: 2px 8px 14px; font-size: 17px; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a { display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.on { background: var(--primary-wash); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.side-event { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-ev-title { padding: 0 10px; font-weight: 650; font-size: 14px; line-height: 1.3; }
.side-ev-meta { padding: 2px 10px 8px; font-size: 12px; color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.side-foot .uname { padding: 0 10px; font-size: 13px; }
.side-foot .btn { justify-content: flex-start; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.main-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.main-head h1 { font-size: 19px; }
.shell .page { max-width: none; margin: 0; padding: 16px 20px; flex: 1; }
.shell .page-head { margin-bottom: 14px; }
.shell .page-head h1 { font-size: 21px; }
.shell .panel { padding: 16px 18px; margin-bottom: 14px; }
.shell .lead { margin: -4px 0 14px; }
.shell .stats { gap: 10px; margin-bottom: 14px; }
.shell .stat { padding: 12px 14px; }
.shell .stat .n { font-size: 24px; }
.shell .grid-form { gap: 10px 12px; }
.shell .event-list { gap: 8px; margin-bottom: 14px; }
.shell .event-row { padding: 10px 14px; gap: 16px; }
.shell table.list td { padding: 8px 12px; }
.shell table.list th { padding: 9px 12px; }
body.full .main { height: 100vh; min-height: 0; }
.page-full { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0 !important; }
.page-full .flash { margin: 0; padding: 8px 14px; border-radius: 0; }

/* Forme lijevo, sadržaj desno */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.split-side { order: -1; position: sticky; top: 16px; }
.split-side .grid-form, .guests-side .grid-form { grid-template-columns: 1fr 1fr; }
.split-side .dims { grid-template-columns: 1fr 1fr; }
.split-side .dims label:first-child { grid-column: 1 / -1; }
.shell .guests-layout { grid-template-columns: 340px minmax(0, 1fr); gap: 16px; }
.guests-side { order: -1; }
.guests-side .panel { padding: 14px 16px; }
.guests-side h2 { font-size: 15px; margin-bottom: 10px; }
.two-col-left { grid-template-columns: 1fr 1fr; }
.shell .event-row { grid-template-columns: 64px minmax(0, 1fr) 170px auto; }


/* ---------- Učitavanje datoteka ---------- */
.filedrop { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--bg); cursor: pointer; font-weight: 400; color: var(--ink-2); margin-top: 5px; }
.filedrop:hover, .filedrop.over { border-color: var(--primary); background: var(--primary-wash); }
.filedrop.has-file { border-style: solid; border-color: var(--primary); background: var(--primary-wash); }
.filedrop .fd-icon { grid-row: span 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); font-weight: 700; color: var(--primary-strong); }
.filedrop .fd-text { font-size: 14px; }
.filedrop .fd-text strong { color: var(--ink); font-weight: 600; }
.filedrop .fd-hint { font-size: 12px; color: var(--muted); }
.filedrop .fd-hint:empty { display: none; }
.filedrop .fd-file { font-size: 13px; font-weight: 600; color: var(--primary-ink); overflow-wrap: anywhere; }
.filedrop .fd-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.filedrop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.row-form .filedrop { flex: 1; min-width: 220px; margin-top: 0; }
.changelog { padding: 10px 0; border-top: 1px solid var(--line); }
.changelog:first-of-type { border-top: 0; padding-top: 0; }
.changelog h3 { font-size: 15px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.changelog ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.changelog li { margin: 2px 0; }


/* ---------- Izbornik na desni klik ---------- */
.ctxmenu { position: fixed; z-index: 100; }
.ctx-list { list-style: none; margin: 0; padding: 5px; min-width: 190px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(30, 28, 24, .16); }
.ctx-li { position: relative; }
.ctx-item { display: flex; width: 100%; align-items: center; font: inherit; font-size: 14px; text-align: left; padding: 7px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible, .ctx-li.open > .ctx-item { background: var(--primary-wash); outline: none; }
.ctx-item:disabled { color: var(--muted); cursor: default; }
.ctx-item.primary { font-weight: 600; }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-bg); }
.has-sub > .ctx-item::after { content: "›"; margin-left: auto; padding-left: 16px; color: var(--muted); font-size: 16px; line-height: 1; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-sub { position: absolute; left: 100%; top: -6px; margin-left: 2px; display: none; }
.ctx-li.open > .ctx-sub { display: block; }
.ctx-li.sub-left > .ctx-sub { left: auto; right: 100%; margin: 0 2px 0 0; }

/* ---------- Modal ---------- */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(30, 28, 24, .42); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 20px 50px rgba(30, 28, 24, .25); overflow: hidden; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.modal-x:hover { background: var(--bg); color: var(--ink); }
.modal-tools { display: grid; grid-template-columns: 1fr 170px; gap: 8px; padding: 12px 18px 0; }
.modal-tools input, .modal-tools select { padding: 8px 10px; font-size: 14px; }
.modal-tools label.check { grid-column: 1 / -1; }
.modal-info { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.modal-info .linkish { font-size: 13px; font-weight: 600; color: var(--primary-strong); }
.modal-body { overflow-y: auto; padding: 6px 10px 10px; min-height: 160px; }
.mgroup { margin-top: 8px; }
.mgroup-h { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 8px; position: sticky; top: -6px; background: var(--surface); z-index: 1; }
.mgroup-h .muted { margin-left: 6px; font-weight: 500; }
.mitem { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; }
.mitem:hover { background: var(--bg); }
.mitem.on { background: var(--primary-wash); }
.mitem input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); flex: none; }
.mitem input:disabled + .mname { color: var(--muted); }
.mitem .mname { flex: 1; min-width: 0; }
.mitem .tag { margin-left: 0; }
.mitem .mseat { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mempty { padding: 20px 8px; text-align: center; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal-foot .muted { margin-right: auto; }
.add-guests { margin-bottom: 12px; }
.mgroup-here { background: var(--primary-wash); border-radius: var(--radius); padding-bottom: 4px; }
.mgroup-here .mgroup-h { background: var(--primary-wash); border-radius: var(--radius) var(--radius) 0 0; }
.mitem .dot { margin-right: 0; }
.mitem.blocked { opacity: .55; }
.mhere-empty { margin: 0; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.modal { position: relative; }
.mtip { position: absolute; z-index: 5; max-width: 300px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4; padding: 7px 11px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.2); pointer-events: none; }
.mtip::after { content: ""; position: absolute; left: 18px; bottom: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.mitem.leaving .mname { text-decoration: line-through; color: var(--danger); }
@media (max-width: 560px) {
  .modal-back { padding: 0; place-items: end stretch; }
  .modal { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-tools { grid-template-columns: 1fr; }
}

/* ---------- Mobitel i tablet ---------- */
@media (max-width: 1100px) {
  .guests-layout { grid-template-columns: 1fr; }
  .shell .guests-layout { grid-template-columns: 1fr; }
  .guests-side { order: 0; }
  .split-side { position: static; }
  .split { grid-template-columns: 1fr; }
  .split-side { order: 0; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 16px; gap: 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .uname { display: none; }
  .page { padding: 18px 16px; }
  .eventbar { padding: 14px 16px 0; }
  .grid-form, .two-col { grid-template-columns: 1fr; }
  .dims { grid-template-columns: 1fr 1fr; }
  .dims label:first-child { grid-column: 1 / -1; }
  .event-row, .shell .event-row { grid-template-columns: 60px 1fr; }
  .event-progress, .event-row .actions { grid-column: 1 / -1; text-align: left; }
  .editor, .page-full .editor { grid-template-columns: 1fr; height: auto; }
  .ed-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-guests { flex: none; max-height: 300px; }
  .ed-props, .editor[data-mode=seat] .ed-props { flex: none; max-height: 280px; }
  .ed-props:has(#propsBody:empty) { padding: 8px 12px; }
  .ed-canvas { height: 62vh; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-event { margin: 0; padding: 0; border: 0; width: 100%; }
  .side-ev-title, .side-ev-meta { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; }
  body.full .main { height: auto; }
  .page-full { overflow: visible; }
  td.actions { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

