/* Asigau Eligibility – customer dashboard */
:root {
	--d-ink: #180862;
	--d-ink-2: #2b1d8f;
	--d-deep: #0e0540;
	--d-text: #1c1a2b;
	--d-body: #3f4554;
	--d-muted: #6b7080;
	--d-line: #e7e5f0;
	--d-line-2: #d6d3e6;
	--d-bg: #f6f5fb;
	--d-tint: #eceaf6;
	--d-card: #ffffff;
	--d-gold: #c39b45;
	--d-gold-soft: #f6efdf;
	--d-pass: #12805c;
	--d-pass-bg: #e6f6ee;
	--d-refer: #a15c07;
	--d-refer-bg: #fff3dc;
	--d-fail: #b42318;
	--d-fail-bg: #fdecea;
	--d-radius: 14px;
	--d-radius-lg: 20px;
	--d-shadow: 0 1px 2px rgba(24, 8, 98, .05), 0 6px 18px rgba(24, 8, 98, .05);
	--d-shadow-lg: 0 2px 4px rgba(24, 8, 98, .06), 0 24px 48px rgba(24, 8, 98, .14);
	--d-head: "Manrope", "Inter", system-ui, sans-serif;
	--d-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--d-side: 264px;
}
html, body.ambe-body { margin: 0; background: var(--d-bg); }
body.ambe-body { font-family: var(--d-sans); color: var(--d-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.ambe-app *, .ambe-auth *, .ambe-modal * { box-sizing: border-box; }
.ambe-app h1, .ambe-app h2, .ambe-app h3, .ambe-app h4 { font-family: var(--d-head); color: var(--d-text); margin: 0; letter-spacing: -.01em; }
.ambe-app a { color: var(--d-ink); }
.ambe-app button { font-family: inherit; }
.ambe-muted { color: var(--d-muted); }
.ambe-num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Boot */
.ambe-boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--d-muted); }
.ambe-boot__spin { width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--d-tint); border-top-color: var(--d-ink); animation: d-spin 1s linear infinite; }
@keyframes d-spin { to { transform: rotate(360deg); } }

