/* LodgeMint — calm, uncluttered admin UI (design/15 §4).
   One accent colour; patterns: shell, page header, list, detail (rail + tabs),
   side panel, status tabs, chips, notices. Bootstrap supplies form basics. */

:root {
  --ground: #F6F7F5;
  --surface: #FFFFFF;
  --border: #E3E6E2;
  --border-strong: #D5DAD6;
  --divider: #EEF0EE;
  --text: #1C2321;
  --muted: #5A635F;
  --faint: #8A928E;
  --accent: #2F6B4F;
  --accent-hover: #214D39;
  --accent-soft: #E6F0EA;
  --accent-ink: #214D39;
  --chip: #EEF1EF;
  --warn-soft: #FFF1D6;
  --warn-ink: #6B4200;
  --info-soft: #E8EEF9;
  --info-ink: #23426E;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --heritage: #7B55A6;
  --heritage-soft: #EFE8F7;
  --heritage-ink: #4A2C6B;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body { font-family: var(--font); color: var(--text); background: var(--ground); font-size: 16px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1:focus { outline: none; }

/* ---------- Shell (UD-033): sidebar with four areas; area views as tabs above the page ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  flex: 0 0 224px; width: 224px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px 16px; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 0 8px 18px; }
.sidebar-brand .product { display: flex; align-items: center; gap: 8px; }
/* LodgeMint wordmark: slab display face, "Mint" in the accent colour. */
.brand-word { font-family: 'Zilla Slab', Rockwell, Georgia, serif; font-weight: 700; font-size: 21px; letter-spacing: -.01em; color: var(--text); line-height: 1; }
.brand-word span { color: var(--accent); }
.sidebar-brand .camp { font-size: 14px; color: var(--muted); }
.nav-main { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-spacer { height: 12px; }
.nav-icon { display: inline-flex; width: 20px; justify-content: center; flex: none; }
.footer-links { display: flex; gap: 14px; margin-top: 4px; }
.nav-collapse {
  margin-top: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 8px; min-height: 32px; width: 100%; cursor: pointer; font-size: 15px;
}
.nav-collapse:hover { background: var(--ground); color: var(--text); }

/* Collapsed sidebar: icons only, names on hover/for screen readers. */
.nav-collapsed .sidebar { flex-basis: 68px; width: 68px; padding-inline: 10px; }
.nav-collapsed .sidebar .nav-text, .nav-collapsed .sidebar .brand-word, .nav-collapsed .sidebar .camp,
.nav-collapsed .sidebar .camp-switcher, .nav-collapsed .sidebar .nav-section,
.nav-collapsed .sidebar .who, .nav-collapsed .sidebar .footer-links { display: none; }
.nav-collapsed .sidebar .nav-item { justify-content: center; padding-inline: 0; }
.nav-collapsed .sidebar .sidebar-footer { padding-inline: 0; border-top: 0; }

/* Phones and small tablets: compact top bar; the sidebar becomes a drawer (UX-006). */
.mobile-bar, .nav-scrim { display: none; }
@media (max-width: 860px) {
  .shell { display: block; }
  .mobile-bar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30;
    padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .menu-button { border: 0; background: none; min-width: 44px; min-height: 44px; border-radius: 8px; color: var(--text); }
  .menu-button:hover { background: var(--ground); }
  .mobile-camp { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar, .nav-collapsed .sidebar {
    position: fixed; z-index: 1060; left: 0; top: 0; bottom: 0; height: auto; width: min(280px, 85vw); flex-basis: auto;
    padding: calc(env(safe-area-inset-top, 0px) + 20px) 12px 16px; transform: translateX(-105%); transition: transform .2s ease;
    visibility: hidden;
  }
  .nav-collapsed .sidebar .nav-text, .nav-collapsed .sidebar .brand-word, .nav-collapsed .sidebar .camp,
  .nav-collapsed .sidebar .camp-switcher, .nav-collapsed .sidebar .nav-section,
  .nav-collapsed .sidebar .who, .nav-collapsed .sidebar .footer-links { display: revert; }
  .nav-collapsed .sidebar .nav-item { justify-content: flex-start; padding-inline: 12px; }
  .nav-collapse { display: none; }
  .nav-open .sidebar { transform: none; visibility: visible; box-shadow: 8px 0 24px rgba(28, 35, 33, .14); }
  .nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 1055; background: rgba(28, 35, 33, .35); }
}

/* Area views (tabs) at the top of the page. */
.area-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -12px 0 20px;
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.area-tab, .area-crumb {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; text-decoration: none;
  color: var(--muted); border-bottom: 3px solid transparent; font-size: 15px; white-space: nowrap;
}
.area-tab:hover, .area-crumb:hover { color: var(--text); }
.area-tab.active, .area-crumb.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.area-group { color: var(--faint); padding: 0 2px; }
.area-group-name { color: var(--text); font-weight: 600; padding: 0 8px 0 2px; font-size: 15px; }
@media (max-width: 860px) { .area-nav { flex-wrap: nowrap; margin-top: 0; } }

/* Sign-in pages and account settings (UX-007). */
.auth-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 3rem; background: var(--ground); }
.auth-card { width: 100%; max-width: 26rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.75rem; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 1.25rem; }
.auth-brand .brand-word { font-size: 25px; }
.auth-card h1 { font-size: 26px; font-weight: 700; margin-bottom: 1rem; }
.auth-card h2, .auth-card h3 { font-size: 17px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; }
.account-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.account-nav { flex: 0 1 220px; display: flex; flex-direction: column; gap: 2px; }
.account-link { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.account-link:hover { background: var(--surface); color: var(--text); }
.account-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.account-main { flex: 1 1 420px; min-width: 0; }
@media (max-width: 860px) { .account-nav { flex: 1 1 100%; flex-direction: row; overflow-x: auto; } .account-link { white-space: nowrap; } }

/* Settings landing page. */
.settings-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 16px; }
.settings-group h2 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.settings-links { list-style: none; margin: 12px 0 0; padding: 0; }
.settings-links li { border-top: 1px solid var(--divider); }
.settings-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; text-decoration: none; color: var(--text); }
.settings-links .hint { text-align: right; }
.settings-links a:hover .settings-link-name { color: var(--accent); }
.settings-link-name { font-weight: 600; white-space: nowrap; }

