:root {
  color-scheme: light;
  --ink: #172a3a;
  --muted: #627586;
  --line: #e2eaf0;
  --paper: #ffffff;
  --wash: #f4f8fa;
  --blue: #176b87;
  --blue-dark: #10546d;
  --green: #18764b;
  --red: #a93636;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); }
a { color: var(--blue); }
.topbar { height: 68px; padding: 0 max(24px, calc((100% - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-size: 19px; font-weight: 800; text-decoration: none; letter-spacing: -.04em; }
nav, .actions { display: flex; align-items: center; gap: 18px; }
nav a { font-size: 14px; text-decoration: none; font-weight: 650; }
.nav-cta { padding: 9px 13px; border-radius: 8px; background: var(--ink); color: white; }
.page { max-width: 1120px; min-height: calc(100vh - 130px); margin: 0 auto; padding: 54px 24px 80px; }
footer { padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 24px; letter-spacing: -.03em; }
h3 { margin-bottom: 5px; font-size: 18px; }
p { line-height: 1.6; }
.muted, small { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { margin-bottom: 10px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero { max-width: 680px; padding: 58px 0 74px; }
.hero p { max-width: 560px; margin-bottom: 28px; color: var(--muted); font-size: 18px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.secondary { background: white; color: var(--ink); border-color: var(--line); }
.danger { color: var(--red); background: #fff; border-color: #efcaca; }
.full { width: 100%; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 20px #16334a08; }
.feature-grid, .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-grid .card { padding: 22px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.icon { display: inline-flex; width: 34px; height: 34px; margin-bottom: 22px; align-items: center; justify-content: center; border-radius: 9px; color: var(--blue); background: #e8f4f7; font-size: 11px; font-weight: 800; }
.auth-card { width: min(100%, 430px); margin: 20px auto; padding: 32px; }
.auth-card h1 { font-size: 34px; }
.stack { display: flex; flex-direction: column; gap: 15px; }
label { display: flex; flex-direction: column; gap: 7px; color: #31485b; font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #d5e0e8; border-radius: 7px; outline: none; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
input:focus, select:focus { border-color: #4b9ab2; box-shadow: 0 0 0 3px #176b8718; }
small { font-size: 11px; font-weight: 450; line-height: 1.45; }
.form-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 46px; align-items: start; max-width: 850px; margin: 0 auto; }
.form-layout > div { position: sticky; top: 35px; padding-top: 20px; }
.form-layout > .card { padding: 26px; }
.domain-input { display: flex; align-items: center; }
.domain-input input { min-width: 0; border-radius: 7px 0 0 7px; }
.domain-input span { overflow: hidden; max-width: 55%; padding: 12px 10px; border: 1px solid #d5e0e8; border-left: 0; border-radius: 0 7px 7px 0; background: #f5f8fa; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 34px 0 16px; }
.section-heading h1, .section-heading h2 { margin-bottom: 5px; }
.section-heading p { margin-bottom: 0; }
.account-card { display: flex; gap: 28px; justify-content: space-between; align-items: end; padding: 20px; }
.profile-form { display: flex; gap: 10px; align-items: end; }
.profile-form label { width: min(280px, 40vw); }
.tenant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tenant-card { padding: 20px; }
.tenant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tenant-head h3 { margin-bottom: 5px; }
.tenant-head .muted { font-size: 12px; overflow-wrap: anywhere; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 20px; background: #eef2f5; color: #445969; font-size: 10px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.badge.active, .badge.confirmed, .badge.completed { background: #e6f4ec; color: var(--green); }
.badge.pending, .badge.pending_payment, .badge.queued, .badge.processing, .badge.provisioning { background: #fff4dc; color: #966514; }
.badge.failed, .badge.rejected, .badge.suspended, .badge.past_due { background: #fbeaea; color: var(--red); }
.details { display: flex; flex-wrap: wrap; gap: 22px; margin: 21px 0; }
.details div { min-width: 100px; }
.details dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.details dd { margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.notice-box { padding: 12px; border-radius: 8px; background: #fff7e7; color: #765a24; font-size: 13px; }
.error-text { color: var(--red); }
.payment-reference { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.payment-reference small { grid-column: 1 / -1; }
.renew-form { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.password-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: end; padding: 18px; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }
.stats-grid { grid-template-columns: repeat(3, 1fr); }
.stat { padding: 18px 20px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 7px; font-size: 30px; }
.plan-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.plan-form { display: flex; flex-direction: column; gap: 13px; padding: 18px; }
.plan-title { display: flex; align-items: center; justify-content: space-between; }
.plan-title code { color: var(--muted); font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.field-grid label { min-width: 0; }
.checkbox { flex-direction: row; align-items: center; }
.checkbox input { width: 16px; min-height: auto; }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12px; }
th { background: #f8fafb; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
td small { display: block; margin-top: 4px; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.actions.compact { gap: 6px; flex-wrap: wrap; }
.small-button { min-height: 31px; padding: 6px 9px; font-size: 10px; }
.inline { display: inline; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 650; cursor: pointer; }
.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 8px; font-size: 13px; }
.alert.error { background: #fbeaea; color: var(--red); }
.alert.success { background: #e6f4ec; color: var(--green); }

@media (max-width: 760px) {
  .page { padding: 32px 16px 54px; }
  .topbar { padding: 0 16px; }
  .feature-grid, .stats-grid, .tenant-grid, .plan-list, .form-layout { grid-template-columns: 1fr; }
  .form-layout { gap: 10px; }
  .form-layout > div { position: static; }
  .account-card, .profile-form { align-items: stretch; flex-direction: column; }
  .profile-form label { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .password-form { grid-template-columns: 1fr; }
}
