/* eDomaćin - design system (CP5-D3.7)
   ---------------------------------------------------------------------
   Dva sloja, i to namjerno:

   1. PRIMITIVI (--p-*)   sirove boje jedne teme, tačno po paleti
   2. SEMANTIČKI TOKENI   šta ta boja ZNAČI u proizvodu

   Komponente koriste isključivo drugi sloj, pa se tema mijenja jednim
   atributom na <html> i ništa drugo ne zna da se promijenila.

   Boje su iz odobrene palete - heksadecimalne vrijednosti nisu
   približne nego prepisane:

     PLANINA   #2F5D9B  #63A9D6  #2E4D3A  #F8FAFC  #E2E7E6  #1F2937
     MORE      #007786  #00C2A8  #FF6B68  #FAD780  #F8FBFF  #1F2937
     RIJEKA    #C65D3B  #2BA9A1  #66735F  #F4B89A  #F5E7CF  #2B2B2B
     URBAN     #1F2937  #475569  #D4AF7C  #E5E7EB  #FAFAF9  #1F2937

   Hrbat aplikacije je SVIJETAO. Do D3.6 je bio taman; referenca ga
   vraća na svijetlu podlogu sa toplim akcentom na aktivnoj stavci, što
   cijelu aplikaciju čini mirnijom i pušta fotografiju u heroju da nosi
   boju.

   Tipografija je sistemska. Ne isporučujemo nijedan font fajl. */

:root {
  /* ---- PLANINA (podrazumijevano za javni demo) ---- */
  --p-primary:       #2F5D9B;
  --p-primary-hover: #254B7E;
  --p-primary-soft:  #E8EFF7;
  --p-primary-on-soft:#234B7D;
  --p-accent:        #63A9D6;
  --p-forest:        #2E4D3A;
  --p-canvas:        #F4F6F7;
  --p-surface:       #FFFFFF;
  --p-surface-2:     #F8FAFC;
  --p-line:          #E2E7E6;
  --p-line-strong:   #CBD3D2;
  --p-text:          #1F2937;
  --p-text-muted:    #5A6572;
  --p-text-faint:    #8D97A3;
  --p-nav-active:    #E7EFE9;
  --p-nav-active-fg: #2E4D3A;
  --p-second:        #B4884E;
  --p-second-hover:  #96713F;
  --p-second-soft:   #F6EEE1;
  --p-second-on-soft:#7C5B2C;

  /* Četiri KPI kartice u heroju. Redoslijed je fiksan; boje su iz teme. */
  --p-stat-1: #2F5D9B; --p-stat-1-fg: #FFFFFF;
  --p-stat-2: #2E4D3A; --p-stat-2-fg: #FFFFFF;
  --p-stat-3: #63A9D6; --p-stat-3-fg: #10293F;
  --p-stat-4: #EDE4D3; --p-stat-4-fg: #4A3C26;

  /* Skala popunjenosti: jaka boja = pun hotel, blijeda = prazan. */
  --p-occ-5: #2E4D3A; --p-occ-4: #2F5D9B; --p-occ-3: #63A9D6;
  --p-occ-2: #AFC9D9; --p-occ-1: #DDE5E4;

  /* Paleta grafikona po temi. NIJE isto što i brend boja: boja u
     grafikonu mora proći kontrast i provjeru daltonizma na podlozi, a
     brend boja ne mora. Zato su ovo zasebni tokeni, a ne var(--p-primary).
     Svaki par je provjeren alatom za oba smjera (vidi komentar uz .viz). */
  --p-viz-1: #2F5D9B; --p-viz-2: #eb6834;

  /* ---- statusne boje: NE mijenjaju se sa temom ----
     Značenje mora ostati isto bez obzira na izgled: zeleno je uvijek
     "u redu", crveno uvijek "problem". Tema koja bi to pomjerila
     napravila bi UI koji laže. */
  --green: #2F7D5C;  --green-soft: #E9F4EE;
  --amber: #9A6B25;  --amber-soft: #F8F1E2;
  --red:   #A93F30;  --red-soft:   #FBEAE7;
  --blue:  #35678A;  --blue-soft:  #EAF1F6;
  --purple:#5F5588;  --purple-soft:#F0EEF7;
  --teal:  #2A8A84;  --teal-soft:  #E6F4F3;

  /* ---- semantički sloj: jedino što komponente smiju koristiti ---- */
  --bg:            var(--p-canvas);
  --surface:       var(--p-surface);
  --surface-2:     var(--p-surface-2);
  --border:        var(--p-line);
  --border-strong: var(--p-line-strong);
  --text:          var(--p-text);
  --text-muted:    var(--p-text-muted);
  --text-faint:    var(--p-text-faint);
  --ink:           var(--p-forest);
  --ink-2:         var(--p-primary);
  --accent:        var(--p-primary);
  --accent-hover:  var(--p-primary-hover);
  --accent-soft:   var(--p-primary-soft);
  --accent-soft-text: var(--p-primary-on-soft);
  --gold:          var(--p-second);
  --gold-hover:    var(--p-second-hover);
  --gold-soft:     var(--p-second-soft);
  --gold-soft-text:var(--p-second-on-soft);
  --gray-soft:     #EDF0F0;

  --sidebar-bg:     var(--p-surface);
  --sidebar-text:   var(--p-text-muted);
  --sidebar-strong: var(--p-text);
  --nav-active-bg:  var(--p-nav-active);
  --nav-active-fg:  var(--p-nav-active-fg);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(31, 41, 55, .05);
  --shadow: 0 1px 2px rgba(31, 41, 55, .05), 0 6px 18px rgba(31, 41, 55, .05);
  --shadow-lg: 0 20px 48px rgba(20, 28, 38, .16), 0 2px 8px rgba(20, 28, 38, .06);
  --sidebar-w: 244px;
  --topbar-h: 68px;
  font-size: 14px;
}

/* =====================================================================
   TEME - svaka redefiniše SAMO primitive
   ===================================================================== */

[data-theme="planina"] { /* isto što i :root, imenovano radi potpunosti */ }

/* JADRAN - more, so i koral. Ista struktura kao planina, druga porodica
   boja. Ranije se zvala "more"; ime je promijenjeno, vrijednosti nisu,
   osim tamo gdje je kontrast tražio korekciju. */
[data-theme="jadran"] {
  --p-primary: #007786; --p-primary-hover: #005E6A; --p-primary-soft: #E0F2F3; --p-primary-on-soft: #00606D;
  --p-accent: #00C2A8; --p-forest: #05505A;
  --p-canvas: #F2F7F9; --p-surface: #FFFFFF; --p-surface-2: #F8FBFF;
  --p-line: #DEE9EC; --p-line-strong: #C3D6DB;
  --p-text: #1F2937; --p-text-muted: #55707C; --p-text-faint: #8AA3AD;
  --p-nav-active: #E0F2F3; --p-nav-active-fg: #00606D;
  --p-second: #FF6B68; --p-second-hover: #E2534F; --p-second-soft: #FFEBEA; --p-second-on-soft: #A93F30;
  --p-stat-1: #007786; --p-stat-1-fg: #FFFFFF;
  --p-stat-2: #00C2A8; --p-stat-2-fg: #04352F;
  --p-stat-3: #FF6B68; --p-stat-3-fg: #FFFFFF;
  --p-stat-4: #FAD780; --p-stat-4-fg: #4A3A12;
  --p-occ-5: #007786; --p-occ-4: #00A092; --p-occ-3: #00C2A8;
  --p-occ-2: #9BDCD2; --p-occ-1: #DCEDEA;
  --p-viz-1: #0E9AAC; --p-viz-2: #eb6834;
}

/* CLASSIC - klasičan hotel: bordo, staro zlato, topla slonovača.
   Zamijenila je raniju temu "rijeka". Namjerno je najmirnija od četiri:
   objekti koji hoće da izgledaju ustaljeno, a ne moderno. */
[data-theme="classic"] {
  --p-primary: #7B2D3B; --p-primary-hover: #63232F; --p-primary-soft: #F6E7E9; --p-primary-on-soft: #6B2632;
  --p-accent: #B08A4F; --p-forest: #3B3A36;
  --p-canvas: #F6F3EC; --p-surface: #FFFDF9; --p-surface-2: #FAF6EE;
  --p-line: #E6DFD1; --p-line-strong: #CDC2AC;
  --p-text: #2A2724; --p-text-muted: #6B6459; --p-text-faint: #99907F;
  --p-nav-active: #F1E6E8; --p-nav-active-fg: #6B2632;
  --p-second: #B08A4F; --p-second-hover: #94723E; --p-second-soft: #F6EEDF; --p-second-on-soft: #6E5528;
  --p-stat-1: #7B2D3B; --p-stat-1-fg: #FFFFFF;
  --p-stat-2: #3B3A36; --p-stat-2-fg: #FFFFFF;
  --p-stat-3: #B08A4F; --p-stat-3-fg: #FFFFFF;
  --p-stat-4: #EFE3CE; --p-stat-4-fg: #5A4A2C;
  --p-occ-5: #7B2D3B; --p-occ-4: #A2485A; --p-occ-3: #B08A4F;
  --p-occ-2: #DCC9A6; --p-occ-1: #EDE5D6;
  --p-viz-1: #B8364C; --p-viz-2: #199e70;
}

