/* Camp Platform — 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;
  --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 { font-weight: 700; font-size: 17px; }
.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 .product, .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 .product, .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 { font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 1rem; }
.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); }
.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; }

/* 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; }

/* ---------- 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-info { background: var(--info-soft); color: var(--info-ink); font-weight: 600; }
.chip-muted { background: #F0F1F3; color: #3D4550; 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; }
