:root {
  --forest: #1b2f57;
  --forest-dark: #101d38;
  --logo-navy: #01081d; /* exact ink color sampled from the Starr logo artwork */
  --gold: #c9a876; /* sampled from the logo's star */
  --gold-light: #e6d7b8;
  --gold-dark: #a5895f;
  --cream: #f5f2e9;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #4a4a4a;
  --danger: #b8433a;
  --success: #3f7d5a;
  --border: #ddd6c5;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Times New Roman", Times, Georgia, serif;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* Header / Nav */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--forest);
  color: #ffffff;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
}
/* The logo artwork's text/star are a very dark navy on a transparent
   background - designed to sit on white/light surfaces. The header itself
   is navy, so the logo gets a small light "plaque" behind it here to stay
   legible; everywhere else in the app (login, guest portal, owner portal)
   the page background is already light/cream, so the logo sits directly on
   it with no wrapper needed - see .login-logo below. */
.brand-logo-wrap {
  background: var(--paper);
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  line-height: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 13px; letter-spacing: 0.5px; color: var(--gold-light); text-transform: uppercase; }
.brand-text small { font-size: 11px; color: rgba(255,255,255,0.7); }
.menu-toggle {
  background: none; border: none; color: #ffffff; font-size: 22px; cursor: pointer;
  display: none;
}
.app-nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 0 12px 10px;
}
.app-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.app-nav a.active, .app-nav a:hover { background: rgba(255,255,255,0.12); color: var(--gold-light); text-decoration: none; }
.app-nav .nav-signout {
  margin-left: auto;
  color: rgba(255,255,255,0.65);
}

@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .app-nav { display: none; flex-direction: column; padding: 8px 12px 12px; }
  .app-nav.open { display: flex; }
  .app-nav .nav-signout { margin-left: 0; }
}

/* Main layout */
.app-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.page-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-title h1 { font-size: 20px; margin: 0; }
.page-title .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2, .card h3 { margin-top: 0; }
.card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row > * { flex: 1; min-width: 140px; }

/* Buttons */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  background: var(--forest);
  color: white;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--forest-dark); }
