/* =====================================================================
   Icon Casa Properties — Viewing Booking System
   Shared design system
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Archivo:wght@400;500;600;700&display=swap');

:root{
  color-scheme: light dark;

  /* -- tokens (light) -- */
  --ink:        #17181d;
  --ink-soft:   #43413c;
  --muted:      #706c63;
  --paper:      #faf8f4;
  --surface:    #ffffff;
  --surface-2:  #f2efe7;
  --line:       #e4e0d5;
  --line-soft:  #edeae0;

  --accent:      #9c7a45;
  --accent-ink:  #6e5630;
  --accent-tint: #f2e9d8;

  --success:      #3f7d58;
  --success-tint: #e4f0e7;
  --warning:      #b67816;
  --warning-tint: #f8ecd8;
  --danger:       #b23a34;
  --danger-tint:  #f6e2e0;
  --info:         #3a6ea5;
  --info-tint:    #e4edf6;
  --renovation:      #6d4aa6;
  --renovation-tint: #ece5f5;

  --shadow-sm: 0 1px 2px rgba(23,24,29,.06), 0 1px 1px rgba(23,24,29,.04);
  --shadow-md: 0 6px 20px rgba(23,24,29,.08), 0 2px 6px rgba(23,24,29,.05);
  --shadow-lg: 0 20px 48px rgba(23,24,29,.16), 0 4px 12px rgba(23,24,29,.08);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ink:        #f1ede4;
    --ink-soft:   #d9d4c8;
    --muted:      #a19c8f;
    --paper:      #131318;
    --surface:    #1b1c22;
    --surface-2:  #22232a;
    --line:       #303138;
    --line-soft:  #292a30;

    --accent:      #cdac6e;
    --accent-ink:  #e9d9ae;
    --accent-tint: #362d1c;

    --success:      #6bb886;
    --success-tint: #16281d;
    --warning:      #e3ab52;
    --warning-tint: #332512;
    --danger:       #e2716b;
    --danger-tint:  #331c1a;
    --info:         #7aa8d6;
    --info-tint:    #182430;
    --renovation:      #b399e0;
    --renovation-tint: #2a2140;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 20px rgba(0,0,0,.45);
    --shadow-lg: 0 20px 48px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"]{
  --ink:        #f1ede4;
  --ink-soft:   #d9d4c8;
  --muted:      #a19c8f;
  --paper:      #131318;
  --surface:    #1b1c22;
  --surface-2:  #22232a;
  --line:       #303138;
  --line-soft:  #292a30;

  --accent:      #cdac6e;
  --accent-ink:  #e9d9ae;
  --accent-tint: #362d1c;

  --success:      #6bb886;
  --success-tint: #16281d;
  --warning:      #e3ab52;
  --warning-tint: #332512;
  --danger:       #e2716b;
  --danger-tint:  #331c1a;
  --info:         #7aa8d6;
  --info-tint:    #182430;
  --renovation:      #b399e0;
  --renovation-tint: #2a2140;
}

*, *::before, *::after{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  /* When opened as a Home Screen app on iOS, content otherwise renders
     underneath the status bar / camera cutout — this pushes everything
     down by the device's actual safe-area inset (0 in a normal browser
     tab, so this has no effect there). */
  padding-top:env(safe-area-inset-top);
}
img{ max-width:100%; display:block; }
a{ color:inherit; }
button, input, select, textarea{ font-family:inherit; font-size:inherit; color:inherit; }
[hidden]{ display:none !important; }

h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:600;
  line-height:1.15;
  margin:0 0 .3em;
  text-wrap:balance;
}
h1{ font-size:clamp(28px,4vw,40px); }
h2{ font-size:clamp(20px,2.6vw,26px); }
h3{ font-size:18px; }
p{ margin:0 0 1em; color:var(--ink-soft); }
.eyebrow{
  font-family:var(--font-body);
  font-size:11.5px;
  font-weight:700;
  letter-spacing:.11em;
  text-transform:uppercase;
  color:var(--accent-ink);
}

/* ---------- layout helpers ---------- */
.wrap{ max-width:1120px; margin:0 inline auto; padding-inline:24px; }
.wrap{ margin-left:auto; margin-right:auto; }
.stack{ display:flex; flex-direction:column; }
.center-col{ max-width:640px; margin:0 auto; padding-inline:20px; }

