/* ============================================================
   تسكين — Booking UI · Design System
   Editorial calm · Cairo-warm palette · RTL-first
   ============================================================ */

:root {
  /* Palette (matches Taskeen TikTok brand — same source of truth) */
  --paper:      #EFE7D8;    /* sand cream */
  --paper-2:    #E5DDCE;    /* card face */
  --paper-3:    #DBD3C4;    /* deeper card */
  --ink:        #1A1A1A;    /* ink */
  --ink-2:      #2E2E2E;    /* softer ink */
  --muted:      #7A7060;    /* warm muted */
  --muted-2:    #A99F8F;    /* warmer soft */
  --hair:       #C7BEAB;    /* hairline */

  --gold:       #B8945A;    /* warm accent */
  --gold-soft:  #E7D6B3;
  --nile:       #1F3A5F;    /* deep nile blue */
  --nile-soft:  #B8CADE;

  --success:    #4A7A4A;
  --success-soft:#C9E0C9;
  --danger:     #8B4A3F;
  --danger-soft: #E9C9C4;
  --warn:       #C08A2E;
  --warn-soft:  #F4E4C1;

  /* Type */
  --f-body:    "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Metrics */
  --container: 1360px;
  --gutter:    clamp(1rem, 3vw, 2rem);
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(30, 20, 10, 0.05);
  --shadow-md: 0 4px 12px rgba(30, 20, 10, 0.08);

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------ Reset ------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body.app-body {
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  padding-bottom: 80px; /* space for mobile nav */
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
[x-cloak] { display: none !important; }

::selection { background: var(--ink); color: var(--paper); }

.mono { font-family: var(--f-mono); font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.inline { display: inline; }

/* ------------ Header ------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem var(--gutter);
  background: rgba(239, 231, 216, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(184, 148, 90, 0.15);
}
.brand-dot.big { width: 16px; height: 16px; box-shadow: 0 0 0 6px rgba(184, 148, 90, 0.2); }

.site-nav {
  display: none;
  align-items: center;
  gap: 1.25rem;
  margin-inline-start: 1rem;
}
@media (min-width: 720px) {
  .site-nav { display: inline-flex; }
}
.nav-link {
  color: var(--ink-2);
  font-weight: 500;
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); border-color: var(--gold); }
.nav-link.nav-cta {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  border: 0;
}
.nav-link.nav-cta:hover { background: var(--gold); color: var(--ink); }

.user-chip {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.user-name { font-weight: 500; color: var(--ink-2); }
/* Bell + unread badge (طلب حسان 2026-08-07) */
.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem;
  border-radius: 999px;
  text-decoration: none;
}
.bell.is-active { filter: saturate(1.4); }
.bell-badge {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* «آخر ما صار» activity feed */
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px dashed var(--hair);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item.is-new { background: var(--paper-2); border-inline-start: 3px solid var(--gold); }
.activity-icon { font-size: 1rem; line-height: 1.5; flex: none; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { margin: 0; font-size: 0.9rem; color: var(--ink-2); line-height: 1.6; }
.activity-actor { font-weight: 700; color: var(--ink); }
/* Pre-accounts rows: the actor is genuinely unknown, so it must not look like a name. */
.activity-actor.is-legacy { font-weight: 500; color: var(--muted); }
.activity-when { font-size: 0.72rem; color: var(--muted); }
.activity-note {
  margin: 0 0 0.6rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px dashed var(--hair);
  border-radius: 8px;
}

/* حسابي */
.account-card {
  padding: 1rem 1.15rem;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
}
.account-form { flex-direction: column; align-items: stretch; gap: 0.8rem; max-width: 340px; }
.text-btn {
  color: var(--muted);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  font-size: 0.85rem;
}
.text-btn:hover { color: var(--danger); }

/* ------------ Layout ------------ */
/* All views render <main class="page ..."> directly (no .site-main wrapper) */
main.page {
  max-width: var(--container);
  margin-inline: auto;
  padding: 1.5rem var(--gutter) 2.5rem;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hair);
}
.page-eyebrow {
  /* Arabic text must never get mono-fallback or letter-spacing —
     spacing disconnects the letters. */
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0;
  color: var(--gold);
  display: block;
  margin-bottom: 0.25rem;
}
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.page-sub {
  color: var(--muted);
  margin-top: 0.35rem;
  font-size: 0.95rem;
}
.page-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.view-toggle {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 3px;
}
.toggle-btn {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.toggle-btn.is-active {
  background: var(--ink);
  color: var(--paper);
}
.toggle-btn:hover:not(.is-active) { color: var(--ink); }

.nav-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.arrow-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--ink);
  transition: background .2s;
}
.arrow-btn:hover { background: var(--gold-soft); }
.arrow-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ------------ Buttons ------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background .2s, color .2s, transform .3s var(--ease-out), border-color .2s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--gold); color: var(--ink); }
.btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-ghost {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* ------------ Alerts ------------ */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.94rem;
  border-inline-start: 3px solid;
}
.alert-error { background: var(--danger-soft); border-color: var(--danger); color: #4a251e; }
.alert-ok    { background: var(--success-soft); border-color: var(--success); color: #1c3d1c; }
.alert-warn  { background: var(--warn-soft);   border-color: var(--warn);   color: #4d3405; }
.alert-info  { background: var(--nile-soft);   border-color: var(--nile);   color: #0e2038; }

/* ------------ Legend ------------ */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  justify-content: center;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .dot {
  width: 12px; height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.legend .dot.free       { background: var(--success-soft); border: 1px solid #A8CBA8; }
.legend .dot.booked     { background: var(--gold); }
.legend .dot.checkout   { background: linear-gradient(135deg, var(--gold) 48%, var(--success-soft) 52%); border: 1px solid var(--gold); }
.legend .dot.blocked    { background: var(--muted-2); }
.legend .dot.today-ring { background: var(--paper); border: 2px solid var(--nile); border-radius: 50%; }

/* ------------ Apartment cards (availability) ------------ */
.apt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 1.1rem;
}
.apt-card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-inline-start: 4px solid var(--hair);
}
.apt-card.status-free    { border-inline-start-color: var(--success); }
.apt-card.status-booked  { border-inline-start-color: var(--gold); }
.apt-card.status-blocked { border-inline-start-color: var(--muted-2); }

.apt-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.apt-color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.apt-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}
.status-chip {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip-free    { background: var(--success-soft); color: #1c3d1c; }
.chip-booked  { background: var(--gold-soft);    color: #4d3405; }
.chip-blocked { background: var(--paper-3);      color: var(--muted); }

.apt-card-detail {
  font-size: 0.92rem;
  color: var(--muted);
  margin: -0.35rem 0 0;
  line-height: 1.6;
}

/* Fortnight: weekday header + 7×2 calendar grid, Sunday-first, no scroll */
.fortnight-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fortnight-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.fdow {
  text-align: center;
  font-size: 0.66rem;
  color: var(--muted-2);
  font-weight: 500;
}
.fortnight {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.fday {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.3rem 0;
  border-radius: 8px;
  border: 1px solid var(--hair);
  min-height: 42px;
  transition: transform .15s var(--ease-out), filter .15s;
}
a.fday:active { transform: scale(0.94); }
.fday-num {
  font-family: var(--f-mono);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}
.fday-month {
  font-size: 0.58rem;
  line-height: 1;
  color: inherit;
  opacity: 0.75;
}
/* Free days get a soft green tint — partners scan for gaps, make them pop */
.fday-free    { background: var(--success-soft); border-color: #A8CBA8; }
.fday-free .fday-num { color: #1c3d1c; }
a.fday-free:hover { filter: brightness(0.96); }
.fday-booked  { background: var(--gold); border-color: var(--gold); }
/* Checkout day: guest leaves in the morning — bookable the same day.
   Diagonal split: gold (was occupied) → green (available). */
.fday-checkout {
  background: linear-gradient(135deg, var(--gold) 48%, var(--success-soft) 52%);
  border-color: var(--gold);
}
.fday-checkout .fday-num { color: #1c3d1c; }
.fday-blocked { background: var(--muted-2); border-color: var(--muted-2); color: var(--paper); }
.fday.is-past { opacity: 0.38; }
.fday.is-today {
  outline: 2px solid var(--nile);
  outline-offset: 1px;
}

/* High-season advisory banner */
.season-banner {
  padding: 0.55rem 0.85rem;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: #4d3405;
  line-height: 1.6;
}

/* Free-gap pills */
.gaps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.gap-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--success-soft);
  border: 1px solid var(--success);
  border-radius: 10px;
  color: #1c3d1c;
  font-size: 0.9rem;
  font-weight: 500;
  transition: filter .15s;
}
.gap-pill:hover { filter: brightness(0.96); }
.gap-nights {
  margin-inline-start: auto;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  background: rgba(255,255,255,.55);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.gap-all { justify-content: center; font-weight: 600; }

/* Upcoming bookings inside a card */
.upcoming-title {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
}
.upcoming-list {
  display: flex;
  flex-direction: column;
}
.upcoming-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-top: 1px dashed var(--hair);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.upcoming-guest { font-weight: 600; color: var(--ink); }
.upcoming-dates { color: var(--muted); font-size: 0.78rem; font-family: var(--f-body); }
.upcoming-amount {
  margin-inline-start: auto;
  font-weight: 600;
  color: var(--success);
  font-size: 0.85rem;
}

.apt-card-actions {
  display: flex;
  gap: 0.6rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--hair);
  margin-top: auto;
}

/* ------------ Finance ------------ */
.totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.total-card {
  padding: 1.25rem 1.35rem;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.total-card.income { border-inline-start: 3px solid var(--success); }
.total-card.expense { border-inline-start: 3px solid var(--danger); }
.total-card.net { border-inline-start: 3px solid var(--gold); }
.total-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.5rem;
}
.total-value {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.total-value .negative { color: var(--danger); }
.total-value .plus { color: var(--muted-2); font-weight: 400; }

.apt-summaries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.apt-summary-card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 76px;
}
.apt-summary-head {
  width: 100%;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: start;
  transition: background .2s;
}
.apt-summary-head:hover { background: var(--paper-3); }
.apt-name-lg {
  font-weight: 600;
  font-size: 1.05rem;
}
.apt-summary-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-inline-start: auto;
}
.chip {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--hair);
  font-size: 0.8rem;
  font-weight: 500;
}
.chip.income   { background: var(--success-soft); border-color: transparent; color: #1c3d1c; }
.chip.expense  { background: var(--danger-soft);  border-color: transparent; color: #4a251e; }
.chip.net-chip { background: var(--ink); border-color: transparent; color: var(--paper); font-weight: 600; }
.chip.net-chip.negative-chip { background: var(--danger); }
.chip.share-chip { background: var(--gold-soft); border-color: var(--gold); color: #4d3405; font-weight: 600; }
.chip.owner-exp  { background: var(--paper-3); border-color: var(--hair); color: var(--muted); }
/* Payment tracking pills + inline forms */
.pay-details {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}
.pay-details summary { list-style: none; cursor: pointer; }
.pay-details summary::-webkit-details-marker { display: none; }
.pay-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--muted);
  transition: filter .15s;
}
.pay-pill:hover { filter: brightness(0.96); }
.pay-toggle { display: inline-flex; align-items: center; gap: 0.35rem; }
.pay-chev { font-size: 0.6rem; opacity: 0.65; }
/* Whole booking/rent row toggles its payment details; inner controls opt out via @click.stop */
.event-item.row-clickable { cursor: pointer; }
.event-item.row-clickable .pay-body { cursor: auto; }
.pay-none    { background: var(--paper); }
.pay-deposit { background: var(--warn-soft); border-color: var(--warn); color: #4d3405; }
.pay-paid    { background: var(--success-soft); border-color: var(--success); color: #1c3d1c; }
.pay-body {
  margin-top: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper-3);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pay-row { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.pay-del-form { display: inline; }
.pay-del {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pay-del:hover { background: var(--danger); color: var(--paper); }
.pay-edit-btn { background: var(--gold-soft); color: #6b5312; }
.pay-edit-btn:hover { background: var(--gold); color: var(--paper); }
.pay-edit-form { width: 100%; margin-top: 0.35rem; }
.pay-edit-form input[type="date"] { padding: 0.45rem 0.6rem; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--paper); font: inherit; font-size: 0.85rem; }
.pay-settle {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6b5312;
  border: 1px solid var(--gold);
  font-family: var(--f-body); /* العربي يتفكك بخط mono الموروث من pay-row */
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
}
.pay-settle:hover { background: var(--gold); color: var(--paper); }
.pay-settle-form { width: 100%; margin-top: 0.35rem; }
.settled-note { color: var(--muted); font-size: 0.72rem; font-family: var(--f-body); }
.usd-eq { color: var(--muted); font-size: 0.72rem; }
.egp-eq { color: var(--muted); font-size: 0.72rem; }
.pay-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.pay-form input[type="number"],
.pay-form input[type="text"],
.pay-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font: inherit;
  font-size: 0.85rem;
  min-width: 0;
}
.pay-form input[type="number"] { width: 130px; }
.pay-form input[type="text"] { flex: 1; min-width: 140px; }
/* Optional receipt attachment (ارفق إيصالك) — a compact dashed pill wrapping
   a hidden file input; the span echoes the chosen filename via Alpine. */
.receipt-attach { cursor: pointer; }
.receipt-attach input[type="file"] { display: none; }
.receipt-attach span {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border: 1px dashed var(--hair);
  border-radius: 999px;
  font-family: var(--f-body); /* العربي يتفكك بخط mono الموروث من pay-row */
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--paper);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.receipt-attach:hover span { border-color: var(--gold); color: var(--ink-2); }
/* A payment that HAS a receipt gets a solid success chip — must never look
   like the dashed muted "attach" button (Hassan couldn't tell them apart). */
.receipt-link {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--success);
  border-radius: 999px;
  background: var(--success-soft);
  font-family: var(--f-body); /* العربي يتفكك بخط mono الموروث من pay-row */
  font-size: 0.72rem;
  color: #1c3d1c;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
.receipt-link:hover { background: var(--success); color: var(--paper); }
.receipt-bar { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.receipt-view { display: flex; justify-content: center; }
.receipt-img { max-width: 100%; height: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.receipt-frame { width: 100%; height: 80vh; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: #fff; }
.receipt-fallback { margin-top: 0.75rem; text-align: center; }

/* Deposit-at-creation block inside the booking form */
.deposit-block {
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: var(--gold-soft);
}
.deposit-block summary { list-style: none; cursor: pointer; }
.deposit-block summary::-webkit-details-marker { display: none; }
.deposit-summary { font-weight: 600; color: #4d3405; font-size: 0.95rem; }
.deposit-hint { display: block; font-weight: 400; font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.deposit-fields { margin-top: 0.75rem; }

.manual-entry { margin-bottom: 1rem; }
.manual-entry summary { list-style: none; cursor: pointer; display: inline-block; }
.manual-entry summary::-webkit-details-marker { display: none; }
.manual-form { margin-top: 0.75rem; padding: 0.85rem; background: var(--paper-2); border: 1px solid var(--hair); border-radius: var(--radius-sm); }

.ledger-in  { color: var(--success); font-weight: 600; }
.ledger-out { color: var(--danger); font-weight: 600; }

.no-amount-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: 999px;
  color: #4d3405;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.owner-report {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--gold-soft);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: #4d3405;
  line-height: 1.8;
}
.share-figure { font-size: 1.05rem; }
.chip.muted    { background: var(--paper); color: var(--muted); }

.fx-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--muted-2);
}
.fx-footer {
  margin-top: 1.5rem;
  padding: 0.8rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
}
.chevron {
  margin-inline-start: 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
}
/* Expense "paid" toggle (مسدده) — settled flag per expense */
.expense-paid-cell { grid-column: 1 / -1; margin-top: 0.3rem; }
.expense-day-paid { display: flex; align-items: center; gap: 0.6rem; padding: 0.2rem 0.5rem 0; }
.paid-toggle {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px dashed var(--muted-2);
  background: transparent;
  color: var(--muted);
  transition: filter .15s;
}
.paid-toggle:hover { filter: brightness(0.96); }
.paid-toggle.is-paid {
  background: var(--success-soft);
  border: 1px solid var(--success);
  color: #1c3d1c;
}
.paid-count { font-size: 0.72rem; color: var(--muted); }
.expense-paid-cell { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.paid-source-alt {
  font: inherit; font-size: 0.72rem; color: var(--muted); background: none;
  border: none; cursor: pointer; padding: 0.2rem 0.1rem;
}
.paid-source-alt:hover { color: var(--ink-2); }
.paid-source-options { display: flex; gap: 0.4rem; width: 100%; margin-top: 0.2rem; }
.paid-toggle.paid-alt { border-style: dashed; }

/* عهدة كامبس — operational float card on the boxes page */
.float-card {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--paper-2);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-sm);
}
.float-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.float-label { font-weight: 600; color: var(--ink-2); }
.float-value { font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.float-hint { margin: 0.4rem 0 0.7rem; font-size: 0.78rem; color: var(--muted); line-height: 1.6; }
.float-topup-form { margin-top: 0.6rem; }
/* عهدة + حركة يدوية: زرّان بعرض واحد متناسق */
.cash-actions { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.cash-actions > details > summary { display: flex; width: 100%; }
.cash-actions > details[open] > summary { margin-bottom: 0.2rem; }
/* سجل الحركات: رأس + فلترة بالصندوق */
.ledger-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1.5rem; }
.ledger-filter { display: flex; gap: 0.4rem; }
.ledger-filter button {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 0.25rem 0.8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hair); background: var(--paper); color: var(--muted);
  transition: background .15s, color .15s;
}
.ledger-filter button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pay-remaining { margin: 0 0 0.15rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }

/* Box card (صفحة الصناديق) — balance only; owed hint when a balance is negative */
.box-owed-hint { margin: 0.6rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--hair); font-size: 0.78rem; color: var(--danger); line-height: 1.6; }
/* Box card — click to expand "تفسير الأرقام" (holdings breakdown) */
.box-card { cursor: default; }
.box-card-toggle {
  display: block; width: 100%; text-align: inherit;
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.box-card-chev { font-size: 0.7rem; color: var(--muted); margin-inline-start: 0.3rem; }
.box-holdings { margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--hair); }
.box-holdings-title { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.box-holdings-empty { margin: 0; font-size: 0.82rem; color: var(--muted); }
.box-holdings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.box-holdings-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; font-size: 0.85rem; }
.box-holdings-list .bh-label { color: var(--ink-2); }
.box-holdings-list .bh-amt { color: var(--ink); white-space: nowrap; }
.box-holdings-note { margin: 0.6rem 0 0; font-size: 0.75rem; color: var(--muted); line-height: 1.6; }
/* Ledger row: reason line + running balance right under it */
.ledger-row .event-title { display: flex; flex-direction: column; gap: 0.15rem; }
.ledger-balance-after { font-size: 0.72rem; color: var(--muted); }

.egp-rate-box { margin-top: 0.6rem; }
.egp-rate-panel {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
}
.egp-rate-hint {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
}
.egp-rate-list { list-style: none; margin: 0 0 0.8rem; padding: 0; }
.egp-rate-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.egp-rate-list li:last-child { border-bottom: 0; }
.egp-rate-empty { color: var(--muted); font-size: 0.85rem; }
.egp-rate-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
}
.egp-rate-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.egp-rate-form input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}
.apt-summary-body {
  padding: 0.5rem 1.25rem 1.25rem;
  border-top: 1px solid var(--hair);
}
.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.event-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px dashed var(--hair);
  font-size: 0.92rem;
  scroll-margin-top: 76px;
}
.event-item:last-child { border-bottom: 0; }
.event-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}
.event-item.kind-booking .event-dot { background: var(--success); }
.event-item.kind-expense .event-dot { background: var(--danger); }
.event-item.kind-block .event-dot  { background: var(--muted-2); }
.event-when { font-size: 0.8rem; color: var(--muted); }
.event-title { color: var(--ink); }
.event-amount { font-weight: 600; text-align: end; }
.split-note {
  display: block;
  font-size: 0.72rem;
  color: var(--nile);
  background: var(--nile-soft);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  width: max-content;
  margin-top: 0.2rem;
}
.split-full {
  display: block;
  font-size: 0.7rem;
  color: var(--muted-2);
  font-weight: 400;
}
.list-subhead {
  margin: 0.9rem 0 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.list-subhead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hair);
}

/* Same-day expense groups (tap to expand) */
.expense-group { display: block; border-bottom: 1px dashed var(--hair); }
.expense-group:last-child { border-bottom: 0; }
.group-head {
  width: 100%;
  text-align: start;
  cursor: pointer;
  border-bottom: 0 !important;
  transition: background .15s;
  border-radius: 8px;
}
.group-head:hover { background: var(--paper-3); }
.group-count {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--paper-3);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-inline-start: 0.35rem;
}
.chev {
  font-size: 0.65rem;
  color: var(--muted-2);
  margin-inline-start: 0.35rem;
}
.group-items {
  margin: 0 1.25rem 0.6rem 0.5rem;
  padding-inline-start: 0.85rem;
  border-inline-start: 2px solid var(--hair);
  display: flex;
  flex-direction: column;
}
.group-items .group-item {
  grid-template-columns: auto 1fr auto;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  border-bottom: 1px dotted var(--hair);
}
.group-items .group-item:last-child { border-bottom: 0; }
.event-item.kind-expense .event-amount { color: var(--danger); }
.event-item.kind-booking .event-amount { color: var(--success); }

.empty-state {
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* ------------ Add form ------------ */
.add-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-width: 720px;
}
.kind-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  border: 0;
}
.kind-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.75rem;
  border: 2px solid var(--hair);
  border-radius: var(--radius);
  background: var(--paper-2);
  transition: border-color .2s, background .2s;
}
.kind-option input { position: absolute; opacity: 0; }
.kind-option:hover { border-color: var(--muted); }
.kind-option.is-active,
.kind-option:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.kind-option.is-active.kind-booking,
.kind-option.kind-booking:has(input:checked) { border-color: var(--success); }
.kind-option.is-active.kind-expense,
.kind-option.kind-expense:has(input:checked) { border-color: var(--danger); }
.kind-icon { font-size: 1.5rem; }
.kind-label { font-weight: 600; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--gold);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(184, 148, 90, 0.15);
}
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0.85rem;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.apt-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 0.5rem;
}
.apt-option {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--paper-2);
  border: 2px solid var(--hair);
  border-radius: var(--radius-sm);
  transition: border-color .2s, background .2s;
}
.apt-option input { position: absolute; opacity: 0; }
.apt-option:hover { border-color: var(--muted); }
/* Highlight tracks the REAL radio state — no JS, can't go stale */
.apt-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hair);
}

