/* LoanDesk prototype — calm lending back office
   Plain CSS only: no imports, external fonts, images, or build step. */

:root {
  /* Ink and surfaces */
  --navy-950: #0a1b24;
  --navy-900: #0f2732;
  --navy-800: #163743;
  --navy-700: #1e4653;
  --page: #f6f3ec;
  --page-deep: #f0ebe1;
  --surface: #ffffff;
  --surface-warm: #fcfaf5;
  --ink: #1c2b31;
  --ink-soft: #3d4e54;
  --muted: #6d7b7d;
  --muted-light: #8b9694;
  --line: #e6e0d5;
  --line-strong: #d5cdc0;

  /* Accents */
  --teal: #0f766e;
  --teal-dark: #0b5c56;
  --teal-bright: #38a99d;
  --teal-soft: #e8f4f1;
  --teal-line: #cbe6df;
  --amber: #b7791f;
  --amber-strong: #96620f;
  --amber-ink: #7a5418;
  --amber-soft: #fdf3dd;
  --amber-line: #efd9a6;
  --rose: #b23b48;
  --rose-dark: #922d39;
  --rose-ink: #8a2532;
  --rose-soft: #fbeaec;
  --rose-line: #f0c8cd;
  --green: #2f7d5d;
  --green-dark: #246349;
  --green-ink: #1f5d43;
  --green-soft: #e9f5ee;
  --green-line: #c8e4d3;
  --info: #2f6f8f;
  --info-ink: #245a75;
  --info-soft: #eaf3f7;
  --info-line: #cbe0ea;

  /* Shape and depth */
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(24, 38, 40, 0.035), 0 8px 24px rgba(24, 38, 40, 0.035);
  --shadow-pop: 0 18px 48px rgba(10, 27, 36, 0.22);
  --focus: #0f766e;

  /* Type */
  --font: "Noto Sans TC", "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------------------------------------------------------------
   Base
   --------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 88% -10%, rgba(15, 118, 110, 0.055), transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

#app {
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

p {
  margin-bottom: 8px;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin-top: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--teal);
  text-decoration: none;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--teal-dark);
}

img,
svg {
  max-width: 100%;
}

svg {
  flex: none;
  vertical-align: middle;
}

strong,
b {
  font-weight: 700;
}

hr {
  border: 0;
}

::selection {
  background: rgba(15, 118, 110, 0.18);
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

:where(input, select, textarea):focus-visible {
  outline: 0;
}

/* Keep keyboard focus visible even on dark chrome. */
.proto-bar :where(a, button):focus-visible,
.sidebar :where(a, button):focus-visible,
.flow-intro :where(a, button):focus-visible {
  outline-color: #8fe0d3;
}

/* ---------------------------------------------------------------
   Prototype bar
   --------------------------------------------------------------- */

.proto-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 52px;
  padding: 6px 20px;
  background: linear-gradient(100deg, #0a1d27 0%, #0e2b35 58%, #103b3a 100%);
  color: #edf5f3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.proto-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.proto-brand svg {
  width: 18px;
  height: 18px;
  color: #75d4c7;
}

.proto-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 8px;
  border: 1px solid rgba(126, 220, 207, 0.35);
  border-radius: 999px;
  background: rgba(56, 169, 157, 0.14);
  color: #a8e8df;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.proto-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.role-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.065);
}

.role-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 7px;
  min-height: 30px;
  padding: 4px 12px;
  background: transparent;
  color: #c6d7d4;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.role-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.role-btn.active {
  background: #f4f7f2;
  color: var(--navy-900);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.proto-link {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: #a9c7c3;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: rgba(169, 199, 195, 0.35);
  cursor: pointer;
}

.proto-link:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

/* ---------------------------------------------------------------
   Staff / admin shell
   --------------------------------------------------------------- */

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 52px);
}

.app-shell.customer {
  display: block;
  min-height: calc(100vh - 52px);
}

.sidebar {
  position: sticky;
  top: 52px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  flex: 0 0 252px;
  width: 252px;
  height: calc(100vh - 52px);
  padding: 22px 14px 16px;
  overflow-y: auto;
  background:
    radial-gradient(380px 260px at 10% 0%, rgba(56, 169, 157, 0.14), transparent 70%),
    linear-gradient(180deg, var(--navy-900) 0%, #0c222c 100%);
  color: #dce8e5;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 20px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sidebar-brand .nav-item-icon {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
}

.sidebar-brand .nav-item-icon svg {
  width: 24px;
  height: 24px;
}

.sidebar-brand svg {
  width: 24px;
  height: 24px;
  color: #6fd0c3;
}

.sidebar-brand .small,
.sidebar-brand .muted {
  color: #8fa8a4;
  font-size: 11.5px;
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b8cac7;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.065);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(56, 169, 157, 0.17);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #5ec6b9;
}

