:root {
  color-scheme: light;
  --ink: #2f2021;
  --muted: #78696a;
  --line: #d8c9bb;
  --paper: #fffaf6;
  --canvas: #f5efe9;
  --deep: #540D15;
  --teal: #7a1d28;
  --teal-soft: #E0D4C6;
  --gold: #b38b62;
  --rose: #a9505c;
  --danger: #9b2632;
  --shadow: 0 18px 50px rgba(84, 13, 21, .10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.test-environment-banner {
  padding: 10px 18px;
  color: #540D15;
  background: #E0D4C6;
  border-bottom: 1px solid #c7b29d;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.loading-screen, .error-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #eadfd3, transparent 38%), var(--canvas);
}
.loading-card, .error-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}
.loading-card strong, .loading-card small { display: block; }
.loading-card strong { margin-top: 16px; font-size: 20px; }
.loading-card small { margin-top: 8px; color: var(--muted); }
.login-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg, #540D15, #7a1d28);
  font-family: Georgia, serif;
  font-size: 23px;
  box-shadow: 0 10px 24px rgba(84, 13, 21, .24);
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  color: white;
  background: linear-gradient(180deg, #540D15, #3d090f);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.66); font-size: 12px; }
.navigation { display: grid; gap: 7px; }
.nav-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255,255,255,.78);
  background: transparent;
  text-align: left;
}
.nav-button:hover, .nav-button.active {
  color: white;
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.10);
}
.sidebar-user { margin-top: auto; padding: 16px 10px 2px; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user small { margin-top: 4px; color: rgba(255,255,255,.6); overflow-wrap: anywhere; }
.role-badge { display: inline-flex; margin-top: 9px; padding: 4px 9px; border-radius: 999px; color: white; background: rgba(255,255,255,.14); font-size: 12px; font-weight: 800; }
.sidebar-logout { margin-top: 12px; padding: 0; border: 0; color: rgba(255,255,255,.7); background: transparent; font-size: 12px; }
.sidebar-logout:hover { color: white; text-decoration: underline; }

.workspace { min-width: 0; padding: 32px clamp(22px, 4vw, 58px) 54px; }
.topbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar { margin-bottom: 28px; flex-wrap: wrap; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 3vw, 36px); }
h2 { margin-bottom: 8px; }
.eyebrow { margin-bottom: 6px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.view-switcher-wrap { min-width: 210px; }
.view-switcher-wrap label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.guide-hub-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #c8ae96;
  border-radius: 999px;
  color: var(--deep);
  background: #fffaf6;
  font-weight: 800;
}
.guide-hub-button span, .guide-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--deep);
  font-weight: 900;
  line-height: 1;
}
.guide-icon { margin-left: 5px; padding: 0; vertical-align: 3px; }
.guide-icon:hover, .guide-hub-button:hover { background-color: var(--teal); }
select, input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
}
select:focus, input:focus { outline: 3px solid rgba(84, 13, 21, .14); border-color: var(--teal); }
.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, var(--deep), var(--teal));
  box-shadow: var(--shadow);
}
.hero-card.executive { background: linear-gradient(135deg, #540D15, #8a3a43); }
.hero-card p:last-child { max-width: 680px; margin-bottom: 0; color: rgba(255,255,255,.78); }
.status-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.summary-card, .empty-card, .account-list-panel, .account-editor, .account-empty,
.list-card, .form-card, .detail-card, .notification-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(29,48,51,.06);
}
.summary-card { padding: 20px; }
.summary-card span, .summary-card strong, .summary-card small { display: block; }
.summary-card span, .summary-card small { color: var(--muted); }
.summary-card strong { margin: 8px 0; font-size: 30px; }
.executive-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.executive-summary-grid .summary-card { min-width: 0; }
.executive-summary-grid .summary-card strong { font-size: clamp(21px, 2vw, 29px); overflow-wrap: anywhere; }
.executive-summary-grid .refund-summary strong { color: var(--rose); }
.executive-summary-grid .net-summary { color: white; border-color: var(--deep); background: var(--deep); }
.executive-summary-grid .net-summary span, .executive-summary-grid .net-summary small { color: rgba(255,255,255,.72); }
.empty-card { margin-top: 18px; padding: 28px; text-align: center; }
.empty-card p { margin-bottom: 0; color: var(--muted); }

.list-card, .form-card, .detail-card { margin-top: 18px; padding: 24px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.card-heading h3, .card-heading p { margin-bottom: 0; }
.card-heading p { margin-top: 5px; color: var(--muted); }
.executive-alert-panel { border-color: #c9ad94; background: #fff8f2; }
.alert-count { display: inline-flex; min-width: 56px; min-height: 32px; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 999px; color: white; background: var(--danger); font-size: 12px; font-weight: 900; }
.alert-count.is-clear { background: #417452; }
.executive-alert-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.executive-alert, .executive-clear-state { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.executive-alert > span, .executive-clear-state > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: var(--deep); font-weight: 900; }
.executive-alert.warning > span { color: #643900; background: #ffdca8; }
.executive-alert.info > span { background: #52727a; }
.executive-alert.critical { border-color: #d9a0a6; background: #fff4f4; }
.executive-alert.critical > span { background: var(--danger); }
.executive-alert strong, .executive-alert small, .executive-clear-state strong, .executive-clear-state small { display: block; }
.executive-alert small, .executive-clear-state small { margin-top: 3px; color: var(--muted); }
.executive-clear-state { grid-column: 1 / -1; }
.executive-clear-state > span { background: #417452; }
.executive-disclosure { padding: 0; overflow: hidden; }
.executive-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; cursor: pointer; list-style: none; }
.executive-disclosure > summary::-webkit-details-marker { display: none; }
.executive-disclosure > summary span strong, .executive-disclosure > summary span small { display: block; }
.executive-disclosure > summary span small { margin-top: 5px; color: var(--muted); font-weight: 400; }
.executive-disclosure > summary > b { color: var(--deep); font-size: 12px; white-space: nowrap; }
.executive-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.executive-disclosure > :not(summary) { margin-left: 24px; margin-right: 24px; }
.executive-disclosure > :last-child { margin-bottom: 24px; }
.executive-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 20px; }
.executive-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.executive-card.warning { border-color: #ddb36d; background: #fffbf3; }
.executive-card.critical { border-color: #d28c95; background: #fff5f5; }
.executive-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.executive-card header strong, .executive-card header small { display: block; }
.executive-card header small { margin-top: 3px; color: var(--muted); }
.executive-card header > span { padding: 4px 8px; border-radius: 999px; color: #315c3d; background: #e3f2e8; font-size: 12px; font-weight: 900; }
.executive-card.warning header > span { color: #704200; background: #ffe7bd; }
.executive-card.critical header > span { color: white; background: var(--danger); }
.utilization-track { height: 9px; margin: 14px 0 17px; overflow: hidden; border-radius: 999px; background: #eee7df; }
.utilization-track i { display: block; height: 100%; border-radius: inherit; background: #6d9b7b; }
.width-0 { width: 0; }
.width-5 { width: 5%; }
.width-10 { width: 10%; }
.width-15 { width: 15%; }
.width-20 { width: 20%; }
.width-25 { width: 25%; }
.width-30 { width: 30%; }
.width-35 { width: 35%; }
.width-40 { width: 40%; }
.width-45 { width: 45%; }
.width-50 { width: 50%; }
.width-55 { width: 55%; }
.width-60 { width: 60%; }
.width-65 { width: 65%; }
.width-70 { width: 70%; }
.width-75 { width: 75%; }
.width-80 { width: 80%; }
.width-85 { width: 85%; }
.width-90 { width: 90%; }
.width-95 { width: 95%; }
.width-100 { width: 100%; }
.executive-card.warning .utilization-track i { background: #d08b2f; }
.executive-card.critical .utilization-track i { background: var(--danger); }
.executive-card-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.executive-card-metrics div { min-width: 0; }
.executive-card-metrics small, .executive-card-metrics strong { display: block; overflow-wrap: anywhere; }
.executive-card-metrics small { color: var(--muted); }
.executive-card-metrics strong { margin-top: 4px; font-size: 13px; }
.executive-card-metrics .available-metric strong { color: var(--deep); font-size: 16px; }
.executive-card footer { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 15px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.executive-future-list { padding-top: 18px; }
.future-week { border: 1px solid var(--line); border-radius: 14px; background: white; }
.future-week + .future-week { margin-top: 10px; }
.future-week > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; cursor: pointer; }
.future-week > summary span strong, .future-week > summary span small { display: block; }
.future-week > summary span small { margin-top: 3px; color: var(--muted); }
.future-week > summary > b { color: var(--deep); }
.future-week[open] > summary { border-bottom: 1px solid var(--line); }
.future-row { display: grid; grid-template-columns: 82px minmax(180px, 1fr) 100px 120px; align-items: center; gap: 12px; padding: 13px 16px; }
.future-row + .future-row { border-top: 1px dashed var(--line); }
.future-row strong, .future-row small { display: block; }
.future-row small { margin-top: 3px; color: var(--muted); }
.future-row time { color: var(--muted); font-size: 12px; }
.future-row > b { color: var(--deep); text-align: right; }
.future-type, .transaction-kind { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; color: #365d63; background: #e6eff0; font-size: 11px; font-weight: 900; }
.future-type.recurring { color: #704200; background: #ffe7bd; }
.future-type.reservation { color: var(--deep); background: var(--teal-soft); }
.executive-trend { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); gap: 10px; padding-top: 20px; }
.trend-month { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.trend-month > strong, .trend-month > small { display: block; }
.trend-month > strong { font-size: 12px; }
.trend-month > small { margin-top: 10px; color: var(--muted); font-size: 11px; }
.trend-bars { display: grid; gap: 8px; margin-top: 12px; }
.trend-bars > div { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 6px; align-items: center; }
.trend-bars span { color: var(--muted); font-size: 10px; }
.trend-bars i { display: block; min-height: 8px; justify-self: start; border-radius: 999px; background: var(--deep); }
.trend-bars i.refund { background: var(--rose); }
.trend-bars b { grid-column: 1 / -1; font-size: 10px; font-weight: 700; overflow-wrap: anywhere; }
.executive-method-wrap { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.executive-method-wrap h4 { margin: 0 0 10px; }
.method-chip-list { display: flex; flex-wrap: wrap; gap: 9px; }
.method-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; }
.method-chip small { color: var(--muted); }
.executive-filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 160px 180px; gap: 12px; padding-top: 20px; }
.executive-result-count { margin: 0 24px 12px !important; color: var(--muted); font-size: 12px; }
.executive-transaction-list { display: grid; gap: 8px; }
.executive-transaction-row { display: grid; grid-template-columns: 58px minmax(230px, 1fr) 170px 135px; align-items: center; gap: 13px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.executive-transaction-row strong, .executive-transaction-row small { display: block; }
.executive-transaction-row small { margin-top: 3px; color: var(--muted); }
.executive-transaction-row > b { color: var(--deep); text-align: right; }
.transaction-kind.charge { color: #315c3d; background: #e3f2e8; }
.transaction-kind.refund { color: #8c2430; background: #ffe7e9; }
.executive-transaction-row .refund-amount { color: var(--rose); }
.executive-transaction-row .original-transaction { color: var(--deep); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.compact { gap: 8px 12px; }
.full-span { grid-column: 1 / -1; }
.flow-tag { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 12px; border: 1px solid #ccb9a7; border-radius: 999px; color: var(--deep); background: var(--teal-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
.registration-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.registration-step { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: white; text-align: left; }
.registration-step b { display: grid; width: 28px; height: 28px; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--deep); background: var(--teal-soft); }
.registration-step.active { color: white; border-color: var(--deep); background: var(--deep); }
.registration-step.active b { color: var(--deep); background: white; }
.registration-step.done { color: var(--deep); border-color: #c5ae99; background: #f0e6dc; }
.registration-panel h3 { margin-bottom: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); background: #fbf4ef; }
.choice-card input { width: 18px; height: 18px; grid-row: 1 / span 2; margin-top: 2px; accent-color: var(--deep); }
.choice-card small { color: var(--muted); line-height: 1.55; }
.entry-choice-grid { margin-top: 18px; }
.entry-choice { width: 100%; grid-template-columns: 1fr; color: var(--ink); text-align: left; }
.entry-choice:hover { border-color: var(--deep); box-shadow: inset 0 0 0 1px var(--deep); background: #fbf4ef; }
.inline-control { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 0 !important; }
.compact-button { width: auto; padding: 9px 11px; white-space: nowrap; }
.review-toolbar { grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; }
.modal-card { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.modal-card::backdrop { background: rgba(47, 32, 33, .45); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.guide-modal { width: min(760px, calc(100vw - 28px)); }
.guide-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.guide-tabs button, .inline-guides button, .action-guide-link button {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--deep);
  background: white;
  font-weight: 800;
}
.guide-tabs button:hover, .guide-tabs button.active, .inline-guides button:hover, .action-guide-link button:hover {
  color: white;
  border-color: var(--deep);
  background: var(--deep);
}
.guide-intro { margin-bottom: 18px; padding: 14px 16px; border-radius: 13px; background: var(--teal-soft); line-height: 1.7; }
.guide-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: guide-step; }
.guide-steps li { position: relative; padding: 14px 16px 14px 56px; border: 1px solid var(--line); border-radius: 14px; background: white; counter-increment: guide-step; }
.guide-steps li::before { content: counter(guide-step); position: absolute; left: 15px; top: 14px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: white; background: var(--deep); font-weight: 900; }
.guide-steps span { font-weight: 900; }
.guide-steps p { margin: 4px 0 0; color: var(--muted); line-height: 1.65; }
.guide-tip { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--deep); border-radius: 0 12px 12px 0; background: #fff7ee; }
.guide-tip p { margin: 5px 0 0; line-height: 1.65; }
.inline-guides { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.panel-title { display: flex; align-items: center; gap: 4px; }
.action-guide-link { margin-bottom: 12px; }
.special-conditions { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbf6f1; }
.special-conditions summary { cursor: pointer; color: var(--deep); font-weight: 800; }
.special-conditions[open] summary { margin-bottom: 14px; }
.flow-note { margin-top: 16px; padding: 14px 16px; border-left: 4px solid var(--deep); border-radius: 0 12px 12px 0; color: #5d484a; background: var(--teal-soft); line-height: 1.65; }
.step-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.confirmation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.confirmation-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.confirmation-grid small, .confirmation-grid strong { display: block; }
.confirmation-grid small { margin-bottom: 5px; color: var(--muted); }
.static-row { cursor: default; }
.static-row:hover { transform: none; }
.muted-status { color: var(--muted); background: #eee7df; }
.list-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.list-toolbar .search-field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.case-list { display: grid; gap: 10px; }
.case-row {
  display: grid;
  grid-template-columns: 145px minmax(190px, 1.1fr) minmax(220px, 1.5fr) 90px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  box-shadow: 0 5px 20px rgba(29,48,51,.04);
}
.case-row:hover { border-color: #c8ae96; background: #fffaf6; transform: translateY(-1px); }
.case-row strong, .case-row small { display: block; }
.case-row small { color: var(--muted); }
.case-main small { margin-top: 4px; }
.case-next strong { margin-top: 3px; font-size: 13px; }
.case-status { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; color: var(--teal); background: var(--teal-soft); font-size: 12px; font-weight: 800; }
.case-status.urgent { color: var(--danger); background: #fff0ef; }
.workbench-card { display: block; width: 100%; padding: 17px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--paper); text-align: left; box-shadow: 0 5px 20px rgba(29,48,51,.04); }
.workbench-card.requires-action { border-left: 5px solid var(--deep); }
.workbench-card.tracking { background: #fbf8f4; }
.workbench-card:hover { border-color: #c8ae96; transform: translateY(-1px); }
.workbench-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workbench-card h3 { margin: 11px 0 13px; }
.workbench-details { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(130px, .7fr) minmax(220px, 1.4fr) minmax(80px, .5fr); gap: 12px; }
.workbench-details small, .workbench-details strong { display: block; }
.workbench-details small { margin-bottom: 4px; color: var(--muted); }
.workbench-details strong { font-size: 13px; line-height: 1.45; }
.workbench-cta { display: block; margin-top: 13px; color: var(--deep); font-size: 12px; font-weight: 900; text-align: right; }
.receipt-followup-groups { display: grid; gap: 16px; }
.receipt-followup-group { display: grid; gap: 8px; }
.receipt-followup-group > header { display: flex; align-items: center; justify-content: space-between; padding: 0 3px; }
.receipt-followup-group > header strong { color: var(--deep); }
.receipt-followup-group > header span { padding: 3px 8px; border-radius: 999px; color: var(--muted); background: #f2ece6; font-size: 12px; font-weight: 800; }
.receipt-followup-group.overdue > header strong,
.receipt-followup-group.anomaly > header strong,
.receipt-followup-group.unconfirmed > header strong { color: var(--danger); }
.receipt-followup-row {
  display: grid;
  grid-template-columns: 125px minmax(190px, 1.1fr) minmax(180px, 1.2fr) 100px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
}
.receipt-followup-row:hover { border-color: #c8ae96; background: #fffaf6; }
.receipt-followup-row.overdue,
.receipt-followup-row.anomaly,
.receipt-followup-row.unconfirmed { border-left: 4px solid var(--danger); }
.receipt-followup-row.this_week { border-left: 4px solid #d78d20; }
.receipt-followup-row.future { border-left: 4px solid var(--teal); }
.future-receipt-disclosure { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbf8f4; }
.future-receipt-disclosure > summary { cursor: pointer; padding: 14px 16px; color: var(--deep); font-weight: 900; }
.future-receipt-disclosure > .case-list { padding: 0 14px 14px; }
.compact-empty { min-height: 88px; }
.receipt-blocked { margin-bottom: 14px; color: var(--danger); background: #fff2ef; }
.empty-inline { display: grid; place-items: center; min-height: 140px; padding: 24px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
.empty-inline strong, .empty-inline small { display: block; }
.empty-inline small { margin-top: 6px; }
.detail-card { scroll-margin-top: 24px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-header h3 { margin-bottom: 5px; }
.detail-header p:last-child { color: var(--muted); }
.workflow-banner { display: flex; justify-content: space-between; gap: 18px; margin: 18px 0; padding: 15px 17px; border-radius: 14px; color: white; background: linear-gradient(135deg, var(--deep), var(--teal)); }
.workflow-banner strong, .workflow-banner small { display: block; }
.workflow-banner small { color: rgba(255,255,255,.76); text-align: right; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.detail-grid > div { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.detail-grid small, .detail-grid strong { display: block; }
.detail-grid small { margin-bottom: 5px; color: var(--muted); }
.timeline { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.timeline h4 { margin: 0 0 12px; }
.timeline-item { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.timeline-item small { color: var(--muted); text-align: right; }
.step-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step-pill { display: flex; align-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: white; font-size: 12px; }
.step-pill b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #eee9e2; }
.step-pill.done { color: var(--deep); border-color: #c8ae96; background: var(--teal-soft); }
.step-pill.done b { color: white; background: var(--teal); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.action-panel { margin: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.action-panel h4 { margin: 0 0 10px; }
.action-panel p { color: var(--muted); font-size: 13px; }
.action-panel summary { cursor: pointer; font-weight: 800; }
.action-panel[open] summary { margin-bottom: 14px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-text { color: var(--danger); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; }
.filter-chip.active { color: white; border-color: var(--teal); background: var(--teal); }
.notification-list { display: grid; gap: 12px; }
.notification-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; padding: 18px; }
.notification-item.requires-action { border-left: 5px solid var(--deep); }
.notification-item.is-read { background: #f8f3ed; }
.notification-item h3 { margin: 10px 0 9px; }
.notification-item small { display: block; margin-top: 12px; color: var(--muted); }
.notification-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.notification-kind, .unread-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.notification-kind.action { color: white; background: var(--deep); }
.notification-kind.update { color: #365d63; background: #e6eff0; }
.notification-kind.completed { color: #315c3d; background: #e3f2e8; }
.unread-badge { color: #8a4b00; background: #fff0d7; }
.notification-details { display: grid; gap: 6px; margin: 0; }
.notification-details div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.notification-details dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.notification-details dd { margin: 0; line-height: 1.5; }
.notification-actions { display: flex; min-width: 128px; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; }
.notification-actions .secondary-button { min-height: 36px; padding: 7px 10px; }
.notification-secondary-actions { display: flex; justify-content: center; gap: 12px; }
.text-button { padding: 2px; color: var(--muted); background: transparent; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--deep); }
.mini-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; color: var(--teal); background: var(--teal-soft); font-size: 11px; font-weight: 800; }
.metric-list { display: grid; gap: 10px; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.metric-row strong, .metric-row small { display: block; }
.metric-row small { color: var(--muted); }
.availability-status { margin-top: 4px; }
.availability-status.is-open { color: #315c3d; }
.availability-status.is-closed { color: var(--danger); }
.availability-switch[aria-checked="true"] { border-color: #7ca78a; color: #315c3d; background: #edf7f0; }
.availability-switch[aria-checked="false"] { border-color: #c99b95; color: var(--danger); background: #fff7f5; }
.rate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.rate-source-status {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  line-height: 1.65;
}
.rate-source-status.is-warning { border-left-color: var(--danger); background: #fff7f5; }
.rate-source-status strong, .rate-source-status small { display: block; }
.rate-source-status small { color: var(--muted); }
.rate-source-status a { color: var(--deep); font-weight: 800; text-underline-offset: 3px; }

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
}
.primary-button { border: 1px solid var(--deep); color: white; background: var(--deep); }
.primary-button:hover { background: var(--teal); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.section-heading { margin-bottom: 20px; }
.section-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.account-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.account-list-panel { padding: 16px; }
.search-field span, .field span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.account-list { display: grid; gap: 8px; margin-top: 14px; max-height: 68vh; overflow: auto; }
.account-item {
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.account-item:hover, .account-item.active { border-color: #c8ae96; background: var(--teal-soft); }
.account-item strong, .account-item small { display: block; }
.account-item small { margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.account-item .mini-badge { display: inline-block; margin-top: 7px; margin-right: 5px; padding: 2px 7px; border-radius: 999px; color: var(--teal); background: white; font-size: 11px; font-weight: 800; }
.account-editor { padding: 24px; }
.editor-header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.editor-header .status-chip { color: var(--deep); border-color: #c7d8d6; background: var(--teal-soft); }
.field { display: block; margin-bottom: 14px; }
.toggle-field { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.toggle-field input { width: 18px; height: 18px; margin-top: 2px; }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field small { margin-top: 3px; color: var(--muted); }
.permission-intro { margin: 24px 0 12px; }
.permission-intro strong, .permission-intro small { display: block; }
.permission-intro small { margin-top: 5px; color: var(--muted); }
.permission-groups { display: grid; gap: 14px; }
.permission-group { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.permission-group h4 { margin: 0 0 10px; }
.role-function-list { margin: 12px 0 0; padding-left: 20px; color: var(--ink); }
.role-function-list li + li { margin-top: 7px; }
.permission-option { display: flex; gap: 10px; padding: 9px 0; }
.permission-option + .permission-option { border-top: 1px dashed var(--line); }
.permission-option input { width: 18px; height: 18px; margin-top: 2px; }
.permission-option strong, .permission-option small { display: block; }
.permission-option small { margin-top: 3px; color: var(--muted); }
.permission-option.is-disabled { opacity: .5; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.account-empty { min-height: 300px; display: grid; place-content: center; padding: 30px; text-align: center; color: var(--muted); }
.account-empty p { margin-bottom: 0; }
.toast { position: fixed; right: 24px; top: 24px; z-index: 10; max-width: 420px; padding: 13px 16px; border-radius: 12px; color: white; background: var(--deep); box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-user { display: none; }
  .account-layout { grid-template-columns: 1fr; }
  .account-list { max-height: 250px; }
  .case-row { grid-template-columns: 125px minmax(0, 1fr); }
  .receipt-followup-row { grid-template-columns: 125px minmax(0, 1fr); }
  .workbench-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-next, .case-due { grid-column: 2; }
  .receipt-followup-row .case-next, .receipt-followup-row .case-due { grid-column: 2; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: 1fr; }
  .review-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executive-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executive-summary-grid .net-summary { grid-column: span 2; }
  .executive-card-grid { grid-template-columns: 1fr; }
  .executive-trend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .executive-transaction-row { grid-template-columns: 58px minmax(180px, 1fr) 130px; }
  .executive-transaction-row > b { grid-column: 3; }
}

@media (max-width: 640px) {
  .workspace { padding: 22px 16px 40px; }
  .topbar, .section-heading, .hero-card { align-items: stretch; flex-direction: column; }
  .rate-actions { justify-content: stretch; }
  .rate-actions button { flex: 1 1 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .navigation { grid-template-columns: 1fr 1fr; }
  .view-switcher-wrap { width: 100%; }
  .guide-hub-button { width: 100%; justify-content: center; }
  .account-editor { padding: 18px; }
  .login-actions { align-items: stretch; flex-direction: column; }
  .form-grid, .detail-grid, .step-row, .metric-row, .registration-stepper, .choice-grid, .confirmation-grid { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .list-toolbar { grid-template-columns: 1fr; }
  .review-toolbar, .inline-control { grid-template-columns: 1fr; }
  .case-row { grid-template-columns: 1fr; }
  .receipt-followup-row { grid-template-columns: 1fr; }
  .workbench-details { grid-template-columns: 1fr; }
  .case-next, .case-due { grid-column: auto; }
  .receipt-followup-row .case-next, .receipt-followup-row .case-due { grid-column: auto; }
  .detail-header, .workflow-banner { align-items: stretch; flex-direction: column; }
  .notification-item { grid-template-columns: 1fr; }
  .workflow-banner small, .timeline-item small { text-align: left; }
  .notification-actions { justify-content: flex-start; }
  .notification-details div { grid-template-columns: 68px minmax(0, 1fr); }
  .executive-summary-grid { grid-template-columns: 1fr; }
  .executive-summary-grid .net-summary { grid-column: auto; }
  .executive-alert-list { grid-template-columns: 1fr; }
  .executive-disclosure > summary { align-items: flex-start; padding: 18px; }
  .executive-disclosure > :not(summary) { margin-left: 18px; margin-right: 18px; }
  .executive-disclosure > :last-child { margin-bottom: 18px; }
  .executive-card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .future-row { grid-template-columns: 1fr auto; }
  .future-row > div { grid-column: 1 / -1; }
  .future-row time { grid-column: 1; }
  .future-row > b { grid-column: 2; }
  .executive-trend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executive-filter-bar { grid-template-columns: 1fr; }
  .executive-transaction-row { grid-template-columns: 1fr auto; }
  .executive-transaction-row > div { grid-column: 1 / -1; }
  .executive-transaction-row > b { grid-column: 2; grid-row: 1; }
  .executive-result-count { margin-left: 18px !important; margin-right: 18px !important; }
}
.finance-review-panel {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.finance-review-buckets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.finance-review-bucket {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

.finance-review-bucket strong { font-size: 1.8rem; }
.finance-review-bucket small { color: var(--muted); line-height: 1.45; }
.finance-review-bucket.quick { border-color: #c8dccf; }
.finance-review-bucket.exception { border-color: #e7c4b8; }
.finance-review-bucket.active { box-shadow: 0 0 0 3px rgba(114, 13, 29, 0.12); border-color: var(--deep); }

.finance-classification {
  display: block;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.finance-classification.quick { color: #24563b; background: #e8f4ec; }
.finance-classification.exception { color: #8a381f; background: #fff0e9; }

@media (max-width: 700px) {
  .finance-review-buckets { grid-template-columns: 1fr; }
}