/* Inline ✎ edit link on finance rows */
.row-edit {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  margin-inline-start: 0.3rem;
}
.row-edit:hover { color: var(--gold); }

/* Edit page — destructive delete area */
.danger-zone {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--danger);
  max-width: 720px;
}
.danger-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.btn-danger {
  background: var(--danger);
  color: var(--paper);
  border-color: var(--danger);
}
.btn-danger:hover { background: #6f3a31; color: var(--paper); }

/* ------------ Auth ------------ */
.auth-page {
  /* svh = the viewport WITH the mobile browser bars showing. Plain 100vh is the
     bar-less height, so on a phone the box grew taller than the visible area and
     centering pushed the card's bottom half out of sight (حسان 2026-08-07).
     vh stays as the fallback for browsers without svh. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 30% 20%, var(--gold-soft), var(--paper) 60%);
}
.auth-card {
  /* margin:auto centers safely: unlike place-items:center it never puts the
     overflow beyond the scrollable area when the card is taller than the screen
     (e.g. the on-screen keyboard is open). */
  margin: auto;
  width: min(420px, 100%);
  padding: 2.25rem 2rem;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}
.brand-name-big {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.auth-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.auth-sub {
  color: var(--muted);
  margin-bottom: 1.75rem;
  font-size: 0.94rem;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.auth-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.pin-input {
  /* width MUST be pinned: an <input>'s intrinsic width (~20ch) at this font
     size blows the card wider than a phone screen and clips the whole page. */
  width: 100%;
  min-width: 0;
  font-family: var(--f-mono) !important;
  font-size: 1.9rem !important;
  text-align: center;
  letter-spacing: 0.5em;
  padding-inline-start: 0.5em !important; /* recenters: compensates the trailing letter-space */
  direction: ltr;
}

.auth-card { max-width: 100%; }
.auth-page { overflow-x: clip; }

/* Short screens (small phones, or any phone once the keyboard is up): tighten
   the card so the whole form — including the دخول button — stays on screen. */
@media (max-height: 700px) {
  .auth-page { padding: 1rem; }
  .auth-card { padding: 1.4rem 1.35rem; }
  .auth-title { margin-bottom: 0.2rem; }
  .auth-sub { margin-bottom: 1rem; font-size: 0.82rem; }
  .auth-brand { margin-bottom: 0.8rem; }
  .auth-footer { margin-top: 0.9rem; }
}

/* ------------ Mobile nav ------------ */
.mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: none;
  justify-content: space-around;
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  background: rgba(239, 231, 216, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--hair);
}
@media (max-width: 720px) {
  .mobile-nav { display: flex; }
  .site-nav { display: none; }

  /* Comfortable touch targets */
  .arrow-btn { width: 42px; height: 42px; }
  .kind-option { padding: 0.85rem 0.5rem; }
  .fday { min-height: 52px; }

  /* Declutter header: the shared identity name adds nothing on a phone */
  .user-chip .user-name { display: none; }

  /* Tighter page header + single-column cards */
  .page-head { margin-bottom: 1.1rem; padding-bottom: 0.9rem; }
  .apt-cards { gap: 0.9rem; }
  .apt-card { padding: 1rem 0.95rem 0.85rem; }
  .legend { gap: 0.55rem; font-size: 0.75rem; padding: 0.55rem 0.7rem; }
}
.m-nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.35rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}
.m-nav-link.is-active { color: var(--ink); }
.m-nav-link.accent {
  background: var(--ink);
  color: var(--paper);
  margin: 0 0.35rem;
}
.m-nav-link.accent .m-icon {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}
.m-icon { font-size: 1.15rem; }

/* ------------ Error pages ------------ */
.error-page {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
  padding: 2rem;
}
.error-code {
  font-family: var(--f-mono);
  font-size: 4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.error-title {
  font-size: 1.65rem;
  margin-bottom: 0.6rem;
}
.error-sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ─── تسكين 5 — تحت التجهيز (طلب حسان 2026-08-14) ─────────────────────
   Fit-out spending is capital, not a month's expense, so it lives on its own
   page; the banner below is the only doorway to it from الماليات. */
.setup-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  text-decoration: none;
  color: var(--ink-2);
}
.setup-banner:hover { border-style: solid; }
.setup-banner .sb-icon { font-size: 1.05rem; }
.setup-banner .sb-text { flex: 1; font-size: 0.88rem; }
.setup-banner .sb-go { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.setup-approx { margin: 0.35rem 0 0; font-size: 0.78rem; color: var(--muted); }

.setup-payers { list-style: none; margin: 0 0 0.9rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.setup-payer {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
}
.setup-payer.is-empty { opacity: 0.55; }
.setup-payer.is-unknown { border-style: dashed; }
.setup-payer .sp-name { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.setup-payer .sp-amt { flex: 1; text-align: end; font-size: 0.9rem; }
/* الدولار هو الرقم، والعملة الأصلية سطر باهت تحته (طلب حسان 2026-08-14). */
.setup-payer .sp-raw { display: block; font-size: 0.72rem; color: var(--muted); }
.setup-payer .sp-count { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* نسبة كامبس من المدفوع + قاعدتها (قرار حسان 2026-08-16) — سطر واحد، والقاعدة
   بين قوسين باهتة فلا تزاحم الرقم. حلّ محل سطر الفرق كامبس/عباس (`.setup-gap`،
   شِيل بنفس التاريخ: عباس ما دفع من جيبه شيئاً فالمقارنة صارت مضلِّلة). */
.setup-share { margin: 0 0 1.2rem; font-size: 0.85rem; color: var(--ink-2); }
.setup-share .ss-rule { font-size: 0.76rem; color: var(--muted); }

.setup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.setup-item { padding: 0.75rem 0.4rem; border-bottom: 1px dashed var(--hair); scroll-margin-top: 80px; }
.setup-item:last-child { border-bottom: 0; }
.si-head { display: flex; align-items: baseline; gap: 0.6rem; }
.si-main { flex: 1; min-width: 0; }
.si-label { font-size: 0.9rem; color: var(--ink); }
.si-date { display: block; font-size: 0.72rem; color: var(--muted); }
.si-amt { font-size: 0.92rem; white-space: nowrap; }
.si-amt .usd-eq { display: block; font-size: 0.72rem; color: var(--muted); }
.si-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.si-payer { cursor: default; }
.si-receipt-form { display: inline; margin: 0; }
.btn-xs { padding: 0.25rem 0.7rem; font-size: 0.75rem; }
.si-pick { margin-top: 0.6rem; padding: 0.6rem; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--paper-2); }
.si-pick-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.si-pick-file { display: block; font-size: 0.78rem; color: var(--muted); }
.si-pick-file input[type="file"] { display: block; margin-top: 0.25rem; font-size: 0.75rem; max-width: 100%; }

.setup-note { margin-top: 1.4rem; font-size: 0.75rem; line-height: 1.8; color: var(--muted); }

/* ثلاثة أنواع لبنود التجهيز + قائمة «باقي نشتريه» (طلب حسان 2026-08-14) */
.setup-aside { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.45rem; font-size: 0.75rem; color: var(--muted); }
.setup-group {
  margin: 1.1rem 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
}
.setup-group .sg-hint { font-weight: 400; color: var(--muted); }
.si-type { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--hair); }
.si-type-label { font-size: 0.72rem; color: var(--muted); margin-inline-end: 0.2rem; }

.planned-list { list-style: none; margin: 0 0 0.9rem; padding: 0; display: flex; flex-direction: column; }
.planned-item { padding: 0.65rem 0.4rem; border-bottom: 1px dashed var(--hair); }
.planned-item:last-child { border-bottom: 0; }
.pl-head { display: flex; align-items: baseline; gap: 0.6rem; }
.pl-label { flex: 1; font-size: 0.9rem; color: var(--ink); }
.pl-note { display: block; font-size: 0.72rem; color: var(--muted); }
.pl-amt { font-size: 0.9rem; white-space: nowrap; color: var(--muted); }
.pl-amt .usd-eq { display: block; font-size: 0.72rem; }
.pl-foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.45rem; }
.planned-add { padding: 0.7rem; border: 1px dashed var(--hair); border-radius: var(--radius-sm); background: var(--paper-2); }

/* حجز Airbnb: مكان الفلوس ثابت (الحساب) بدل قائمة اختيار — قرار حسان 2026-08-18 */
.place-fixed {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px dashed var(--hair);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--paper-2);
  white-space: nowrap;
}

/* سطر تفاصيل التعديل/الحذف في «آخر ما صار» (طلب حسان 2026-08-18) */
.activity-detail {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--ink-2);
  word-break: break-word;
}