/* ---------- top bar / brand ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:18px 24px;
  border-bottom:1px solid var(--line);
  background:var(--surface);
}
.topbar > a.btn, .topbar > button{ flex:0 0 auto; }
.topbar > div{ flex:1 1 auto; min-width:0; } /* the back-btn + brand wrapper, when present, needs room to shrink */
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; min-width:0; }
.brand img{ height:34px; width:auto; flex:0 0 auto; }
.brand > span{ min-width:0; }
.brand-name, .brand-sub{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-name{ font-family:var(--font-display); font-weight:600; font-size:16px; letter-spacing:.01em; }
.brand-sub{ font-size:11px; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; margin-top:1px; }
@media (max-width:420px){
  .brand-sub{ display:none; }
  .brand-name{ font-size:14.5px; }
}

/* Opened as a Home Screen app, there's no browser back button at all —
   this gives the client an obvious way to go back a page. */
.icon-back-btn{
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:36px; height:36px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface); color:var(--ink); cursor:pointer; font-size:18px; line-height:1;
  padding:0; transition:background .12s ease, transform .12s ease;
}
.icon-back-btn:hover{ background:var(--surface-2); }
.icon-back-btn:active{ transform:scale(.92); }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 20px; border-radius:999px; border:1px solid transparent;
  font-weight:600; font-size:14.5px; cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  text-decoration:none;
  white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.btn-primary{ background:var(--ink); color:var(--paper); }
.btn-primary:hover{ box-shadow:var(--shadow-md); }
:root[data-theme="dark"] .btn-primary, @media (prefers-color-scheme:dark){ }
.btn-accent{ background:var(--accent); color:#1b1305; }
.btn-accent:hover{ box-shadow:var(--shadow-md); }
.btn-outline{ background:transparent; border-color:var(--line); color:var(--ink); }
.btn-outline:hover{ border-color:var(--accent); }
.btn-ghost{ background:transparent; color:var(--ink-soft); padding:10px 14px; }
.btn-ghost:hover{ background:var(--surface-2); }
.btn-danger{ background:var(--danger-tint); color:var(--danger); }
.btn-sm{ padding:8px 14px; font-size:13px; }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* ---------- forms ---------- */
label{ display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ink-soft); }
.field{ margin-bottom:16px; }
.hint{ font-size:12px; color:var(--muted); margin-top:5px; }
input[type=text], input[type=tel], input[type=number], input[type=date],
input[type=password], input[type=email], select, textarea{
  width:100%; padding:12px 14px; border-radius:var(--radius-sm);
  border:1px solid var(--line); background:var(--surface); color:var(--ink);
  outline:none; transition:border-color .12s ease, box-shadow .12s ease;
}
textarea{ resize:vertical; min-height:80px; }
input:focus, select:focus, textarea:focus{
  border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-tint);
}
.row-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.req::after{ content:" *"; color:var(--danger); }

/* ---------- cards ---------- */
.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); box-shadow:var(--shadow-sm);
}
.card-pad{ padding:22px; }

/* ---------- badges / pills ---------- */
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 11px; border-radius:999px; font-size:12px; font-weight:600;
}
.pill-success{ background:var(--success-tint); color:var(--success); }
.pill-warning{ background:var(--warning-tint); color:var(--warning); }
.pill-renovation{ background:var(--renovation-tint); color:var(--renovation); }
.pill-danger{ background:var(--danger-tint); color:var(--danger); }
.pill-info{ background:var(--info-tint); color:var(--info); }
.pill-neutral{ background:var(--surface-2); color:var(--muted); }
.dot{ width:7px; height:7px; border-radius:50%; background:currentColor; }

/* ---------- date strip ---------- */
.date-strip{
  display:flex; gap:8px; overflow-x:auto; padding:4px 2px 12px;
  scrollbar-width:thin;
}
.date-chip{
  flex:0 0 auto; width:66px; padding:10px 4px; border-radius:14px;
  border:1px solid var(--line); background:var(--surface); text-align:center;
  cursor:pointer; transition:all .12s ease;
}
.date-chip .dow{ font-size:10.5px; letter-spacing:.06em; color:var(--muted); text-transform:uppercase; }
.date-chip .dom{ font-family:var(--font-display); font-size:19px; font-weight:600; margin-top:2px; }
.date-chip .mon{ font-size:10px; color:var(--muted); }
.date-chip.selected{ background:var(--ink); border-color:var(--ink); color:var(--paper); }
.date-chip.selected .dow, .date-chip.selected .mon{ color:var(--paper); opacity:.7; }
.date-chip.disabled{ opacity:.35; cursor:not-allowed; }