/* Shell */
.d-shell { display: grid; grid-template-columns: var(--d-side) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, #120758 var(--d-side), var(--d-bg) var(--d-side)); }
body.admin-bar .d-shell { min-height: calc(100vh - 32px); }
.d-side { background: linear-gradient(180deg, var(--d-deep) 0%, #160a55 100%); color: #cfcbea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; z-index: 30; }
body.admin-bar .d-side { top: 32px; height: calc(100vh - 32px); }
.d-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; color: #fff; text-decoration: none; }
.d-brand img { width: 34px; height: 34px; border-radius: 9px; background: #fff; padding: 3px; }
.d-brand__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--d-gold); color: var(--d-deep); display: grid; place-items: center; font: 800 16px var(--d-head); }
.d-brand strong { display: block; font: 700 15px/1.2 var(--d-head); color: #fff; }
.d-brand small { display: block; font-size: 11px; color: var(--d-gold); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.d-nav { display: grid; gap: 2px; overflow-y: auto; min-height: 0; flex: 0 1 auto; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.d-nav__label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #8a84b8; padding: 16px 12px 6px; font-weight: 700; }
.d-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #d9d6f0; text-decoration: none; font-weight: 500; font-size: 14px; transition: background .15s, color .15s; }
.d-nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.d-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.d-nav a.is-active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--d-gold); }
.d-nav a .d-lock { margin-left: auto; width: 14px; height: 14px; opacity: .55; }
.d-nav a .d-count { margin-left: auto; background: var(--d-gold); color: var(--d-deep); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.d-plancard { margin-top: auto; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--d-radius); padding: 16px; }
.d-plancard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.d-plancard strong { color: #fff; font: 700 15px var(--d-head); }
.d-plancard p { margin: 0 0 12px; font-size: 12.5px; color: #aaa5d0; }
.d-plancard .d-meter { background: rgba(255, 255, 255, .12); }
.d-plancard .d-btn { width: 100%; margin-top: 12px; background: var(--d-gold); border-color: var(--d-gold); color: var(--d-deep); }
.d-plancard .d-btn:hover { background: #d4ad59; }

.d-main { min-width: 0; display: flex; flex-direction: column; }
.d-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(246, 245, 251, .85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--d-line); }
body.admin-bar .d-top { top: 32px; }
.d-top h1 { font-size: 20px; }
.d-top .d-crumb { font-size: 12.5px; color: var(--d-muted); }
.d-top__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.d-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--d-ink); color: #fff; display: grid; place-items: center; font: 700 14px var(--d-head); border: 2px solid #fff; box-shadow: var(--d-shadow); }
.d-burger { display: none; border: 0; background: #fff; width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--d-shadow); cursor: pointer; }
.d-content { padding: 28px 32px 64px; max-width: 1360px; width: 100%; }
.d-foot { margin-top: auto; padding: 18px 32px; font-size: 12px; color: var(--d-muted); border-top: 1px solid var(--d-line); }

/* Buttons */
.d-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--d-ink); background: var(--d-ink); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important; transition: background .15s, box-shadow .15s, transform .1s; white-space: nowrap; line-height: 1.2; }
.ambe-app .d-btn { color: #fff; }
.d-btn:hover { background: var(--d-ink-2); border-color: var(--d-ink-2); box-shadow: 0 6px 16px rgba(24, 8, 98, .2); }
.d-btn:active { transform: translateY(1px); }
.d-btn svg { width: 16px; height: 16px; }
.d-btn--ghost { background: #fff; color: var(--d-ink) !important; border-color: var(--d-line-2); }
.d-btn--ghost:hover { background: var(--d-tint); border-color: var(--d-ink); box-shadow: none; }
.d-btn--gold { background: var(--d-gold); border-color: var(--d-gold); color: var(--d-deep) !important; }
.d-btn--gold:hover { background: #d4ad59; border-color: #d4ad59; }
.d-btn--danger { background: #fff; color: var(--d-fail) !important; border-color: #f2c4bf; }
.d-btn--danger:hover { background: var(--d-fail-bg); border-color: var(--d-fail); box-shadow: none; }
.d-btn--sm { padding: 7px 13px; font-size: 13px; }
.d-btn--icon { padding: 7px; width: 34px; height: 34px; border-radius: 10px; }
.d-btn[disabled] { opacity: .5; pointer-events: none; }
.d-link { background: none; border: 0; padding: 0; color: var(--d-ink); font-weight: 600; cursor: pointer; font-size: 14px; text-decoration: none; }
.d-link:hover { text-decoration: underline; }

/* Cards & grid */
.d-grid { display: grid; gap: 20px; }
.d-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.d-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-grid--main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.d-card { background: var(--d-card); border: 1px solid var(--d-line); border-radius: var(--d-radius-lg); box-shadow: var(--d-shadow); padding: 22px 24px; min-width: 0; }
.d-card--flush { padding: 0; overflow: hidden; }
.d-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.d-card__head h3 { font-size: 16px; }
.d-card__head p { margin: 2px 0 0; font-size: 13px; color: var(--d-muted); }
.d-card--flush .d-card__head { padding: 20px 24px 0; }
.d-section { margin-top: 24px; }
.d-hero { background: linear-gradient(120deg, var(--d-deep), var(--d-ink) 60%, #3a2aa8); color: #e7e4fb; border: 0; position: relative; overflow: hidden; padding: 28px 30px; }
.d-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(195, 155, 69, .35), transparent 70%); }
.d-hero h2 { color: #fff; font-size: 26px; margin-bottom: 6px; }
.d-hero p { margin: 0 0 18px; max-width: 560px; }
.d-hero .d-btn--ghost { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .35); }
.d-hero .d-btn--ghost:hover { background: rgba(255, 255, 255, .1); }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }

.d-kpi { display: flex; flex-direction: column; gap: 6px; }
.d-kpi__label { font-size: 12.5px; color: var(--d-muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.d-kpi__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--d-tint); color: var(--d-ink); }
.d-kpi__icon svg { width: 16px; height: 16px; }
.d-kpi__value { font: 800 26px/1.15 var(--d-head); color: var(--d-text); letter-spacing: -.02em; }
.d-kpi__sub { font-size: 12.5px; color: var(--d-muted); }

/* Badges */
.d-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.d-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.d-badge--PASS, .d-badge--ok, .d-badge--paid, .d-badge--active, .d-badge--completed { background: var(--d-pass-bg); color: var(--d-pass); }
.d-badge--REFER, .d-badge--warn, .d-badge--awaiting, .d-badge--pending, .d-badge--in_review, .d-badge--new { background: var(--d-refer-bg); color: var(--d-refer); }
.d-badge--FAIL, .d-badge--bad, .d-badge--failed, .d-badge--expired, .d-badge--cancelled { background: var(--d-fail-bg); color: var(--d-fail); }
.d-badge--muted, .d-badge--abandoned, .d-badge--replaced { background: var(--d-tint); color: var(--d-muted); }
.d-badge--plan { background: var(--d-gold-soft); color: #7a5a14; }
.d-badge--plan::before { display: none; }

/* Tables */
.d-table-wrap { overflow-x: auto; }
.d-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.d-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--d-muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--d-line); background: #fbfaff; white-space: nowrap; }
.d-table td { padding: 14px 16px; border-bottom: 1px solid var(--d-line); vertical-align: middle; }
.d-table tr:last-child td { border-bottom: 0; }
.d-table tbody tr { transition: background .1s; }
.d-table tbody tr:hover { background: #fbfaff; }
.d-table .r { text-align: right; }
.d-table td strong { color: var(--d-text); }
.d-table tr.is-current { background: var(--d-tint); }
.d-table tr.is-best td:first-child { box-shadow: inset 3px 0 0 var(--d-gold); }
.d-rowtitle { font-weight: 600; color: var(--d-text); cursor: pointer; }
.d-rowtitle small { display: block; font-weight: 400; color: var(--d-muted); font-size: 12.5px; }

/* Breakdown list */
.d-list { display: grid; margin: 0; }
.d-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--d-line); font-size: 14px; }
.d-list > div:last-child { border-bottom: 0; }
.d-list dt { color: var(--d-body); }
.d-list dd { margin: 0; font-weight: 600; color: var(--d-text); font-variant-numeric: tabular-nums; text-align: right; }
.d-list .is-total { border-top: 2px solid var(--d-text); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.d-list .is-total dt, .d-list .is-total dd { font-weight: 800; color: var(--d-text); }
.d-list .is-sub dt { padding-left: 14px; color: var(--d-muted); }
.d-list .is-neg dd { color: var(--d-fail); }

/* Forms */
.d-form { display: grid; gap: 18px; }
.d-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.d-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-field { display: grid; gap: 6px; align-content: start; }
.d-field > span { font-size: 13px; font-weight: 600; color: var(--d-text); display: flex; gap: 6px; align-items: center; }
.d-field small { font-size: 12px; color: var(--d-muted); }
.d-field--full { grid-column: 1 / -1; }
.d-input, .d-field input, .d-field select, .d-field textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--d-line-2); border-radius: 10px; background: #fff; font: 15px var(--d-sans); color: var(--d-text); transition: border-color .15s, box-shadow .15s; }
.d-field textarea { min-height: 90px; resize: vertical; }
.d-field input:focus, .d-field select:focus, .d-field textarea:focus, .d-input:focus { outline: none; border-color: var(--d-ink); box-shadow: 0 0 0 4px rgba(24, 8, 98, .1); }
.d-field input[readonly] { background: var(--d-bg); color: var(--d-muted); }
.d-money { position: relative; }
.d-money::before { content: "K"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--d-muted); font-weight: 600; pointer-events: none; }
.d-money input { padding-left: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.d-tip { width: 16px; height: 16px; border-radius: 50%; background: var(--d-tint); color: var(--d-ink); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; cursor: help; }

.d-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--d-text); }
.d-switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--d-line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.d-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.d-switch input:checked { background: var(--d-ink); }
.d-switch input:checked::after { transform: translateX(18px); }
.d-switch input:disabled { opacity: .5; cursor: not-allowed; }

.d-seg { display: inline-flex; background: var(--d-tint); padding: 4px; border-radius: 999px; gap: 2px; flex-wrap: wrap; }
.d-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--d-muted); cursor: pointer; }
.d-seg button.is-active { background: #fff; color: var(--d-ink); box-shadow: var(--d-shadow); }

/* Lender picker */
.d-banks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.d-bank { border: 1.5px solid var(--d-line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; text-align: left; transition: border-color .15s, background .15s; display: grid; gap: 2px; }
.d-bank strong { color: var(--d-text); font-size: 15px; }
.d-bank small { color: var(--d-muted); font-size: 12px; }
.d-bank:hover { border-color: var(--d-ink-2); }
.d-bank.is-active { border-color: var(--d-ink); background: var(--d-tint); box-shadow: inset 0 0 0 1px var(--d-ink); }

/* Wizard */
.d-wiz { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; }
.d-wiz button { flex: 1; min-width: 130px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--d-line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; font-size: 13px; font-weight: 600; color: var(--d-muted); transition: all .15s; }
.d-wiz button span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--d-tint); color: var(--d-ink); font-size: 12px; font-weight: 700; flex: none; }
.d-wiz button.is-active { border-color: var(--d-ink); color: var(--d-text); box-shadow: var(--d-shadow); }
.d-wiz button.is-active span { background: var(--d-ink); color: #fff; }
.d-wiz button.is-done span { background: var(--d-pass); color: #fff; }
.d-stepnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--d-line); }

/* Income grid */
.d-inc { width: 100%; border-collapse: collapse; }
.d-inc th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--d-muted); text-align: right; padding: 8px 6px; }
.d-inc th:first-child { text-align: left; }
.d-inc td { padding: 5px 6px; }
.d-inc td:first-child { font-size: 14px; color: var(--d-text); white-space: nowrap; padding-right: 14px; }
.d-inc td.d-inc__mon { text-align: right; color: var(--d-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-inc .d-money input { padding-top: 8px; padding-bottom: 8px; }
.d-inc tr.d-inc__group td { padding-top: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--d-ink); }
.d-inc tr.d-inc__total td { border-top: 2px solid var(--d-line); font-weight: 700; padding-top: 10px; color: var(--d-text); text-align: right; font-variant-numeric: tabular-nums; }
.d-inc tr.d-inc__total td:first-child { text-align: left; }
.d-inc input { min-width: 110px; }

/* Live panel & results */
.d-live { position: sticky; top: 84px; }
body.admin-bar .d-live { top: 116px; }
.d-outcome { border-radius: var(--d-radius-lg); padding: 22px; color: #fff; position: relative; overflow: hidden; }
.d-outcome--PASS { background: linear-gradient(135deg, #0f6e4f, #18a174); }
.d-outcome--REFER { background: linear-gradient(135deg, #8a4e05, #d08a1a); }
.d-outcome--FAIL { background: linear-gradient(135deg, #8e1c13, #d0453a); }
.d-outcome__label { padding-right: 56px; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; opacity: .85; font-weight: 700; }
.d-outcome__value { font: 800 40px/1 var(--d-head); margin: 8px 0 6px; letter-spacing: -.01em; }
.d-outcome p { margin: 0; font-size: 13.5px; opacity: .92; }
.d-outcome__dots { position: absolute; right: 20px; top: 22px; display: flex; gap: 6px; }
.d-outcome__dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.d-outcome__dots i.on { background: #fff; }

.d-test { padding: 14px 0; border-bottom: 1px solid var(--d-line); }
.d-test:last-child { border-bottom: 0; }
.d-test__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.d-test__name { font-weight: 700; color: var(--d-text); font-size: 14px; }
.d-test__val { font: 700 15px var(--d-head); color: var(--d-text); font-variant-numeric: tabular-nums; }
.d-test small { display: block; color: var(--d-muted); font-size: 12px; margin-top: 6px; }
.d-meter { position: relative; height: 8px; border-radius: 999px; background: var(--d-tint); margin-top: 10px; overflow: visible; }
.d-meter__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--d-ink); transition: width .3s ease; max-width: 100%; }
.d-meter__fill.ok { background: var(--d-pass); }
.d-meter__fill.bad { background: var(--d-fail); }
.d-meter__mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--d-text); border-radius: 2px; }
.d-meter__mark::after { content: attr(data-label); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--d-muted); white-space: nowrap; font-weight: 600; }

.d-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.d-pay div { background: var(--d-bg); border-radius: 12px; padding: 12px 14px; }
.d-pay span { display: block; font-size: 12px; color: var(--d-muted); font-weight: 600; }
.d-pay strong { font: 800 19px var(--d-head); color: var(--d-text); font-variant-numeric: tabular-nums; }

.d-testcard { display: flex; flex-direction: column; gap: 10px; }
.d-testcard__ring { display: flex; align-items: center; gap: 16px; }
.d-ring { width: 84px; height: 84px; flex: none; }
.d-ring circle { fill: none; stroke-width: 9; }
.d-ring .bg { stroke: var(--d-tint); }
.d-ring .fg { stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .4s; }
.d-ring text { font: 800 15px var(--d-head); fill: var(--d-text); }

.d-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--d-tint); }
.d-bar span { display: block; height: 100%; }
.d-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--d-muted); margin-top: 10px; }
.d-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.d-hbars { display: grid; gap: 10px; }
.d-hbar { display: grid; grid-template-columns: 80px 1fr 110px; gap: 12px; align-items: center; font-size: 13px; }
.d-hbar__track { height: 12px; background: var(--d-tint); border-radius: 999px; overflow: hidden; }
.d-hbar__fill { height: 100%; background: var(--d-ink); border-radius: 999px; transition: width .3s; }
.d-hbar__fill.is-best { background: var(--d-gold); }
.d-hbar strong { color: var(--d-text); }

