/* ==========================================================================
   CasaChecked Premium Design System  ·  premium.css
   --------------------------------------------------------------------------
   Shared by account.html (customer), staff.html (staff) and admin.html
   (admin). Loaded AFTER site.css and never on the public marketing pages, so
   the existing site is untouched.

   Palette — the CasaChecked identity, unchanged in spirit:
     Deep maroon   #4B0B0B family   (--ink, headings, primary buttons)
     Champagne gold #D7AA45 family  (--gold, accents, eyebrows, focus)
     Warm ivory    #FBF8F4 family   (--cream/--warm, surfaces)
     White         #FFFFFF          (--paper, cards)

   Everything here layers ON TOP of site.css tokens. It defines no new
   colors outside the brand family, honours prefers-reduced-motion, keeps
   the site's focus ring, and never removes an existing accessible pattern
   (skip link, live regions, aria-busy…). The ROSE chatbot and the CasaChecked
   branding are deliberately untouched.
   ========================================================================== */

:root {
  /* Brand tokens — the maroon site.css referenced but never defined. */
  --maroon: #4b0b0b;
  --maroon-deep: #350606;
  --maroon-soft: #681c1c;
  --champagne: #d7aa45;
  --champagne-light: #f0d28a;
  --champagne-deep: #996915;
  --champagne-soft: #fbf5e6;
  --ivory: #fbf8f4;
  --ivory-warm: #f6efe8;
  --ivory-deep: #efe7dd;

  /* Status palette — one honest colour per lifecycle step. */
  --status-received-bg: #f1ece5;
  --status-received-fg: #6b5a4a;
  --status-review-bg: #fbf5e6;
  --status-review-fg: #7a5a12;
  --status-pending-bg: #f8ecd7;
  --status-pending-fg: #8a5a10;
  --status-confirmed-bg: #e7f1e9;
  --status-confirmed-fg: #2e6a3f;
  --status-completed-bg: #eceae4;
  --status-completed-fg: #4b0b0b;
  --status-cancelled-bg: #f6e9e9;
  --status-cancelled-fg: #8f1d1d;

  --prem-shadow-card: 0 18px 48px rgba(64, 10, 10, 0.08);
  --prem-shadow-soft: 0 6px 20px rgba(64, 10, 10, 0.06);
}

/* --------------------------------------------------------------------------
   1 · Premium page scaffolding
   -------------------------------------------------------------------------- */

.prem-page {
  background:
    radial-gradient(1100px 420px at 88% -8%, rgba(215, 170, 69, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ivory) 0%, var(--ivory-warm) 100%);
}

.prem-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-gold);
  background:
    radial-gradient(900px 380px at 12% -20%, rgba(215, 170, 69, 0.14), transparent 62%),
    linear-gradient(135deg, #fffdf9 0%, var(--ivory) 56%, var(--ivory-warm) 100%);
}

/* The premium hero is a LIGHT ivory surface, but site.css paints every hero
   for its own dark surface: white heading, near-white paragraph, pale gold
   breadcrumb links and the #f6e9cf .account-hero-note. Those foregrounds are
   retinted here. Each pair is measured against the lightest gradient stop
   (#fffdf9), the ivory middle (#fbf8f4) and the warm end (#f6efe8):

     h1 / ink             15.29 : 14.67 : 13.63
     p / muted             6.70 :  6.43 :  5.97
     note / ink-soft      11.67 : 11.20 : 10.40
     eyebrow + links       5.55 :  5.32 :  4.95   (#8a5f12)

   All are >= 4.5:1, so the hero meets WCAG AA for normal text on every stop
   of its gradient. The gold is the brand gold, darkened only as far as AA
   requires. */
.prem-hero { color: var(--ink); }

.prem-hero h1 { color: var(--ink); }

.prem-hero p { color: var(--muted); }

.prem-hero .account-hero-note {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-gold);
}

.prem-hero .eyebrow { color: #8a5f12; }

.prem-hero .crumbs { color: var(--muted); }

.prem-hero .crumbs a { color: #8a5f12; }

.prem-hero .crumbs [aria-current="page"] { color: var(--ink-soft); }

.prem-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.prem-welcome-name {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  color: var(--maroon);
  line-height: 1.08;
  margin: 6px 0 8px;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
}

.prem-welcome-sub { color: var(--muted); max-width: 60ch; }

.prem-welcome-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   2 · Stat cards
   -------------------------------------------------------------------------- */

.prem-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.prem-stat {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px 16px;
  box-shadow: var(--prem-shadow-soft);
  overflow: hidden;
}

.prem-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--champagne), rgba(215, 170, 69, 0.15));
}

.prem-stat-value {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--maroon);
  line-height: 1.1;
}

.prem-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.83rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.prem-stat-hint { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }

.prem-stat.is-alert { border-color: rgba(143, 29, 29, 0.35); }
.prem-stat.is-alert .prem-stat-value { color: #8f1d1d; }
.prem-stat.is-positive .prem-stat-value { color: #2e6a3f; }

/* Coverage bar — assignment/check-in coverage, honest proportion display. */
.prem-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: var(--ivory-deep);
  overflow: hidden;
}
.prem-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--champagne-deep), var(--champagne));
}