/* ---------- slot grid ---------- */
.slot-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(92px,1fr)); gap:9px; }
.slot{
  padding:11px 8px; border-radius:10px; border:1px solid var(--line);
  background:var(--surface); text-align:center; font-weight:600; font-size:13.5px;
  cursor:pointer; font-variant-numeric:tabular-nums; transition:all .12s ease;
}
.slot:hover{ border-color:var(--accent); }
.slot.selected{ background:var(--accent); border-color:var(--accent); color:#1b1305; }
.slot.taken{ opacity:.32; text-decoration:line-through; cursor:not-allowed; background:var(--surface-2); }
.slot.lunch{ display:none; }

/* ---------- steps ---------- */
.steps{ display:flex; gap:6px; margin-bottom:22px; }
.steps .seg{ flex:1; height:4px; border-radius:99px; background:var(--line); }
.steps .seg.done{ background:var(--accent); }

/* ---------- always-open notifications rail ---------- */
.notif-rail{
  background:var(--surface); border-left:1px solid var(--line);
  display:flex; flex-direction:column; min-height:100vh; position:sticky; top:env(safe-area-inset-top,0px); align-self:start;
}
.notif-rail-head{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:18px 16px 14px; border-bottom:1px solid var(--line);
}
.notif-rail-head strong{ font-size:14px; }
.notif-rail-actions{ display:flex; align-items:center; gap:6px; }
.notif-bell-btn{
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; flex:0 0 auto; border-radius:999px; border:1px solid transparent;
  background:transparent; color:var(--ink-soft); cursor:pointer; padding:0;
  transition:background .12s ease, color .12s ease, border-color .12s ease;
}
.notif-bell-btn svg{ width:17px; height:17px; }
.notif-bell-btn:hover{ background:var(--surface-2); color:var(--ink); }
.notif-bell-btn.active{ background:var(--accent-tint); color:var(--accent-ink); border-color:var(--accent-tint); }
.notif-bell-dot{
  position:absolute; top:2px; right:2px; width:8px; height:8px; border-radius:50%;
  background:var(--danger); border:2px solid var(--surface);
}
.notif-bell-dot.hide{ display:none; }
.notif-list{ overflow-y:auto; flex:1; padding:6px 0; }
.notif-empty{ text-align:center; padding:40px 18px; color:var(--muted); font-size:13px; }
.notif-row.removing{ opacity:0; transform:translateX(10px); transition:opacity .18s ease, transform .18s ease; }
.notif-row{
  position:relative; display:flex; align-items:flex-start; gap:10px;
  padding:12px 16px 12px 22px; border-bottom:1px solid var(--line-soft);
  cursor:pointer; border-left:3px solid transparent;
}
.notif-row:hover{ background:var(--surface-2); }
.notif-row.unread{ background:var(--accent-tint); }
.notif-row.nr-booked{ border-left-color:var(--success); }
.notif-row.nr-amended{ border-left-color:var(--warning); }
.notif-row.nr-cancelled{ border-left-color:var(--danger); }
.notif-row .nr-dot{
  position:absolute; top:16px; left:8px; width:8px; height:8px; border-radius:50%;
  background:var(--danger);
}
.notif-row .nr-dot.hide{ display:none; }
.notif-row .nr-body{ flex:1; min-width:0; }
.notif-row .nr-label{ font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-bottom:3px; }
.notif-row .nr-msg{ font-size:13px; font-weight:600; line-height:1.4; }
.notif-row .nr-time{ font-size:11px; color:var(--muted); margin-top:4px; }

/* Actions tab (Master) — same row look as the notifications rail, but
   full-width with an action-button group instead of an unread dot. */
.action-log{ padding:0; }
.action-row{ cursor:default; align-items:center; padding:12px 18px; gap:14px; }
.action-row:last-child{ border-bottom:none; }
.action-row .nr-msg{ font-size:14px; }
.action-row-btns{ display:flex; align-items:center; gap:8px; flex-shrink:0; }

/* ---------- admin shell ---------- */
.admin-shell{ display:grid; grid-template-columns:220px 1fr 300px; min-height:100vh; }
.admin-nav{ background:var(--surface); border-right:1px solid var(--line); padding:20px 14px; display:flex; flex-direction:column; gap:4px; }
.nav-home-btn{
  display:flex; align-items:center; gap:8px; width:100%; margin-bottom:14px;
  padding:9px 12px; border-radius:10px; border:1px solid var(--line); background:var(--surface-2);
  color:var(--ink-soft); font-weight:600; font-size:13px; cursor:pointer; text-align:left;
  transition:background .12s ease, border-color .12s ease;
}
.nav-home-btn:hover{ background:var(--accent-tint); border-color:var(--accent); color:var(--ink); }
.admin-nav a{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; text-decoration:none; color:var(--ink-soft); font-weight:600; font-size:13.5px; }
.admin-nav a:hover{ background:var(--surface-2); }
.admin-nav a.active{ background:var(--ink); color:var(--paper); }
.admin-main{ padding:26px 30px 60px; max-width:1180px; }
.admin-topline{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; gap:12px; flex-wrap:wrap; }

.tabs{ display:flex; gap:6px; background:var(--surface-2); padding:4px; border-radius:12px; width:fit-content; }
.tabs button{ border:none; background:transparent; padding:8px 16px; border-radius:9px; font-weight:600; font-size:13px; cursor:pointer; color:var(--muted); }
.tabs button.active{ background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }

/* ---------- calendar (month view) ---------- */
.cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
.cal-dow{ text-align:center; font-size:11px; font-weight:700; letter-spacing:.06em; color:var(--muted); text-transform:uppercase; padding-bottom:4px; }
.cal-cell{
  min-height:92px; border-radius:12px; border:1px solid var(--line); background:var(--surface);
  padding:8px; cursor:pointer; transition:border-color .12s ease;
  display:flex; flex-direction:column; gap:4px;
}
.cal-cell:hover{ border-color:var(--accent); }
.cal-cell.out{ opacity:.35; }
.cal-cell.today{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-tint) inset; }
.cal-cell .dnum{ font-family:var(--font-display); font-weight:600; font-size:15px; }
.cal-cell .count{ font-size:11px; color:var(--muted); }
.cal-cell .mini-dots{ display:flex; gap:3px; flex-wrap:wrap; margin-top:auto; }
.cal-cell .mini-dots span{ width:6px; height:6px; border-radius:50%; }

