:root {
  color-scheme: light;
  --brand: #217346;
  --brand-hover: #185a37;
  --ink: #192a22;
  --brand-outline: #39805a;
  --brand-accent: #84b698;
  --brand-soft: #e1f0e6;
  --paper: #fff;
  --canvas: #f5f5f6;
  --surface-muted: #f8f9f9;
  --text-muted: #535c57;
  --line: #e3e6e4;
  --line-strong: #d2d8d4;
  --red: #a92538;
  --red-line: #efcbcf;
  --red-soft: #fff1f2;
  --green: #22634a;
  --green-soft: #ebf7ef;
  --amber: #805017;
  --amber-soft: #fff3dd;
  --shadow: 0 1px 2px #192a2206, 0 3px 10px #192a2204;
  --sidebar-width: 15rem;
  font: 400 1rem/1.55 "Readex Pro", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .56; }
a { color: var(--brand); text-underline-offset: .2em; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; display: block; }
p, h1, h2, h3, h4 { margin: 0; }
ul, ol { margin-block: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand-outline); outline-offset: 3px; }
::selection { color: var(--ink); background: var(--brand-soft); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon, .btn svg, .nav-link svg {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
  vertical-align: -.2em;
}
button > .icon:only-child { display: block; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  height: 100dvh;
  min-height: 0;
  padding: 1.35rem .9rem 1rem;
  border-right: 1px solid var(--line);
  background: var(--paper);
  overflow-y: auto;
}
.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}
a.brand:hover { color: var(--ink); }
.sidebar .brand { margin: 0 .3rem 1.65rem; }
.brand img { width: 100%; height: auto; }
.sidebar .brand { width: calc(100% - .6rem); }
.sidebar-label {
  display: block;
  margin: 0 .65rem .2rem;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
}
.nav-list {
  display: grid;
  align-content: start;
  gap: .2rem;
  padding: 0;
  list-style: none;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 2.7rem;
  padding: .55rem .65rem;
  border: 0;
  border-radius: .65rem;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}
.nav-link:where(:hover, :focus-visible) { color: var(--brand); background: var(--surface-muted); }
.nav-link[aria-current]:not([aria-current="false"]), .nav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}
.sidebar-footer {
  display: grid;
  gap: .85rem;
  margin-top: auto;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  padding: .85rem .48rem .15rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: .82rem;
  text-decoration: none;
}
.user-chip:hover { color: var(--brand); }
.user-chip > :not(.avatar) { min-width: 0; }
.user-chip :is(strong, small) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip small { color: var(--text-muted); font-size: .75rem; }
.avatar {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  border-radius: 36%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}
.sidebar-scrim, .mobile-menu { display: none !important; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.2rem;
  padding: .65rem clamp(1rem, 2.65vw, 2.8rem);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.topbar-start, .topbar-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: .86rem;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }
.breadcrumb svg { width: .85rem; height: .85rem; }
.topbar-actions > :not(.btn) { color: var(--text-muted); font-size: .86rem; }
.workspace-date { display: inline-flex; align-items: center; gap: .43rem; white-space: nowrap; }
.workspace-date .icon { width: 1rem; height: 1rem; color: var(--brand); }
.page-content {
  width: 100%;
  max-width: 109rem;
  margin-inline: auto;
  padding: clamp(1.4rem, 3.2vw, 3rem) clamp(1rem, 2.65vw, 2.8rem) 3.5rem;
}
.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.65rem;
}
.page-intro { min-width: 0; }
.eyebrow { margin-bottom: .4rem; color: var(--brand); font-size: .82rem; font-weight: 650; }
.page-header h1 {
  margin-bottom: .35rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.8rem, 2.7vw, 2.65rem);
  line-height: 1.13;
  letter-spacing: -.05em;
}
.page-description { max-width: 48rem; color: var(--text-muted); }
.page-actions, .panel-actions, .empty-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
}
.pdf-downloads { display: inline-flex; align-items: center; gap: .45rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .47rem;
  min-height: 2.65rem;
  padding: .53rem .88rem;
  border: 1px solid transparent;
  border-radius: .63rem;
  color: var(--ink);
  background: transparent;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn-primary { color: var(--paper); background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { color: var(--paper); background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-secondary { color: var(--ink); background: var(--paper); border-color: var(--line-strong); }
.btn-secondary:hover { color: var(--brand); background: var(--surface-muted); border-color: var(--brand-accent); }
.btn-ghost { color: var(--brand); }
.btn-ghost:hover { color: var(--brand-hover); background: var(--brand-soft); }
.btn-danger { color: var(--paper); background: var(--red); border-color: var(--red); }
.btn-danger:hover { color: var(--paper); background: #8e1b2b; border-color: #8e1b2b; }
.btn-small { min-height: 2.15rem; padding: .37rem .62rem; }
.btn-small .icon { width: .98rem; height: .98rem; }
.btn:disabled:hover { filter: none; }

.team-panel { margin-top: 1rem; }
.team-invitation { border-block-start: 1px solid var(--line); }
.team-invitation label { display: block; margin-bottom: .45rem; overflow-wrap: anywhere; }
.team-invite-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.team-invite-actions input { flex: 1 1 15rem; min-width: 0; }
.team-list { margin: 0; padding: 0; list-style: none; }
.team-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .85rem 1.15rem; border-top: 1px solid var(--line); }
.team-list li > div { min-width: 0; overflow-wrap: anywhere; }
.auth-invitation-link { display: inline-block; margin-top: 1rem; }
.balance-breakdown { margin-bottom: 1.15rem; }
.balance-breakdown > summary { cursor: pointer; font-weight: 600; padding: .9rem 1.15rem; }
.balance-breakdown > summary::marker { color: var(--brand); }
.balance-breakdown > p { margin: 0; padding: 0 1.15rem .85rem; color: var(--text-muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.btn-renewal { color: var(--ink); background: var(--surface, #fff); }
.btn-renewal[aria-pressed="true"] { color: #fff; background: #176748; border-color: #176748; }
.btn-renewal[aria-pressed="true"]:hover { background: #10553b; border-color: #10553b; }
.stat-card {
  position: relative;
  min-width: 0;
  min-height: 9.65rem;
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .92rem;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat-card:first-child {
  border-color: #d5e5da;
  background: linear-gradient(140deg, var(--paper) 40%, var(--surface-muted) 100%);
}
.stat-card:first-child::after {
  position: absolute;
  right: -.95rem;
  bottom: -2.5rem;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 1.2rem;
  background: var(--brand-soft);
  transform: rotate(45deg);
  opacity: .67;
  pointer-events: none;
  content: "";
}
.stat-card > * { position: relative; z-index: 1; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: .55rem; margin-bottom: .67rem; }
.stat-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .58rem;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat-icon .icon { width: 1rem; height: 1rem; }
.stat-green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-blue .stat-icon { background: #edf4f4; color: #35646a; }
.stat-label { color: var(--text-muted); font-size: .875rem; font-weight: 520; line-height: 1.25; }
.stat-value {
  font-size: clamp(1.2rem, 2vw, 1.78rem);
  font-weight: 700;
  letter-spacing: -.047em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.stat-foot { margin-top: .45rem; color: var(--text-muted); font-size: .78rem; }
.money-stack { display: inline-grid; align-items: center; gap: .1em; font-variant-numeric: tabular-nums; }
.currency { font-size: .78em; font-weight: 550; }
.stat-value .currency { margin-left: .1em; color: var(--text-muted); font-size: .6em; letter-spacing: 0; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, .38fr);
  gap: 1rem;
  align-items: start;
}
.panel, .profile-card, .service-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .92rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel-header, .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1rem;
}
.panel-header { padding: 1.1rem 1.15rem .92rem; }
.panel-heading { min-width: 0; }
.panel-heading h2, h2.panel-heading, .section-header h2 {
  color: var(--ink);
  font-size: 1.13rem;
  line-height: 1.3;
  letter-spacing: -.025em;
}
.panel-heading p, .section-header p { margin-top: .23rem; color: var(--text-muted); font-size: .875rem; }
.panel-header .btn-small { margin-block: -.13rem; }
.section-stack { display: grid; gap: 1.15rem; align-items: start; }
.section-stack + .panel, .deleted-services + .panel { margin-top: 1.15rem; }
.section-header { margin-top: .3rem; }
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .15rem;
  width: fit-content;
  max-width: 100%;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: .62rem;
  background: var(--surface-muted);
}
.segment {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  padding: .32rem .65rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.2;
  white-space: nowrap;
}
.segment:hover { background: var(--brand-soft); color: var(--brand); }
.segment[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--paper);
  color: var(--brand);
  box-shadow: var(--shadow);
  font-weight: 650;
}

.table-wrap { overflow-x: auto; max-width: 100%; }
.panel > .table-wrap:last-child, .panel #view-results > .table-wrap:last-child { border-radius: 0 0 .92rem .92rem; }
.data-table {
  width: 100%;
  min-width: 37rem;
  border-collapse: collapse;
  font-size: .875rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.compact-table { min-width: 33rem; }
.data-table :is(th, td) { padding: .72rem .65rem; vertical-align: middle; }
.data-table :is(th, td):first-child { padding-left: 1.15rem; }
.data-table :is(th, td):last-child { padding-right: 1.15rem; }
.data-table th {
  border-block: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 550;
  white-space: nowrap;
}
.data-table tbody tr + tr td { border-top: 1px solid var(--line); }
.data-table tbody tr:hover { background: var(--surface-muted); }
.data-table tbody tr.row-overdue { background: var(--red-soft); }
.data-table tbody tr.row-overdue:hover { background: #ffe8eb; }
.data-table tbody tr.row-overdue td:first-child { box-shadow: inset 2px 0 var(--red); }
.data-table tbody tr.row-overdue + tr.row-overdue td { border-top-color: var(--red-line); }
.data-table td a { color: var(--brand); }
.date-cell, .amount-cell { white-space: nowrap; }
.amount-cell { font-variant-numeric: tabular-nums; }
.cell-main, .cell-sub { display: block; }
.cell-main {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
a.cell-main { text-decoration: none; }
a.cell-main:hover { text-decoration: underline; }
.customer-cell { display: flex; align-items: center; gap: .58rem; }
.cell-sub { margin-top: .18rem; color: var(--text-muted); font-size: .78rem; line-height: 1.35; overflow-wrap: anywhere; }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions > * { vertical-align: middle; }
.table-actions > * + * { margin-left: .25rem; }
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: fit-content;
  padding: .22rem .55rem;
  border-radius: 99rem;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.status svg { width: .85rem; height: .85rem; }
.status-detail { font-size: .9em; }
.status-overdue { background: #fbe0e5; color: var(--red); }
.status-due, .status-partial { background: var(--amber-soft); color: var(--amber); }
.status-paid, .status-complimentary { background: var(--green-soft); color: var(--green); }
.status-void { background: #eaf0ec; color: var(--text-muted); }

.empty-state {
  display: grid;
  justify-items: center;
  gap: .65rem;
  padding: 2.15rem 1.2rem 2.35rem;
  color: var(--text-muted);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid #cee3d4;
  border-radius: .85rem;
  background: var(--brand-soft);
  color: var(--brand);
}
.empty-icon .icon { width: 1.35rem; height: 1.35rem; }
.empty-state h3 { color: var(--ink); font-size: 1.02rem; letter-spacing: -.022em; }
.empty-state p { max-width: 30rem; font-size: .875rem; }
.empty-state :is(.btn, .empty-actions) { margin-top: .35rem; }
.empty-actions .btn { margin-top: 0; }
.activity-list, .payment-list {
  display: grid;
  padding: 0 1.1rem;
  margin: 0;
  list-style: none;
}
.activity-item, .payment-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem 0;
  min-width: 0;
}
.activity-item + .activity-item, .payment-item + .payment-item { border-top: 1px solid var(--line); }
.activity-list > :last-child, .payment-list > :last-child { padding-bottom: 1rem; }
.activity-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .55rem;
  background: var(--green-soft);
  color: var(--green);
}
.activity-icon .icon { width: .95rem; height: .95rem; }
.activity-item > :not(.activity-icon), .payment-item > * { min-width: 0; }
.activity-item :is(strong, b), .payment-item :is(strong, b) { font-size: .875rem; }
.activity-item :is(small, time), .payment-item :is(small, time) { color: var(--text-muted); font-size: .78rem; }
.activity-item > :last-child, .payment-item > :last-child { margin-left: auto; }

.profile-card { margin-bottom: 1.15rem; padding: 1.2rem; }
.profile-card .panel-header { padding: 0 0 1rem; }
.profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .8rem;
  margin: 0;
}
.contact-item {
  display: flex;
  align-items: start;
  gap: .6rem;
  min-width: 0;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .64rem;
  background: var(--surface-muted);
  overflow-wrap: anywhere;
}
.contact-icon {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  border-radius: .42rem;
  color: var(--brand);
  background: var(--brand-soft);
}
.contact-icon .icon { width: .93rem; height: .93rem; }
.contact-item :is(small, dt) { display: block; color: var(--text-muted); font-size: .82rem; }
.contact-item dd { margin: .15rem 0 0; font-weight: 500; }
.service-card { overflow: hidden; }
.service-card > :is(.section-header, .panel-header) { margin-top: 0; padding: 1.05rem 1.15rem; }
.service-card > :is(h3, p) { margin-inline: 1.15rem; }
.service-cost { min-width: 5.3rem; }
.service-cost strong { white-space: nowrap; }
.service-price-detail { max-width: 20rem; }
.service-price-detail .currency { font-size: 1em; }
.service-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.deleted-services {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .92rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.deleted-services > summary {
  padding: .9rem 1.15rem;
  border-radius: inherit;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.deleted-services > summary::marker { color: var(--brand); }
.deleted-services > summary:hover { background: var(--surface-muted); }
.deleted-services > summary span {
  display: inline-block;
  min-width: 1.4rem;
  margin-left: .25rem;
  padding: .08rem .35rem;
  border-radius: 1rem;
  color: var(--brand);
  background: var(--brand-soft);
  text-align: center;
}
.deleted-services[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: .92rem .92rem 0 0;
}
.deleted-service-list { padding: 0 1.15rem; list-style: none; }
.deleted-service-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .75rem 0;
}
.deleted-service-list li + li { border-top: 1px solid var(--line); }
.service-card .payment-list { border-top: 1px solid var(--line); }
.payment-item { align-items: center; flex-wrap: wrap; }
.payment-copy { flex: 1; }
.payment-action { min-width: 4rem; text-align: right; }
.payment-note { white-space: pre-wrap; }
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .9rem;
}
.panel > .filters { margin: 0; padding: 0 1.15rem .85rem; }
.search-field { position: relative; display: flex; align-items: center; width: min(100%, 19rem); }
.search-field .icon { position: absolute; left: .7rem; color: var(--text-muted); pointer-events: none; }
.search-field input { padding-left: 2.2rem; width: 100%; }
.select { min-width: 8rem; }

.form-stack, .auth-form { display: grid; gap: 1rem; }
.panel-form { padding: .1rem 1.15rem 1.15rem; }
.account-panel { max-width: 51rem; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.form-grid > *, .form-stack > * { min-width: 0; }
.field { display: grid; align-content: start; gap: .33rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, label.field > span:first-child { color: var(--ink); font-size: .875rem; font-weight: 600; }
.field-hint { color: var(--text-muted); font-size: .8rem; }
.pricing-editor {
  display: grid;
  gap: .85rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface-muted);
}
.pricing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: .4rem;
  margin: 0;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.pricing-summary > div {
  display: grid;
  align-content: start;
  gap: .2rem;
  min-width: 0;
  padding: .45rem .5rem;
  border-radius: .45rem;
}
.pricing-summary dt { color: var(--text-muted); font-size: .8rem; }
.pricing-summary dd {
  margin: 0;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.pricing-summary .currency { font-size: .9em; }
.pricing-summary .pricing-net { background: var(--brand-soft); }
.pricing-summary .pricing-net :is(dt, dd) { color: var(--brand); }
.pricing-error { color: var(--red); font-size: .875rem; }
.pricing-error:empty { display: none; }
:where(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 2.68rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: .57rem;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.4;
  transition: background-color .15s ease, border-color .15s ease;
}
:where(input, textarea)::placeholder { color: #687970; opacity: 1; }
:where(input:is(:not([type]), [type="text"], [type="search"], [type="email"], [type="password"], [type="tel"], [type="number"]), textarea):enabled {
  cursor: text;
  caret-color: var(--brand);
  -webkit-user-select: text;
  user-select: text;
}
:where(input, textarea)::selection { color: var(--paper); background: var(--brand); }
@media (hover: hover) {
  :where(input:not([type="checkbox"], [type="radio"]), select, textarea):enabled:hover:not(:focus) {
    border-color: var(--brand-outline);
    background-color: var(--surface-muted);
  }
}
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus {
  border-color: var(--brand-outline);
  outline: 2px solid var(--brand-outline);
  outline-offset: 1px;
}
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):disabled {
  background-color: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}
textarea { min-height: 5.4rem; resize: vertical; }
select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - .95rem) 50%, calc(100% - .68rem) 50%;
  background-size: .3rem .3rem;
  background-repeat: no-repeat;
}
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: .55rem; font-weight: 600; }
.form-error { color: var(--red); font-size: .875rem; font-weight: 500; }
.form-error:empty { display: none; }
.notice {
  padding: .72rem .9rem;
  border: 1px solid #cee3d4;
  border-radius: .6rem;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: .875rem;
}
.notice strong { color: var(--ink); }
.notice strong + p { margin-top: .15rem; }
.down-payment-fields {
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface-muted);
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  min-height: 1.5rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-field input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--brand);
  cursor: inherit;
}
.down-payment-details:not([hidden]) { margin-top: .8rem; }
.schedule-list { display: grid; gap: .55rem; }
.schedule-actions { margin: .65rem 0 .25rem; }
.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 2.65rem;
  align-items: end;
  gap: .55rem;
}
.schedule-row > .btn { padding-inline: 0; }

.modal {
  width: min(37rem, calc(100% - 2rem));
  max-width: 100%;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .98rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1.1rem 4rem #192a2238;
  overflow: auto;
}
.modal[open] { animation: modal-in .16s ease both; }
.modal::backdrop { background: #192a2269; backdrop-filter: blur(2px); }
.modal-content { min-width: 0; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { font-size: 1.23rem; letter-spacing: -.027em; }
.modal-header p { color: var(--text-muted); font-size: .875rem; }
.modal-body { padding: 1.12rem 1.25rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}
.modal-close {
  display: inline-grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  min-height: 2.05rem;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .53rem;
  background: var(--paper);
  color: var(--text-muted);
}
.modal-close:hover { color: var(--brand); background: var(--brand-soft); }
@keyframes modal-in { from { opacity: 0; transform: translateY(.35rem); } to { opacity: 1; transform: translateY(0); } }

.toast, #toast:not(:empty) {
  position: fixed;
  right: clamp(1rem, 2.65vw, 2.5rem);
  bottom: 1.2rem;
  z-index: 20;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: .7rem .95rem;
  border: 1px solid #fff3;
  border-radius: .68rem;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 .45rem 1.65rem #192a2233;
  font-size: .875rem;
  line-height: 1.4;
}
#toast:empty { display: none; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(23rem, .91fr);
  min-height: 100dvh;
  background: var(--paper);
}
.auth-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  padding: clamp(1.7rem, 5.4vw, 5.6rem);
  background: #f1f3f2;
  color: var(--ink);
}
.auth-brand-panel::before, .auth-brand-panel::after {
  z-index: -1;
  position: absolute;
  aspect-ratio: 1;
  transform: rotate(45deg);
  pointer-events: none;
  content: "";
}
.auth-brand-panel::before {
  top: 12%;
  right: -22%;
  width: min(40vw, 36rem);
  border-radius: 18%;
  border: 1px solid #d8e3dc;
  background: linear-gradient(135deg, #ffffff20, #dce9e1);
  box-shadow: 0 0 0 clamp(1.5rem, 3.7vw, 3.8rem) #e4ebe680, 0 0 0 clamp(3.1rem, 7.4vw, 7.6rem) #e9eeea70;
}
.auth-brand-panel::after {
  right: 15%;
  bottom: -6%;
  width: min(14vw, 10.5rem);
  border-radius: 21%;
  background: var(--brand-accent);
  opacity: .19;
}
.auth-brand-panel .brand {
  width: min(100%, 22rem);
  border-radius: .9rem;
  background: var(--paper);
}
.auth-brand-content { position: relative; max-width: 37rem; padding-block: 3.5rem clamp(1rem, 4vh, 3.6rem); }
.auth-brand-content .eyebrow { color: var(--brand); }
.auth-brand-content :is(h1, h2) {
  font-size: clamp(2.55rem, 5.15vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -.065em;
  overflow-wrap: anywhere;
}
.auth-brand-content strong { font-size: clamp(1.4rem, 2vw, 2.1rem); line-height: 1.2; }
.auth-brand-content p:not(.eyebrow) {
  max-width: 29rem;
  margin-top: .9rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  line-height: 1.6;
}
.auth-main {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(1.65rem, 5vw, 5rem);
}
.auth-card { width: min(100%, 26rem); }
.auth-header { margin-bottom: 1.7rem; }
.auth-icon {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 1rem;
  border: 1px solid #cee3d4;
  border-radius: .62rem;
  color: var(--brand);
  background: var(--brand-soft);
}
.auth-icon .icon { width: 1.25rem; height: 1.25rem; }
.auth-header :is(h1, h2) {
  margin: 0 0 .42rem;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -.05em;
}
.auth-header p:not(.eyebrow) { color: var(--text-muted); }
.auth-form { gap: 1.1rem; }
.auth-form > .btn { width: 100%; margin-top: .18rem; min-height: 2.95rem; }
.auth-form input { min-height: 2.9rem; }
.load-state {
  display: grid;
  min-height: 85dvh;
  place-content: center;
  justify-items: center;
  gap: .8rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 86rem) {
  .overview-grid:has(.data-table) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 79rem) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-panel { width: 100%; }
}
@media (max-width: 67rem) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .82rem; }
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 52rem) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 9;
    translate: -100%;
    visibility: hidden;
    width: min(var(--sidebar-width), calc(100% - 2rem));
    height: 100%;
    transition: translate .2s ease, visibility .2s;
  }
  .sidebar.is-open { translate: 0; visibility: visible; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 8;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #192a2266;
  }
  .sidebar-scrim:not([hidden]) { display: block !important; }
  .mobile-menu { display: inline-flex !important; }
  .topbar { min-height: 3.65rem; gap: .7rem; }
  .topbar-start, .topbar-actions { gap: .42rem; }
  .auth-shell { grid-template-columns: minmax(0, .85fr) minmax(20rem, 1fr); }
  .auth-brand-panel { padding: 1.6rem; }
}
@media (max-width: 40rem) {
  .auth-shell { display: flex; flex-direction: column; }
  .auth-brand-panel { min-height: auto; padding: 1.35rem 1.3rem; }
  .auth-brand-panel::before { width: 45vw; right: -6%; top: -15%; }
  .auth-brand-panel::after { width: 20vw; right: 23%; }
  .auth-brand-content { display: none; }
  .auth-main { place-items: start center; padding: 2.15rem 1.25rem 2.8rem; }
  .auth-header { margin-bottom: 1.45rem; }
  .page-header { margin-bottom: 1.1rem; }
  .page-content { padding-bottom: 2rem; }
  .stat-card { min-height: 8.35rem; padding: .8rem; }
  .stat-head { gap: .4rem; margin-bottom: .62rem; }
  .stat-label { font-size: .84rem; }
  .stat-icon { width: 1.8rem; height: 1.8rem; }
  .stat-card:first-child::after { width: 4rem; height: 4rem; bottom: -1.75rem; }
  .panel-header, .service-card > :is(.section-header, .panel-header) { padding-inline: .85rem; }
  .data-table :is(th, td):first-child { padding-left: .85rem; }
  .data-table :is(th, td):last-child { padding-right: .85rem; }
  .profile-card { padding: .9rem; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats > :last-child { grid-column: 1 / -1; }
  .payment-copy { flex-basis: calc(100% - 3rem); }
  .form-grid { grid-template-columns: 1fr; gap: .72rem; }
  .pricing-summary { gap: .2rem; }
  .pricing-summary > div { padding-inline: .3rem; }
  .modal { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .modal-header, .modal-body, .modal-footer { padding-inline: .9rem; }
}
@media (max-width: 25rem) {
  .stat-grid { gap: .55rem; }
  .stat-label { font-size: .78rem; }
  .stat-value { font-size: 1.12rem; }
  .topbar-actions > :not(.btn) { display: none; }
  .data-table { min-width: 33rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