/* What-if */
.d-range { display: grid; gap: 8px; }
.d-range__top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--d-text); }
.d-range__top output { font-variant-numeric: tabular-nums; color: var(--d-ink); }
.d-range input[type=range] { width: 100%; accent-color: var(--d-ink); }
.d-delta { font-size: 12px; font-weight: 700; margin-left: 6px; }
.d-delta.up { color: var(--d-pass); }
.d-delta.down { color: var(--d-fail); }

/* Locked */
.d-locked { position: relative; overflow: hidden; }
.d-locked__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .96) 55%); backdrop-filter: blur(3px); display: grid; place-content: center; text-align: center; padding: 20px; z-index: 2; }
.d-locked__veil h4 { font-size: 16px; margin: 10px 0 4px; }
.d-locked__veil p { margin: 0 0 14px; font-size: 13px; color: var(--d-muted); max-width: 320px; }
.d-locked__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--d-gold-soft); color: #7a5a14; display: grid; place-items: center; margin: 0 auto; }
.d-locked__icon svg { width: 20px; height: 20px; }
.d-locked .d-locked__ghost { filter: blur(1px); opacity: .6; pointer-events: none; user-select: none; }

/* Toolbar */
.d-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.d-search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.d-search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px; border: 1px solid var(--d-line-2); font: 14px var(--d-sans); background: #fff; }
.d-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--d-muted); }
.d-spacer { flex: 1; }