/* ---------- day list ---------- */
.booking-row{
  display:flex; align-items:center; gap:14px; padding:14px 16px; border:1px solid var(--line);
  border-radius:12px; background:var(--surface); cursor:pointer; margin-bottom:9px;
}
.booking-row:hover{ border-color:var(--accent); }
.booking-time{ font-family:var(--font-display); font-weight:600; font-size:15px; width:64px; flex:0 0 auto; font-variant-numeric:tabular-nums; }
.booking-main{ flex:1; min-width:0; }
.booking-main .nm{ font-weight:700; }
.booking-main .sub{ font-size:12.5px; color:var(--muted); }

/* ---------- modal / drawer ---------- */
.modal-backdrop{ position:fixed; inset:0; background:rgba(15,14,10,.45); z-index:70; display:flex; align-items:flex-end; justify-content:center; }
@media(min-width:720px){ .modal-backdrop{ align-items:center; } }
.modal{
  background:var(--surface); width:100%; max-width:560px; max-height:92vh; overflow-y:auto;
  border-radius:20px 20px 0 0; box-shadow:var(--shadow-lg); padding:26px;
}
@media(min-width:720px){ .modal{ border-radius:20px; } }
.modal-close{ float:right; background:none; border:none; font-size:20px; cursor:pointer; color:var(--muted); }

/* ---------- read-only booking detail grid ---------- */
.detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px 18px; }
.detail-item .detail-label{ display:block; font-size:10.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-bottom:2px; }
.detail-item div:not(.detail-label){ font-size:14px; font-weight:600; word-break:break-word; }
@media (max-width:520px){ .detail-grid{ grid-template-columns:1fr; } }