/* --------------------------------------------------------------------------
   3 · Panels, sections and cards
   -------------------------------------------------------------------------- */

.prem-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--prem-shadow-card);
  padding: clamp(20px, 3vw, 32px);
}

.prem-panel + .prem-panel { margin-top: 20px; }

.prem-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.prem-panel-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--maroon);
  margin: 0;
}

.prem-panel-note { color: var(--muted); font-size: 0.92rem; margin: 4px 0 16px; }

.prem-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.prem-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* Elegant viewing / booking card */
.prem-booking-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--champagne);
  border-radius: var(--radius-md);
  box-shadow: var(--prem-shadow-soft);
  padding: 18px 20px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.prem-booking-card + .prem-booking-card { margin-top: 14px; }

@media (hover: hover) and (pointer: fine) {
  .prem-booking-card:hover { box-shadow: var(--prem-shadow-card); transform: translateY(-1px); }
}

.prem-booking-card.is-cancelled { border-left-color: #c98f8f; }
.prem-booking-card.is-completed { border-left-color: var(--maroon-soft); }
.prem-booking-card.is-confirmed { border-left-color: #4f8a63; }

.prem-booking-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.prem-booking-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.2rem;
  color: var(--maroon);
  margin: 0;
}

.prem-booking-when { color: var(--muted); font-size: 0.92rem; margin: 6px 0 2px; }
.prem-booking-address { margin: 2px 0 0; }

/* Key/value rows for property and customer details */
.prem-kv { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 6px 16px; margin: 12px 0 0; }
.prem-kv dt { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding-top: 2px; }
.prem-kv dd { margin: 0; }

/* --------------------------------------------------------------------------
   4 · Status badges & timeline
   -------------------------------------------------------------------------- */

.prem-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.prem-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.prem-badge.is-received { background: var(--status-received-bg); color: var(--status-received-fg); border-color: rgba(107, 90, 74, 0.25); }
.prem-badge.is-under_review { background: var(--status-review-bg); color: var(--status-review-fg); border-color: rgba(122, 90, 18, 0.25); }
.prem-badge.is-pending_host_confirmation { background: var(--status-pending-bg); color: var(--status-pending-fg); border-color: rgba(138, 90, 16, 0.3); }
.prem-badge.is-confirmed { background: var(--status-confirmed-bg); color: var(--status-confirmed-fg); border-color: rgba(46, 106, 63, 0.3); }
.prem-badge.is-completed { background: var(--status-completed-bg); color: var(--status-completed-fg); border-color: rgba(75, 11, 11, 0.2); }
.prem-badge.is-cancelled { background: var(--status-cancelled-bg); color: var(--status-cancelled-fg); border-color: rgba(143, 29, 29, 0.25); }

.prem-timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 22px; position: relative; }
.prem-timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--champagne), rgba(215, 170, 69, 0.18));
}
.prem-timeline li { position: relative; padding: 0 0 16px 8px; }
.prem-timeline li:last-child { padding-bottom: 0; }
.prem-timeline li::before {
  content: "";
  position: absolute;
  left: -21px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--champagne);
}
.prem-timeline .prem-timeline-date { display: block; font-size: 0.8rem; color: var(--muted); }
.prem-timeline .prem-timeline-note { display: block; margin-top: 2px; }

/* --------------------------------------------------------------------------
   5 · Toolbar, filters, search
   -------------------------------------------------------------------------- */

.prem-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
}

.prem-search { flex: 1 1 240px; min-width: 200px; }
.prem-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(75, 11, 11, 0.18);
  background: var(--paper);
  font: inherit;
  color: var(--text);
}
.prem-search input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.prem-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.prem-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 15px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.prem-chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-deep));
  border-color: var(--maroon);
  color: #fff;
}

.prem-chip .prem-chip-count { opacity: 0.72; margin-left: 6px; font-weight: 700; }

.prem-select {
  min-height: 46px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(75, 11, 11, 0.18);
  background: var(--paper);
  font: inherit;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   6 · Data tables (admin)
   -------------------------------------------------------------------------- */

.prem-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.prem-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.prem-table th, .prem-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prem-table thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #fffdf9, var(--ivory));
  color: var(--maroon);
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 1;
}

.prem-table tbody tr:nth-child(even) { background: rgba(251, 248, 244, 0.7); }
.prem-table tbody tr:hover { background: var(--champagne-soft); }
.prem-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.prem-table .prem-table-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Card mode for narrow screens: each row becomes a labelled card. */
@media (max-width: 720px) {
  .prem-table, .prem-table tbody, .prem-table tr, .prem-table td { display: block; width: 100%; }
  .prem-table thead { display: none; }
  .prem-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin: 0 0 12px;
    padding: 6px 4px;
    background: var(--paper);
  }
  .prem-table td {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr;
    gap: 10px;
    border-bottom: 1px dashed var(--line);
  }
  .prem-table td:last-child { border-bottom: 0; }
  .prem-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }
  .prem-table .prem-table-actions { display: flex; }
}

/* --------------------------------------------------------------------------
   6a2 · Staff workspace extras
   -------------------------------------------------------------------------- */