/* «آخر ظهور» للشركاء في صفحة حسابي (طلب حسان 2026-08-18) */
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.person-row { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.5rem 0.6rem; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--paper-2); }
.person-row.is-me { border-style: dashed; }
.person-row .pr-name { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.person-row .pr-me { font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.person-row .pr-times { flex: 1; text-align: end; }
.person-row .pr-active { font-size: 0.82rem; color: var(--ink-2); }
.person-row .pr-login { display: block; font-size: 0.7rem; color: var(--muted); }

/* ─── حساب «مشاهد» (قراءة فقط) — طلب حسان 2026-08-18 لنسخة كامبس ───────
   المنع الحقيقي في السيرفر (blockViewerWrites)؛ هذي تخفي الأزرار حتى لا
   يضغط المالك شيئاً يُرفض. */
.is-viewer .row-edit,
.is-viewer .pay-form,
.is-viewer .pay-edit-form,
.is-viewer .pay-edit-btn,
.is-viewer .pay-del,
.is-viewer .pay-del-form,
.is-viewer .expense-paid-cell,
.is-viewer .receipt-attach,
.is-viewer .si-pick,
.is-viewer .si-add-btn,
.is-viewer .si-type,
.is-viewer .planned-add,
.is-viewer .planned-item .pl-foot,
.is-viewer .cash-form,
.is-viewer .egp-rate-form { display: none !important; }

/* مدى الدورة المالية لمن بدايتها ليست الأول من الشهر (شقة سعود: 20 ← 19) */
.period-range { font-size: 0.82em; color: var(--muted); }

/* عدد الليالي تحت تاريخَي الحجز في نموذج الإضافة (طلب حسان 2026-08-20) */
.nights-hint {
  flex-basis: 100%;
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}
.nights-hint .nights-note { color: var(--danger, #8B4A3F); }