/* ---------- settings ---------- */
.settings-block{ margin-bottom:30px; }
.day-row{ display:grid; grid-template-columns:110px 90px 1fr 1fr 1fr; gap:10px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line-soft); }
.day-row label{ margin:0; }
.chip-list{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ display:flex; align-items:center; gap:8px; padding:7px 8px 7px 14px; border-radius:999px; background:var(--surface-2); font-size:13px; font-weight:600; }
.chip button{ background:none; border:none; cursor:pointer; color:var(--muted); font-size:15px; line-height:1; padding:2px; }
.account-row{ padding:14px 0; border-bottom:1px solid var(--line-soft); }
.account-row:last-child{ border-bottom:none; }
.account-row-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.account-row-name{ font-weight:700; font-size:14px; }
.account-row-form{ margin-top:12px; max-width:320px; }
.share-link-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line-soft); }
.share-link-row:last-child{ border-bottom:none; }
.share-link-info{ min-width:0; }
.share-link-label{ font-weight:700; font-size:13.5px; }
.share-link-url{ font-size:11.5px; color:var(--muted); margin-top:3px; word-break:break-all; }
.share-copy-btn{ flex:0 0 auto; }

/* ---------- misc ---------- */
.divider{ height:1px; background:var(--line); margin:22px 0; border:none; }
.empty{ text-align:center; padding:50px 20px; color:var(--muted); }
.spinner{ width:20px; height:20px; border-radius:50%; border:2.5px solid var(--line); border-top-color:var(--accent); animation:spin .7s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg);} }
.toast{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%);
  background:var(--ink); color:var(--paper); padding:13px 22px; border-radius:999px;
  font-size:13.5px; font-weight:600; box-shadow:var(--shadow-lg); z-index:90;
  opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-4px); }

@media (max-width:760px){
  .admin-shell{ grid-template-columns:1fr; }
  .admin-nav{
    flex-direction:row; align-items:center; flex-wrap:nowrap;
    overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
    border-right:none; border-bottom:1px solid var(--line);
    position:sticky; top:env(safe-area-inset-top,0px); background:var(--surface); z-index:20;
  }
  /* Without this, the nav links/logo shrink to fit and their text wraps
     onto a second line instead of the bar simply scrolling sideways —
     that's what caused the squashed, overlapping-looking header after
     sliding the nav and switching tabs. */
  .admin-nav > *{ flex:0 0 auto; }
  .admin-nav a{ white-space:nowrap; }
  .admin-nav .brand{ margin-bottom:0 !important; }
  .admin-main{ padding:18px 16px 60px; }
  .row-2{ grid-template-columns:1fr; }
  .day-row{ grid-template-columns:1fr 1fr; row-gap:6px; }
  .cal-cell{ min-height:64px; }
  .cal-cell .dnum{ font-size:13px; }
  .notif-rail{ position:static; min-height:0; border-left:none; border-top:1px solid var(--line); max-height:380px; }
  .notif-list{ max-height:320px; }
}

/* ---------- units & occupancy ---------- */
.units-table-wrap{ overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); }
.units-table{ width:100%; border-collapse:collapse; font-size:13.5px; white-space:nowrap; }
.units-table th{
  text-align:left; font-size:10.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--muted); padding:10px 14px; border-bottom:1px solid var(--line); background:var(--surface-2);
  position:sticky; top:0;
}
.units-table td{ padding:9px 14px; border-bottom:1px solid var(--line-soft); }
.units-table tbody tr:last-child td{ border-bottom:none; }
.units-table tbody tr:hover{ background:var(--surface-2); }
.units-table tr.status-vacant td:first-child{ box-shadow:inset 3px 0 0 var(--success); }
.units-table tr.status-renovation td:first-child{ box-shadow:inset 3px 0 0 var(--renovation); }
.units-table tr.status-hold td:first-child{ box-shadow:inset 3px 0 0 var(--warning); }
.units-table tr.status-booked td:first-child{ box-shadow:inset 3px 0 0 var(--info); }
.unit-building-cell{ font-weight:600; color:var(--ink-soft); }

/* Brief highlight when a notification jumps to a specific unit row
   (Master: "unit vacant" notification → Units tab). */
.unit-row-flash{ animation:unit-row-flash 2.4s ease-out; }
@keyframes unit-row-flash{
  0%{ background:var(--success-tint); }
  70%{ background:var(--success-tint); }
  100%{ background:transparent; }
}

.unit-price-input{
  width:120px; padding:7px 10px; border-radius:8px; border:1px solid var(--line);
  background:var(--surface); color:var(--ink); font-size:13.5px; font-variant-numeric:tabular-nums;
}
.unit-price-input:disabled{ background:var(--surface-2); color:var(--muted); cursor:not-allowed; }