.prem-group-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--maroon);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-gold);
}

.prem-group-title:first-child { margin-top: 0; }

.prem-checklist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.prem-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ivory);
}

.prem-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--maroon);
  flex: none;
}

.prem-checklist label { font-size: 0.92rem; cursor: pointer; }

.prem-checklist li:has(input:checked) {
  background: var(--champagne-soft);
  border-color: var(--line-gold);
}

.prem-card-extras { margin-top: 14px; }

/* --------------------------------------------------------------------------
   6b · Viewing calendar (admin)
   -------------------------------------------------------------------------- */

.prem-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.prem-cal-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}

.prem-cal-day {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font: inherit;
  color: var(--text);
  text-align: left;
}

button.prem-cal-day { cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
button.prem-cal-day:hover, button.prem-cal-day:focus-visible { border-color: var(--champagne); background: var(--champagne-soft); }

.prem-cal-day.is-empty { border-style: dashed; background: transparent; pointer-events: none; }
.prem-cal-day.is-today { border-color: var(--champagne-deep); box-shadow: inset 0 0 0 1px var(--champagne); }
.prem-cal-day.has-viewings { background: linear-gradient(180deg, #fffdf9, var(--champagne-soft)); }

.prem-cal-day-number { font-weight: 700; color: var(--maroon); }
.prem-cal-day-count { font-size: 0.72rem; color: var(--muted); }

@media (max-width: 560px) {
  .prem-calendar { gap: 4px; }
  .prem-cal-day { min-height: 54px; padding: 4px 5px; }
  .prem-cal-day-count { display: none; }
}

/* --------------------------------------------------------------------------
   7 · Buttons & actions (premium variants layered on .button)
   -------------------------------------------------------------------------- */

.prem-btn-gold {
  background: linear-gradient(135deg, var(--champagne), var(--champagne-deep));
  color: #2c1c00;
  border: 1px solid rgba(153, 105, 21, 0.5);
}
.prem-btn-gold:hover, .prem-btn-gold:focus-visible { filter: brightness(1.05); }

.prem-btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.button[disabled] { opacity: 0.55; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   8 · Honest notes, empty / loading / error states
   -------------------------------------------------------------------------- */

.prem-note {
  border-left: 4px solid var(--champagne);
  background: var(--champagne-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.92rem;
  margin: 14px 0 0;
}

.prem-note.is-honest { background: var(--ivory-warm); border-left-color: var(--maroon-soft); }

.prem-empty {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed rgba(75, 11, 11, 0.25);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdf9, var(--ivory));
}
.prem-empty strong {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  color: var(--maroon);
  margin-bottom: 6px;
}

.prem-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, #efe7dd 40%, #f8f1e8 50%, #efe7dd 60%);
  background-size: 200% 100%;
  animation: prem-shimmer 1.4s ease-in-out infinite;
}
@keyframes prem-shimmer { to { background-position: -200% 0; } }

.prem-fade-in { animation: prem-fade 0.35s ease both; }
@keyframes prem-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .prem-skeleton { animation: none; }
  .prem-fade-in { animation: none; }
  .prem-booking-card { transition: none; }
  .prem-booking-card:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   9 · Navigation accents (shared premium chrome)
   -------------------------------------------------------------------------- */

.header .links a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 0 var(--champagne);
}

.prem-nav-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--champagne-soft);
  color: #8a5f12;
  border: 1px solid var(--line-gold);
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   10 · Sign-in additions (single sign-on buttons)
   -------------------------------------------------------------------------- */

.prem-sso { margin-top: 18px; }
.prem-sso[hidden] { display: none; }

.prem-sso-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.prem-sso-divider::before, .prem-sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-gold);
}

.prem-sso-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.prem-sso-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(75, 11, 11, 0.22);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.prem-sso-button:hover, .prem-sso-button:focus-visible {
  border-color: var(--champagne);
  background: var(--champagne-soft);
  box-shadow: var(--prem-shadow-soft);
}
.prem-sso-button svg { width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------------------
   11 · Keyboard focus visibility on the premium pages
   --------------------------------------------------------------------------
   site.css draws the focus ring in --gold (#d7aa45): 2.13:1 against the ivory
   hero and 2.16:1 against white, below the 3:1 that WCAG 2.2 SC 1.4.11
   requires for a focus indicator. premium.css is loaded only by account.html,
   staff.html and admin.html, so this deeper brand gold (#8a5f12, >= 4.95:1 on
   every surface these three pages use) is scoped to them and the public
   marketing pages keep their existing ring. */
body :focus-visible { outline-color: #8a5f12; }

/* Rules that set a lighter ring with a higher specificity have to be named. */
.prem-search input:focus-visible,
.button.oauth-button:focus-visible,
.cc-calendar-grid > button:focus-visible { outline-color: #8a5f12; }

/* --------------------------------------------------------------------------
   12 · Print
   -------------------------------------------------------------------------- */

@media print {
  .prem-sso, .prem-toolbar, .prem-welcome-actions { display: none !important; }
  .prem-panel, .prem-booking-card { box-shadow: none; }
}