button.secondary, .btn.secondary { background: var(--paper); color: var(--forest); border: 1px solid var(--forest); }
button.secondary:hover { background: var(--cream); }
button.danger, .btn.danger { background: var(--danger); }
button.gold, .btn.gold { background: var(--gold); color: var(--forest-dark); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.block { width: 100%; }
button.small, .btn.small { padding: 6px 10px; font-size: 13px; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge.pending { background: #f1e6c9; color: #8a6a1a; }
.badge.in_progress { background: #dcebff; color: #24578c; }
.badge.completed { background: #dbeee0; color: var(--success); }
.badge.issue { background: #f7dad7; color: var(--danger); }
.badge.role-admin { background: #e6ddf6; color: #5a3d99; }
.badge.role-field { background: #d9f0e6; color: #1f6b4b; }

/* Lists */
.list-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.list-item .meta { color: var(--muted); font-size: 13px; }

/* Checklist */
.checklist-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.checklist-item .item-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.checklist-item input[type=checkbox] { width: 22px; height: 22px; margin-top: 2px; }
.checklist-item .item-text { flex: 1; font-size: 15px; font-weight: 600; white-space: pre-wrap; }
.photo-required-tag { font-size: 11px; color: var(--gold); font-weight: 700; text-transform: uppercase; }
.room-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--forest); background: var(--gold-light); padding: 2px 8px; border-radius: 5px;
  width: fit-content; margin-bottom: 6px;
}
.photo-input-wrap { margin-top: 10px; }
.photo-preview-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-preview { max-width: 140px; border-radius: 8px; margin-top: 8px; display: block; }

.linen-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.linen-row:last-child { border-bottom: none; }
.linen-row .linen-name { flex: 2; font-size: 14px; }
.linen-row .linen-par { flex: 1; font-size: 12px; color: var(--muted); }
.linen-row input[type=number] { width: 80px; flex: none; }

/* Login */
.login-wrap {
  max-width: 380px; margin: 60px auto; padding: 0 16px;
}
.guest-wrap {
  max-width: 560px; margin: 32px auto; padding: 0 16px 60px;
}
.login-wrap .card { padding: 28px 24px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .brand-logo { height: 64px; width: auto; margin: 0 auto 8px; }

/* Itemized payout entry (admin property page) - the boxed calculator area
   where the office enters what the guest paid and each cost against it,
   with the owner's subtotal computed live at the bottom. */
.payout-calc {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
}
.payout-derived-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 5px 0; font-size: 13.5px;
}
.payout-derived-row:first-of-type { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.payout-breakdown-row.subtotal-line {
  border-top: 1px solid var(--border); margin-top: 3px; padding-top: 4px; color: var(--ink);
}
.payout-subtotal-row {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 2px solid var(--gold); margin-top: 12px; padding-top: 10px;
}
.payout-subtotal-row span { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.payout-subtotal-row strong { font-size: 19px; color: var(--forest-dark); }

/* Read-only breakdown shown under each saved payout, on both the admin
   property page and the owner portal. */
.payout-breakdown {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 12.5px; max-width: 340px;
}
.payout-breakdown-row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; color: var(--muted); }
.payout-breakdown-row.total {
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px;
  font-weight: 700; color: var(--forest-dark);
}

/* ---- Guest portal: hero, welcome, and access panel ----
   Built mobile-first. Guests open this on a phone, often outdoors at the
   front door with one hand, so the door code is large, high-contrast, and
   near the top of the page. */
.g-hero {
  position: relative;
  height: 190px;
  margin: -32px -16px 0;           /* bleed to the screen edges */
  background: var(--forest);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.g-hero.no-photo { height: 140px; }
.g-hero-logo {
  position: absolute; top: 14px; left: 0; right: 0;
  display: flex; justify-content: center;
}
.g-hero-logo img {
  height: 34px; width: auto; display: block;
  background: rgba(255,255,255,0.95);
  padding: 6px 12px; border-radius: 8px;
}
.g-hero-caption {
  position: relative; width: 100%; padding: 14px 16px;
  background: linear-gradient(transparent, rgba(1,8,29,0.85));
}
.g-hero.no-photo .g-hero-caption { background: none; }
.g-hero-label { color: var(--gold-light); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; }
.g-hero-name { color: #fff; font-size: 21px; line-height: 1.25; margin-top: 2px; }
.g-hero-sub { color: rgba(255,255,255,0.8); font-size: 12.5px; }

.g-welcome { padding: 18px 2px 4px; }
.g-welcome h2 { margin: 0; font-size: 20px; }
.g-welcome p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }

.g-access {
  background: var(--forest); border-radius: 12px;
  padding: 18px 16px; margin: 14px 0 10px; text-align: center;
}
.g-access-label {
  color: var(--gold-light); font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase;
}
.g-access-code {
  color: #fff; font-size: 40px; letter-spacing: 10px;
  margin: 6px 0 4px; padding-left: 10px;   /* optical centring for the tracking */
}
.g-access p { color: rgba(255,255,255,0.78); font-size: 12.5px; line-height: 1.55; margin: 6px 0 0; }
.g-access-backup { color: rgba(255,255,255,0.6) !important; font-size: 11.5px !important; }
.g-access.locked { background: var(--cream); border: 1px dashed var(--border); }
.g-access.locked .g-access-label { color: var(--muted); }
.g-access.locked p { color: var(--muted); }

.g-wifi {
  background: var(--paper); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.g-wifi-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13.5px; }
.g-wifi-row span { color: var(--muted); }
.g-wifi-row strong { word-break: break-all; text-align: right; }

/* Comfortable tap targets and no accidental zoom on focus: iOS zooms the
   page when a focused input's text is under 16px. */
@media (max-width: 720px) {
  .guest-wrap input[type=text], .guest-wrap input[type=file], .guest-wrap select, .guest-wrap textarea { font-size: 16px; }
  .guest-wrap button, .guest-wrap .btn, .guest-wrap .id-upload-label { min-height: 46px; }
  .g-access-code { font-size: 34px; letter-spacing: 8px; }
}

/* Trip-reason chips and the marketing consent row (guest portal). */
.trip-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.trip-chip {
  background: var(--paper); border: 1px solid var(--border); color: var(--ink);
  border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 400;
  min-height: 0;
}
.trip-chip:hover { background: var(--cream); border-color: var(--gold); }
.trip-chip.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.trip-chip.active:hover { background: var(--forest-dark); }
.consent-row {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 0; font-weight: 400; font-size: 12.5px;
  color: var(--muted); line-height: 1.55; text-transform: none; letter-spacing: 0;
}
.consent-row input[type=checkbox] { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* Guest ID photo upload (guest portal) and review thumbnail (admin). */
.id-upload-label {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; background: var(--forest); color: #fff;
  border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600;
  margin: 0;
}
.id-upload-label:hover { background: var(--forest-dark); }
.id-upload-label.block { width: 100%; }
.id-photo-thumb {
  max-width: 100%; max-height: 220px; border-radius: 8px;
  border: 1px solid var(--border); margin: 8px 0; display: block;
}

/* Guest arrival guide (guest portal). Sections read as a document rather
   than a form - this replaces a long text message the office used to send
   by hand, so it should feel like prose, not UI. */
.guide-welcome { margin: 0 0 16px; font-size: 15px; line-height: 1.6; }
.guide-block { margin-bottom: 18px; }
.guide-block:last-child { margin-bottom: 0; }
.guide-block h4 {
  margin: 0 0 5px; font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.guide-block p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.65; }
.guide-access {
  background: var(--cream); border: 1px solid var(--gold);
  border-radius: 10px; padding: 14px 16px;
}
.guide-code {
  font-size: 30px; font-weight: 700; letter-spacing: 5px;
  color: var(--forest-dark); margin: 2px 0 8px !important;
}
.guide-locked {
  background: var(--cream); border: 1px dashed var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.guide-locked p { color: var(--muted); font-size: 13.5px; }

/* Receipt attachments on payouts and ledger expenses (admin only - these
   never render on the owner portal). Each attached file is a chip linking
   to the file, with the "+ Receipt" label acting as the file picker. */
.receipt-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.receipt-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--cream); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 4px 2px 10px; font-size: 11.5px; max-width: 200px;
}
.receipt-chip a { color: var(--forest); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-chip a:hover { text-decoration: underline; }
.receipt-chip .receipt-del {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 4px;
}
.receipt-chip .receipt-del:hover { color: var(--danger); background: none; }
.receipt-add {
  display: inline-flex; align-items: center; cursor: pointer;
  border: 1px dashed var(--border); border-radius: 999px;
  padding: 3px 11px; font-size: 11.5px; font-weight: 600; color: var(--muted);
  margin: 0;
}
.receipt-add:hover { border-color: var(--gold); color: var(--forest); }

/* Disclaimer under the owner portal's payout list - the figures there are
   the pre-expense subtotal, so this sets expectations before the owner
   compares it against what actually lands in their account. */
.payout-disclaimer {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.5;
}

/* Owner portal's Upcoming Payouts, grouped by the month each stay's payout
   will actually be paid out in (see loadPayoutsArea in app.js). */
.payout-month-group { margin-bottom: 18px; }
.payout-month-group:last-child { margin-bottom: 0; }
.payout-month-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-bottom: 2px solid var(--gold); padding-bottom: 5px; margin-bottom: 8px;
}
.payout-month-header h4 { margin: 0; font-size: 15px; color: var(--forest-dark); }
.payout-month-total { font-size: 13px; font-weight: 700; color: var(--forest); white-space: nowrap; }

.helper-text { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.error-text { color: var(--danger); font-size: 13.5px; margin-top: 8px; }

.toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--forest-dark); color: white; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }

.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-group .pill {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; background: var(--paper);
}
.pill-group .pill.active { background: var(--forest); color: white; border-color: var(--forest); }

/* Calendar (per-property + master cleaning views) */
.cal-nav { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav h3 { margin: 0; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day {
  min-height: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--paper);
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal-day.outside { background: transparent; border-color: transparent; }
.cal-day.today { border-color: var(--gold); border-width: 2px; }
.cal-day-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-event {
  font-size: 11px; padding: 2px 5px; border-radius: 5px; line-height: 1.35; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: default;
}
.cal-event.cleaning { background: #dbeee0; color: var(--success); }
.cal-event.cleaning.completed { opacity: 0.6; text-decoration: line-through; }

/* Merged booking bars (reservation + synced iCal block + expected payout,
   see lib/calendarStays.js) - one continuous-looking bar per stay instead of
   a stack of separate pills. Colored by booking platform; "confirmed" means
   the office has actually entered an expected payout for it (real guest name
   and figures behind it), vs. an "unconfirmed" raw synced block with neither. */
.cal-event.stay { font-weight: 700; }
.cal-event.stay.unconfirmed { font-weight: 400; opacity: 0.72; border-bottom: 1px dashed rgba(0, 0, 0, 0.25); }
.cal-event.stay.plat-airbnb { background: #ffe1e0; color: #b83232; }
.cal-event.stay.plat-vrbo { background: #dbeafe; color: #1e40af; }
.cal-event.stay.plat-booking { background: #dce7f5; color: #003580; }
.cal-event.stay.plat-direct { background: #dbeee0; color: var(--success); }
.cal-event.stay.plat-other { background: #ececec; color: #666; }
/* Only bleed to the cell edges and drop rounding on the connecting side
   inside an actual calendar grid cell - legend chips (rendered outside
   .cal-day) keep their normal rounded pill shape. */
.cal-day .cal-event.stay { border-radius: 0; margin: 0 -6px; }
.cal-day .cal-event.stay.stay-start { border-top-left-radius: 5px; border-bottom-left-radius: 5px; margin-left: 0; }
.cal-day .cal-event.stay.stay-end { border-top-right-radius: 5px; border-bottom-right-radius: 5px; margin-right: 0; }
.cal-legend .cal-event { margin-bottom: 0; }
@media (max-width: 720px) {
  .cal-day { min-height: 64px; font-size: 11px; }
  .cal-dow { font-size: 9px; }
}

/* Printing an owner statement: hide everything except the statement card. */
@media print {
  body.printing-statement .app-header,
  body.printing-statement .page-title,
  body.printing-statement > .app-main > *:not(#statement-output),
  body.printing-statement #statement-output ~ * {
    display: none !important;
  }
  body.printing-statement #statement-output {
    display: block !important;
  }

  /* Printing an onboarding inspection report: hide nav/chrome and any
     editing controls (buttons, file inputs, delete links), keep the
     summary, section comments and photos. */
  body.printing-onboarding .app-header,
  body.printing-onboarding .no-print {
    display: none !important;
  }
  body.printing-onboarding textarea {
    display: none;
  }
  body.printing-onboarding .print-only {
    display: block;
    white-space: pre-wrap;
    font-size: 14px;
  }
  body.printing-onboarding .card {
    break-inside: avoid;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
}
.print-only { display: none; }

/* ---------- Contractor pay ---------- */

/* Marks the parts of the payout form the owner never sees, so what Starr
   pays its cleaner is visibly separate from what the owner is charged. */
.internal-block {
  margin-top: 14px;
  padding: 12px 14px 4px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
.internal-block-head {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.contractor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.contractor-card {
  flex: 1 1 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.contractor-name { font-weight: 600; }
.contractor-owed { font-size: 1.5rem; margin: 4px 0; }
.review-flag {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--danger);
}

.cp-pay-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 10px 0;
  border-radius: 8px;
  background: var(--cream, #f5f1e8);
  border: 1px solid var(--border);
}
.cp-pay-bar.hidden { display: none; }
.cp-row { align-items: flex-start; }

.pill {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  border: 1px solid var(--border);
}
.pill.owed { background: #fff6e0; }
.pill.paid { background: #e8f5e9; }
.pill.review { background: #fdecea; }

.material-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.material-row .rc-material-desc { flex: 2 1 160px; }
.material-row .rc-material-amount { flex: 0 1 100px; }

/* On a phone the cleaner is filling this in one-handed, so the material row
   stacks rather than squeezing four controls onto one line. */
@media (max-width: 640px) {
  .material-row { flex-direction: column; align-items: stretch; }
  .cp-pay-bar { flex-direction: column; align-items: stretch; }
}

/* ---------- Owner-facing service history (lawn / grounds) ---------- */

.service-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--cream, #f5f1e8);
  border: 1px solid var(--border);
}
.service-summary > div { min-width: 110px; }
.service-summary strong { font-size: 1.05rem; }

.service-visit {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.service-visit:first-of-type { border-top: none; }

.service-photo-group { margin-top: 10px; }
.service-photo-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.service-photo-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* Fixed height so a before and an after sit side by side at the same scale
   and the pair can actually be compared. */
.service-photo {
  height: 130px;
  width: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .service-photo { height: 100px; }
  .service-summary { gap: 12px; }
}

/* Agreed scope of work, shown on the task screen to whoever is doing the job.
   Pre-wrap so a multi-paragraph scope keeps its line breaks instead of
   collapsing into a wall of text on a phone. */
.scope-note {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold, #b08d3f);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 6px 6px 0;
}
.scope-note-head {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.scope-note-body {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.5;
}
/* Contractor's own reimbursement summary */
.claim-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.claim-summary > div { min-width: 130px; }
.claim-summary strong { font-size: 1.15rem; }


/* ---------- Guest feedback ---------- */

.feedback-item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.feedback-item:first-child { border-top: none; }

/* Anything not yet shared with the owner is visibly marked in the office
   view, so "did I publish this one?" is answerable at a glance rather than
   by opening each checkbox. */
.feedback-item.is-private {
  opacity: 0.72;
  border-left: 3px solid var(--border);
  padding-left: 10px;
}

.feedback-comment {
  margin: 6px 0 4px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.stars {
  color: var(--gold, #b08d3f);
  letter-spacing: 1px;
  margin-right: 4px;
}

/* ---------- Applying a payment to specific charges ---------- */

.allocate-block {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
.allocate-block.hidden { display: none; }

.allocate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.allocate-row:first-child { border-top: none; }
.allocate-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 2 1 260px;
  margin: 0;
  cursor: pointer;
}
.allocate-owed { flex: 1 1 140px; }
.allocate-row .alloc-amount { flex: 0 1 110px; }

.allocate-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* A charge with nothing left owed, in the ledger table */
.charge-settled {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .allocate-row { flex-direction: column; align-items: stretch; }
  .allocate-row .alloc-amount { flex: 1 1 auto; }
}

/* Sample-portal notice, shown only on the shareable demo link */
.demo-banner {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid var(--gold, #b08d3f);
  background: rgba(176, 141, 63, 0.08);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Bulk photo tray on the cleaning report. Thumbnails are large enough to
   recognise a room at a glance on a phone, since that's the whole point of
   assigning them by eye. */
.bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bulk-tray { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.bulk-cell {
  width: 150px; border: 1px solid var(--border, #d8d8d8); border-radius: 10px;
  padding: 6px; background: #fff; display: flex; flex-direction: column; gap: 6px;
}
.bulk-cell.assigned { border-color: #9a8452; box-shadow: 0 0 0 1px #9a845233; }
.bulk-thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; background: #eee; }
.bulk-cell .bulk-target { width: 100%; font-size: 12px; padding: 4px; }
.bulk-remove {
  border: none; background: none; color: #a33; font-size: 12px;
  cursor: pointer; padding: 0; text-align: left;
}
@media (max-width: 480px) { .bulk-cell { width: calc(50% - 5px); } }

/* Closed payout months. Folded away by default so "what am I owed" stays the
   headline, with the history one click below it rather than gone. */
.payout-archive { margin-top: 14px; border-top: 1px solid var(--border, #d8d8d8); padding-top: 10px; }
.payout-archive > summary {
  cursor: pointer; font-size: 13px; color: #555; padding: 4px 0; list-style: revert;
}
.payout-archive > summary:hover { color: #000; }
.payout-archive-body { margin-top: 8px; opacity: 0.92; }
.payout-month-group.settled .payout-month-header h4 { color: #555; }
.badge.paid-badge { background: #e7efe7; color: #2c5c2c; border: 1px solid #bcd4bc; }

/* Pet stays. The fee is income, never a deduction, so it is never styled
   like the cost lines it sits among. */
.pet-block { margin-top: 12px; padding: 10px; border: 1px dashed var(--border, #d8d8d8); border-radius: 8px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.checkbox-line input { width: auto; margin: 0; }
#po-pet-fields { margin-top: 10px; }
.payout-breakdown-row.pet-row span:last-child { color: #2c5c2c; }
.badge.pet-badge { background: #f1ecf7; color: #4a3a63; border: 1px solid #d6c9e5; }