.unit-status-select{
  padding:6px 30px 6px 12px; border-radius:999px; border:1px solid transparent; font-weight:700; font-size:12.5px;
  cursor:pointer; appearance:none; -webkit-appearance:none;
  background-repeat:no-repeat; background-position:right 10px center; background-size:9px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23706c63' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.status-select-vacant{ background-color:var(--success-tint); color:var(--success); }
.status-select-renovation{ background-color:var(--renovation-tint); color:var(--renovation); }
.status-select-hold{ background-color:var(--warning-tint); color:var(--warning); }
.status-select-booked{ background-color:var(--info-tint); color:var(--info); }

/* building filter + occupancy toolbar */
.units-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px; }

/* donut chart */
.donut-row{ display:flex; align-items:center; gap:28px; flex-wrap:wrap; }
.donut-wrap svg{ display:block; }
.chart-legend{ display:flex; flex-direction:column; gap:10px; }
.chart-legend-row{ display:flex; align-items:center; gap:9px; font-size:13.5px; }
.chart-legend-row .dot{ width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.chart-legend-label{ font-weight:600; min-width:60px; }
.chart-legend-value{ color:var(--muted); font-variant-numeric:tabular-nums; }

/* horizontal bar chart */
.bar-chart{ display:flex; flex-direction:column; gap:12px; }
.bar-chart-row{ display:grid; grid-template-columns:120px 1fr 44px; align-items:center; gap:12px; }
.bar-chart-label{ font-size:13px; font-weight:600; color:var(--ink-soft); text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-chart-track{ height:14px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
.bar-chart-fill{ height:100%; border-radius:999px; background:var(--accent); min-width:4px; transition:width .3s ease; }
.bar-chart-value{ font-size:12.5px; font-weight:700; color:var(--ink-soft); font-variant-numeric:tabular-nums; }

/* occupancy summary stat tiles */
.occ-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:12px; margin-bottom:22px; }
.occ-stat{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-md); padding:16px; text-align:center; }
.occ-stat-num{ font-family:var(--font-display); font-size:26px; font-weight:600; }
.occ-stat-label{ font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-top:2px; }

/* printable report */
.report-letterhead{ display:flex; align-items:center; gap:14px; padding-bottom:18px; margin-bottom:18px; border-bottom:2px solid var(--ink); }
.report-logo{ height:38px; width:auto; flex:0 0 auto; }
.report-company{ font-family:var(--font-display); font-weight:600; font-size:16px; }
.report-head{ text-align:center; margin-bottom:14px; }
.report-head h1{ font-size:26px; line-height:1.25; }
.report-head h1.report-title-long{ font-size:19px; }
.report-eyebrow{ font-size:11.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--accent-ink); margin-bottom:6px; }
.report-meta{ font-size:12.5px; color:var(--muted); margin-top:6px; }
.report-narrative{
  font-size:14px; line-height:1.6; color:var(--ink-soft); text-align:center; max-width:620px; margin:0 auto 26px;
  padding:14px 18px; background:var(--surface-2); border-radius:12px;
}
.report-narrative strong{ color:var(--ink); }
.report-stats{ display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:28px; }
.report-stats-4{ grid-template-columns:repeat(4,1fr); }
.report-stats-5{ grid-template-columns:repeat(5,1fr); }
.report-summary-mini{ max-width:560px; margin:30px auto 0; }
.report-summary-mini .report-table{ margin-bottom:0; }
.report-building-page{ margin-top:8px; padding-top:28px; border-top:2px dashed var(--line); page-break-before:always; break-before:page; page-break-inside:avoid; break-inside:avoid; }
.report-building-head{ text-align:center; margin-bottom:26px; }
.report-building-eyebrow{ font-size:11.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--accent-ink); margin-bottom:8px; }
.report-building-title{
  font-family:var(--font-display); font-weight:600;
  text-align:center; font-size:22px; border-bottom:none; padding-bottom:14px; margin:0;
  display:inline-block; position:relative;
}
.report-building-title::after{
  content:""; display:block; width:64px; height:3px; margin:14px auto 0; border-radius:999px; background:var(--accent);
}
.report-stat{ text-align:center; padding:14px 6px 12px; background:var(--surface-2); border-radius:12px; border-top:3px solid var(--line); box-shadow:var(--shadow-sm); }
.report-stat-num{ font-family:var(--font-display); font-size:22px; font-weight:600; }
.report-stat-label{ font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-top:2px; }
.report-stat-total{ border-top-color:var(--ink-soft); }
.report-stat-vacant{ border-top-color:var(--success); }
.report-stat-vacant .report-stat-num{ color:var(--success); }
.report-stat-renovation{ border-top-color:var(--renovation); }
.report-stat-renovation .report-stat-num{ color:var(--renovation); }
.report-stat-hold{ border-top-color:var(--warning); }
.report-stat-hold .report-stat-num{ color:var(--warning); }
.report-stat-booked{ border-top-color:var(--info); }
.report-stat-booked .report-stat-num{ color:var(--info); }
.report-stat-occ{ border-top-color:var(--accent); }
.report-stat-occ .report-stat-num{ color:var(--accent-ink); }
.report-section-title{
  font-family:var(--font-display); font-size:15px; font-weight:600; margin:0 0 12px;
  padding-bottom:6px; border-bottom:1px solid var(--line);
}
.report-charts{ display:flex; flex-direction:column; gap:26px; margin-bottom:26px; padding:18px; background:var(--surface-2); border-radius:14px; }
.report-table{ width:100%; border-collapse:collapse; font-size:13px; margin-bottom:8px; }
.report-table th{ text-align:left; padding:8px 10px; border-bottom:2px solid var(--ink); font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.report-table td{ padding:9px 10px; border-bottom:1px solid var(--line); }
.report-table tbody tr:nth-child(even):not(.report-table-totals){ background:var(--surface-2); }
.report-table-name{ font-weight:600; }
.report-num-vacant{ color:var(--success); font-weight:600; }
.report-num-renovation{ color:var(--renovation); font-weight:600; }
.report-num-hold{ color:var(--warning); font-weight:600; }
.report-num-booked{ color:var(--info); font-weight:600; }
.report-occ-cell{ display:flex; align-items:center; gap:8px; }
.report-occ-pct{ font-weight:700; font-variant-numeric:tabular-nums; min-width:34px; }
.report-bar-mini{ display:inline-block; width:56px; height:6px; border-radius:999px; background:var(--line); overflow:hidden; }
.report-bar-mini span{ display:block; height:100%; border-radius:999px; background:var(--accent); }
.report-table-totals{ font-weight:700; border-top:2px solid var(--ink); }
.wk-delta{ font-size:12px; font-weight:700; vertical-align:middle; }
.wk-up{ color:var(--success); }
.wk-down{ color:var(--danger); }
.wk-flat{ color:var(--muted); }
.report-table-totals td{ border-bottom:none; }
.report-footer{ margin-top:26px; padding-top:14px; border-top:1px solid var(--line); text-align:center; font-size:11px; color:var(--muted); letter-spacing:.02em; }

.report-picker-actions{ display:flex; gap:8px; margin-bottom:10px; }
.report-picker-list{ display:flex; flex-direction:column; gap:2px; max-height:260px; overflow-y:auto; border:1px solid var(--line-soft); border-radius:10px; padding:6px; }
.report-picker-row{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; font-size:13.5px; font-weight:600; cursor:pointer; }
.report-picker-row:hover{ background:var(--surface-2); }
.report-picker-row input{ accent-color:var(--accent); width:16px; height:16px; cursor:pointer; }
#rp-empty-hint{ color:var(--danger); margin-top:8px; }

@media print{
  @page{ margin:14mm; }
  body{ padding-top:0 !important; background:#fff !important; }
  .report-print-body{ max-width:760px; margin:0 auto; padding:20px; }
  /* The dashed divider only makes sense on-screen in the modal's
     scrolling preview — on paper each building already starts a fresh
     page, so it's dropped. In its place: a bit of breathing room at the
     top of the page so the title sits a little lower, not flush against
     the very top edge, and reads as a proper section opener. */
  .report-building-page{ margin-top:0 !important; padding-top:64px !important; border-top:none !important; }
}

@media (max-width:640px){
  .units-table{ font-size:12.5px; }
  .report-stats{ grid-template-columns:repeat(2,1fr); }
  .report-stats-4{ grid-template-columns:repeat(2,1fr); }
  .report-stats-5{ grid-template-columns:repeat(2,1fr); }
  .bar-chart-row{ grid-template-columns:86px 1fr 38px; }
  .report-letterhead{ flex-direction:column; text-align:center; }
}