/* Communication: replies with their context. */
.reply-list { display: flex; flex-direction: column; gap: 12px; }
.reply { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.reply-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.reply-body { margin: 8px 0 10px; font-size: 16px; white-space: pre-wrap; }
.reply-context { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); align-items: center; }

/* Camp setup: day picker, choice cards, rules preview */
.day-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.day-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--surface); font-size: 14px; cursor: pointer; user-select: none;
}
.day-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.day-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.day-toggle:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
}
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 4px; }
fieldset[disabled] .day-toggle, fieldset[disabled] .choice { cursor: default; opacity: .85; }
.preview-panel { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
.notice-info { background: var(--info-soft); color: var(--info-ink); }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }

.choice.unavailable { background: var(--ground); color: var(--muted); }

/* Reservations: status chips, grid, changeover */
.stay-chip { display: inline-block; max-width: 100%; padding: 3px 8px; border-radius: 8px; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.stay-confirmed { background: var(--accent-soft); color: var(--accent-ink); }
.stay-pending, .stay-review { background: var(--warn-soft); color: var(--warn-ink); }
.stay-in { background: var(--info-soft); color: var(--info-ink); }
.stay-done, .stay-off { background: var(--chip); color: var(--muted); }
.stay-chip.partial { border: 1px dashed currentColor; }
.grid-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stay-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.stay-grid th, .stay-grid td { border-bottom: 1px solid var(--divider); border-right: 1px solid var(--divider); padding: 6px; vertical-align: top; }
.stay-grid thead th { position: sticky; top: 0; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; text-align: left; }
.stay-grid th.cabin-col { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 9rem; text-align: left; }
.stay-grid td { min-width: 8.5rem; height: 3rem; }
.stay-grid td.closed { background: repeating-linear-gradient(45deg, var(--ground), var(--ground) 6px, var(--surface) 6px, var(--surface) 12px); }
.grid-add { width: 100%; height: 100%; min-height: 2rem; border: 1px dashed transparent; border-radius: 8px; background: none; color: var(--faint); font-size: 18px; line-height: 1; }
.grid-add:hover, .grid-add:focus-visible { border-color: var(--border-strong); color: var(--accent); background: var(--accent-soft); }
.day-grid td { min-width: 3.25rem; height: 2.5rem; padding: 4px 0; border-right-color: transparent; }
.day-grid thead th.weekend { color: var(--text); }
/* The one booking grid (UD-043): the rules banner, arrival days, days outside a season, and the picked arrival. */
.rules-banner { background: var(--accent-soft); border: 1px solid var(--divider); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.day-grid thead th.arrival-day { box-shadow: inset 0 -3px 0 var(--accent); }
.day-grid thead th.no-season { color: var(--faint); }
.day-grid thead th.today { color: var(--accent); }
/* Arrival and departure days as half-days, split by a diagonal (the gap is the slash). */
.day-grid td { position: relative; }
.day-chip.half-in, .day-chip.half-out { position: absolute; inset: 4px 0; height: auto; padding: 0; }
.day-chip.half-in { clip-path: polygon(100% 6%, 100% 100%, 6% 100%); }
.day-chip.half-out { clip-path: polygon(0 0, 94% 0, 0 94%); }
.day-chip.half-in.stay-confirmed, .day-chip.half-out.stay-confirmed { background: color-mix(in srgb, var(--accent) 35%, var(--accent-soft)); }
/* Heritage Stays (UD-055): their own colour; next year's held, not-yet-confirmed week is outlined. */
.stay-heritage { background: var(--heritage-soft); color: var(--heritage-ink); }
.stay-heritage.stay-pending, .stay-heritage.stay-review { box-shadow: inset 0 0 0 2px var(--heritage); background: repeating-linear-gradient(135deg, var(--heritage-soft), var(--heritage-soft) 6px, var(--surface) 6px, var(--surface) 12px); }
.day-chip.half-in.stay-heritage, .day-chip.half-out.stay-heritage { background: color-mix(in srgb, var(--heritage) 35%, var(--heritage-soft)); }
/* Leaving on a day another group arrives: the button sits in the free morning half (top-left), under the arrival chip. */
.grid-add.grid-leave { position: absolute; inset: 4px 0; min-height: 0; text-align: left; vertical-align: top; padding: 2px 0 0 6px; line-height: 1; }
.day-grid td.picked .grid-add { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.day-chip { display: block; border-radius: 0; height: 100%; padding: 4px 6px; overflow: visible; }
.changeover-day { margin-bottom: 1rem; }
.changeover-day h2 { font-size: 16px; margin-bottom: .5rem; }
.changeover-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
.changeover-cols ul { list-style: none; padding: 0; margin: 0; }
.changeover-cols li { padding: 4px 0; border-bottom: 1px solid var(--divider); }

.end-confirm { position: fixed; z-index: 60; right: 1rem; bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem); max-width: 26rem; box-shadow: 0 8px 24px rgba(28, 35, 33, .16); }

.message-body { white-space: pre-wrap; font-family: var(--font); font-size: 14px; background: var(--ground); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }

/* Public pages opened from messages */
.public-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 3rem 16px; background: var(--ground); }
.public-card { width: 100%; max-width: 28rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.public-camp { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.public-card h1 { font-size: 24px; margin-bottom: .25rem; }
.public-stay { color: var(--muted); }
.public-card.policy { max-width: 40rem; }
.public-card.policy h2 { font-size: 17px; margin-top: 1.25rem; }

/* The public calendar (UD-056): full width; ?embed=1 sits inside the camp's own website with no page chrome. */
.public-wide { width: 100%; max-width: 80rem; }
.public-title { font-size: 24px; margin-bottom: 1rem; }
.public-page:has(.public-embed) { min-height: 0; padding: 4px; background: transparent; }
/* Embedded on a camp's website: the host page sizes the iframe to fit, so no scrollbars of our own (app.js). */
html.in-frame, html.in-frame body { overflow: hidden; }
html.in-frame .public-page { min-height: 0; }
.public-booked { background: var(--chip); color: var(--text); }
.public-open { background: var(--surface); color: var(--muted); border: 1px dashed var(--border-strong); }
.day-chip.half-in.public-booked, .day-chip.half-out.public-booked { background: color-mix(in srgb, var(--muted) 30%, var(--chip)); }
.day-grid td.picked { background: var(--accent-soft); }
.public-book { margin-bottom: 12px; }
.public-book h2 { font-size: 18px; margin-bottom: .25rem; }
.pb-website { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* A signed-in guest's own bookings (UD-064): listed above the calendar, and marked on it. */
.public-mine { background: var(--accent); color: #fff; font-weight: 600; }
.day-chip.half-in.public-mine, .day-chip.half-out.public-mine { background: color-mix(in srgb, var(--accent) 60%, var(--accent-soft)); }
/* Top row: the title on the left, signing in on the right (UD-064). Embedded, there's no title, so it sits right on its own. */
.public-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.public-top .public-title { margin-bottom: 0; }
.public-account { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; }
.public-account-who { color: var(--muted); font-size: 14px; }
/* Sign-in dropdown: anchored under the button and floating over the calendar, so opening it doesn't move the page. */
.public-signin-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: min(20rem, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(28, 35, 33, .16); font-size: 15px;
}
.public-signin-pop .close-x { position: absolute; top: 2px; right: 2px; min-width: 36px; min-height: 36px; font-size: 22px; }
.public-mine-panel { margin-bottom: 12px; padding: 14px 16px; }
.public-mine-panel h2 { font-size: 18px; }
.public-mine-list { list-style: none; padding: 0; margin: 0; }
.public-mine-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .4rem 0; border-top: 1px solid var(--divider); }
.public-mine-list li > span { flex: 1 1 14rem; color: var(--muted); }

/* The guest's "My stay" page (UD-047) */
.my-stay .my-code { letter-spacing: .3em; font-size: 1.5rem; }
.my-stay-facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.my-stay-facts dt { color: var(--muted); font-weight: 500; }
.my-stay-facts dd { margin: 0; }
.my-stay-camp { border-top: 1px solid var(--border); padding-top: .75rem; margin-top: 1rem; }
.my-section { border-top: 1px solid var(--border); padding-top: .75rem; margin-top: 1rem; }
.my-section h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.my-guest-list { list-style: none; padding: 0; margin: 0 0 .5rem; }
.my-guest-list li { display: flex; justify-content: space-between; align-items: center; padding: .15rem 0; }
/* "My stay" on a computer: once open, a wider page with the booking on the left and what the guest can change on the
   right. Phones keep the single column above. */
@media (min-width: 900px) {
  .public-card.my-stay.my-open { max-width: 60rem; padding: 2rem 2.25rem; }
  .my-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "head head" "main side" "foot foot"; column-gap: 2.5rem; }
  .my-head { grid-area: head; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.25rem; }
  .my-head .public-stay { font-size: 18px; }
  .my-head #my-pick { max-width: 26rem; }
  .my-main { grid-area: main; }
  .my-side { grid-area: side; }
  .my-side > .my-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
  .my-foot { grid-area: foot; }
  .my-stay-facts { gap: .6rem 1.5rem; }
}
@media (max-width: 400px) { .public-page { padding: 1.25rem 16px; } }

/* Global admin camp switcher (UD-024) */
.camp-switcher { margin-top: 6px; position: relative; }
.camp-switcher summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; font-weight: 600;
}
.camp-switcher summary::-webkit-details-marker { display: none; }
.camp-switcher summary::after { content: "▾"; color: var(--muted); font-weight: 400; }
.camp-switcher-menu {
  position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(28, 35, 33, .12); max-height: 60vh; overflow-y: auto;
}
.camp-switcher-menu .camp-option {
  display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 14px; color: var(--text);
}
.camp-switcher-menu .camp-option:hover { background: var(--chip); }
.camp-switcher-menu .camp-option.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.camp-switcher-menu hr { margin: 4px 0; border-color: var(--divider); opacity: 1; }
.nav-section { padding: 16px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; box-sizing: border-box;
  text-decoration: none; color: var(--text); padding: 9px 12px; border-radius: 8px; font-size: 15px;
}
.nav-item:hover { background: var(--ground); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-soon { padding: 7px 12px; font-size: 15px; color: var(--faint); }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.sidebar-footer .who { font-weight: 600; color: var(--text); word-break: break-all; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-button:hover { color: var(--accent-hover); text-decoration: underline; }

.main { flex: 1 1 auto; min-width: 0; padding: 32px 40px 48px; box-sizing: border-box; }
@media (max-width: 860px) { .main { padding: 16px 16px 40px; } }

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: 30px; font-weight: 700; }
.page-header .subtitle { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.breadcrumb-line { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb-line a { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); min-height: 44px; padding: 10px 18px; font-size: 15px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }
.btn-secondary-quiet { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn-secondary-quiet:hover { background: var(--ground); }
.btn-danger-quiet { background: var(--surface); border: 1px solid var(--border-strong); color: var(--danger); }

/* ---------- Forms ---------- */
.form-label { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.form-control, .form-select { border-color: var(--border-strong); border-radius: var(--radius-sm); min-height: 44px; font-size: 16px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 79, .18); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- Toolbar & lists ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 280px; }
.toolbar .filter { flex: 0 1 220px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-body { padding: 20px 24px; }
.panel-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table-clean { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.table-clean th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.table-clean td { padding: 14px 20px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table-clean tbody tr:last-child td { border-bottom: 0; }
.table-clean tbody tr.clickable { cursor: pointer; }
.table-clean tbody tr.clickable:hover { background: #FAFBFA; }
.row-title { font-weight: 600; color: var(--text); text-decoration: none; }
.row-sub { color: var(--muted); font-size: 14px; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state h2 { font-size: 20px; color: var(--text); margin-bottom: 6px; }

/* ---------- Voicemail and follow-ups (UD-049) ---------- */
.vm-list { display: grid; gap: 12px; }
.vm-card { padding: 16px; }
.vm-head { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; align-items: baseline; }
.vm-transcript { margin: 10px 0; white-space: pre-wrap; line-height: 1.5; }
.vm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vm-actions audio { height: 36px; max-width: 100%; }
.fu-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.fu-row:first-of-type { border-top: 0; }
.fu-main { flex: 1; min-width: 0; }
.fu-note { white-space: pre-wrap; max-width: 46ch; }
.fu-reason { min-width: 150px; }
.fu-new > td { background: var(--accent-soft); }

/* ---------- Chips ---------- */
.chip { display: inline-block; background: var(--chip); color: var(--text); padding: 3px 10px; border-radius: 999px; font-size: 13px; line-height: 1.4; }
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.chip-warn { background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; }
.chip-heritage { background: var(--heritage-soft); color: var(--heritage-ink); font-weight: 600; }
.chip-info { background: var(--info-soft); color: var(--info-ink); font-weight: 600; }
.chip-muted { background: #F0F1F3; color: #3D4550; font-weight: 600; }
.chip-danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.chip-remove { background: none; border: 0; padding: 0 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.chip-remove:hover { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Tabs (sections and status) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { font: inherit; font-size: 15px; padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); min-height: 44px; cursor: pointer; }
.tab:hover:not(:disabled) { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tab:disabled { color: var(--faint); cursor: default; }
.tab .count { background: var(--chip); border-radius: 999px; padding: 1px 8px; font-size: 13px; margin-left: 4px; color: var(--text); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.filter-chip { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); min-height: 36px; cursor: pointer; }
.filter-chip.active { background: var(--text); color: #FFFFFF; border-color: var(--text); font-weight: 600; }

/* ---------- Detail page: header + rail + tabs ---------- */
.detail-header { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 24px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 21px; flex: none; }
.detail-header .title { flex: 1 1 280px; min-width: 0; }
.detail-header h1 { margin: 0; font-size: 30px; font-weight: 700; }
.detail-header .chips { margin-top: 6px; }
.detail-body { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.detail-main { flex: 999 1 480px; min-width: 0; }
.facts-rail { flex: 1 1 280px; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) { .facts-rail { max-width: none; } }
.rail-section h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.rail-section .value { font-size: 15px; }
.facts-grid { display: grid; grid-template-columns: 110px 1fr; row-gap: 6px; column-gap: 12px; font-size: 15px; }
.facts-grid dt { color: var(--muted); font-weight: 400; }
.facts-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Activity timeline ---------- */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.activity-item { padding: 0 4px; font-size: 15px; }
.activity-item .meta { font-size: 13px; color: var(--muted); }
.activity-note { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.activity-note.pinned { border-color: var(--accent); }
.activity-note .body { white-space: pre-wrap; margin-top: 4px; }

/* ---------- Side panel ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(28, 35, 33, .35); z-index: 1040; }
.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100%; background: var(--surface);
  box-shadow: -8px 0 24px rgba(28, 35, 33, .12); z-index: 1050; display: flex; flex-direction: column;
}
.side-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px 8px; }
.side-panel-header h2 { margin: 0; font-size: 22px; font-weight: 700; }
.side-panel-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.side-panel-footer { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.close-x { font-size: 24px; line-height: 1; border: 0; background: transparent; color: var(--muted); min-width: 44px; min-height: 44px; cursor: pointer; }
.unsaved-bar { background: var(--warn-soft); color: var(--warn-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
@media (max-width: 600px) { .side-panel { width: 100%; } }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--chip); border-radius: var(--radius-sm); padding: 4px; }
.segmented button { font: inherit; font-size: 15px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); min-height: 40px; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------- Notices ---------- */
.notice { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 15px; margin-bottom: 16px; }
.notice-success { background: var(--accent-soft); color: var(--accent-ink); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-warn { background: #FFF8E6; border: 1px solid #F1DFA8; color: var(--text); }

/* ---------- Today ---------- */
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.attention-list li:last-child { border-bottom: 0; }
.attention-count { font-weight: 700; font-size: 20px; min-width: 40px; }

/* ---------- "More actions" menu for less common, consequential actions ---------- */
.action-menu { position: relative; }
.action-menu > summary { list-style: none; display: inline-flex; align-items: center; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary::after { content: "▾"; margin-left: 6px; color: var(--muted); font-weight: 400; }
.action-menu-items {
  position: absolute; right: 0; z-index: 25; min-width: 14rem; margin-top: 4px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(28, 35, 33, .12);
}
.action-menu-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 15px; color: var(--text); min-height: 40px; }
.action-menu-item:hover, .action-menu-item:focus-visible { background: var(--chip); }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .page-header h1, .detail-header h1 { font-size: 24px; }
  .page-header { margin-bottom: 16px; }
  .page-header .actions { width: 100%; }
  .panel-body { padding: 16px; }
  .table-clean th, .table-clean td { padding: 12px 14px; }
}

/* ---------- Framework bits kept from the template ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }
.blazor-error-boundary { background: var(--danger-soft); padding: 1rem; color: var(--danger); border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "An error has occurred."; }
#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); box-sizing: border-box; display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
