:root {
  --primary: #276542;
  --primary-dark: #1d4c32;
  --font-body: 'Montserrat', -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);
  --bg: #ffffff;
  --bg-secondary: #f6f8fa;
  --text: #0b1724;
  --border: #d9e0e4;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --success: #1e6b3c;
  --success-bg: #e8f5ec;
  --badge-green-bg: #d7e8dc;
  --text-muted: #667;
  --text-faint: #98a2ab;
  --admin-content-max-width: 1200px;

  --slot-available-bg: #c9edd2;
  --slot-available-border: #4f9e69;
  --slot-available-text: #1e4a2b;
  --slot-mine-bg: #e3ecfa;
  --slot-mine-border: #8aabdc;
  --slot-mine-text: #2c4f85;
  --slot-taken-bg: #dfe1e3;
  --slot-taken-border: #a7acb1;
  --slot-taken-text: #52585d;
  --slot-urni-bg: #fde9d2;
  --slot-urni-border: #93601a;
  --slot-urni-text: #93601a;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  margin: 0;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

header.topbar {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-shell {
  --primary: #6b3a2e;
  --primary-dark: #4c2921;
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.admin-sidebar {
  flex-shrink: 0;
  width: 220px;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.15s ease;
}
.admin-sidebar.collapsed { width: 64px; }
.admin-sidebar.collapsed .admin-sidebar-label { display: none; }

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  text-decoration: none;
}
.admin-sidebar-brand img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
}
.admin-sidebar.collapsed .admin-sidebar-brand img { width: 32px; height: auto; }

.admin-sidebar-heading {
  padding: 0 1rem 0.85rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  flex: 1;
}
.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 1rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  white-space: nowrap;
}
.admin-sidebar-nav a svg { flex-shrink: 0; }
.admin-sidebar-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.admin-sidebar-nav a.active { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }

.admin-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}
.admin-sidebar-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.admin-sidebar.collapsed .admin-sidebar-toggle svg { transform: rotate(180deg); }

.admin-main {
  flex: 1;
  min-width: 0;
  max-width: var(--admin-content-max-width);
  padding: 1.5rem;
}

header.topbar a { color: #fff; text-decoration: none; }
header.topbar nav a { margin-right: 1rem; font-weight: 400; display: inline-flex; align-items: center; gap: 0.35rem; }
header.topbar nav a:hover { text-decoration: underline; }
header.topbar nav a.active { font-weight: 700; }

.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { display: block; height: 28px; width: auto; }

.profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 0.6rem;
  margin-bottom: -0.6rem;
}

.profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-right: 0 !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.profile-icon:hover { background: rgba(255, 255, 255, 0.28); }

.profile-dropdown {
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  position: absolute;
  top: 100%;
  right: 0;
  padding: 0.4rem;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  z-index: 20;
}

.profile-menu:hover .profile-dropdown,
.profile-menu:focus-within .profile-dropdown {
  display: flex;
}

.profile-dropdown-name {
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
}

header.topbar .profile-dropdown a,
.profile-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-right: 0;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.profile-dropdown svg { flex-shrink: 0; color: var(--primary); }

header.topbar .profile-dropdown a:hover,
.profile-dropdown button:hover {
  background: var(--bg-secondary);
  color: var(--text);
  text-decoration: none;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
  padding: 1.5rem 1rem 2rem;
}

main.auth-main {
  max-width: none;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8vh 1.5rem 1.5rem;
}
.auth-box { width: 100%; max-width: 350px; }
.auth-box button[type="submit"] { width: 100%; }
.auth-box h1 { text-align: center; font-size: 1.4rem; margin: 0 0 1.5rem; }
.error-box { text-align: center; }
.error-box h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.error-box .btn { margin-top: 1rem; }

h1, h2, h3 { color: var(--primary-dark); font-family: var(--font-heading); font-weight: 600; }

.subtle-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.admin-breadcrumb { font-weight: 400; }
.admin-breadcrumb a { color: inherit; text-decoration: none; }
.admin-breadcrumb a:hover { text-decoration: underline; }
.admin-breadcrumb-sep { margin: 0 0.4rem; color: var(--text-faint); }

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.card-narrow { max-width: 360px; }