/* Empty */
.d-empty { text-align: center; padding: 48px 24px; }
.d-empty__icon { width: 64px; height: 64px; border-radius: 18px; background: var(--d-tint); color: var(--d-ink); display: grid; place-items: center; margin: 0 auto 16px; }
.d-empty__icon svg { width: 28px; height: 28px; }
.d-empty h3 { font-size: 18px; margin-bottom: 6px; }
.d-empty p { color: var(--d-muted); margin: 0 auto 18px; max-width: 420px; }

/* Clients */
.d-client { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.d-client:hover { box-shadow: var(--d-shadow-lg); transform: translateY(-2px); }
.d-client__top { display: flex; gap: 12px; align-items: center; }
.d-client__top .d-avatar { width: 44px; height: 44px; background: var(--d-tint); color: var(--d-ink); }
.d-client h4 { font-size: 16px; }
.d-client small { color: var(--d-muted); }
.d-checklist { display: grid; gap: 4px; }
.d-checklist label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.d-checklist label:hover { background: var(--d-bg); }
.d-checklist input { width: 18px; height: 18px; accent-color: var(--d-pass); }
.d-checklist input:checked + span { color: var(--d-muted); text-decoration: line-through; }

/* Plans in billing */
.d-plan { border: 1.5px solid var(--d-line); border-radius: var(--d-radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.d-plan.is-current { border-color: var(--d-ink); box-shadow: inset 0 0 0 1px var(--d-ink); }
.d-plan h4 { font-size: 18px; }
.d-plan__price { font: 800 30px var(--d-head); color: var(--d-text); }
.d-plan__price small { font: 500 13px var(--d-sans); color: var(--d-muted); }
.d-plan ul { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 7px; font-size: 13px; }
.d-plan li { padding-left: 22px; position: relative; }
.d-plan li::before { content: "✓"; position: absolute; left: 0; color: var(--d-pass); font-weight: 800; }
.d-plan li.off { color: #a3a6b4; }
.d-plan li.off::before { content: "–"; color: #c3c5cf; }
.d-plan > div:last-child { margin-top: auto; }

/* Notices */
.d-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.d-alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.d-alert--info { background: #f1effc; border-color: #dcd7f5; color: var(--d-ink); }
.d-alert--warn { background: var(--d-refer-bg); border-color: #f3dcae; color: #7a4405; }
.d-alert--bad { background: var(--d-fail-bg); border-color: #f2c4bf; color: #8e1c13; }
.d-alert--ok { background: var(--d-pass-bg); border-color: #bfe6d3; color: #0d5e44; }
.d-alert .d-btn { margin-left: auto; }
.d-disclaimer { font-size: 12px; color: var(--d-muted); line-height: 1.6; margin-top: 20px; }

/* Toasts & modal */
.d-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100000; display: grid; gap: 10px; }
.d-toast { background: var(--d-text); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--d-shadow-lg); animation: d-in .2s ease; max-width: 360px; }
.d-toast--bad { background: var(--d-fail); }
.d-toast--ok { background: var(--d-pass); }
@keyframes d-in { from { opacity: 0; transform: translateY(8px); } }
.ambe-modal { position: fixed; inset: 0; background: rgba(14, 5, 64, .45); backdrop-filter: blur(3px); z-index: 99999; display: grid; place-items: center; padding: 20px; animation: d-in .15s; }
.ambe-modal__box { background: #fff; border-radius: var(--d-radius-lg); box-shadow: var(--d-shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 26px; font-family: var(--d-sans); }
.ambe-modal__box h3 { font: 700 19px var(--d-head); color: var(--d-text); margin: 0 0 6px; }
.ambe-modal__box > p { margin: 0 0 18px; color: var(--d-muted); font-size: 14px; }
.ambe-modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Auth (logged out) */
.ambe-auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; font-family: var(--d-sans); }
.ambe-auth__brand { background: linear-gradient(140deg, var(--d-deep), var(--d-ink) 65%, #3a2aa8); color: #dcd8f6; display: grid; place-items: center; padding: 48px; position: relative; overflow: hidden; }
.ambe-auth__brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(195, 155, 69, .3), transparent 70%); }
.ambe-auth__brandin { max-width: 460px; position: relative; z-index: 1; }
.ambe-auth__logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 700 17px var(--d-head); margin-bottom: 48px; }
.ambe-auth__logo img { border-radius: 10px; background: #fff; padding: 4px; }
.ambe-auth h1 { font: 800 36px/1.15 var(--d-head); color: #fff; margin: 0 0 24px; letter-spacing: -.02em; }
.ambe-auth ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ambe-auth li { padding-left: 30px; position: relative; }
.ambe-auth li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--d-gold); color: var(--d-deep); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.ambe-auth__form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.ambe-auth__card { width: 100%; max-width: 400px; }
.ambe-auth__card h2 { font: 800 26px var(--d-head); color: var(--d-text); margin: 0 0 6px; }
.ambe-auth__card .ambe-muted { margin: 0 0 24px; font-size: 14px; }
#ambe-loginform p { margin: 0 0 14px; }
#ambe-loginform label { display: block; font-size: 13px; font-weight: 600; color: var(--d-text); margin-bottom: 6px; }
#ambe-loginform input[type=text], #ambe-loginform input[type=password] { width: 100%; padding: 12px 14px; border: 1px solid var(--d-line-2); border-radius: 10px; font: 15px var(--d-sans); }
#ambe-loginform input:focus { outline: none; border-color: var(--d-ink); box-shadow: 0 0 0 4px rgba(24, 8, 98, .1); }
#ambe-loginform .login-remember label { display: inline; font-weight: 400; }
#ambe-loginform input[type=submit] { width: 100%; padding: 13px; border-radius: 999px; background: var(--d-ink); color: #fff; border: 0; font: 600 15px var(--d-sans); cursor: pointer; }
#ambe-loginform input[type=submit]:hover { background: var(--d-ink-2); }
.ambe-auth__links { font-size: 14px; }
.ambe-auth__links a { color: var(--d-ink); }
.ambe-auth__alt { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--d-line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.ambe-btn { display: inline-flex; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--d-line-2); color: var(--d-ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.ambe-btn:hover { border-color: var(--d-ink); background: var(--d-tint); }

/* Responsive */
@media (max-width: 1200px) {
	.d-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.d-grid--main { grid-template-columns: 1fr; }
	.d-live { position: static; }
}
@media (max-width: 960px) {
	.d-shell { grid-template-columns: 1fr; }
	.d-side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: 100vh; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--d-shadow-lg); }
	body.admin-bar .d-side { top: 0; height: 100vh; }
	.d-shell.is-open .d-side { transform: none; }
	.d-shell.is-open::after { content: ""; position: fixed; inset: 0; background: rgba(14, 5, 64, .4); z-index: 25; }
	.d-burger { display: grid; place-items: center; }
	.d-top, .d-content, .d-foot { padding-left: 16px; padding-right: 16px; }
	.d-grid--3, .d-grid--2 { grid-template-columns: 1fr; }
	.d-banks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ambe-auth { grid-template-columns: 1fr; }
	.ambe-auth__brand { padding: 32px 24px; }
	.ambe-auth__logo { margin-bottom: 24px; }
	.ambe-auth h1 { font-size: 26px; }
	.d-top .d-btn span { display: none; }
	.d-shell { background: var(--d-bg); }
	.d-top .d-crumb { display: none; }
	.d-top h1 { font-size: 17px; }
}
@media (max-width: 600px) {
	.d-grid--4 { grid-template-columns: 1fr 1fr; gap: 12px; }
	.d-fields, .d-fields--3 { grid-template-columns: 1fr; }
	.d-card { padding: 18px 16px; }
	.d-kpi__value { font-size: 21px; }
	.d-wiz button { min-width: 0; flex: none; }
	.d-wiz button b { display: none; }
	.d-hbar { grid-template-columns: 64px 1fr 90px; }
	.d-inc td:first-child { white-space: normal; }
	.d-inc input { min-width: 90px; }
}

/* Print – when printing the dashboard itself */
@media print {
	.d-side, .d-top, .d-foot, .d-stepnav, .d-wiz, .d-actions, .d-toolbar { display: none !important; }
	.d-shell { display: block; }
	body.ambe-body { background: #fff; }
}
.d-boot { height: 240px; background: radial-gradient(circle at center, transparent 18px, transparent 19px) center no-repeat; position: relative; }
.d-boot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 4px solid var(--d-tint); border-top-color: var(--d-ink); animation: d-spin 1s linear infinite; }

/* Notice banner */
#d-notice:empty { display: none; }
.d-banner { display: flex; gap: 12px; align-items: flex-start; margin: 18px 32px 0; padding: 14px 18px; border-radius: 14px; font-size: 14px; border: 1px solid; }
.d-banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.d-banner div { flex: 1; }
.d-banner--info { background: #f1effc; border-color: #dcd7f5; color: var(--d-ink); }
.d-banner--warn { background: var(--d-refer-bg); border-color: #f3dcae; color: #7a4405; }
.d-banner--ok { background: var(--d-pass-bg); border-color: #bfe6d3; color: #0d5e44; }
.d-banner__x { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 4px; }
.d-banner__x:hover { opacity: 1; }
@media (max-width: 960px) { .d-banner { margin: 14px 16px 0; } }

/* Admin console */
.a-pub { position: sticky; bottom: 16px; z-index: 15; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--d-deep); color: #dcd8f6; border-radius: 16px; padding: 14px 18px; box-shadow: var(--d-shadow-lg); margin-top: 22px; }
.a-pub strong { color: #fff; }
.a-pub .d-spacer { flex: 1; }
.a-pub .d-btn--ghost { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.3); }
.a-pub .d-btn--ghost:hover { background: rgba(255,255,255,.1); }
.a-pub.is-clean { background: #fff; color: var(--d-muted); border: 1px solid var(--d-line); box-shadow: var(--d-shadow); }
.a-pub.is-clean strong { color: var(--d-text); }
.a-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--d-gold); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 4px rgba(195,155,69,.25); }
.a-pub.is-clean .a-dot { background: var(--d-pass); box-shadow: 0 0 0 4px rgba(18,128,92,.15); }
.a-edit td { padding: 8px 10px; }
.a-edit input, .a-edit select { width: 100%; padding: 9px 11px; border: 1px solid var(--d-line-2); border-radius: 9px; font: 14px var(--d-sans); color: var(--d-text); background: #fff; }
.a-edit input:focus { outline: none; border-color: var(--d-ink); box-shadow: 0 0 0 3px rgba(24,8,98,.1); }
.a-edit input.is-changed { border-color: var(--d-gold); background: #fffaf0; }
.a-edit .a-unit { position: relative; }
.a-edit .a-unit input { padding-right: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.a-edit .a-unit::after { content: attr(data-unit); position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--d-muted); font-size: 12px; font-weight: 600; pointer-events: none; }
.a-edit .a-unit.pre input { padding-left: 28px; padding-right: 11px; }
.a-edit .a-unit.pre::after { left: 11px; right: auto; }
.a-rule { display: grid; gap: 10px; }
.a-rule__top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.a-rule h4 { font-size: 15px; }
.a-rule p { margin: 4px 0 0; font-size: 13px; color: var(--d-muted); }
.a-rule .a-unit { width: 120px; flex: none; }
.a-rule input[type=range] { width: 100%; accent-color: var(--d-ink); }
.a-impact { display: grid; gap: 14px; }
.a-impact__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.a-impact__nums div { background: var(--d-bg); border-radius: 12px; padding: 12px; text-align: center; }
.a-impact__nums strong { display: block; font: 800 22px var(--d-head); color: var(--d-text); }
.a-impact__nums span { font-size: 12px; color: var(--d-muted); font-weight: 600; }
.a-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.a-chart div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.a-chart i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--d-ink-2), var(--d-ink)); min-height: 3px; transition: height .4s; }
.a-chart div:last-child i { background: linear-gradient(180deg, #d4ad59, var(--d-gold)); }
.a-chart small { font-size: 12px; color: var(--d-muted); font-weight: 600; }
.a-chart b { font-size: 11.5px; color: var(--d-text); font-variant-numeric: tabular-nums; }
.a-log { display: grid; gap: 0; }
.a-log__item { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--d-line); }
.a-log__item:last-child { border-bottom: 0; }
.a-log__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--d-tint); color: var(--d-ink); display: grid; place-items: center; }
.a-log__icon svg { width: 18px; height: 18px; }
.a-log__item ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.a-log__meta { font-size: 12.5px; color: var(--d-muted); }
.a-feat { display: grid; gap: 6px; }
.a-plan { display: grid; gap: 12px; }
.a-plan .d-switch { font-size: 13px; }
.a-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--d-pass); background: var(--d-pass-bg); padding: 4px 10px; border-radius: 999px; }
.a-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: a-pulse 1.6s infinite; }
@keyframes a-pulse { 50% { opacity: .3; } }
.d-preview-wrap { border: 1px dashed var(--d-line-2); border-radius: 14px; padding: 4px 0 14px; background: var(--d-bg); }
.d-preview-wrap .d-banner { margin: 14px 14px 0; }

.d-foot__links { display: flex; gap: 16px; margin-top: 8px; }
.d-foot__links a { color: var(--d-muted); font-weight: 600; text-decoration: none; }
.d-foot__links a:hover { color: var(--d-ink); text-decoration: underline; }

/* Continue with Google (sign-in screen) */
.ambe-auth .ambe-google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px 18px; border: 1.5px solid #dadce0; border-radius: 999px; background: #fff; color: #1f1f1f; font: 600 15px var(--d-sans); text-decoration: none; transition: background .15s, box-shadow .15s; }
.ambe-auth .ambe-google-btn:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(60, 64, 67, .12); }
.ambe-auth .ambe-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--d-muted); font-size: 12.5px; }
.ambe-auth .ambe-or::before, .ambe-auth .ambe-or::after { content: ""; flex: 1; height: 1px; background: var(--d-line); }
.ambe-auth .ambe-notice { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; background: #fdecea; color: #8e1c13; border: 1px solid #f2c4bf; }