.nav-item-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: currentColor;
  opacity: 0.86;
}

.nav-item-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  color: #a6bbb7;
}

.sidebar-footer .muted {
  color: #94aaa6;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #e1ecea;
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
}

.user-chip strong {
  display: block;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 650;
}

.user-chip .small,
.user-chip .muted {
  color: #9fb4b0;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #dff2ed, #c3e6de);
  color: var(--teal-dark);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 10.5px;
}

.avatar.lg {
  width: 58px;
  height: 58px;
  font-size: 19px;
}

.main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 52px;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 62px;
  padding: 10px 32px;
  background: rgba(246, 243, 236, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar-title {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.main-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}

/* ---------------------------------------------------------------
   Customer shell
   --------------------------------------------------------------- */

.customer-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 52px);
  background: var(--page);
}

.customer-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 15px max(28px, calc((100% - 1080px) / 2));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.customer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--navy-900);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.customer-brand .nav-item-icon {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
}

.customer-brand .nav-item-icon svg {
  width: 22px;
  height: 22px;
}

.customer-brand svg {
  width: 22px;
  height: 22px;
  color: var(--teal);
}

.customer-brand .small,
.customer-brand .muted {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.customer-header .user-chip {
  margin-left: auto;
  padding: 6px 9px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  color: var(--ink);
}

.customer-header .user-chip .small,
.customer-header .user-chip .muted {
  color: var(--muted);
}

.customer-header .customer-nav {
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.customer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 0 max(28px, calc((100% - 1080px) / 2));
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.customer-nav::-webkit-scrollbar {
  display: none;
}

.customer-nav a,
.customer-nav .nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 0;
  padding: 11px 12px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.customer-nav a:hover,
.customer-nav .nav-item:hover {
  background: transparent;
  color: var(--ink);
}

.customer-nav a.active,
.customer-nav a[aria-current="page"],
.customer-nav .nav-item.active {
  background: transparent;
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  box-shadow: none;
}

.customer-nav .nav-item-icon {
  flex-basis: 17px;
  width: 17px;
  height: 17px;
}

.customer-nav .nav-item-icon svg {
  width: 17px;
  height: 17px;
}

.customer-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1128px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}

.bottom-nav {
  display: none;
}

.bottom-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 7px 4px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.bottom-nav-item svg {
  width: 21px;
  height: 21px;
}

.bottom-nav-item .nav-item-icon {
  flex-basis: 21px;
  width: 21px;
  height: 21px;
}

.bottom-nav-item.active {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

/* ---------------------------------------------------------------
   Layout primitives
   --------------------------------------------------------------- */

.screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-width: 0;
  margin-bottom: 2px;
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page-title {
  margin: 3px 0 0;
  color: var(--navy-900);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-sub {
  max-width: 760px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.stack > * {
  margin-top: 0;
  margin-bottom: 0;
}

.row,
.row-between {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.row-between {
  justify-content: space-between;
}

.row-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.grid,
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.divider {
  width: 100%;
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: var(--line);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
  line-height: 1.5;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.nowrap {
  white-space: nowrap;
}

.spacer {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------------------------------------------------------------
   Cards and stats
   --------------------------------------------------------------- */

.card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 18px 20px 15px;
}

.card-head + .card-body {
  border-top: 1px solid rgba(230, 224, 213, 0.7);
}

.card-title {
  margin: 0;
  color: var(--navy-900);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.35;
}

.card-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.card-body {
  min-width: 0;
  padding: 18px 20px;
}

.card-body > :first-child {
  margin-top: 0;
}

.card-body > :last-child {
  margin-bottom: 0;
}

.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: auto;
}

.card.flush .card-body {
  padding: 0;
}

.card.flush .table-wrap {
  border: 0;
  border-radius: 0;
}

.card.flush .data-table th,
.card.flush .data-table td {
  padding-left: 20px;
  padding-right: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  min-width: 0;
}

.stat {
  min-width: 0;
  padding: 15px 17px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.stat-value {
  margin-top: 3px;
  color: var(--navy-900);
  font-size: clamp(18px, 4.6vw, 27px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stat-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.stat.tone-warning {
  border-top: 2px solid var(--amber);
}

.stat.tone-warning .stat-value {
  color: var(--amber-strong);
}

.stat.tone-danger {
  border-top: 2px solid var(--rose);
}

.stat.tone-danger .stat-value {
  color: var(--rose-ink);
}

.stat.tone-success {
  border-top: 2px solid var(--green);
}

.stat.tone-success .stat-value {
  color: var(--green-ink);
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */

.btn,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.05s ease;
}

.btn svg,
.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn:hover,
.btn-icon:hover {
  background: #fbf8f2;
  border-color: #c5bcad;
  color: var(--ink);
}

.btn:active,
.btn-icon:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn-icon:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.18);
}

.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-secondary:hover {
  background: var(--surface-warm);
  border-color: #c3b9a9;
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: #f1ece3;
  border-color: transparent;
  color: var(--ink);
}

.btn-danger {
  background: var(--rose);
  border-color: var(--rose);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(178, 59, 72, 0.16);
}

.btn-danger:hover {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
  color: #ffffff;
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  gap: 5px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

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

/* ---------------------------------------------------------------
   Pills
   --------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.55;
  white-space: nowrap;
}

.pill-neutral {
  background: #f2eee7;
  border-color: #e4ddd1;
  color: #596365;
}

.pill-success {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green-ink);
}

.pill-warning {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  color: var(--amber-ink);
}

.pill-danger {
  background: var(--rose-soft);
  border-color: var(--rose-line);
  color: var(--rose-ink);
}

.pill-info {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info-ink);
}

.pill-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.data-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.data-table th {
  padding: 10px 14px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f0ebe2;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fcfaf6;
}

.data-table tr.clickable {
  cursor: pointer;
}

.data-table tr.clickable:hover td {
  background: #f3faf7;
}

.data-table tr.clickable:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--teal-bright);
}

.data-table .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: right;
  white-space: nowrap;
}

.data-table .input {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12.5px;
}

.data-table .checkbox {
  align-items: center;
  justify-content: center;
}

.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.table-empty {
  padding: 30px 18px !important;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------------------------------------------------------------
   Tabs
   --------------------------------------------------------------- */

.tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 10px 12px 11px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.tab:hover {
  color: var(--ink);
  background: rgba(15, 118, 110, 0.035);
}

.tab.active {
  color: var(--navy-900);
  border-bottom-color: var(--teal);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f0ece3;
  color: #6f7777;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.tab.active .tab-count {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px 16px;
  min-width: 0;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label:not(.checkbox):not(.radio-card) {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
}

.field .help {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.input,
.select,
.textarea,
.search-input,
.filter-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid #d8d2c7;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.input::placeholder,
.textarea::placeholder,
.search-input::placeholder {
  color: #9ba4a2;
}

.input:hover,
.select:hover,
.textarea:hover,
.search-input:hover,
.filter-select:hover {
  border-color: #c3bbad;
}

.input:focus,
.select:focus,
.textarea:focus,
.search-input:focus,
.filter-select:focus {
  outline: 0;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
  background: #ffffff;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: #f4f0e9;
  color: var(--muted);
  cursor: not-allowed;
}

.select {
  padding-right: 32px;
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.field > input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field > select,
.field > textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid #d8d2c7;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.field > textarea {
  min-height: 104px;
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.checkbox input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--teal);
  cursor: pointer;
}

.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  min-width: 0;
}

.radio-card {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  column-gap: 9px;
  row-gap: 1px;
  min-width: 0;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.radio-card:hover {
  background: var(--surface-warm);
  border-color: #b9c9c5;
}

.radio-card.active,
.radio-card:has(input:checked) {
  background: rgba(232, 244, 241, 0.62);
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.28);
}

.radio-card > input {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.radio-card > input:focus-visible,
.checkbox input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.radio-card:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.checkbox:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.radio-card > span:not(.radio-card-title):not(.radio-card-desc) {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

.radio-card-title {
  grid-column: 2;
  grid-row: 1;
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.radio-card-desc {
  grid-column: 2;
  grid-row: 2;
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.file-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 9px 12px;
  padding: 11px 13px;
  background: var(--surface-warm);
  border: 1px dashed #cfc7b9;
  border-radius: 11px;
}

.file-row input[type="file"] {
  flex: 1 1 190px;
  width: auto;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 12px;
  color: var(--muted);
}

.file-row input[type="file"]:focus {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  box-shadow: none;
}

.file-name {
  flex: 1 1 180px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.error-text {
  color: var(--rose-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

/* ---------------------------------------------------------------
   Schedule editor
   --------------------------------------------------------------- */

.schedule-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  padding: 13px 15px;
  background: linear-gradient(180deg, #f2f9f6, #eef6f3);
  border: 1px solid var(--teal-line);
  border-radius: 12px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.summary-row.total {
  margin-top: 3px;
  padding-top: 7px;
  border-top: 1px dashed #b9d6cf;
  color: var(--navy-900);
  font-size: 13.5px;
  font-weight: 700;
}

.summary-label {
  color: var(--muted);
}

.summary-row.total .summary-label {
  color: var(--navy-900);
}

.summary-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 650;
  white-space: nowrap;
}

.schedule-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.45;
}

.schedule-table th {
  padding: 8px 9px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.schedule-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #f0ebe2;
  vertical-align: middle;
}

.schedule-table tbody tr:last-child td {
  border-bottom: 0;
}

.schedule-table .num,
.schedule-table td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.schedule-input {
  width: 100%;
  min-width: 78px;
  min-height: 36px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid #d8d2c7;
  border-radius: 8px;
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.schedule-input[type="date"] {
  text-align: left;
}

.schedule-input:focus {
  outline: 0;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

/* ---------------------------------------------------------------
   Loan cards and progress
   --------------------------------------------------------------- */

.loan-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.loan-card {
  min-width: 0;
  padding: 16px 18px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.loan-card:hover {
  border-color: #d2dbd6;
  box-shadow: 0 2px 4px rgba(24, 38, 40, 0.04), 0 12px 30px rgba(24, 38, 40, 0.06);
}

.card .loan-card {
  background: var(--surface-warm);
  box-shadow: none;
}

.card .loan-card:hover {
  background: var(--surface);
}

.loan-card-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  min-width: 0;
}

.loan-card-head h3 {
  color: var(--navy-900);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.loan-card-head .pill {
  margin-top: 1px;
}

.loan-card-head .loan-meta {
  margin: 6px 0 0;
}

.loan-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin: 9px 0 11px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.loan-meta strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: #ece7dd;
  border-radius: 999px;
}

.progress-bar {
  height: 100%;
  min-width: 2px;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: inherit;
  transition: width 0.3s ease;
}

.progress-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

/* ---------------------------------------------------------------
   Timeline
   --------------------------------------------------------------- */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  min-width: 0;
  padding: 0 0 18px 26px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  top: 4px;
  left: 0;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.timeline-content {
  min-width: 0;
}

.timeline-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.timeline-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.timeline-detail {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------
   Consent and evidence
   --------------------------------------------------------------- */

.consent-card {
  min-width: 0;
  padding: 17px 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.consent-card + .consent-card {
  margin-top: 12px;
}

.consent-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
}

.consent-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  white-space: nowrap;
}

.consent-status .pill {
  font-size: 12px;
}

.ref-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
}

.ref-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e3f1ed;
  color: var(--teal-dark);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ref-avatar .avatar {
  width: 32px;
  height: 32px;
  background: transparent;
  color: inherit;
  font-size: 11.5px;
}

.ref-item .stack {
  gap: 2px;
}

.map-placeholder {
  position: relative;
  min-height: 188px;
  margin-top: 12px;
  overflow: hidden;
  background: linear-gradient(155deg, #e9f0e6 0%, #dfeae0 55%, #e7eee4 100%);
  border: 1px solid #d3e0d5;
  border-radius: 14px;
}

.card-body > .map-placeholder:first-child {
  margin-top: 0;
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image:
    linear-gradient(118deg, transparent 41%, rgba(255, 255, 255, 0.68) 41%, rgba(255, 255, 255, 0.68) 44.5%, transparent 44.5%),
    linear-gradient(24deg, transparent 61%, rgba(255, 255, 255, 0.5) 61%, rgba(255, 255, 255, 0.5) 64%, transparent 64%),
    linear-gradient(90deg, transparent 72%, rgba(255, 255, 255, 0.42) 72%, rgba(255, 255, 255, 0.42) 74%, transparent 74%),
    repeating-linear-gradient(0deg, rgba(81, 111, 91, 0.1) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(81, 111, 91, 0.1) 0 1px, transparent 1px 24px);
}

.map-pin {
  position: absolute;
  top: 43%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  color: var(--rose);
  filter: drop-shadow(0 4px 6px rgba(96, 30, 38, 0.24));
  transform: translate(-50%, -50%);
}

.map-pin svg {
  width: 30px;
  height: 30px;
}

.map-pin::after {
  content: "";
  position: absolute;
  top: 31px;
  left: 50%;
  z-index: -1;
  width: 22px;
  height: 7px;
  border-radius: 50%;
  background: rgba(96, 30, 38, 0.18);
  transform: translateX(-50%);
}

.capture-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.capture-row:first-of-type,
.map-placeholder + .capture-row {
  margin-top: 10px;
}

.capture-row .btn {
  margin-top: 0;
}

.map-placeholder .capture-row {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  margin: 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(211, 224, 213, 0.9);
  backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------------
   Wallet
   --------------------------------------------------------------- */

.wallet-card {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  background:
    radial-gradient(420px 240px at 95% -10%, rgba(104, 213, 199, 0.24), transparent 62%),
    linear-gradient(135deg, #0c2833 0%, #10433f 58%, #0f5c53 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  color: #f2f8f6;
  box-shadow: 0 10px 30px rgba(10, 39, 47, 0.2);
}

.wallet-card::before {
  content: "";
  position: absolute;
  top: -74px;
  right: -44px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.wallet-card::after {
  content: "";
  position: absolute;
  top: -38px;
  right: -8px;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.wallet-card > * {
  position: relative;
  z-index: 1;
}

.wallet-label {
  color: rgba(230, 245, 242, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wallet-balance {
  margin: 4px 0 6px;
  color: #ffffff;
  font-size: clamp(27px, 4vw, 34px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.wallet-note {
  max-width: 540px;
  color: rgba(235, 247, 244, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
  border-top: 1px solid var(--line);
}

.wallet-list > * {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
}

.wallet-list > *:last-child {
  border-bottom: 0;
}

.wallet-card .wallet-list {
  border-top-color: rgba(255, 255, 255, 0.16);
}

.wallet-card .wallet-list > * {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: rgba(242, 249, 247, 0.86);
}

.wallet-card .wallet-list strong {
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------
   Banners, empty states, toast
   --------------------------------------------------------------- */

.banner {
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.banner strong,
.banner b,
.banner .card-title {
  display: block;
  margin: 0 0 2px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.banner p {
  margin: 2px 0 0;
}

.banner .small {
  color: inherit;
  opacity: 0.88;
}

.banner a {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
}

.banner .btn-row {
  margin-top: 9px;
}

.banner .btn {
  margin-top: 0;
}

.banner-info {
  background: var(--info-soft);
  border-color: var(--info-line);
  border-left-color: var(--info);
  color: var(--info-ink);
}

.banner-info strong,
.banner-info b {
  color: #17445a;
}

.banner-warning {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  border-left-color: var(--amber);
  color: var(--amber-ink);
}

.banner-warning strong,
.banner-warning b {
  color: #6b4810;
}

.banner-danger {
  background: var(--rose-soft);
  border-color: var(--rose-line);
  border-left-color: var(--rose);
  color: var(--rose-ink);
}

.banner-danger strong,
.banner-danger b {
  color: #77212b;
}

.empty-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 42px 22px;
  background: var(--surface-warm);
  border: 1px dashed #d7cfc2;
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 11px;
  border-radius: 14px;
  background: #f0ece3;
  color: #968b7b;
}

.empty-icon svg {
  width: 23px;
  height: 23px;
}

.empty-state h3,
.empty-state .card-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.empty-state p {
  max-width: 430px;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
}

.empty-state .btn-row {
  margin-top: 13px;
}

.empty-state .btn {
  margin-top: 0;
}

#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  padding: 11px 15px;
  visibility: hidden;
  opacity: 0;
  background: #14232c;
  border-left: 4px solid var(--teal-bright);
  border-radius: 11px;
  box-shadow: var(--shadow-pop);
  color: #f2f8f6;
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: auto;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-left-color: #6bd3a2;
}

.toast.danger {
  border-left-color: #f08a95;
}

/* ---------------------------------------------------------------
   Flow map
   --------------------------------------------------------------- */

.flow-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  min-width: 0;
}

.flow-intro {
  position: relative;
  overflow: hidden;
  padding: 25px 27px;
  background:
    radial-gradient(460px 260px at 94% -20%, rgba(107, 211, 197, 0.22), transparent 66%),
    linear-gradient(128deg, #0d2732 0%, #113f3b 62%, #0f574e 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  color: #f1f8f6;
  box-shadow: 0 14px 38px rgba(13, 39, 50, 0.16);
}

.flow-intro::after {
  content: "";
  position: absolute;
  top: -96px;
  right: -58px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.flow-intro > * {
  position: relative;
  z-index: 1;
}

.flow-intro .eyebrow {
  color: #8fe0d3;
}

.flow-intro .page-head {
  margin: 0;
}

.flow-intro .page-title {
  color: #ffffff;
}

.flow-intro .page-sub {
  color: rgba(232, 245, 241, 0.76);
}

.flow-intro .muted,
.flow-intro .small {
  color: rgba(232, 245, 241, 0.7);
}

.flow-intro .page-actions {
  margin-top: 0;
}

.flow-intro .page-head + .btn-row,
.flow-intro .page-head + p,
.flow-intro .page-head + .small {
  margin-top: 10px;
}

.flow-intro .btn-primary {
  background: #ecf7f4;
  border-color: #ecf7f4;
  color: #0b4c47;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

.flow-intro .btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #093c38;
}

.flow-intro .btn-secondary,
.flow-intro .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #eaf6f3;
}

.flow-intro .btn-secondary:hover,
.flow-intro .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.flow-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.flow-lane {
  min-width: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.flow-lane-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 2px 10px;
  border-bottom: 2px solid var(--teal-soft);
  color: var(--navy-900);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}

.flow-lane-title svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
}

.flow-lane:nth-child(2) .flow-lane-title {
  border-bottom-color: var(--amber-soft);
}

.flow-lane:nth-child(2) .flow-lane-title svg {
  color: var(--amber);
}

.flow-lane:nth-child(3) .flow-lane-title {
  border-bottom-color: var(--info-soft);
}

.flow-lane:nth-child(3) .flow-lane-title svg {
  color: var(--info);
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.flow-step {
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 11px;
  break-inside: avoid;
  page-break-inside: avoid;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.flow-step:hover {
  background: var(--surface);
  border-color: #cfdcd8;
}

.flow-step-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.flow-step-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.flow-step-body {
  min-width: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.flow-step-body h3,
.flow-step-body > strong {
  display: block;
  margin: 0 0 1px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.flow-step-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.flow-step-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.45;
}

.flow-step-actions > a:not(.btn),
.flow-step-actions > button:not(.btn) {
  padding: 0;
  background: none;
  border: 0;
  color: var(--teal-dark);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.flow-step-actions > a:not(.btn):hover,
.flow-step-actions > button:not(.btn):hover {
  color: var(--teal);
  text-decoration: underline;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8px;
  margin: -1px 0;
  color: #b7ad9e;
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

.flow-arrow svg {
  width: 15px;
  height: 15px;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
}

.check-box {
  display: inline-grid;
  place-content: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1.5px solid #b9b1a4;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.check-box::before {
  content: "";
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.12s ease;
}

.check-box:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.check-box:checked::before {
  transform: rotate(-45deg) scale(1);
}

.check-box:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.open-decision {
  padding: 16px 18px;
  background: linear-gradient(180deg, #fff9ec, var(--amber-soft));
  border: 1px solid var(--amber-line);
  border-radius: 14px;
  color: #6e4d16;
  font-size: 12.5px;
  line-height: 1.55;
}

.open-decision-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--amber-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.open-decision p {
  margin: 3px 0 0;
}

.print-only {
  display: none;
}

/* ---------------------------------------------------------------
   Misc controls
   --------------------------------------------------------------- */

.search-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.search-input {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 460px;
}

.filter-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 168px;
}

.no-print {
  /* Deliberately only removed in print. */
}

.hidden,
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------------------------------------------------------------
   Responsive: desktop-first staff, mobile-first customer
   --------------------------------------------------------------- */

@media (max-width: 1180px) {
  .flow-lanes {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-arrow {
    display: none;
  }
}

@media (max-width: 1100px) {
  .main-content {
    padding: 24px 24px 44px;
  }

  .stat-grid,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-head {
    padding: 16px 18px 14px;
  }

  .card-body {
    padding: 16px 18px;
  }

  .page-title {
    font-size: 26px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    min-height: calc(100vh - 52px);
  }

  .sidebar {
    position: static;
    z-index: 25;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: auto;
    padding: 9px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-brand,
  .sidebar-footer {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 3px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .nav-item.active {
    box-shadow: inset 0 -2px 0 #5ec6b9;
  }

  .nav-item-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
  }

  .nav-item-icon svg {
    width: 16px;
    height: 16px;
  }

  .topbar {
    position: static;
    min-height: 54px;
    padding: 9px 18px;
  }

  .main-content {
    padding: 20px 18px 40px;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-title {
    font-size: 25px;
  }

  .customer-nav {
    display: none;
  }

  .customer-content {
    padding: 20px 18px calc(104px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(24, 38, 40, 0.07);
    backdrop-filter: blur(10px);
  }

  #toast-root {
    right: 14px;
    bottom: 82px;
    left: 14px;
    align-items: stretch;
    max-width: none;
  }

  .flow-steps {
    grid-template-columns: 1fr;
  }

  .flow-intro {
    padding: 22px;
  }
}

@media (max-width: 760px) {
  .proto-bar {
    padding: 7px 14px;
    gap: 8px 10px;
  }

  .proto-brand {
    font-size: 13px;
  }

  .proto-badge {
    min-height: 18px;
    font-size: 10px;
  }

  .role-btn {
    padding: 4px 10px;
    font-size: 12px;
  }

  .customer-header {
    padding: 13px 18px;
  }

  .customer-brand {
    font-size: 18px;
  }

  .customer-content {
    padding: 18px 14px calc(104px + env(safe-area-inset-bottom));
  }

  .main-content {
    padding: 18px 14px 36px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-sub {
    font-size: 13px;
  }

  .stat-grid {
    gap: 10px;
  }

  .stat {
    padding: 13px 14px 14px;
  }

  .stat-label {
    font-size: 11.5px;
  }

  .stat-sub {
    font-size: 11px;
  }

  .card-head {
    padding: 15px 16px 13px;
  }

  .card-body {
    padding: 15px 16px;
  }

  .card.flush .data-table th,
  .card.flush .data-table td {
    padding-left: 16px;
    padding-right: 16px;
  }

  .data-table {
    min-width: 660px;
    font-size: 12.5px;
  }

  .data-table th {
    padding: 9px 12px;
  }

  .data-table td {
    padding: 10px 12px;
  }

  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .search-input,
  .filter-select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .radio-cards {
    grid-template-columns: 1fr;
  }

  .form-grid.two,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .flow-lane {
    padding: 13px;
  }

  .checklist {
    grid-template-columns: 1fr;
  }

  .flow-intro {
    padding: 19px;
    border-radius: 15px;
  }

  .flow-intro .page-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .flow-intro .btn-row .btn {
    flex: 1 1 auto;
  }

  .wallet-card {
    padding: 20px;
  }

  .consent-card {
    padding: 15px 16px;
  }

  .loan-card {
    padding: 15px 16px;
  }

  .page-actions {
    justify-content: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .proto-badge,
  .proto-link {
    display: none;
  }

  .proto-actions {
    margin-left: auto;
    gap: 6px;
  }

  .role-switch {
    padding: 2px;
  }

  .role-btn {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .sidebar {
    padding: 7px 10px;
  }

  .nav-item {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
    gap: 6px;
  }

  .nav-item-icon {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
  }

  .nav-item-icon svg {
    width: 15px;
    height: 15px;
  }

  .topbar {
    padding: 8px 14px;
    gap: 6px 10px;
  }

  .topbar-title {
    font-size: 13.5px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .page-head {
    display: block;
  }

  .page-actions {
    margin-top: 11px;
  }

  .flow-intro .page-actions {
    margin-top: 11px;
  }

  .page-title {
    font-size: 23px;
  }

  .card-head {
    display: block;
  }

  .card-actions {
    margin-left: 0;
    margin-top: 8px;
    justify-content: flex-start;
  }

  .card-body {
    padding: 14px 15px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .btn-row .btn {
    flex: 1 1 auto;
  }

  .row {
    align-items: flex-start;
  }

  .loan-card-head {
    display: block;
  }

  .loan-card-head .pill {
    margin-top: 5px;
  }

  .schedule-summary {
    padding: 11px 12px;
  }

  .summary-row {
    font-size: 12px;
  }

  .schedule-table {
    min-width: 0;
    font-size: 10.5px;
    table-layout: auto;
  }

  .schedule-table th,
  .schedule-table td,
  .card.flush .schedule-table th,
  .card.flush .schedule-table td {
    padding: 5px 4px;
  }

  .schedule-table th:first-child,
  .schedule-table td:first-child,
  .card.flush .schedule-table th:first-child,
  .card.flush .schedule-table td:first-child {
    padding-left: 6px;
  }

  .schedule-table th:last-child,
  .schedule-table td:last-child,
  .card.flush .schedule-table th:last-child,
  .card.flush .schedule-table td:last-child {
    padding-right: 6px;
  }

  .schedule-table th:nth-child(2),
  .schedule-table td:nth-child(2) {
    white-space: nowrap;
  }

  .schedule-table .pill {
    padding: 1px 6px;
    font-size: 10px;
  }

  .schedule-input {
    min-width: 62px;
    min-height: 33px;
    padding: 5px 6px;
    font-size: 11.5px;
  }

  .timeline-item {
    padding-left: 23px;
  }

  .wallet-balance {
    font-size: 28px;
  }

  .wallet-note {
    font-size: 11.5px;
  }

  .empty-state {
    padding: 34px 16px;
  }

  .banner {
    padding: 11px 13px;
  }

  .flow-lane-title {
    font-size: 14px;
  }

  .flow-step {
    padding: 10px 11px;
  }

  .check-item {
    padding: 8px 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------------------------------------------------------------
   Print — clean flow hand-out, no app chrome
   --------------------------------------------------------------- */

@media print {
  @page {
    size: A4 portrait;
    margin: 13mm;
  }

  html,
  body {
    min-width: 0;
    min-height: 0 !important;
    background: #ffffff !important;
    color: #111111;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #app {
    min-height: 0 !important;
  }

  .proto-bar,
  .sidebar,
  .topbar,
  .customer-nav,
  .bottom-nav,
  .no-print,
  #toast-root,
  .toast {
    display: none !important;
  }

  .print-only {
    display: block !important;
    color: #444444 !important;
  }

  .app-shell,
  .app-shell.customer,
  .main,
  .main-content,
  .customer-shell,
  .customer-content {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .screen {
    display: block !important;
  }

  .screen > * + * {
    margin-top: 4mm;
  }

  .page-head {
    display: block;
  }

  .page-actions {
    display: none !important;
  }

  .page-title {
    color: #111111;
    font-size: 18pt;
  }

  .page-sub {
    color: #333333;
    font-size: 9pt;
  }

  .eyebrow {
    color: #444444;
    font-size: 8pt;
  }

  .flow-page {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .flow-intro {
    margin-bottom: 0;
    padding: 5mm;
    overflow: visible;
    background: #ffffff !important;
    border: 1px solid #bbbbbb;
    border-radius: 4px;
    box-shadow: none;
    color: #111111;
  }

  .flow-intro::after {
    display: none;
  }

  .flow-intro .page-title,
  .flow-intro .eyebrow,
  .flow-intro .page-sub {
    color: #111111 !important;
  }

  .flow-intro .btn,
  .flow-intro .page-actions,
  .flow-step-actions {
    display: none !important;
  }

  .flow-lanes {
    display: block;
  }

  .flow-page > .flow-lanes,
  .flow-page > .card,
  .flow-page > .open-decision,
  .flow-page > .print-only:last-child {
    margin-top: 4mm;
  }

  .flow-page > .print-only:first-child {
    margin-bottom: 2mm;
  }

  .flow-lane {
    margin-bottom: 4mm;
    padding: 0;
    overflow: hidden;
    background: #ffffff !important;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .flow-lane:last-child {
    margin-bottom: 0;
  }

  .flow-lane-title {
    margin: 0;
    padding: 2.5mm 3.5mm;
    border-bottom: 1px solid #cccccc;
    color: #111111;
    font-size: 11pt;
  }

  .flow-lane-title svg {
    color: #333333;
  }

  .flow-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2mm;
    padding: 3mm;
  }

  .flow-step {
    padding: 2.2mm 2.6mm;
    background: #ffffff !important;
    border: 1px solid #dddddd;
    border-radius: 3px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .flow-step-num {
    width: 5.5mm;
    height: 5.5mm;
    background: #ffffff;
    border: 1px solid #666666;
    color: #111111;
    font-size: 8pt;
  }

  .flow-step-body {
    color: #333333;
    font-size: 9pt;
  }

  .flow-step-body h3 {
    color: #111111;
    font-size: 9.5pt;
  }

  .flow-step-body p {
    color: #333333;
    font-size: 8.5pt;
  }

  .flow-arrow {
    display: none;
  }

  .checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 6mm;
  }

  .check-item {
    padding: 1.8mm 0;
    border-bottom: 1px solid #dddddd;
    color: #111111;
    font-size: 9pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .check-item .small,
  .check-item .muted {
    color: #444444;
  }

  .flow-step-body > strong {
    color: #111111;
  }

  .check-box {
    width: 4.2mm;
    height: 4.2mm;
    border: 1px solid #555555;
    border-radius: 1mm;
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .check-box:checked {
    background: #111111;
    border-color: #111111;
  }

  .open-decision {
    background: #ffffff !important;
    border: 1px solid #aaaaaa;
    border-radius: 4px;
    color: #222222;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .open-decision-title {
    color: #111111;
  }

  .card,
  .stat,
  .loan-card,
  .consent-card,
  .wallet-card,
  .banner,
  .empty-state,
  .timeline,
  .timeline-item {
    background: #ffffff !important;
    border-color: #bbbbbb;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card-head,
  .card-body {
    padding: 3mm 4mm;
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2mm;
  }

  .stat {
    padding: 2.5mm 3mm;
  }

  .stat-value {
    color: #111111;
    font-size: 12pt;
  }

  .stat-label,
  .stat-sub {
    color: #444444;
  }

  .wallet-card {
    color: #111111;
    background: #ffffff !important;
  }

  .wallet-label,
  .wallet-note,
  .wallet-card .wallet-list > * {
    color: #333333 !important;
    border-color: #dddddd !important;
  }

  .wallet-balance {
    color: #111111;
    font-size: 18pt;
  }

  .timeline-item::before {
    background: #cccccc;
  }

  .timeline-dot {
    border-color: #444444;
    background: #ffffff;
    box-shadow: none;
  }

  .timeline-title,
  .timeline-detail,
  .timeline-meta {
    color: #222222;
  }

  .table-wrap {
    overflow: visible;
    border: 1px solid #bbbbbb;
    border-radius: 3px;
  }

  .data-table {
    min-width: 0;
    font-size: 8.5pt;
  }

  .data-table th,
  .data-table td {
    padding: 1.8mm 2.3mm;
    border-color: #dddddd;
  }

  .data-table th {
    background: #f4f4f4;
    color: #333333;
  }

  .schedule-table {
    font-size: 8.5pt;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 1.5mm 2mm;
  }

  .schedule-summary {
    background: #ffffff;
    border-color: #bbbbbb;
  }

  a {
    color: #111111;
    text-decoration: none;
  }

  .proto-badge {
    display: none !important;
  }
}

/* Owner questionnaire */
.q-page { display: grid; gap: 20px; max-width: 1080px; margin: 0 auto; }
.q-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.q-section { scroll-margin-top: 88px; }
.q-list { margin: 0; padding-left: 1.35rem; display: grid; gap: 10px; }
.q-list li { line-height: 1.65; }
.q-list li::marker { color: var(--accent); font-weight: 700; }
.q-section .field { margin-top: 4px; }

@media print {
  .q-toc, .q-page .no-print { display: none !important; }
  .q-section { break-inside: avoid; }
  .q-list { gap: 4px; }
}