.card-business {
  background: var(--success-bg);
  border: none;
  padding: 50px 30px 50px 30px;
  border-left: 4px solid var(--primary-dark);
  border-radius: 8px;
  font-family: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
}
.card-business p { margin: 0 0 0.3rem; }

.card-user { background: none; border: none; }
.table-plain td { border-bottom: none; }
.table-tight { margin-bottom: 0.5rem; }

.tabs-card { position: relative; margin-bottom: 1.25rem; }
.package-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.package-tag.gostovanje { background: var(--success-bg); color: var(--success); }
.package-tag.partner { background: var(--slot-urni-bg); color: var(--slot-urni-text); }
.package-tag.free { background: var(--bg-secondary); color: var(--text-muted); }
.tabs-card .package-tag { position: absolute; top: 0.45rem; right: 0.5rem; }
#invoices-table .package-tag { font-size: 0.75rem; padding: 0.1rem 0.3rem; }

.tabs-nav { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tabs-nav .tab-btn {
  display: inline-block;
  background: none;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.6rem 0.2rem;
  margin-right: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.tabs-nav .tab-btn:hover { background: none; color: var(--primary-dark); }
.tabs-nav .tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.tab-action-btn {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--primary);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
}
.tab-action-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.tab-action-btn:disabled, .tab-action-btn:disabled:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: #aab;
  opacity: 1;
  cursor: not-allowed;
}
.tabs-nav > .push-right { margin-left: auto; }
.tab-action-btn.disabled {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: #aab;
  cursor: not-allowed;
  pointer-events: none;
}