[data-theme="urban"] {
  --p-primary: #1F2937; --p-primary-hover: #131A24; --p-primary-soft: #E8EAEE; --p-primary-on-soft: #1F2937;
  --p-accent: #475569; --p-forest: #1F2937;
  --p-canvas: #F3F4F3; --p-surface: #FFFFFF; --p-surface-2: #FAFAF9;
  --p-line: #E5E7EB; --p-line-strong: #CBD0D7;
  --p-text: #1F2937; --p-text-muted: #5A6472; --p-text-faint: #949BA6;
  --p-nav-active: #EDE3D3; --p-nav-active-fg: #7A5B2E;
  --p-second: #D4AF7C; --p-second-hover: #B8935F; --p-second-soft: #F7EFE2; --p-second-on-soft: #7A5B2E;
  --p-stat-1: #1F2937; --p-stat-1-fg: #FFFFFF;
  --p-stat-2: #475569; --p-stat-2-fg: #FFFFFF;
  --p-stat-3: #D4AF7C; --p-stat-3-fg: #3B2C14;
  --p-stat-4: #E5E7EB; --p-stat-4-fg: #333B47;
  --p-occ-5: #1F2937; --p-occ-4: #475569; --p-occ-3: #7C8899;
  --p-occ-2: #D4AF7C; --p-occ-1: #E5E7EB;
  /* Brend boje ove teme (#1F2937 i #D4AF7C) padaju provjeru za grafikone:
     prva je pretamna i siva, druga presvijetla. Zato su za grafikone
     odabrani najbliži koraci koji prolaze - ista porodica, druga svrha. */
  --p-viz-1: #31689F; --p-viz-2: #B8860B;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100vh; }
a { color: inherit; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.boot-splash {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #cfd6cf; background: var(--ink);
}
.boot-mark {
  width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(155deg, var(--accent), var(--ink-2)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; font-family: var(--font-display);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}

/* ---------------- Layout ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); border-right: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.sidebar-brand { position: relative; display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .mark {
  width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(155deg, var(--accent), var(--ink-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; font-family: var(--font-display);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar-brand .name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.2; color: #fff; letter-spacing: .01em; }
.sidebar-brand .sub { font-size: 11px; color: rgba(255,255,255,.42); margin-top: 1px; }
.sidebar-close-btn { display: none; position: absolute; right: 10px; top: 14px; background: none; border: none; color: rgba(255,255,255,.55); font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.sidebar-close-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.66); text-decoration: none; font-size: 13.5px; font-weight: 500; cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(31,111,82,.42), rgba(31,111,82,.18));
  color: #fff; box-shadow: inset 2.5px 0 0 var(--gold);
}
.nav-item .ic { width: 17px; text-align: center; flex-shrink: 0; }
.nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.32); padding: 14px 10px 4px; font-weight: 650; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--radius-sm); }
.user-chip:hover { background: rgba(255,255,255,.07); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(179,144,63,.22); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 12px; flex-shrink: 0; }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who .n { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.user-chip .who .r { font-size: 11px; color: rgba(255,255,255,.42); }
.logout-btn { background: none; border: none; color: rgba(255,255,255,.4); cursor: pointer; padding: 4px; }
.logout-btn:hover { color: #e8a898; }

.sidebar-backdrop { display: none; }

.hamburger-btn {
  display: none; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0;
  background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text);
  font-size: 15px; cursor: pointer;
}
.hamburger-btn:hover { background: var(--gray-soft); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0; border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 15;
}
.topbar h1 { font-family: var(--font-display); font-size: 17.5px; font-weight: 600; margin: 0; white-space: nowrap; }
.topbar-search { position: relative; flex: 1; max-width: 420px; }
.topbar-search input {
  width: 100%; padding: 7px 12px 7px 30px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13px;
}
.topbar-search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: var(--surface); }
.topbar-search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 12px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; z-index: 50;
}
.search-results .grp-label { font-size: 10.5px; text-transform: uppercase; color: var(--text-faint); font-weight: 650; padding: 8px 12px 2px; }
.search-results .row { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.search-results .row:hover { background: var(--gray-soft); }
.search-results .row .t { font-size: 13px; font-weight: 550; }
.search-results .row .s { font-size: 11.5px; color: var(--text-faint); }
.search-results .empty { padding: 14px; color: var(--text-faint); font-size: 12.5px; text-align: center; }

.content { flex: 1; padding: 20px 24px 48px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------------- Mobile: collapsible sidebar drawer ---------------- */
@media (max-width: 900px) {
  .hamburger-btn { display: inline-flex; }
  .sidebar-close-btn { display: inline-block; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 210; width: min(84vw, 300px);
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(12, 16, 13, 0); pointer-events: none;
    transition: background .22s ease; z-index: 205;
  }
  .sidebar-backdrop.show { background: rgba(12, 16, 13, .5); pointer-events: auto; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: 15.5px; }
  .content { padding: 14px 14px 40px; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 550; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; line-height: 1.3; white-space: nowrap;
}
.btn:hover { background: var(--gray-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--red-soft); border-color: #e9c3ba; color: var(--red); }
.btn-danger:hover { background: #f6dcd5; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover { background: var(--gray-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 6px; }

/* ---------------- Cards / surfaces ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-pad { padding: 16px 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 13.5px; font-weight: 650; margin: 0; }
.card-header .hint { font-size: 11.5px; color: var(--text-faint); }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* .stat-card je uklonjen u D3.7B. Bio je druga, starija izvedba iste
   stvari koju radi .kpi, pa su izvještaji i rezervacija izgledali kao
   ranija verzija aplikacije obojena novim bojama. Jedna izvedba: .kpi. */

h2.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 700; margin: 26px 0 10px; }
h2.section-title:first-child { margin-top: 0; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 620; white-space: nowrap; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-confirmed { background: var(--blue-soft); color: var(--blue); }
.badge-option { background: var(--amber-soft); color: var(--amber); }
.badge-checked_in { background: var(--green-soft); color: var(--green); }
.badge-checked_out { background: var(--gray-soft); color: var(--text-muted); }
.badge-cancelled { background: var(--red-soft); color: var(--red); }
.badge-no_show { background: var(--ink); color: #fff; }
.badge-blocked { background: var(--gold-soft); color: var(--gold-soft-text); }
.badge-paid { background: var(--green-soft); color: var(--green); }
.badge-partial { background: var(--amber-soft); color: var(--amber); }
.badge-unpaid { background: var(--red-soft); color: var(--red); }
.badge-clean { background: var(--green-soft); color: var(--green); }
.badge-dirty { background: var(--red-soft); color: var(--red); }
.badge-cleaning { background: var(--blue-soft); color: var(--blue); }
.badge-ready { background: var(--accent-soft); color: var(--accent-soft-text); }
.badge-maintenance { background: var(--gold-soft); color: var(--gold-soft-text); }

/* ---------------- Tables ---------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-faint); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl.clickable tbody tr { cursor: pointer; }
.tbl-wrap { overflow-x: auto; }
.empty-row { padding: 34px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field .hint { font-size: 11px; color: var(--text-faint); }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .field-row, .field-row.cols-3 { grid-template-columns: 1fr; } }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 13px; }
.checkbox-field input { width: auto; }

.form-error { background: var(--red-soft); color: var(--red); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 12px; }
.form-warning { background: var(--amber-soft); color: var(--amber); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 12px; }

/* ---------------- Modal / Drawer ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 17, 21, 0.45); z-index: 100; display: flex; justify-content: flex-end; }
.overlay.center { align-items: center; justify-content: center; }
.drawer { width: min(560px, 100vw); height: 100vh; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.modal { width: min(480px, 92vw); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { width: min(760px, 94vw); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-family: var(--font-display); font-size: 16.5px; font-weight: 600; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.close-x { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 6px; }
.close-x:hover { background: var(--gray-soft); color: var(--text); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; }
.tab { padding: 10px 4px; margin-right: 18px; font-size: 13px; font-weight: 550; color: var(--text-faint); border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------- Calendar / Room board ---------------- */
.calendar-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.calendar-toolbar .spacer { flex: 1; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); align-items: center; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }

.cal-scroll { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cal-grid { display: grid; position: relative; }
.cal-corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.cal-day-head {
  position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center; padding: 6px 2px; font-size: 11px; color: var(--text-muted);
}
.cal-day-head.today { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 700; }
.cal-day-head.weekend { background: var(--surface-2); }
.cal-day-head .dow { display: block; font-size: 9.5px; text-transform: uppercase; color: var(--text-faint); }
.cal-room-cell {
  position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; min-width: 148px;
}
.cal-room-cell .code { font-size: 13px; font-weight: 650; }
.cal-room-cell .type { font-size: 10.5px; color: var(--text-faint); }
.cal-day-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; min-height: 40px; cursor: cell; }
.cal-day-cell:hover { background: var(--surface-2); }
.cal-day-cell.weekend { background: rgba(0,0,0,.012); }
.cal-day-cell.selected { background: var(--accent-soft); }
.cal-bar {
  position: absolute; top: 4px; bottom: 4px; left: 0; right: 0; border-radius: 6px; display: flex; align-items: center; padding: 0 8px;
  font-size: 11.5px; font-weight: 600; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.cal-bar:hover { filter: brightness(1.06); box-shadow: var(--shadow); }
.cal-bar.st-confirmed { background: var(--blue); }
.cal-bar.st-option { background: var(--amber); }
.cal-bar.st-checked_in { background: var(--accent); }
.cal-bar.st-checked_out { background: #9a9c8e; }
.cal-bar.st-cancelled { background: #eabfb6; color: #7a2e21; text-decoration: line-through; }
.cal-bar.st-no_show { background: var(--ink); }
.cal-bar.st-blocked { background: repeating-linear-gradient(45deg, var(--gold), var(--gold) 6px, #cba85e 6px, #cba85e 12px); color: #4a3a15; }

/* ---------------- Housekeeping status strip ---------------- */
.hk-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.hk-pill { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; }
.hk-pill:hover { border-color: var(--border-strong); }

/* ---------------- Misc ---------------- */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.mb-14 { margin-bottom: 14px; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.toast-stack { position: fixed; bottom: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.5px; box-shadow: var(--shadow-lg); max-width: 320px; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state .big-ic { font-size: 30px; margin-bottom: 10px; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1100px 620px at 18% -10%, rgba(31,111,82,.35), transparent 60%),
              radial-gradient(900px 520px at 100% 110%, rgba(179,144,63,.18), transparent 55%),
              linear-gradient(165deg, var(--ink) 0%, var(--ink-2) 55%, #14201a 100%);
}
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px 28px; }
.login-mark {
  width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(155deg, var(--accent), var(--ink-2)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-family: var(--font-display); font-size: 16px; margin-bottom: 16px;
}
.login-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin: 0 0 4px; }
.login-card p.sub { color: var(--text-muted); font-size: 13px; margin: 0 0 22px; }
.login-demo-link { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
/* ---- Ulazni ekran: demo je primarna akcija (EDO-DEMO-UX-1) ----------
   Prijava je ranije bila jedina krupna stvar na ekranu i ljudi su na
   testu klikali nju misleći da tako ulaze u demo. Sada demo nosi svu
   vizuelnu težinu, a prijava stoji ispod crte, tiho i dostupno. */
.entry-card { max-width: 400px; text-align: center; }
.entry-card .login-mark, .entry-card h1 { margin-left: auto; margin-right: auto; }
.entry-card p.sub { margin-bottom: 20px; }
.entry-cta { font-size: 16px; padding: 14px 20px; }
.entry-note {
  margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-muted);
}
.entry-secondary {
  margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; text-align: left;
}
.entry-login-line {
  margin: 0; font-size: 12.5px; color: var(--text-muted); text-align: center;
}
/* Dugme koje izgleda kao link: prijava mora ostati vidljiva i klikabilna
   tastaturom, ali ne smije nositi težinu dugmeta. */
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--accent); cursor: pointer; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.entry-form { margin: 0; }
.entry-form .field:first-of-type { margin-top: 0; }
/* `btn-ghost` je u ovoj temi bez ivice, pa je submit izgledao kao običan
   tekst. Prijava mora ostati OČIGLEDNO dugme - samo ne primarno. */
.entry-form button[type="submit"] { border-color: var(--border); margin-top: 4px; }
.entry-form button[type="submit"]:hover { border-color: var(--text-faint); }
@media (max-width: 480px) {
  .entry-card { padding: 26px 20px; }
  .entry-cta { font-size: 16.5px; padding: 15px 20px; }
}

.login-demo-link a { color: var(--accent); font-weight: 600; text-decoration: none; }
.login-demo-link a:hover { text-decoration: underline; }

/* ---------------- Javni demo (CP5-D3) ---------------- */
.demo-landing {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1100px 620px at 18% -10%, rgba(31,111,82,.35), transparent 60%),
              radial-gradient(900px 520px at 100% 110%, rgba(179,144,63,.18), transparent 55%),
              linear-gradient(165deg, var(--ink) 0%, var(--ink-2) 55%, #14201a 100%);
}
.demo-landing-card { width: 100%; max-width: 430px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px 28px; }
.demo-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.demo-landing-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 23px; margin: 0 0 6px; }
.demo-landing-card p.sub { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; line-height: 1.55; }
.demo-points { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.demo-points li { display: flex; gap: 11px; align-items: flex-start; }
.demo-points .ic { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.demo-points b { display: block; font-size: 13px; font-weight: 600; }
.demo-points span:not(.ic) { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.demo-refusal { background: var(--amber-soft); border: 1px solid #e8d6ae; border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 14px; }
.demo-refusal b { display: block; font-size: 12.5px; color: var(--amber); margin-bottom: 3px; }
.demo-refusal span { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.demo-landing-foot { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.demo-landing-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.demo-landing-foot a:hover { text-decoration: underline; }
.demo-expired .demo-kicker { color: var(--text-faint); }

.demo-privacy { display: flex; gap: 9px; align-items: flex-start; margin-top: 16px; padding: 10px 12px; background: var(--amber-soft); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.demo-privacy .ic { color: var(--amber); flex-shrink: 0; }
.demo-privacy b { color: var(--text); }
.demo-privacy.compact { margin-top: 12px; font-size: 11.5px; padding: 8px 10px; }

.demo-welcome .modal-body { display: flex; flex-direction: column; gap: 16px; }
.demo-welcome-lead { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.demo-recovery label, .demo-accounts-box label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.demo-recovery-row { display: flex; gap: 8px; }
.demo-recovery-row input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--surface-2); color: var(--text);
}
.demo-recovery .hint, .demo-accounts-box .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; line-height: 1.45; }
.demo-accounts-box { border-top: 1px solid var(--border); padding-top: 14px; }
.demo-accounts-box .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; font-size: 12px; }
.demo-accounts-box code { font-size: 11px; color: var(--text-muted); background: var(--gray-soft); padding: 2px 6px; border-radius: 5px; }

.demo-banner {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 8px 24px; background: var(--ink); color: rgba(247,245,240,.72); font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.demo-badge { background: var(--gold); color: #1b1305; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 2px 7px; border-radius: 5px; }
.demo-banner-name { font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 13px; }
.demo-banner-sep { color: rgba(247,245,240,.3); }
.demo-banner-text { min-width: 0; }
.demo-countdown { color: #fff; font-variant-numeric: tabular-nums; }
.demo-banner-link {
  margin-left: auto; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: #fff;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.demo-banner-link:hover { background: rgba(255,255,255,.18); }
@media (max-width: 700px) {
  .demo-banner { padding: 8px 14px; font-size: 11.5px; }
  .demo-banner-link { margin-left: 0; }
}

.scan-drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--text-muted);
  cursor: pointer; background: var(--surface-2);
}
.scan-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.scan-preview { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 10px; }
.ocr-progress { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.ocr-field-flag { color: var(--amber); font-size: 10.5px; margin-top: 2px; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline .ev { display: flex; gap: 10px; font-size: 12.5px; }
.timeline .ev .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.timeline .ev .when { color: var(--text-faint); font-size: 11px; }

.progress-bar { height: 6px; background: var(--gray-soft); border-radius: 100px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); }

@media print {
  /* Štampa se dokument, ne aplikacija.
     Do D3.7 se ovo radilo sa visibility:hidden, pa su sakriveni elementi
     i dalje zauzimali prostor i gurali fakturu niz papir - otud "nema
     margina" i odsječen sadržaj. Sada se ljuska stvarno uklanja iz toka,
     a dokument teče normalno kroz stranice, pa @page margine rade svoj
     posao i prelom na drugu stranicu je ispravan. */
  @page { size: A4; margin: 15mm 14mm; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }

  /* #root se sakriva CIJEL, ne samo .app-shell u njemu.
     Razlog je izmjeren, ne pretpostavljen: `#root { min-height: 100vh }`
     drži punu visinu ekrana i kad je ljuska unutra display:none, pa je
     faktura (koja je portalom kod <body>, ODMAH IZA #root) počinjala na
     y=900 i gurala se na DRUGU stranicu - prva je izlazila prazna.
     Faktura nije unutar #root, pa je ovo sigurno. */
  #root, .toast-stack, .demo-banner, .no-print { display: none !important; }

  /* Faktura se od D3.8 crta portalom u <body>, dakle POKRAJ .app-shell.
     Zato je gornje `display:none` na ljusci dovoljno, a dokument ostaje.
     Ranije je bila unutar ljuske, pa ju je to isto pravilo gutalo i
     pregled štampe je bio prazna bijela stranica. */
  .overlay { position: static !important; background: none !important; display: block !important;
             inset: auto !important; padding: 0 !important; overflow: visible !important; }
  .overlay > *:not(.invoice-shell) { display: none !important; }
  .invoice-overlay, .invoice-shell {
    position: static !important; width: auto !important; max-width: none !important;
    margin: 0 !important; padding: 0 !important; overflow: visible !important; background: none !important;
  }
  .invoice-page {
    position: static !important; width: auto !important; max-width: none !important;
    box-shadow: none !important; border-radius: 0 !important; padding: 0 !important;
    color: #000 !important; background: #fff !important;
  }

  /* Crno-bijela štampa mora ostati čitljiva. */
  .inv-head { border-bottom-color: #000 !important; }
  .inv-totals { border-top-color: #000 !important; }
  .inv-table th { border-bottom-color: #666 !important; color: #444 !important; }
  .inv-table td { border-bottom-color: #ccc !important; }
  .inv-logo-fallback { background: #000 !important; color: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-issuer-line, .inv-meta-line, .inv-line-detail, .inv-disclaimer { color: #444 !important; }

  /* Prelom stranica: tabela se ne lomi usred reda, a ukupni iznosi i
     zaglavlje ostaju zajedno sa onim uz šta pripadaju. */
  .inv-table { page-break-inside: auto; }
  .inv-table tr { page-break-inside: avoid; page-break-after: auto; }
  .inv-table thead { display: table-header-group; }
  .inv-head, .inv-parties { page-break-after: avoid; }
  .inv-bottom { page-break-inside: avoid; }
}

@media (max-width: 720px) {
  .inv-parties, .inv-bottom { grid-template-columns: 1fr; gap: 18px; }
  .invoice-page { padding: 24px 20px; }
}

/* ---- Navigacija: tiha linija umjesto lažne sekcije ---- */
.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 14px 10px 8px; }

/* ---- Dolasci i odlasci ---- */
.ops-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ops-toolbar .spacer { flex: 1; }
.ops-toolbar input[type="date"] { padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 12.5px; background: var(--surface); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { background: none; border: none; padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 560; color: var(--text-muted); cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 620; }

/* ---- Kalendar smije koristiti punu širinu ekrana ---- */
.content.wide { max-width: none; }

/* ---- Prijava gostiju: tok "jednom uneseno, svuda upotrijebljeno" ---- */
.reg-pitch {
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 15px; margin-bottom: 14px;
}
.reg-pitch-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--accent-soft-text); }
.reg-pitch-flow span { background: var(--surface); border: 1px solid var(--border); border-radius: 100px; padding: 4px 11px; }
.reg-pitch-flow span.hl { background: var(--accent); color: #fff; border-color: var(--accent); }
.reg-pitch-flow i { font-style: normal; opacity: .45; }
.reg-pitch p { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; max-width: 760px; }

/* ---- Skeniranje dokumenta: glavni potez, ne sitno dugme ---- */
.scan-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 17px; margin-bottom: 4px;
}
.scan-cta b { font-size: 13.5px; }
.scan-cta p { margin: 4px 0 0; font-size: 11.5px; color: var(--text-muted); max-width: 420px; line-height: 1.5; }
.guest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* Prozor za skeniranje mora biti dovoljno velik da se vidi šta je snimljeno. */
.modal.scan-modal { width: min(720px, 94vw); }
.scan-drop { display: block; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 30px 20px; text-align: center; cursor: pointer; background: var(--surface-2); font-size: 13px; }
.scan-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.scan-preview { display: block; width: 100%; max-height: 340px; object-fit: contain; border-radius: var(--radius-sm); margin-top: 12px; background: var(--gray-soft); }

/* =====================================================================
   POČETNA (CP5-D3.7) - raspored po odobrenoj referenci
   ===================================================================== */
.dash { display: flex; flex-direction: column; gap: 0; }

/* ---- Naslovna traka ---- */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  min-height: 300px; display: flex; align-items: flex-start; margin-top: 4px;
}
.hero.hero-compact { min-height: 150px; }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  /* Treći korak redoslijeda: kad objekat nema svoju sliku i tema nema
     fotografiju, hero je prelivanje iz boja TE teme - nikad prazan i
     nikad tuđe boje.

     Tri stanice, a ne dvije: u temi Urban su `--p-primary` i `--p-forest`
     ista boja, pa je dvostanični preliv ispadao ravna tamna ploha.
     `--p-accent` je u svakoj temi različit od prve dvije, pa ovako sve
     četiri imaju dubinu. */
  /* Dva sloja, uvijek. Fotografija je gornji sloj i dolazi kroz
     `--hero-photo` koji postavlja početna; preliv je donji i ostaje
     ovdje, u CSS-u, gdje su i tokeni teme.

     Zašto dva sloja a ne zamjena: ranije je početna upisivala
     `background-image: url(...)` inline, što je preliv POTPUNO
     zamijenilo. Slika koja se ne učita (obrisan fajl, stara putanja iz
     baze) onda nije padala na preliv nego na ništa - siva traka, bez
     ijedne greške u logu servera. Ovako je prazna naslovna traka
     nemoguće stanje. */
  background-image: var(--hero-photo, none), linear-gradient(140deg,
    var(--p-forest) 0%, var(--p-primary) 45%, var(--p-accent) 100%);
}
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(14,24,20,.80) 0%, rgba(14,24,20,.58) 38%, rgba(14,24,20,.12) 72%, rgba(14,24,20,.30) 100%);
}
.hero-inner { position: relative; padding: 34px 38px 0; color: #fff; max-width: 720px; }
.hero-eyebrow {
  font-size: 11px; letter-spacing: .18em; font-weight: 650; color: rgba(255,255,255,.82);
  padding-bottom: 8px; border-bottom: 2px solid rgba(255,255,255,.35); display: inline-block; margin-bottom: 14px;
}
.hero h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.035em; margin: 0 0 8px; line-height: 1.04; }
.hero p { margin: 0; font-size: 15px; color: rgba(255,255,255,.88); }
.hero-quote {
  position: absolute; right: 38px; top: 40px; color: #fff; text-align: left;
  font-size: 17px; font-weight: 600; line-height: 1.42; letter-spacing: -0.015em; max-width: 190px;
  text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
@media (max-width: 1100px) { .hero-quote { display: none; } }

/* ---- Četiri KPI kartice preklapaju dno naslovne trake ---- */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: -92px 38px 0; position: relative; z-index: 2;
}
.hero-compact + .stat-row { margin-top: -54px; }
.stat {
  border-radius: var(--radius); padding: 16px 18px 17px; min-height: 92px;
  display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow);
}
.stat.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.stat.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .s-n { font-size: 32px; font-weight: 680; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .s-l { font-size: 12px; margin-top: 6px; opacity: .86; font-weight: 520; }
.stat.s1 { background: var(--p-stat-1); color: var(--p-stat-1-fg); }
.stat.s2 { background: var(--p-stat-2); color: var(--p-stat-2-fg); }
.stat.s3 { background: var(--p-stat-3); color: var(--p-stat-3-fg); }
.stat.s4 { background: var(--p-stat-4); color: var(--p-stat-4-fg); }

/* ---- Tri kolone ---- */
.dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; margin-top: 18px; }
.dash-col-main, .dash-col-ops, .dash-col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---- Popunjenost ---- */
.occ-nav { display: flex; align-items: center; gap: 6px; }
.occ-range { font-size: 11.5px; color: var(--text-faint); margin-right: 4px; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.occ-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 6px 16px 4px; }
.occ-col { text-align: center; min-width: 0; }
.occ-dow { font-size: 11px; font-weight: 620; color: var(--text-muted); }
.occ-date { font-size: 10px; color: var(--text-faint); margin-bottom: 10px; }
.occ-pct { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; margin-bottom: 5px; }
.occ-bar-wrap { height: 96px; display: flex; align-items: flex-end; }
.occ-bar { width: 100%; border-radius: 8px; transition: height .2s ease; }
.occ-bar.tone-5, .sw.tone-5 { background: var(--p-occ-5); }
.occ-bar.tone-4 { background: var(--p-occ-4); }
.occ-bar.tone-3 { background: var(--p-occ-3); }
.occ-bar.tone-2, .sw.tone-2 { background: var(--p-occ-2); }
.occ-bar.tone-1, .sw.tone-1 { background: var(--p-occ-1); }
.occ-legend { display: flex; gap: 16px; padding: 12px 16px 15px; font-size: 11px; color: var(--text-muted); }
.occ-legend span { display: flex; align-items: center; gap: 6px; }
.occ-legend .sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---- Prsten kanala ---- */
.donut-wrap { display: flex; align-items: center; gap: 14px; padding: 6px 16px 18px; }
.donut { width: 128px; height: 128px; flex-shrink: 0; }
.donut-n { font-size: 24px; font-weight: 680; fill: var(--text); letter-spacing: -0.03em; }
.donut-l { font-size: 9.5px; fill: var(--text-faint); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dl-row i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.dl-name { flex: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-pct { font-weight: 640; font-variant-numeric: tabular-nums; }

/* ---- Prihodi ---- */
.rev-body { padding: 8px 16px 18px; }
.rev-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rev-total { font-size: 26px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rev-delta { font-size: 12px; font-weight: 640; }
.rev-delta.up { color: var(--green); }
.rev-delta.down { color: var(--red); }
.rev-delta.flat { color: var(--text-faint); font-weight: 500; }
.rev-bars { display: flex; align-items: flex-end; gap: 4px; height: 76px; margin-top: 14px; }
.rev-bars i { flex: 1; background: var(--p-occ-2); border-radius: 4px 4px 2px 2px; min-height: 4px; }
.rev-bars i:last-child { background: var(--p-occ-4); }

/* ---- Liste osoba ---- */
.person-list { padding: 2px 0 8px; }
.person-row { display: flex; align-items: center; gap: 11px; padding: 9px 16px; cursor: pointer; }
.person-row:hover { background: var(--surface-2); }
.person-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-soft-text); font-size: 11.5px; font-weight: 660;
}
.person-main { flex: 1; min-width: 0; }
.person-name { font-size: 13px; font-weight: 580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-sub { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.person-right { flex-shrink: 0; font-size: 12px; }
.amount-due { color: var(--red); font-weight: 640; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 11.5px; font-weight: 620; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---- Zadaci ---- */
.task-list { padding: 4px 0 10px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 12.5px; }
.task-box {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff;
}
.task-box.done { background: var(--green); border-color: var(--green); }
.task-text { flex: 1; min-width: 0; }
.task-role {
  font-size: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
  padding: 2px 8px; border-radius: 100px; white-space: nowrap;
}

/* ---- Desna kolona: identitet ---- */
.side-card { border-radius: var(--radius); overflow: hidden; }
.side-photo { position: relative; min-height: 210px; background-size: cover; background-position: center;
  background-image: linear-gradient(150deg, var(--p-primary), var(--p-forest)); display: flex; align-items: flex-end; }
.side-photo-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,20,17,.20), rgba(12,20,17,.70)); }
.side-photo-text { position: relative; padding: 18px; color: #fff; width: 100%; }
.sp-quote { font-size: 17px; font-weight: 640; line-height: 1.32; letter-spacing: -0.02em; }
.sp-brand { font-size: 11px; opacity: .78; margin-top: 10px; }
.side-accent { background: var(--p-stat-1); color: var(--p-stat-1-fg); padding: 18px; }
.sa-mark { opacity: .8; margin-bottom: 12px; }
.sa-title { font-size: 16px; font-weight: 650; line-height: 1.3; letter-spacing: -0.02em; }
.sa-sub { font-size: 11.5px; opacity: .8; margin-top: 10px; }
.side-plain { background: var(--surface); border: 1px solid var(--border); padding: 16px 18px 18px; }
.sp-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 640; }
.sp-value { font-size: 22px; font-weight: 670; letter-spacing: -0.03em; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }

/* ---- Responsivno ---- */
@media (max-width: 1500px) { .dash-cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } .dash-col-side { display: none; } }
@media (max-width: 1080px) {
  .dash-cols { grid-template-columns: 1fr; }
  .dash-pair { grid-template-columns: 1fr; }
  .stat-row { margin: -78px 20px 0; grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 30px; }
  .hero-inner { padding: 26px 24px 0; }
}
@media (max-width: 620px) {
  .stat-row { margin: -70px 12px 0; gap: 10px; }
  .stat .s-n { font-size: 25px; }
  .hero { min-height: 260px; }
  .hero h1 { font-size: 25px; }
  .occ-grid { gap: 4px; padding: 6px 10px 4px; }
  .occ-bar-wrap { height: 70px; }
  .donut-wrap { flex-direction: column; }
}

/* ---- Radnje u redu tabele: prisutne, ali ne vrište ---- */
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn { opacity: 0; transition: opacity .12s ease; }
table.tbl tbody tr:hover .row-actions .btn, .row-actions .btn:focus-visible { opacity: 1; }
.danger-hover:hover { background: var(--red-soft); color: var(--red); }
@media (hover: none) { .row-actions .btn { opacity: 1; } }

/* ---- Izvoz: dvije stvari koje korisnik razumije, ostalo sekundarno ---- */
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2);
}
.export-item b { display: block; font-size: 13px; }
.export-item span { display: block; font-size: 11px; color: var(--text-faint); margin-top: 2px; }
@media (max-width: 820px) { .export-actions { grid-template-columns: 1fr; } }

/* =====================================================================
   CP5-D3.7B - OBNOVLJENI SLOJ
   ---------------------------------------------------------------------
   Ovaj blok vraća stilove koje je uništila jedna moja izmjena u D3.6:
   zamjena @media print bloka koristila je neusidreni s.index('@media
   print {'), koji je pogodio PRVI takav blok u fajlu - onaj iz osnovnog
   stilskog lista - pa je isječak obuhvatio sve između njega i fakture.
   Time su nestali premium sloj (D3.5), sloj domaćinstva i operative
   (D3.6) i svijetli hrbat (D3.7). Automatski testovi to nisu vidjeli jer
   nijedan nije čitao CSS kao sistem; sada postoji test koji tvrdi da
   svaka klasa koju JS koristi ima bar jedno pravilo.

   Blok je NA KRAJU fajla namjerno: sve što nadjačava (npr. tamni
   .sidebar iz osnovnog lista) dolazi ranije, pa kaskada radi bez
   !important.
   ===================================================================== */

/* ---- Osnovna pravila štampe koja su takođe progutana ---- */
@media print { .sidebar, .topbar { display: none !important; } }

/* ---- Hrbat: SVIJETAO ---- */
.sidebar {
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  box-shadow: none; padding: 0; gap: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px; padding: 22px 18px 14px; border-bottom: none;
}
.sidebar-brand .brand-text { min-width: 0; }
.brand-name { font-size: 21px; font-weight: 680; letter-spacing: -0.028em; color: var(--text); line-height: 1.05; }
.brand-name span { opacity: .5; }
.brand-tag { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; }

.sidebar-property {
  display: flex; align-items: center; gap: 9px; margin: 2px 14px 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
  font-size: 13px; font-weight: 620; color: var(--text);
}
.sidebar-property .prop-logo { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--gray-soft); }
.sidebar-property .prop-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 4px 12px 12px; gap: 3px; }
.nav-section-label {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700;
  color: var(--text-faint); padding: 14px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; width: 100%; text-align: left; border: none; cursor: pointer;
  border-radius: 11px; padding: 10px 12px; gap: 12px; font-size: 13.5px; font-weight: 550;
  color: var(--text-muted); background: none; box-shadow: none;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-fg); font-weight: 650; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-item .ic { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; opacity: .7; flex-shrink: 0; }
.nav-item.active .ic { opacity: 1; }
.nav-item .ic svg { width: 17px; height: 17px; display: block; }
.nav-divider { height: 1px; background: var(--border); margin: 12px 10px 8px; }

.sidebar-foot { padding: 10px 12px 14px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-top: 6px;
  border-radius: 11px; background: var(--surface-2);
}
.user-chip:hover { background: var(--gray-soft); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 660;
}
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who .n { font-size: 13px; font-weight: 620; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who .r { font-size: 11px; color: var(--text-faint); }
.logout-btn { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-faint); display: flex; align-items: center; }
.logout-btn:hover { color: var(--red); }
.sidebar-close-btn { color: var(--text-faint); }
.sidebar-close-btn:hover { background: var(--gray-soft); color: var(--text); }

/* ---- Traka na vrhu ---- */
.topbar { height: var(--topbar-h); background: var(--bg); border-bottom: none; padding: 0 26px; gap: 16px; }
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.topbar-search { max-width: 560px; flex: 1; }
.topbar-search input {
  height: 44px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border);
  padding-left: 40px; font-size: 13.5px; box-shadow: var(--shadow-sm);
}
.topbar-search .ic { left: 15px; }
.topbar-actions { gap: 14px; align-items: center; }
.topbar-clock { display: flex; align-items: center; gap: 9px; color: var(--text-muted); white-space: nowrap; }
.topbar-clock .ic { display: flex; opacity: .65; }
.topbar-clock .c-date { font-size: 11.5px; line-height: 1.15; }
.topbar-clock .c-time {
  font-size: 19px; font-weight: 660; letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
@media (max-width: 980px) { .topbar-clock { display: none; } }
@media (max-width: 640px) { .topbar-actions .btn-primary { display: none; } }

/* ---- Tipografija sekcija, kartice, tabele ---- */
.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .085em;
  color: var(--text-faint); margin: 24px 0 10px;
}
.section-title:first-child { margin-top: 2px; }
.card { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { padding: 14px 16px 10px; }
.card-header h3 { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.content { padding: 4px 26px 56px; max-width: 1560px; }
table.tbl th { font-size: 10.5px; letter-spacing: .06em; padding: 10px 14px; font-weight: 700; }
table.tbl td { padding: 11px 14px; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.strong { font-weight: 640; }
.btn { border-radius: 10px; font-weight: 570; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.badge { padding: 3px 9px; font-size: 10.5px; font-weight: 650; }
.mb-8 { margin-bottom: 8px; }

/* ---- Operativni redovi (Dolasci i odlasci, liste) ---- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 15px; box-shadow: var(--shadow-sm);
}
.kpi .k-label { font-size: 11px; color: var(--text-faint); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.kpi .k-value { font-size: 27px; font-weight: 670; letter-spacing: -0.03em; margin-top: 7px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi.accent-amber .k-value { color: var(--amber); }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
/* Raniji "operativni red" (flex lista složenog teksta) je u D3.7B
   zamijenjen tabelom - ekran je tako i prijavljen kao nedovršen. Pravila
   su uklonjena zajedno sa markupom; klase .op-* koje danas postoje
   definisane su niže, uz tabelu kojoj pripadaju. */

/* ---- Domaćinstvo ---- */
.hk-head { display: flex; gap: 10px; margin-bottom: 14px; }
.hk-head > div { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.hk-head-n { font-size: 26px; font-weight: 670; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hk-head-l { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; margin-top: 2px; }
.hk-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hk-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm);
}
.hk-card.st-dirty { box-shadow: inset 3px 0 0 var(--red), var(--shadow-sm); }
.hk-card.st-cleaning { box-shadow: inset 3px 0 0 var(--blue), var(--shadow-sm); }
.hk-card.st-maintenance { box-shadow: inset 3px 0 0 var(--gold), var(--shadow-sm); }
.hk-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hk-card-code { font-size: 20px; font-weight: 670; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hk-card-meta { font-size: 12px; color: var(--text-muted); }
.hk-card-note { font-size: 11.5px; color: var(--amber); background: var(--amber-soft); padding: 6px 9px; border-radius: 7px; }
.hk-action { margin-top: auto; padding: 11px 14px; font-size: 13.5px; }
.hk-cell { display: flex; align-items: center; gap: 8px; }
.hk-cell select { padding: 4px 6px; font-size: 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.hk-summary { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 16px; }
.hk-chip {
  display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px;
}
.hk-chip b { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 660; }
.hk-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
@media (max-width: 520px) { .hk-board { grid-template-columns: 1fr; } }

/* ---- Gosti u rezervaciji ---- */
.guest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ---- Faktura: klase izgubljene sa ostatkom bloka ---- */
.inv-issuer-name { font-size: 16px; font-weight: 670; letter-spacing: -0.015em; }
.inv-issuer-sub { font-size: 12px; color: #5f6469; }
.inv-title { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #92979c; font-weight: 700; }
.inv-number { font-size: 21px; font-weight: 670; letter-spacing: -0.02em; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.inv-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #92979c; font-weight: 700; margin-bottom: 5px; }
.inv-party-name { font-size: 14px; font-weight: 630; margin-bottom: 2px; }
.inv-line-desc { font-weight: 570; }
.inv-notes { min-width: 0; }
.inv-pay { display: flex; justify-content: space-between; font-size: 11.5px; color: #5f6469; padding: 3px 0; }
.inv-footnote { font-size: 11px; color: #5f6469; margin-top: 14px; }
.invoice-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px; font-weight: 620;
}

/* ---- Boot splash ---- */
.boot-text { font-size: 14px; letter-spacing: .02em; }

/* ---- Kalendar: mirnije, čitljivije kad je pun ---- */
.cal-scroll { border-radius: var(--radius); }
.cal-day-head { padding: 7px 2px; font-size: 10.5px; }
.cal-day-head.today { background: var(--accent); color: #fff; }
.cal-day-head.today .dow { color: rgba(255,255,255,.75); }
.cal-room-cell .code { font-size: 12.5px; font-weight: 670; }
.cal-bar { border-radius: 7px; top: 5px; bottom: 5px; font-size: 11px; font-weight: 570; box-shadow: none; border: 1px solid rgba(0,0,0,.08); }
.cal-bar:hover { filter: none; box-shadow: 0 2px 8px rgba(16,18,20,.16); }
.cal-bar.st-checked_out { background: #b9bdc2; }
.occ-card { min-width: 0; }

/* ---- Radni prostor rezervacije ---- */
.ws { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.ws-back {
  background: none; border: none; color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  cursor: pointer; padding: 4px 0; align-self: flex-start;
}
.ws-back:hover { color: var(--accent); }
.ws-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.ws-code { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ws-head h2 { margin: 3px 0 9px; font-size: 24px; font-weight: 670; letter-spacing: -0.028em; }
.ws-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-muted); }
.ws-facts b { color: var(--text); font-weight: 640; }
.ws-badges { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.ws-money { border-left: 1px solid var(--border); padding-left: 20px; }
.ws-money-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: 12.5px; color: var(--text-muted); }
.ws-money-row b { font-variant-numeric: tabular-nums; font-weight: 640; color: var(--text); font-size: 13.5px; }
.ws-money-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.ws-money-row.total b { font-size: 18px; letter-spacing: -0.02em; }
.ws-money-row b.due { color: var(--red); }
.ws-money-row b.ok { color: var(--green); }
.ws-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.ws-tab {
  background: none; border: none; cursor: pointer; padding: 10px 14px; font-size: 13.5px; font-weight: 570;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ws-tab:hover { color: var(--text); }
.ws-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.ws-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm); min-height: 240px;
}
.ws .modal-footer {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); padding: 12px 18px;
}
.ws .field-row { max-width: 720px; }
.ws .field textarea, .ws .field input, .ws .field select { max-width: 520px; }
@media (max-width: 900px) {
  .ws-head { grid-template-columns: 1fr; }
  .ws-money { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 14px; }
  .ws-tabs { overflow-x: auto; }
}
.ws-ident { min-width: 0; }

/* ==========================================================================
   D3.7B — kalendar: neprekidna navigacija kroz vrijeme
   Toolbar više nije samo tri dugmeta nad fiksnim prozorom od tri sedmice.
   Grupe su vizuelno odvojene (kretanje | raspon koji se vidi | skok na
   datum | dužina prikaza) da se na prvi pogled vidi gdje se korisnik
   nalazi u vremenu.
   ========================================================================== */
.calendar-toolbar { gap: 8px; align-items: center; }
.cal-nav { display: inline-flex; gap: 4px; align-items: center; }
.cal-nav .btn { padding: 6px 10px; }
.btn.icon-btn { padding: 6px 9px; font-size: 14px; line-height: 1; font-weight: 600; }
.btn.primary-ghost {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn.primary-ghost:hover { background: var(--accent-soft); }

.cal-range-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 0 4px;
  white-space: nowrap;
}

.cal-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.cal-jump input[type="date"] {
  font: inherit;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.cal-range-picker { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-range-picker .btn {
  border: none;
  border-radius: 0;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--surface);
  border-left: 1px solid var(--border);
}
.cal-range-picker .btn:first-child { border-left: none; }
.cal-range-picker .btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Legenda je sada ispod alatne trake, pa ne gura navigaciju u drugi red. */
.calendar-toolbar + .legend { margin: -4px 0 12px; }

@media (max-width: 900px) {
  .calendar-toolbar .spacer { display: none; }
  .cal-range-label { width: 100%; order: -1; }
}

/* ==========================================================================
   D3.7B — operativne tabele (Dolasci i odlasci, Prijava gostiju)
   Ova dva ekrana su na fizičkom pregledu djelovala nedovršeno: složeni
   tekst u uskim kolonama, bez ritma i bez hijerarhije. Rješenje nije
   dekoracija nego tabelarna gustina - ono što recepcija čita preko reda.
   ========================================================================== */
/* Ekran dolazaka/odlazaka kao cjelina: tri sekcije jedna ispod druge i
   spisak koji se može odštampati bez ostatka aplikacije. */
.ops-view { display: block; }
.ops-view .kpi-row { margin-bottom: 14px; }

.op-section { margin-bottom: 16px; }
.op-section .card-header h3 { display: flex; align-items: center; gap: 8px; }
.op-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text-muted);
}
.op-period { font-size: 12px; color: var(--text-muted); margin: -6px 0 12px; }

table.tbl.op-table td, table.tbl.reg-table td { padding: 9px 14px; }
table.tbl.op-table tbody tr.op-tr { cursor: pointer; }

.op-room {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.op-guest { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.op-guest-name { font-weight: 620; font-size: 13px; color: var(--text); }
.op-code { font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.op-phone { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.op-date { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.op-date .dw { display: inline-block; min-width: 26px; color: var(--text-faint); font-size: 11px; text-transform: capitalize; }
.op-span { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--text-muted); }
.op-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }
.op-people { font-variant-numeric: tabular-nums; }
.op-people .kids { color: var(--text-faint); font-size: 11px; margin-left: 1px; }
.op-src { font-size: 11.5px; color: var(--text-muted); }
.op-due { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--red); white-space: nowrap; }

.op-table .c-room { width: 74px; }
.op-table .c-date { width: 124px; }
.op-table .c-time { width: 62px; text-align: right; }
.op-table .c-num { width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
.op-table .c-src { width: 104px; }
.op-table .c-status { width: 116px; }
.op-table .c-money { width: 108px; text-align: right; }
.op-table .c-act { width: 96px; text-align: right; }

.op-empty { text-align: center; color: var(--text-faint); font-size: 12.5px; padding: 18px 14px !important; }

.op-row-error td {
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.op-row-error .msg { flex: 1; min-width: 200px; }

/* ---- Prijava gostiju ---- */
.reg-table .c-idx { width: 40px; color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: right; }
.reg-table .c-name { font-weight: 600; white-space: nowrap; }
.reg-table .c-date { width: 110px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.reg-table .c-num { width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.reg-table .c-doc { font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.reg-table .c-room { width: 70px; }
.reg-table .c-status { width: 124px; }
/* Red koji čeka prijavu ne boji se cijeli - u demo periodu to je većina
   redova, pa bi tabela bila jednobojna i oznaka bi izgubila značenje.
   Umjesto toga, tanka traka uz redni broj. */
.reg-table tbody tr.reg-pending td.c-idx { box-shadow: inset 3px 0 0 var(--amber); }
.reg-missing { color: var(--text-faint); }

@media (max-width: 900px) {
  .op-table .c-src, .op-table .c-time { display: none; }
  .op-row-error td { display: table-cell; }
}

@media print {
  .op-section { break-inside: avoid; box-shadow: none; }
  .op-count { border-color: #999; }
  table.tbl.op-table td, table.tbl.op-table th { padding: 5px 8px; font-size: 11px; }
}

/* ==========================================================================
   D3.7B — izbor slike objekta (logo / naslovna)
   Polje za URL je zamijenjeno stvarnim uploadom, pa mu treba pregled:
   vlasnik mora vidjeti šta je poslao prije nego što to završi na fakturi.
   ========================================================================== */
.img-field { margin-bottom: 16px; }
.img-picker { display: flex; gap: 14px; align-items: flex-start; }

.img-preview {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.img-preview.square { width: 78px; height: 78px; }
.img-preview.wide { width: 148px; height: 78px; }
.img-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.img-preview.wide img { object-fit: cover; }
.img-empty { font-size: 11px; color: var(--text-faint); text-align: center; padding: 0 8px; }

.img-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.img-actions .hint { flex-basis: 100%; margin: 0; }

@media (max-width: 560px) {
  .img-picker { flex-direction: column; }
}

/* ==========================================================================
   D3.7B — ujednačavanje ekrana
   Fizički nalaz: pojedini ekrani izgledaju kao stari UI sa novim bojama.
   Uzrok je bio što su isti elementi imali po dvije izvedbe: dvije vrste
   KPI kartice (.stat-card i .kpi), dvije alatne trake (.calendar-toolbar
   i .ops-toolbar) i pretrage stilizovane inline umjesto klasom. Zadržana
   je po JEDNA izvedba svakog, a .calendar-toolbar je vraćen kalendaru,
   kome i pripada po imenu.
   ========================================================================== */
.toolbar-search {
  min-width: 240px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
}
.toolbar-search.wide { min-width: 340px; }
.toolbar-search:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* Naslov liste sa brojem - isti obrazac kao na Dolascima i odlascima, da
   svaki spisak u aplikaciji odgovara na "koliko ih ima" na istom mjestu. */
.card > .card-header + .tbl-wrap { border-top: 1px solid var(--border); }

/* KPI kartica sa iznosom: novac je uvijek uži i u tabularnim ciframa, pa
   se kolone brojeva poravnavaju i ne poskakuju pri osvježavanju. */
.kpi .k-value.money { font-size: 21px; letter-spacing: -0.02em; }
.kpi.accent-green .k-value { color: var(--green); }
.kpi-row-2 { grid-template-columns: repeat(2, 1fr); }
.kpi-solo { max-width: 268px; }

.cell-strong { font-weight: 600; }

@media (max-width: 900px) {
  .toolbar-search, .toolbar-search.wide { min-width: 0; width: 100%; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   D3.8 — ograda za greške u prikazu
   Pad jednog ekrana ne smije više obrisati cijelu aplikaciju u bijelo.
   ========================================================================== */
.view-error {
  max-width: 560px;
  margin: 40px auto;
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.view-error h2 { font-size: 17px; margin: 0 0 8px; }
.view-error p { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.view-error-detail {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px !important;
  color: var(--red) !important;
  background: var(--red-soft);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 12px 0 16px !important;
  word-break: break-word;
}

/* ==========================================================================
   D3.8 — FAKTURA NA EKRANU

   Ovo je druga polovina D3.6 štete. Kad je onaj neusidreni isječak pojeo
   pola stilskog lista, sa njim su otišla i EKRANSKA pravila za fakturu -
   ostala su samo ona unutar @media print. Moj D3.7B test to nije uhvatio
   jer je tražio samo da se naziv klase negdje pojavi u CSS-u, a
   `.invoice-shell` se pojavljivao - u print bloku. Test je popravljen da
   traži pravilo IZVAN @media print.

   Posljedica na ekranu: .invoice-shell i .invoice-page nisu imali ni
   širinu, ni pozadinu, ni skrol, pa se dokument razlivao preko stranice
   rezervacije i djelovao kao pokvaren modal. Fizički nalaz je bio tačan.
   ========================================================================== */
.invoice-overlay {
  z-index: 200;               /* iznad radnog prostora i svih panela */
  padding: 24px 16px;
  overflow-y: auto;
  align-items: flex-start;
}

.invoice-shell {
  width: min(860px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Bijeli list papira. Proporcija prati A4 da ono što se vidi na ekranu
   odgovara onome što izađe iz štampača. */
.invoice-page {
  background: #fff;
  color: #1a1d21;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 38px 42px 34px;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Dokument je uvijek svijetao, i u tamnoj temi: papir nije UI. */
.invoice-page * { color: inherit; }

@media (max-width: 720px) {
  .invoice-overlay { padding: 12px 8px; }
  .invoice-page { padding: 22px 18px; border-radius: var(--radius); }
}

/* --------------------------------------------------------------------------
   Faktura — tijelo dokumenta (ekran)

   Ovo je ostatak sloja koji je D3.6 isječak pojeo. Bez njega su
   .inv-head, .inv-parties, .inv-table, .inv-totals i .inv-bottom bili
   goli elementi bez rasporeda, pa se dokument spuštao u jednu dugu kolonu
   teksta preko cijele stranice - ono što je fizički viđeno kao "faktura
   se preliva iza modala".

   Boje su ovdje namjerno fiksne, a ne tokeni teme: ovo je papir. Isti
   dokument mora izgledati isto u svijetloj temi, u tamnoj temi i na
   štampaču.
   -------------------------------------------------------------------------- */
.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 2px solid #1a1d21;
}
.inv-issuer { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.inv-logo { width: 54px; height: 54px; object-fit: contain; flex-shrink: 0; }
.inv-logo-fallback {
  width: 54px; height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1a1d21; color: #fff;
  border-radius: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: .02em;
}
.inv-issuer-line { font-size: 11.5px; color: #5f6469; line-height: 1.55; }
.inv-meta { text-align: right; flex-shrink: 0; }
.inv-meta-line { font-size: 11.5px; color: #5f6469; line-height: 1.6; }

.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}

.inv-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 24px; }
.inv-table th {
  text-align: left;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em;
  color: #92979c; font-weight: 700;
  padding: 0 10px 7px; border-bottom: 1px solid #92979c;
}
.inv-table th.num, .inv-table td.num { text-align: right; }
.inv-table td { padding: 9px 10px; border-bottom: 1px solid #e4e6e8; vertical-align: top; }
.inv-table td.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-line-detail { font-size: 11px; color: #5f6469; margin-top: 2px; }

.inv-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.inv-totals { border-top: 2px solid #1a1d21; padding-top: 10px; }
.inv-total-row {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12.5px; padding: 5px 0;
}
.inv-total-row .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-total-row.strong { font-size: 15px; font-weight: 700; border-top: 1px solid #e4e6e8; margin-top: 4px; padding-top: 9px; }
.inv-total-row.muted { color: #5f6469; }
.inv-disclaimer { font-size: 10.5px; color: #92979c; margin-top: 18px; line-height: 1.5; }

@media (max-width: 720px) {
  .inv-head { flex-direction: column; gap: 16px; }
  .inv-meta { text-align: left; }
}

/* ==========================================================================
   D3.8 — kalendar kao traka vremena
   Datumi se pomjeraju bočnim skrolom, kolona sa sobama stoji. Bafer se
   sam produžava, pa korisnik nikad ne udari u kraj.
   ========================================================================== */
.cal-scroll {
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;   /* ne vuče istoriju pregledača unazad */
  scrollbar-width: thin;
}
.cal-scroll::-webkit-scrollbar { height: 11px; width: 11px; }
.cal-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
.cal-scroll::-webkit-scrollbar-track { background: var(--surface-2); }

/* Prva kolona ostaje na mjestu dok datumi putuju - bez toga se pri
   pomjeranju mjesecima unaprijed izgubi koja soba je koji red. */
.cal-corner, .cal-room-cell { box-shadow: 1px 0 0 var(--border); }

/* Oznaka mjeseca u zaglavlju: pri dugom skrolu se inače izgubi koji je
   mjesec uopšte na ekranu. */
.cal-day-head.month-start { border-left: 2px solid var(--accent); }
.cal-day-head.month-start .mo {
  display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
}

.cal-range-label { min-width: 190px; }

/* ==========================================================================
   D3.8 — gost kao RED, ne kao formular

   Prijava grupe je bila niz punih formulara: dvadeset gostiju = dvadeset
   ekrana. Popunjen gost se sada sklapa u jedan red istog vizuelnog jezika
   kao tabele u Gostima i Prijavi gostiju; "Uredi" ga vraća u formular.
   ========================================================================== */
.guest-rows-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 650; color: var(--text-muted);
  margin: 16px 0 6px; padding: 0 2px;
}

.guest-row {
  display: grid;
  grid-template-columns: 78px minmax(150px, 1.4fr) 96px 110px 96px 120px 96px auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
  font-size: 12.5px;
}
.guest-row + .guest-row { margin-top: 6px; }
.guest-row:hover { border-color: var(--border-strong); }
.gr-role { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 700; }
.gr-name { font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-cell { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-cell.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gr-status { justify-self: start; }
.gr-actions { display: flex; gap: 6px; justify-content: flex-end; }

@media (max-width: 1100px) {
  .guest-row { grid-template-columns: 70px 1fr 110px auto; }
  .guest-row .gr-cell:nth-of-type(1),
  .guest-row .gr-cell:nth-of-type(3) { display: none; }
  .gr-status { display: none; }
}

/* ==========================================================================
   D3.8 — odabir gostiju za izvoz
   Period bira ko je DOSTUPAN, kvačice biraju ko IDE. Traka iznad tabele
   uvijek doslovno kaže šta će se izvesti - izvoz pogrešnog skupa gostiju
   je prijava pogrešnih ljudi nadležnoj službi, pa se to ne smije desiti
   tiho.
   ========================================================================== */
.sel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
}
.sel-bar.active { background: var(--accent-soft); }
.sel-count { color: var(--text-muted); font-weight: 600; }
.sel-bar.active .sel-count { color: var(--accent-soft-text); }

.sel-tag {
  display: inline-block; margin-left: 8px;
  font-size: 10.5px; font-weight: 650;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-soft-text);
}
.sel-tag.faint { background: var(--surface-2); color: var(--text-faint); }

.reg-table .c-check { width: 38px; text-align: center; }
.reg-table .c-check input { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent); }
.reg-table tbody tr.reg-selected td { background: var(--accent-soft); }

/* ==========================================================================
   D3.8 — dnevna tabla soba (glavni meni -> Sobe)

   Kartica po sobi, a ne red u tabeli: ovaj ekran se koristi sa telefona u
   hodniku, gdje je dodirna meta važnija od gustine. Boja lijeve ivice je
   stanje čišćenja, pa se hodnik "čita" na jedan pogled bez čitanja teksta.
   ========================================================================== */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 13px 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.room-card.hk-dirty { border-left-color: var(--red); }
.room-card.hk-cleaning { border-left-color: var(--amber); }
.room-card.hk-ready, .room-card.hk-clean { border-left-color: var(--green); }
.room-card.hk-maintenance { border-left-color: var(--text-faint); }

.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rc-code { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rc-type { font-size: 11px; color: var(--text-faint); margin-top: -6px; }

.rc-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-occ { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.rc-occ.occ-occupied { color: var(--accent); }
.rc-occ.occ-departed { color: var(--red); }
.rc-occ.occ-free { color: var(--text-faint); }
.rc-occ.occ-maintenance { color: var(--text-muted); }

.rc-guest, .rc-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text);
  text-align: left; text-decoration: underline; text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.rc-guest:hover, .rc-link:hover { color: var(--accent); }
.rc-link-plain { font-size: 12.5px; color: var(--text-muted); }

.rc-lines { display: flex; flex-direction: column; gap: 4px; }
.rc-line { display: flex; align-items: baseline; gap: 7px; font-size: 12px; min-width: 0; }
.rc-line .rc-link, .rc-line .rc-link-plain { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-tag {
  flex-shrink: 0; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-faint);
}
.rc-tag.out { background: var(--red-soft); color: var(--red); }
.rc-tag.in { background: var(--accent-soft); color: var(--accent-soft-text); }
.rc-when { flex-shrink: 0; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.rc-actions { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.rc-actions .btn { flex: 1; min-width: 96px; }

@media (max-width: 560px) {
  .board-grid { grid-template-columns: 1fr; }
  .rc-actions .btn { padding: 8px 10px; }
}

/* ==========================================================================
   D3.8 — ANALITIKA (Izvještaji)

   Boje su provjerene alatom (kontrast, daltonizam) na svijetloj podlozi,
   koju ova aplikacija jedina i koristi - sve četiri teme su svijetle.
   NAMJERNO nema bloka za prefers-color-scheme: dark. Kad bi postojao,
   pokrenuo bi se prema postavci operativnog sistema dok bi aplikacija
   ostala svijetla, pa bi tamne varijante boja završile na svijetloj
   podlozi. To bi bio kvar, ne podrška za tamnu temu. Kad eDomaćin dobije
   pravu tamnu temu, ovdje ide njen validirani niz.

   --viz-1 je brend plava (Planina #2F5D9B). Slot 2 se koristi samo za
   poređenje sa prethodnom godinom. Veličina (prihod, kanali, usluge) ide
   u jednoj boji: više boja tu ne nosi informaciju.
   ========================================================================== */
:root {
  /* Semantički sloj: komponente koriste --viz-*, a svaka tema puni
     --p-viz-* svojim provjerenim parom. Grafikon zato prati izgled
     objekta, a da nijedna komponenta ne zna ime teme. */
  --viz-1: var(--p-viz-1);
  --viz-2: var(--p-viz-2);
  --viz-grid: var(--p-line);
  --viz-track: var(--p-surface-2);
}

.analytics .an-filter {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--text-muted);
}
.analytics .an-filter select {
  font: inherit; font-size: 12.5px; padding: 6px 9px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.an-note {
  font-size: 11.5px; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 13px; margin: 0 0 14px;
}
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---- zajedničko za sve grafikone ---- */
.viz { margin: 0; }
.viz figcaption { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.viz-title { font-size: 13px; font-weight: 660; letter-spacing: -0.01em; }
.viz-hint { font-size: 11px; color: var(--text-faint); }
.viz-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.viz-legend .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

/* ---- stubići ---- */
.viz-cols { display: flex; align-items: flex-end; gap: 4px; margin-top: 8px; }
.viz-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; cursor: default; }
.viz-bars { display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; flex: 1; }
.viz-bar { width: 46%; max-width: 20px; border-radius: 4px 4px 0 0; }
.viz-bar.cur { background: var(--viz-1); }
.viz-bar.prev { background: var(--viz-2); opacity: .55; }
.viz-col:hover .viz-bar.cur { filter: brightness(1.12); }
.viz-x { font-size: 9.5px; color: var(--text-faint); margin-top: 5px; text-transform: uppercase; letter-spacing: .03em; }

.viz-tip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 10px;
  font-size: 11px; white-space: nowrap; z-index: 5; margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.viz-tip .faint { color: rgba(255,255,255,.7); }

/* ---- linija ---- */
.viz-svg { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis { font-size: 9px; fill: var(--text-faint); }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line.cur { stroke: var(--viz-1); }
.viz-line.prev { stroke: var(--viz-2); opacity: .6; stroke-dasharray: 4 3; }
.viz-dot { fill: var(--viz-1); stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.viz-readout { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; min-height: 17px; }

/* ---- vodoravna raspodjela ---- */
.viz-rows { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.viz-row { display: grid; grid-template-columns: minmax(96px, 150px) 1fr minmax(110px, auto); align-items: center; gap: 12px; }
.viz-row-label { min-width: 0; }
.vr-name { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vr-sub { font-size: 10px; color: var(--text-faint); }
.viz-track { background: var(--viz-track); border-radius: 5px; height: 10px; overflow: hidden; }
.viz-fill { background: var(--viz-1); height: 100%; border-radius: 5px; }
.viz-row-value { text-align: right; font-size: 12px; font-weight: 640; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vr-pct { display: inline-block; min-width: 34px; text-align: right; font-weight: 500; color: var(--text-faint); font-size: 11px; margin-left: 6px; }

@media (max-width: 1000px) {
  .an-grid { grid-template-columns: 1fr; }
  .viz-row { grid-template-columns: minmax(80px, 120px) 1fr auto; }
}

/* ==========================================================================
   D3.9 — IZBOR IZGLEDA

   Kontrola stoji u traci jer je to jedina stvar koju vlasnik u prvim
   minutama može DOKAZATI klikom: da sistem može izgledati kao njegov
   objekat. Sve boje dolaze iz tokena teme, pa se sam izbornik prefarba
   zajedno sa aplikacijom.
   ========================================================================== */
.theme-picker { position: relative; }
.theme-btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.theme-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0 50%, var(--gold) 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 288px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; overflow: hidden;
}
.theme-menu-head {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); padding: 8px 10px 6px;
}
.theme-menu-empty { padding: 12px 10px; font-size: 12px; color: var(--text-muted); }
.theme-menu-foot {
  font-size: 10.5px; color: var(--text-faint);
  padding: 8px 10px 6px; border-top: 1px solid var(--border); margin-top: 4px;
}

.theme-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; border-radius: var(--radius-sm);
  padding: 8px 10px; cursor: pointer; text-align: left; font: inherit;
}
.theme-item:hover { background: var(--surface-2); }
.theme-item.active { background: var(--accent-soft); }
.theme-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.theme-item-text b { font-size: 12.5px; font-weight: 640; color: var(--text); }
.theme-item-text span { font-size: 10.5px; color: var(--text-faint); }
.theme-check { color: var(--accent); font-weight: 700; }

.theme-swatch { display: inline-flex; gap: 2px; flex-shrink: 0; }
.theme-swatch i {
  width: 11px; height: 22px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

/* Podešavanja -> Objekat: iste teme, više prostora. */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.theme-tile {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font: inherit; text-align: left;
}
.theme-tile:hover { border-color: var(--border-strong); }
.theme-tile.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-tile b { font-size: 13px; }
.theme-tile-hint { font-size: 10.5px; color: var(--text-faint); }

@media (max-width: 700px) {
  .theme-menu { width: min(300px, calc(100vw - 24px)); right: -6px; }
  .theme-btn span:not(.theme-dot) { display: none; }
}

/* ==========================================================================
   D3.9 — PRO MOGUĆNOSTI

   Ovo je prodajni sloj, ali ostaje hotelski softver. Zato: bez zlatnih
   preliva, bez treptanja, bez katanaca na svakom uglu i bez ijedne
   cijene. Akcenat je jedna suzdržana boja iz teme i jedna zvjezdica.
   ========================================================================== */
.nav-pro { color: var(--gold-soft-text); }
.nav-pro .ic { color: var(--gold); }
.nav-pro:hover { background: var(--gold-soft); }
.nav-pro.active { background: var(--gold-soft); color: var(--gold-soft-text); }
.nav-pro.active .ic { color: var(--gold-hover); }

.pro-page { max-width: 1120px; }
.pro-hero { margin: 4px 0 22px; }
.pro-hero h1 {
  font-family: var(--font-display); font-size: 27px; font-weight: 640;
  letter-spacing: -0.028em; margin: 0 0 6px; line-height: 1.18;
}
.pro-hero p { font-size: 14.5px; color: var(--text-muted); margin: 0 0 4px; }
.pro-hero-note {
  font-size: 12px !important; color: var(--text-faint) !important;
  max-width: 640px; margin-top: 10px !important;
}

.pro-status {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-soft-text);
}

.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.pro-card {
  display: flex; flex-direction: column; gap: 7px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px 16px;
  cursor: pointer; font: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.pro-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.pro-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pro-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pro-card-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-soft-text);
}
.pro-ic { width: 19px; height: 19px; }
.pro-marked {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green); background: var(--green-soft); padding: 3px 8px; border-radius: 999px;
}
.pro-card h3 { font-size: 15px; font-weight: 650; margin: 4px 0 0; letter-spacing: -0.01em; }
.pro-card-tag { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.pro-card-benefit { font-size: 12px; color: var(--text-faint); margin: 2px 0 0; line-height: 1.5; }
.pro-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 11px; border-top: 1px solid var(--border);
}
.pro-card-more { font-size: 12px; font-weight: 620; color: var(--accent); }
.pro-foot-note { font-size: 11.5px; color: var(--text-faint); margin-top: 18px; }

/* ---- pregled jedne mogućnosti ---- */
.pro-overlay { z-index: 180; padding: 24px 16px; overflow-y: auto; align-items: flex-start; }
.pro-modal {
  position: relative; width: min(620px, 100%); margin: auto;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 26px 28px 24px;
}
.pro-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 24px; line-height: 1;
  color: var(--text-faint); cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.pro-close:hover { background: var(--surface-2); color: var(--text); }

.pro-modal-head { display: flex; gap: 15px; align-items: flex-start; padding-right: 30px; }
.pro-modal-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-soft-text);
}
.pro-modal-icon .pro-ic { width: 23px; height: 23px; }
.pro-modal-head h2 {
  font-family: var(--font-display); font-size: 20px; font-weight: 640;
  letter-spacing: -0.02em; margin: 7px 0 4px;
}
.pro-tagline { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.pro-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 18px 0 0; }

.pro-section { margin-top: 18px; }
.pro-section h3 {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); margin: 0 0 8px;
}
.pro-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pro-list li {
  font-size: 13px; color: var(--text); padding-left: 20px; position: relative; line-height: 1.5;
}
.pro-list li::before {
  content: ''; position: absolute; left: 4px; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}

.pro-benefit {
  margin-top: 18px; padding: 13px 15px;
  background: var(--accent-soft); color: var(--accent-soft-text);
  border-radius: var(--radius); font-size: 13px; line-height: 1.5; font-weight: 560;
}
.pro-benefit-label {
  display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; opacity: .75; margin-bottom: 3px;
}

/* Rečenica koja sprečava da pregled zazvuči kao da nešto već radi. */
.pro-honesty {
  margin-top: 14px; padding: 11px 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px; color: var(--text-muted); line-height: 1.5;
}

.pro-cta { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pro-cta-note { font-size: 11px; color: var(--text-faint); margin: 9px 0 0; line-height: 1.5; }
.pro-saved {
  font-size: 13px; font-weight: 600; color: var(--green);
  background: var(--green-soft); border-radius: var(--radius-sm); padding: 10px 13px;
}

/* ---- kontekstualni ulaz: primjetan, ali sekundaran ---- */
.pro-hints { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pro-hint {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: 999px; padding: 6px 13px 6px 10px;
  cursor: pointer; font: inherit; font-size: 12px; color: var(--text-muted);
}
.pro-hint:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-soft-text); }
.pro-hint-lock { color: var(--gold); font-size: 12px; }
.pro-hint-title { font-weight: 600; }
.pro-hint-more { font-size: 11px; color: var(--text-faint); }
.pro-hint:hover .pro-hint-more { color: inherit; }

@media (max-width: 600px) {
  .pro-hero h1 { font-size: 22px; }
  .pro-grid { grid-template-columns: 1fr; }
  .pro-overlay { padding: 12px 8px; }
  .pro-modal { padding: 22px 18px 20px; border-radius: var(--radius); }
  .pro-modal-head { flex-direction: column; gap: 10px; }
}

/* Rečenica koja stoji u svakom pregledu, običnim jezikom: oznaka u
   zaglavlju je stilizovana i lako se previdi, a ovo se pročita. */
.pro-planned {
  margin-top: 16px; padding: 11px 13px;
  background: var(--gold-soft); color: var(--gold-soft-text);
  border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5;
}

/* ==========================================================================
   D3.9.1 — neuspjelo učitavanje se VIDI

   Ranije je pad poziva ostavljao ekran na "Učitavanje..." zauvijek, bez
   ijedne poruke. Od sada svaki takav ekran kaže šta je palo i nudi
   povratak, pa se tiho zaglavljivanje ne može ponoviti.
   ========================================================================== */
.load-error {
  max-width: 560px; margin: 28px auto;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.load-error-title { font-size: 14px; font-weight: 640; margin-bottom: 6px; }
.load-error-msg {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px;
}
.theme-menu-error { padding: 12px 10px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* ==========================================================================
   Obroci i aktivnosti (V1)

   Kalendar ostaje JEDAN grid: Smještaj, Restoran i Aktivnosti su redovi
   istog rasporeda, razdvojeni trakom sa imenom sekcije. Zbirni redovi su
   mirni - prazna ćelija je samo mreža, a broj je malo dugme koje otvara
   ko stoji iza njega.
   ========================================================================== */
.cal-section-label {
  position: sticky; left: 0; z-index: 3;
  display: flex; align-items: center; padding: 0 12px;
  background: var(--surface-2); border-right: 1px solid var(--border);
  border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.cal-section-band {
  display: flex; align-items: center;
  background: var(--surface-2);
  border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border);
}
.cal-section-hint {
  position: sticky; left: calc(152px + 12px);
  font-size: 11.5px; color: var(--text-faint); padding-left: 12px;
}
.cal-sum-label { justify-content: center; }
.cal-sum-label .code { font-size: 12px; font-weight: 600; }
.cal-sum-cell {
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cal-sum-cell.weekend { background: rgba(0,0,0,.012); }
.cal-sum-cell.today { background: var(--accent-soft); }
.cal-sum {
  min-width: 26px; height: 22px; padding: 0 5px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text);
  font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  cursor: pointer; line-height: 1;
}
.cal-sum:hover { border-color: var(--accent); color: var(--accent); }
.cal-sum:focus-visible { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.modal.cal-breakdown { width: min(520px, 94vw); }
.breakdown-list { list-style: none; margin: 0; padding: 0; }
.breakdown-list li { border-bottom: 1px solid var(--border); padding: 8px 0; }
.breakdown-list li:last-child { border-bottom: none; }
.breakdown-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  width: 100%; text-align: left; background: none; border: none; padding: 4px 6px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text);
}
.breakdown-row:hover { background: var(--surface-2); }
.breakdown-row .mono { font-size: 12px; color: var(--text-muted); }
.bd-guest { font-weight: 560; min-width: 0; }
.bd-persons { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bd-note {
  margin: 4px 6px 0; padding: 5px 9px; border-radius: var(--radius-sm);
  background: var(--amber-soft); color: var(--amber); font-size: 12px;
}
@media (max-width: 560px) {
  .breakdown-row { grid-template-columns: 1fr auto; }
  .breakdown-row .mono { grid-column: 1 / -1; }
}

/* ---- Editor plana ishrane ---- */
.meal-editor { display: flex; flex-direction: column; gap: 6px; }
.meal-plan-picker { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.meal-plan-opt {
  padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text-muted); font-size: 12.5px; font-weight: 550; cursor: pointer;
}
.meal-plan-opt:hover { color: var(--text); }
.meal-plan-opt.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-text); font-weight: 650; }
.meal-plan-opt:disabled { cursor: default; opacity: .7; }
.meal-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.meal-summary-text b { color: var(--text); font-weight: 620; }
.meal-custom-flag { display: inline-flex; align-items: center; gap: 8px; }
.meal-custom-flag .link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 12px; font-weight: 560; text-decoration: underline; text-underline-offset: 2px;
}

/* Prekidač rasporeda: prepoznatljiva kontrola (ivica, strelica, broj
   dana), ne tekst koji liči na "+ Više detalja". */
.meal-days-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.meal-days-toggle:hover { border-color: var(--accent); }
.meal-days-toggle:focus-visible { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.meal-days-toggle.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.meal-days-toggle .chev { width: 12px; color: var(--accent); }
.meal-days-count { margin-left: auto; font-size: 11.5px; font-weight: 550; color: var(--text-faint); }

.meal-days { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.meal-days-toggle.open + .meal-days { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; }
.meal-days .hint { padding: 8px 12px 10px; }
.meal-day {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
  padding: 7px 12px;
}
.meal-day + .meal-day { border-top: 1px solid var(--border); }
.meal-days .hint { border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-faint); }
.meal-day-date { font-size: 12.5px; white-space: nowrap; line-height: 1.25; }
.meal-day-date b { display: block; font-weight: 620; }
.meal-tag {
  display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em;
}
.meal-day-meals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.meal-chip {
  display: flex; align-items: center; justify-content: space-between; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); overflow: hidden;
}
.meal-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.meal-chip-toggle {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 9px;
  background: none; border: none; cursor: pointer; font-size: 12.5px; font-weight: 560; color: var(--text-muted);
}
.meal-chip.on .meal-chip-toggle { color: var(--accent-soft-text); font-weight: 650; padding-right: 6px; }
.meal-chip-toggle:disabled { cursor: default; }
.meal-chip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 999px; }
.meal-chip .tick {
  display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong); border-radius: 4px; font-size: 10px; line-height: 1; background: var(--surface);
}
.meal-chip.on .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.meal-persons-wrap { display: inline-flex; align-items: center; gap: 3px; padding-right: 9px; font-size: 11.5px; color: var(--accent-soft-text); }
/* Editor živi i unutar .field (Nova rezervacija), pa njegova polja moraju
   nadjačati opšte `.field input { width: 100% }`. */
.meal-editor input.meal-persons {
  width: 46px; padding: 2px 4px; font-size: 12px; text-align: center;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface);
}
.meal-editor input.meal-note {
  grid-column: 2 / -1; width: 100%; min-width: 0; padding: 5px 8px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
}
.meal-note-btn {
  background: none; border: none; padding: 4px 2px; cursor: pointer; white-space: nowrap;
  font-size: 11.5px; font-weight: 560; color: var(--text-faint);
}
.meal-note-btn:hover:not(:disabled) { color: var(--accent); }
.meal-note-btn.active { color: var(--accent-soft-text); }
.meal-note-btn:disabled { cursor: default; opacity: .55; }
/* Telefon: dan je naslov reda, a obroci idu jedan ispod drugog - svaki
   je cijelom širinom lako pogodiv prstom, broj osoba desno. */
@media (max-width: 720px) {
  .meal-day { grid-template-columns: minmax(0, 1fr) auto; }
  .meal-day-meals { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .meal-note-btn { grid-column: 2; grid-row: 1; justify-self: end; }
  .meal-chip-toggle { padding-top: 8px; padding-bottom: 8px; }
  .meal-editor input.meal-note { grid-column: 1 / -1; }
}

/* Modal čiji je sadržaj <form> (Nova rezervacija): forma mora biti dio
   flex kolone modala, inače se tijelo ne skroluje i duži sadržaj (npr.
   raspored obroka na telefonu) izađe ispod okvira modala. */
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }

/* ==========================================================================
   Kapacitet i dostupnost soba (V1)

   Nova rezervacija: termin i broj gostiju idu PRIJE sobe, a lista soba
   pokazuje samo one koje su slobodne i primaju sve goste.
   ========================================================================== */
.field-row.res-stay { grid-template-columns: 1.3fr 1.3fr 1fr 1fr; }
@media (max-width: 560px) { .field-row.res-stay { grid-template-columns: 1fr 1fr; } }
.room-status { margin-top: 5px; font-size: 12px; }
.room-count { color: var(--accent-soft-text); font-weight: 600; }
.room-none { color: var(--amber); font-weight: 600; }
.room-status .text-danger, .room-capacity-preview .text-danger { color: var(--red); }
.form-warning.room-notice { margin-bottom: 0; }
.room-capacity-preview { font-size: 12.5px; color: var(--text-muted); margin: -4px 0 12px; }
.room-capacity-preview b { color: var(--text); }

/* ==========================================================================
   Tipovi i smještajne jedinice (V1)

   Naziv jedinice je slobodan tekst ("101", "Vila Jelena", "A-frame 2"),
   pa kolona kalendara i kartice moraju podnijeti i dug naziv.
   ========================================================================== */
.cal-room-cell .code, .cal-room-cell .type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 132px; }
.unit-beds { font-size: 11px; font-weight: 450; margin-top: 2px; }
.hk-card-code, .rc-code { overflow-wrap: anywhere; }

/* ==========================================================================
   Cjenovnik i folio (Pricing & Reservation Folio V1)
   ========================================================================== */
.pricing-intro { font-size: 12px; margin: 4px 0 14px; max-width: 760px; line-height: 1.5; }
.price-input { width: 110px; padding: 5px 8px; font-size: 12.5px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.inline-check + .price-input { display: block; margin-top: 6px; }
.row-selected { background: var(--accent-soft); }
.season-prices .flex-between { flex-wrap: wrap; gap: 8px; }
.season-pct input { width: 110px; padding: 5px 8px; font-size: 12.5px; border: 1px solid var(--border-strong); border-radius: 6px; }
.override-row { align-items: center; flex-wrap: wrap; }
.override-name { min-width: 160px; font-size: 13px; }
.meal-prices { max-width: 560px; }
.quote-line { color: var(--text-muted); }

.folio-table td.num, .folio-table th.num { text-align: right; white-space: nowrap; }
.folio-section td { background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.folio-total td { font-weight: 700; border-top: 1px solid var(--border-strong); }
.folio-detail { font-size: 11.5px; margin-top: 2px; }
.folio-negative { color: var(--green, var(--accent)); }
.folio-note { font-size: 11.5px; }
.folio-list { list-style: none; margin: 8px 0 0; padding: 0; }
.folio-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.folio-list li:last-child { border-bottom: none; }
.folio-list .mono { min-width: 90px; text-align: right; }
.folio-reason { flex: 1; min-width: 0; }
.meal-editor input.meal-children { border-style: dashed; }
@media (max-width: 560px) {
  .folio-table th:nth-child(3), .folio-table td:nth-child(3) { display: none; }
  .price-input { width: 90px; }
}
.season-prices .hint, .meal-prices .hint, .pricing-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
