:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e3e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #be1622;        /* net97 brand red */
    --primary-dark: #9d111b;
    --primary-soft: #fbe9eb;
    --danger: #dc2626;
    --ok: #16a34a;
    --warn: #d97706;
    --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.05);
    --radius: 12px;
    --sidebar-w: 240px;
    font-synthesis: none;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }

/* ---- App shell --------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
    background: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: block; padding: 4px 6px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.brand img.brand-logo { display: block; width: 100%; max-width: 190px; height: auto; }
.brand-sub { display: block; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-top: 9px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #475569; font-weight: 500; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-item.is-active { background: var(--primary); color: #fff; }
.nav-item svg { width: 19px; height: 19px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 10px 8px 0; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 26px; background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 18px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }

.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border); border-radius: 30px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; color: var(--text); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 190px; overflow: hidden; }
.user-menu-head { padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.user-menu-item { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; font: inherit; cursor: pointer; color: var(--text); }
.user-menu-item:hover { background: var(--surface-2); }

.content { padding: 24px 26px 60px; }

/* ---- KPIs -------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-link:hover { border-color: var(--primary); text-decoration: none; }
.kpi-value { font-size: 30px; font-weight: 720; letter-spacing: -.02em; }
.kpi-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi-warn .kpi-value { color: var(--warn); }

/* ---- Toolbar / filters ------------------------------------------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-sync { white-space: nowrap; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-search { min-width: 280px; }
textarea { resize: vertical; }

/* ---- Buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 8px 15px; font: inherit; font-weight: 550; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; justify-content: center; }
.link { color: var(--primary); background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.link-danger { color: var(--danger); }

/* ---- Cards / tables ---------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-grow { flex: 1; }
.card-title { margin: 0 0 14px; font-size: 15px; font-weight: 650; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.table-compact td, .table-compact th { padding: 7px 10px; }
.td-domain a { font-weight: 600; }
.td-empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.td-actions { text-align: right; white-space: nowrap; display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.sort { color: var(--muted); }
.sort:hover { color: var(--text); }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover, .table th[aria-sort] { color: var(--text); }
.table th.is-sortable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; color: var(--text); }
.table th .sort-arrow { font-size: 11px; }

.status { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.status-active, .status-ok, .status-connect, .status-registered { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.status-hold, .status-pending, .status-transfer { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.status-failed, .status-error, .status-deleted { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.exp { font-variant-numeric: tabular-nums; }
.exp-over { color: var(--danger); font-weight: 650; }
.exp-30 { color: var(--warn); font-weight: 650; }
.exp-60 { color: #ca8a04; }

/* ---- Pagination / table footer ---------------------------------------- */
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; }
.table-foot { display: flex; align-items: center; gap: 16px; padding-top: 14px; flex-wrap: wrap; }
.per-page { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.per-page select { width: auto; padding: 5px 8px; }
.foot-count { font-size: 13px; }
.refresh-note { margin-bottom: 12px; }
.pager { display: flex; gap: 8px; margin-left: auto; }
.pager-btn { border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; }
.pager-btn.is-disabled { color: var(--muted); opacity: .5; }

/* ---- Detail ------------------------------------------------------------ */
.detail-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.link-back { color: var(--muted); }
.detail-title { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 12px; flex: 1; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.detail-grid > .detail-span { grid-column: 1 / -1; }
/* Customer assignment: wide combobox grows, Save button sits beside it. */
.customer-assign { display: flex; align-items: flex-start; gap: 10px; }
.customer-assign .combo { flex: 1 1 auto; min-width: 0; }
/* Abonnements (Plesk structure) */
.badge-plan { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary-soft); }
/* Service-plan filter buttons */
.plan-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.plan-filter-btn { text-decoration: none; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.plan-filter-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.plan-filter-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.plan-filter-btn.is-active:hover { color: #fff; }
.plan-filter-note { margin-top: 8px; font-size: 13px; }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-main { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.sub-block { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 12px; }
.sub-block:first-of-type { border-top: 0; padding-top: 4px; margin-top: 4px; }
.sub-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sub-count { font-size: 12.5px; }
.sub-plesk { margin-left: auto; font-size: 12.5px; }
.sub-empty { margin: 2px 0 0; font-size: 13px; }
.td-right { text-align: right; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.ns-list { margin: 0; padding-left: 18px; }
.ns-list li { padding: 2px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stack select, .stack textarea { width: 100%; }
.raw { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; max-height: 280px; font-size: 12px; }
.note-box { background: var(--surface-2); border: 1px solid var(--border); color: #475569; border-radius: 9px; padding: 12px 14px; font-size: 13px; margin-top: 12px; }

/* ---- Forms / split ----------------------------------------------------- */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
/* Editor + list: give the editor (with its body textarea) the wider share. */
.split-editor { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
/* The edit form is a .stack (align-items:flex-start), which would otherwise size
   each label to its content width and leave the fields narrow. Stretch the labels
   so the inputs/textarea fill the (now wider) card. */
.split-editor .stack > label { width: 100%; }
label.stack, .login-form label, .split label { display: block; margin-bottom: 4px; }
.split label span, .login-form label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.split label input, .split label textarea { width: 100%; }
.form-actions { display: flex; gap: 10px; }
.row-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.inline-search { display: flex; gap: 8px; }

/* ---- Badges / flash ---------------------------------------------------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.badge-warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.badge-ok { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.badge-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.ns-order { white-space: nowrap; }
.ns-order .inline-form { display: inline; }
.ns-arrow { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 12px; line-height: 1; padding: 0 3px; }
.ns-arrow[disabled] { color: var(--border); cursor: default; }
.badge-alias { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.badge-task { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; white-space: nowrap; }
.badge-count { text-decoration: none; min-width: 24px; text-align: center; }
.badge-count:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.active-filters-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.active-filters-clear { font-size: 13px; margin-left: 2px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 11px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); color: var(--text); font-size: 13px; }
.filter-chip code { background: transparent; padding: 0; color: var(--primary-dark); font-weight: 600; }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 2px; }
.chip-x:hover { color: var(--danger); }

.flash-stack { padding: 14px 26px 0; display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; justify-content: space-between; align-items: center; padding: 11px 15px; border-radius: 9px; border: 1px solid; font-weight: 500; }
.flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.flash-close { background: none; border: 0; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; }

/* ---- Spinner ----------------------------------------------------------- */
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Auth -------------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(140deg, #be1622 0%, #7a0f16 100%); }
.login-card { background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 34px; width: 360px; max-width: 100%; }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head h1 { margin: 10px 0 2px; font-size: 20px; }
.login-head p { color: var(--muted); margin: 0; font-size: 13px; }
.login-head img.brand-logo { display: block; width: 100%; max-width: 210px; height: auto; margin: 0 auto 6px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input { width: 100%; }
.auth-shell .flash { width: 360px; max-width: 100%; }

/* ---- Phase 2/3 additions ---------------------------------------------- */
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: block; }
.form-grid label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-grid label input, .form-grid label select { width: 100%; }
.form-grid .col-2 { grid-column: 1 / -1; }
.w-full { width: 100%; }
.w-full input { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.check-result { margin-top: 14px; }
.check-box { padding: 12px 15px; border-radius: 9px; border: 1px solid var(--border); }
.check-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check-taken { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.check-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alt-tlds { margin-top: 16px; }
.alt-tlds-head { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.alt-tlds-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.alt-tld { display: flex; align-items: center; gap: 8px 10px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); flex-wrap: wrap; }
.alt-domain { font-weight: 600; flex: 1 1 110px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alt-status { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.alt-ok { background: #ecfdf5; color: var(--ok); }
.alt-taken { background: var(--surface-2); color: var(--muted); }
.alt-unknown { background: #fffbeb; color: var(--warn); }

/* ---- Searchable handle combobox (registration) ------------------------ */
.combo { position: relative; }
.combo-input { width: 100%; padding-right: 28px; }
.combo-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 17px; line-height: 1; padding: 0 2px; }
.combo-clear:hover { color: var(--danger); }
.combo-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.combo-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.combo-empty { color: var(--muted); cursor: default; }
.combo-new { border-top: 1px solid var(--border); color: var(--primary); font-weight: 600; margin-top: 4px; }
.check-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.task-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); }
.task-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.task-pending { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.task-failed { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.task-other { background: var(--surface-2); color: var(--muted); }

/* ---- Phase 4: lifecycle actions --------------------------------------- */
.section-title { font-size: 16px; font-weight: 650; margin: 8px 0 14px; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
/* Inside .form-grid the rules `label { display:block }` and `label input { width:100% }`
   are more specific than a bare `.check-inline`, which would stack the caption and
   stretch the checkbox. Re-assert the inline-checkbox layout with matching specificity. */
.check-inline input, .form-grid label.check-inline input { width: auto; }
.form-grid label.check-inline { display: flex; }
.authcode { font-size: 13px; background: #0f172a; color: #e2e8f0; padding: 3px 8px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.danger-zone { border-color: #fecaca; background: #fff7f7; }
.danger-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---- Phase 5: DNS editor ---------------------------------------------- */
.dns-table input, .dns-table select { width: 100%; padding: 6px 8px; }
.dns-table td { padding: 5px 6px; vertical-align: middle; }
.dns-table td:nth-child(4), .dns-table td:nth-child(5) { width: 80px; }
.dns-table .is-dim { opacity: .4; }
.dns-table input.is-dim:focus { opacity: 1; }

.hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---- 2FA --------------------------------------------------------------- */
.setup-steps { margin: 0 0 16px; padding-left: 20px; color: var(--muted); }
.setup-steps li { margin: 4px 0; }
.twofa-setup { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
#qrcode { background: #fff; padding: 10px; border: 1px solid var(--border); border-radius: 8px; line-height: 0; }
.twofa-manual { min-width: 220px; }
.recovery-box { background: #fffbeb; border-color: #fde68a; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; max-width: 360px; }
.recovery-codes code { background: #0f172a; color: #e2e8f0; padding: 8px 12px; border-radius: 6px; text-align: center; font-size: 14px; letter-spacing: 1px; }

/* ---- REST API access --------------------------------------------------- */
.token-reveal { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 14px; margin: 4px 0 16px; }
.token-reveal .token-value { display: block; margin-top: 8px; background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 6px; font-size: 14px; word-break: break-all; user-select: all; }
.code-block { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.55; margin: 12px 0; white-space: pre; }
.api-docs > summary { cursor: pointer; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.api-docs .table code { font-size: 12px; }

/* ---- Customer ↔ handle comparison (Abgleich) --------------------------- */
.compare-table th:first-child, .compare-table td:first-child { width: 140px; color: var(--muted); }
.compare-table .row-diff td { background: #fff7ed; }
.compare-table .row-diff td:first-child { color: var(--primary); font-weight: 600; }

/* ---- Inline handle edit (domain detail Eckdaten) ----------------------- */
.handle-inline { width: 100%; max-width: 190px; padding: 3px 7px; font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.handle-save { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.handle-save .muted { font-size: 12px; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.dns-records td { font-size: 13px; }
.dns-records .dns-content { word-break: break-all; }

/* ---- Mail preview ------------------------------------------------------ */
.mail-preview { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; background: var(--surface-2, #f8fafc); }
.mail-body { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px;
    background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; margin: 8px 0 12px; }

/* ---- Empty state ------------------------------------------------------- */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-code { font-size: 56px; font-weight: 800; color: var(--border); }

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
    .nav { flex-direction: row; }
    .sidebar-foot, .brand-name { display: none; }
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .detail-grid, .split { grid-template-columns: 1fr; }
}