.invoice-status-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.invoice-status-banner.generated { background: var(--bg-secondary); color: var(--text-muted); }
.invoice-status-banner.finalized { background: var(--success-bg); color: var(--success); }
.invoice-status-banner.finalized .btn { margin-left: auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
:where(.invoice-tabs) .tab-panel .grid-scroll { margin-top: 0; }
:where(.invoice-tabs) .tab-panel table { margin-bottom: 0; }
:where(.invoice-tabs) .tab-panel tfoot td { border-top: 2px solid var(--border); border-bottom: none; }
:where(.invoice-tabs) .tab-panel[data-tab-panel="koledar"],
:where(.invoice-tabs) .tab-panel[data-tab-panel="podrobnosti"],
.analytics-tabs .tab-panel[data-tab-panel="koledar"] {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 8px;
}
:where(.invoice-tabs) .tab-panel[data-tab-panel="podrobnosti"] .grid-scroll { background: var(--bg); }

.month-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 0.75rem;
}
.month-cal-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-dark);
  padding-bottom: 0.3rem;
}
.month-cal-day {
  position: relative;
  min-height: 68px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.month-cal-day.outside { background: var(--bg-secondary); opacity: 0.5; }
.month-cal-day.today { border-color: var(--primary); border-width: 2px; }
.month-cal-daynum { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.month-cal-entry {
  font-size: 0.62rem;
  position: relative;
  line-height: 1.3;
  padding-right: 26px;
}
.month-cal-entry .badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.05rem 0.35rem;
  font-size: 0.58rem;
}
.month-cal-entry-info { display: flex; flex-direction: column; min-width: 0; }
.month-cal-room { font-weight: 700; }
.month-cal-time { color: var(--text-muted); }

.card-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.card-row > div {
  flex: 1 1 320px;
}

@media (max-width: 700px) {
  .invite-card-row .card:last-child {
    order: -1;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  table-layout: auto;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  white-space: nowrap;
}

th { color: var(--primary-dark); }

.col-spacer { width: 100%; }

.text-right { text-align: right; }

table.list-table th, table.list-table td { padding-right: 1.5rem; }
table.list-table th.text-right, table.list-table td.text-right { padding-right: 0.6rem; padding-left: 1.5rem; }

tr.row-inactive { background: var(--bg-secondary); color: var(--text-muted); }

form.inline { display: inline; }

form.urni-move-form { display: flex; align-items: center; gap: 0.35rem; }
form.urni-move-form select { max-width: 130px; }

.urni-row-actions { display: flex; align-items: center; gap: 0.4rem; }

td.actions { vertical-align: middle; }
td.actions form.inline { display: inline-flex; align-items: center; gap: 0.5rem; }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.form-actions-left { display: flex; gap: 0.5rem; }

button svg, .btn svg { vertical-align: -2px; margin-right: 0.3rem; }

.btn-spinner { display: none; animation: btn-spin 0.6s linear infinite; }
form.htmx-request .btn-icon { display: none; }
form.htmx-request .btn-spinner { display: inline-block; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.list-toolbar { text-align: right; margin-bottom: 0.75rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text); }

.invoice-toggle-btn svg { transition: transform 0.15s ease; }
.invoice-toggle-btn.expanded svg { transform: rotate(180deg); }
#invoices-table tr.row-expanded > td { background: var(--bg-secondary); border-bottom: none; }
#invoices-table tr.row-expanded > td:first-child { border-left: 1px solid var(--border); }
#invoices-table tr.row-expanded > td:last-child { border-right: 1px solid var(--border); }

.invoice-detail-row { position: relative; }
.invoice-detail-row > td {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  padding: 0.75rem 1rem 1rem 3.3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 20px 24px -10px rgba(11, 23, 36, 0.18);
  max-height: 70vh;
  overflow-y: auto;
}
.invoice-detail-row .invoice-summary { max-width: 420px; margin-bottom: 0; }
.invoice-summary-detailed { max-width: 520px; }
.invoice-summary-detailed td { padding-left: 1rem; }
.invoice-summary-detailed td:first-child { padding-left: 0.6rem; }

#invoices-table { table-layout: fixed; }
#invoices-table col.col-toggle { width: 2.2rem; }
#invoices-table col.col-user { width: 9rem; }
#invoices-table col.col-package { width: 6.3rem; }
#invoices-table col.col-amount { width: 7.5rem; }
#invoices-table col.col-status { width: 6rem; }
#invoices-table col.col-actions { width: 15rem; }
#invoices-table col.col-sent { width: 10.5rem; }

.invoice-actions-row { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; }
.btn-compact.btn, .btn-compact {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.btn-compact svg { width: 12px; height: 12px; }
.invoice-send-action { display: flex; flex-direction: column; gap: 0.2rem; }
.invoice-sent-note { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.invoice-send-error { font-size: 0.72rem; color: var(--danger); }

.table-compact th, .table-compact td { padding: 0.3rem 0.5rem; font-size: 0.78rem; }

#invoices-table .secondary:hover,
.invoice-detail-row .secondary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 0.75rem;
}

.form-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 0.25rem;
}

.form-row label[hidden] {
  display: none;
}

select, input[type="date"], input[type="month"], input[type="text"], input[type="email"],
input[type="password"], input[type="number"] {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
}

.form-stacked .form-row {
  flex-direction: column;
  align-items: stretch;
}
.form-stacked .form-row label { width: 100%; }
.form-stacked .form-row select,
.form-stacked .form-row input[type]:not([type="checkbox"]) {
  width: 100%;
  box-sizing: border-box;
}
.form-stacked .form-row.two-up { flex-direction: row; }
.form-stacked .form-row.two-up label { flex: 1 1 0; width: auto; }
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.toggle-switch input[type="checkbox"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.toggle-track {
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.toggle-switch input:checked ~ .toggle-track { background: var(--primary); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); }
.toggle-switch input:focus-visible ~ .toggle-track { box-shadow: 0 0 0 2px var(--primary); }
.toggle-state {
  min-width: 1.6rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.toggle-state::after { content: "Ne"; }
.toggle-switch input:checked ~ .toggle-state::after { content: "Da"; color: var(--primary); }
.form-stacked h3 {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
}
.form-stacked h3:first-child { margin-top: 0; }
.form-stacked .section-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.card-header h2 { margin: 0; }

fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] input, fieldset[disabled] select {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

input.input-match {
  border-color: var(--success);
  padding-right: 2rem;
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e6b3c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}

input.input-error { border-color: var(--danger); }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--primary-dark); color: #fff; }

button:disabled, button:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--primary);
  color: #fff;
}
button.danger:disabled, button.danger:disabled:hover { background: var(--danger); }

button.danger { background: var(--danger); }
button.danger:hover { background: #8f1f19; color: #fff; }

button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary:hover, .btn.secondary:hover { background: var(--bg-secondary); color: var(--text); }
button.secondary:disabled, button.secondary:disabled:hover { background: transparent; }

button.action-btn:hover {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

button.action-btn-done, button.action-btn-done:disabled, button.action-btn-done:disabled:hover {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
  opacity: 1;
  cursor: default;
}

.form-actions-right { display: flex; gap: 0.5rem; align-items: center; }

.invite-action { display: inline-flex; align-items: center; opacity: 1; transition: opacity 150ms ease-in; }
.invite-action.htmx-swapping { opacity: 0; transition: opacity 150ms ease-out; }
.invite-action.htmx-added { opacity: 0; }

.invite-success {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--success);
}
.invite-manual-link a { color: var(--success); font-size: 0.9rem; }
.invite-error { display: block; margin-top: 0.25rem; font-size: 0.8rem; color: var(--danger); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.secondary-action { font-size: 0.9rem; }

.restore-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin: 0.5rem 0; }

.room-move-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.room-move-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.room-move-option.occupied {
  opacity: 0.5;
  text-decoration: line-through;
  cursor: not-allowed;
}

.alert {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  background: var(--border);
}

.badge-stalni, .badge-izdan { background: var(--badge-green-bg); color: var(--success); }
.badge-fleksibilni, .badge-potrjen { background: var(--slot-urni-bg); color: var(--slot-urni-text); }
.badge-urni { background: #e2e6ea; color: #444; }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }
.badge-potrjen, .badge-izdan { font-weight: 600; }

.row-cancelled { opacity: 0.55; }
.row-cancelled td { text-decoration: line-through; }
.row-cancelled td:has(.badge) { text-decoration: none; }
.month-cal-entry.row-cancelled { text-decoration: line-through; }

.muted { color: var(--text-muted); font-size: 0.85rem; }

.invoice-summary td { border-bottom: none; padding: 0.4rem 0.6rem; }
.invoice-summary tr.muted td { color: var(--text-muted); font-size: 0.85rem; }
.invoice-summary tr.spaced-top td { padding-top: 1.1rem; }
.invoice-summary td:empty::before { content: "\00a0"; }
.info-icon { display: inline-flex; vertical-align: -2px; margin-left: 0.3rem; color: var(--text-muted); cursor: help; }

.week-tabs, .weeknav { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.week-tabs a, .weeknav a, .weeknav .disabled {
  font-size: 0.85rem; font-weight: 600; padding: 0.35rem 0.8rem; border-radius: 6px;
  text-decoration: none; color: var(--primary); border: 1px solid var(--border);
}
.week-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.weeknav .disabled { color: #aaa; border-color: var(--border); cursor: default; }
.weeknav .range { font-weight: 600; padding: 0 0.4rem; }
.month-heading { margin: 0 0 1rem; }
.invoices-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.invoices-heading-row .month-heading { margin-bottom: 1rem; }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.legend .swatch { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid var(--border); }
.legend .swatch-mine { background: var(--slot-mine-bg); border-color: var(--slot-mine-border); }
.legend .swatch-available { background: var(--slot-available-bg); border-color: var(--slot-available-border); }
.legend .swatch-taken { background: var(--slot-taken-bg); border-color: var(--slot-taken-border); }
.legend .swatch-urni { background: var(--slot-urni-bg); border-color: var(--slot-urni-border); }
.legend .swatch-cancelled { background: var(--danger-bg); border-color: var(--danger); }

.grid-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1rem; }
table.roomgrid { border-collapse: collapse; table-layout: fixed; width: 100%; min-width: 760px; font-size: 0.83rem; margin-bottom: 0; }
table.roomgrid th, table.roomgrid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
table.roomgrid th:last-child, table.roomgrid td:last-child { border-right: none; }
table.roomgrid thead th {
  background: var(--bg-secondary); padding: 0.5rem; font-size: 0.72rem; text-align: center;
  color: var(--primary-dark);
}
table.roomgrid thead th small { display: block; font-weight: 500; color: var(--text-muted); font-size: 0.66rem; margin-top: 2px; }
table.roomgrid td.rowlabel-day, table.roomgrid td.rowlabel-daypart, table.roomgrid th.corner {
  position: sticky; background: #fff; z-index: 1; white-space: nowrap;
}
table.roomgrid td.rowlabel-day, table.roomgrid th.corner-day { left: 0; width: 62px; }
table.roomgrid td.rowlabel-daypart, table.roomgrid th.corner-daypart { left: 62px; width: 96px; }
table.roomgrid th.corner { background: var(--bg-secondary); z-index: 2; }
td.rowlabel-day, td.rowlabel-daypart { padding: 0.4rem 0.6rem; font-weight: 600; font-size: 0.76rem; }
td.rowlabel-day small, td.rowlabel-daypart small { display: block; color: var(--text-muted); font-weight: 500; font-size: 0.68rem; }
table.roomgrid tr.newday td { border-top: 2px solid var(--border); }

td.cell { padding: 4px; text-align: center; vertical-align: middle; }
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 6px; padding: 5px 3px; min-height: 34px; font-size: 0.7rem; line-height: 1.15;
  border: 1px solid transparent; width: 100%; position: relative;
}
.slot .hours { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.slot .with-icon { display: inline-flex; align-items: center; gap: 3px; }
.slot .with-icon svg { flex-shrink: 0; }
button.slot { cursor: pointer; font-family: inherit; }
button.slot:hover { filter: brightness(0.97); }
.slot.available { background: var(--slot-available-bg); border-color: var(--slot-available-border); color: var(--slot-available-text); }
.slot.mine { background: var(--slot-mine-bg); border-color: var(--slot-mine-border); color: var(--slot-mine-text); font-weight: 600; border-width: 2px; }
.slot.taken { background: var(--slot-taken-bg); border-color: var(--slot-taken-border); color: var(--slot-taken-text); opacity: 0.8; }
div.slot.taken { cursor: not-allowed; }
.slot.urni-partial { background: var(--slot-urni-bg); border-color: var(--slot-urni-border); color: var(--slot-urni-text); }
.slot.cancelled { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); text-decoration: line-through; }
.slot.outline { opacity: 0.3; }
.slot.outline.has-occupant { opacity: 0.8; }
div.slot.outline { cursor: not-allowed; }
.slot.past { opacity: 0.55; }
.slot.past.empty { background: var(--bg-secondary); border-color: var(--border); }
.slot.past.mine, .slot.past.cancelled { opacity: 0.85; }
#admin-calendar-panel .slot.past { opacity: 0.9; }
#calendar-panel .slot.taken, #calendar-panel .legend .swatch-taken { background: var(--bg-secondary); }
.slot .name { font-weight: 600; font-size: 0.68rem; }

.dt-head { display: flex; justify-content: flex-start; align-items: baseline; gap: 0.6rem; margin-bottom: 0.5rem; padding-right: 1.6rem; }
.dt-head strong {
  font-size: 1rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-bookings { margin-bottom: 1rem; }
.cell-bookings p { margin: 0; line-height: 1.6; }
.hint { font-size: 0.76rem; color: var(--text-muted); font-style: italic; margin-top: 0.5rem; }

dialog.cell-modal {
  border: none; border-radius: 10px; padding: 0; max-width: 480px; width: calc(100% - 2rem);
  box-shadow: 0 12px 32px rgba(11, 23, 36, 0.25);
}
dialog.cell-modal.cell-modal-wide { max-width: 620px; }
dialog.cell-modal::backdrop { background: rgba(11, 23, 36, 0.45); }
dialog.cell-modal .modal-body { padding: 1.1rem 1.25rem; font-size: 0.88rem; }
dialog.cell-modal .modal-close {
  position: absolute; top: 0.5rem; right: 0.6rem; z-index: 1; background: none; border: none;
  color: var(--text-muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0.25rem 0.5rem;
}
dialog.cell-modal .modal-close:hover { color: var(--primary-dark); }


.calc-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.calc-copy { font-size: 0.9rem; line-height: 1.65; }
.calc-copy p { margin: 0 0 0.7rem; }
.calc-copy p:last-child { margin-bottom: 0; }
.calc-copy ul, .calc-copy ol { margin: 0; padding-left: 1.2rem; }
.calc-copy li { margin-bottom: 0.5rem; }
.calc-copy li:last-child { margin-bottom: 0; }
.calc-explainers { display: flex; flex-direction: column; gap: 0.6rem; }
.calc-info { padding: 0; margin: 0; position: relative; }
.calc-info[open] { z-index: 10; }
.calc-info summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.65rem 0.9rem; font-weight: 600; font-size: 0.9rem; cursor: pointer; list-style: none;
}
.calc-info summary::-webkit-details-marker { display: none; }
.calc-info summary:hover { color: var(--primary-dark); }
.calc-caret { flex: none; color: var(--text-muted); transition: transform 0.15s ease; }
.calc-info[open] .calc-caret { transform: rotate(180deg); }
.calc-info-body {
  position: absolute; top: calc(100% - 4px); left: -1px; right: -1px; z-index: 5;
  background: var(--bg-secondary); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 8px 8px; padding: 0.75rem 0.9rem;
  box-shadow: 0 28px 28px -10px rgba(11, 23, 36, 0.18);
}
.calc-info-body > :first-child { margin-top: 0; }
.calc-info-body > :last-child { margin-bottom: 0; }
.calc-info-body p { margin: 0 0 0.5rem; font-size: 0.85rem; }
.calc-info-body ul, .calc-info-body ol { margin: 0; padding-left: 1.15rem; font-size: 0.85rem; }
.calc-info-body li { margin-bottom: 0.45rem; }
.calc-info-body li:last-child { margin-bottom: 0; }
.calc-editor td { vertical-align: middle; }
.calc-editor select, .calc-editor input[type="number"] { width: 100%; min-width: 4.5rem; }
.calc-editor td.actions { width: 1%; white-space: nowrap; }
.calc-editor td.actions button { padding: 0.3rem 0.5rem; font-size: 0.78rem; }
.calc-ignored { opacity: 0.45; }
.calc-compare { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; grid-template-rows: repeat(7, auto); align-items: stretch; }
.calc-compare > .card { margin-bottom: 0; }
.calc-estimate { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; }
.calc-block { align-self: start; }
.calc-estimate .table-compact th, .calc-estimate .table-compact td { white-space: normal; }
.calc-estimate .table-compact .text-right, .calc-estimate .table-compact .badge { white-space: nowrap; }
.calc-estimate h3 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-size: 1.05rem; }
.calc-estimate h4 { margin: 0.9rem 0 0.35rem; font-size: 0.88rem; color: var(--primary-dark); }
.calc-estimate table { margin-bottom: 0; }
.calc-bullets { margin: 0 0 0.5rem; padding-left: 1.1rem; font-size: 0.82rem; color: var(--text-muted); }
.calc-bullets li { margin-bottom: 0.3rem; }
.calc-estimate .table-compact tfoot td { font-weight: 600; border-top: 1px solid var(--border); border-bottom: none; }
.calc-was { color: var(--text-faint); font-weight: 400; font-size: 0.85em; }
.calc-total { margin: 0.7rem 0 0.2rem; font-size: 1.02rem; font-weight: 600; }
.calc-due { color: var(--success); }
.hint-carry { font-weight: 500; color: var(--success); }
.calc-ok { display: inline-flex; vertical-align: -2px; color: var(--success); }
.calc-warn { display: inline-flex; vertical-align: -2px; margin-right: 0.2rem; color: var(--danger); }
.calc-estimate .alert { margin: 0.7rem 0 0; font-size: 0.82rem; }
.calc-signup { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.calc-signup > div { flex: 1 1 320px; }
.calc-signup h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.calc-signup p, .calc-signup ul { color: var(--text-muted); }

@media (max-width: 900px) {
  .calc-compare { grid-template-columns: 1fr; }
  .calc-top { grid-template-columns: 1fr; gap: 1.25rem; }
}

.analytics-range { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.range-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.range-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.range-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.range-note { margin-left: auto; font-size: 0.82rem; color: var(--text-muted); }

.analytics-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.8rem 0.95rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.kpi-sub { font-size: 0.72rem; color: var(--text-muted); }
.kpi-alert { border-color: var(--danger); }
.kpi-alert .kpi-value { color: var(--danger); }

.analytics-pending ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

.table-wrap { overflow-x: auto; }
.analytics-heatmap { width: 100%; border-collapse: collapse; }
.analytics-heatmap th, .analytics-heatmap td { padding: 0.5rem 0.6rem; text-align: center; border: 1px solid var(--border); font-size: 0.84rem; }
.analytics-heatmap thead th, .analytics-heatmap tbody th, .analytics-heatmap tfoot th { background: var(--bg-secondary); color: var(--primary-dark); font-size: 0.78rem; }
.analytics-heatmap tbody th { text-align: left; white-space: nowrap; }
.analytics-heatmap .heat-pct { display: block; font-weight: 700; }
.analytics-heatmap .heat-sub { display: block; font-size: 0.7rem; opacity: 0.8; }
.heat-0 { background: #fff; color: var(--text-faint); }
.heat-1 { background: color-mix(in srgb, var(--primary) 12%, #fff); }
.heat-2 { background: color-mix(in srgb, var(--primary) 26%, #fff); }
.heat-3 { background: color-mix(in srgb, var(--primary) 46%, #fff); color: #fff; }
.heat-4 { background: var(--primary); color: #fff; }
.heat-3 .heat-sub, .heat-4 .heat-sub { color: rgba(255, 255, 255, 0.85); }
.heat-total { background: #faf8f6; font-weight: 600; }

.analytics-section { padding: 0.5rem 0.95rem; margin-bottom: 1.5rem; }
.analytics-charts, .analytics-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.analytics-section > h3 { margin-top: 0; }
.chart-box { position: relative; height: 300px; }
.chart-note { margin-left: 0.35rem; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.analytics-empty { margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.analytics-notes { margin: 1.25rem 0 0; padding-left: 1.1rem; font-size: 0.78rem; color: var(--text-muted); }
.analytics-notes li { margin-bottom: 0.25rem; }

.analytics-tabs .tab-panel[data-tab-panel="koledar"] .legend { margin-bottom: 0; }
.events-table { width: 100%; }
.events-table td, .events-table th { vertical-align: middle; }
.events-table .nowrap { white-space: nowrap; }
.overview-cal .month-cal-day { min-height: 0; gap: 5px; }
.overview-cal .month-cal-day.today { border-width: 1px; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
a.overview-day, a.overview-day:hover { text-decoration: none; color: inherit; }
a.overview-day:hover { border-color: var(--primary); }
.overview-day.past { opacity: 0.7; }
.overview-slots { display: grid; grid-template-columns: repeat(var(--rooms), 1fr); gap: 2px; }
.slot-dot { display: block; height: 12px; border-radius: 2px; border: 1px solid transparent; }
.slot-dot.available { background: var(--bg); border-color: var(--border); }
.slot-dot.stalni { background: color-mix(in srgb, var(--success) 50%, var(--badge-green-bg)); border-color: transparent; }
.slot-dot.fleksibilni { background: color-mix(in srgb, var(--slot-urni-text) 50%, var(--slot-urni-bg)); border-color: transparent; }
.slot-dot.urni { background: color-mix(in srgb, #444 50%, #e2e6ea); border-color: transparent; }
.slot-dot.cancelled { background: color-mix(in srgb, var(--danger) 50%, var(--danger-bg)); border-color: transparent; }

@media (max-width: 900px) {
  .analytics-charts, .analytics-columns { grid-template-columns: 1fr; }
  .range-note { margin-left: 0; }
}
