/* ============ BXiao Mail design system ============ */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6e8f1;
  --violet: #7c3aed; --pink: #ec4899; --orange: #f97316; --cyan: #06b6d4;
  --green: #10b981; --blue: #3b82f6; --amber: #f59e0b; --red: #ef4444; --slate: #64748b;
  --grad-brand: linear-gradient(135deg, #7c3aed 0%, #ec4899 55%, #f97316 100%);
  --grad-violet: linear-gradient(135deg, #8b5cf6, #6366f1);
  --grad-pink: linear-gradient(135deg, #f472b6, #e11d48);
  --grad-cyan: linear-gradient(135deg, #22d3ee, #3b82f6);
  --grad-green: linear-gradient(135deg, #34d399, #059669);
  --grad-orange: linear-gradient(135deg, #fbbf24, #f97316);
  --grad-blue: linear-gradient(135deg, #60a5fa, #4f46e5);
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --ring: 0 0 0 4px rgba(124, 58, 237, .16);
  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0a0e1f;
  --surface: #121833;
  --surface-2: #19203f;
  --text: #e8ecfa;
  --muted: #95a1c3;
  --border: #252e57;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --ring: 0 0 0 4px rgba(167, 139, 250, .25);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.span-2 { grid-column: span 2; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-brand); border: 0; color: #fff; box-shadow: 0 8px 20px rgba(236, 72, 153, .28); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(236, 72, 153, .38); }
.btn-dark { background: #111827; color: #fff; border-color: #111827; }
.btn-danger { color: var(--red); }
.btn-danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-sm { height: 32px; padding: 0 11px; border-radius: 10px; font-size: 13px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
textarea.input { height: auto; min-height: 120px; padding: 11px 13px; resize: vertical; }
.input:focus { border-color: var(--violet); box-shadow: var(--ring); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.input-group:focus-within { border-color: var(--violet); box-shadow: var(--ring); }
.input-group .input { border: 0; border-radius: 0; box-shadow: none !important; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; border-left: 1px solid var(--border); white-space: nowrap; }
.input-group .addon.left { border-left: 0; border-right: 1px solid var(--border); }
.input-group .btn { border: 0; border-left: 1px solid var(--border); border-radius: 0; height: auto; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cbd5e1; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--grad-brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15.5px; }
.card-body { padding: 18px 22px; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.section-title h2 { font-size: 21px; }
.section-title p { margin: 2px 0 0; color: var(--muted); }

.stat {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius); padding: 20px; min-height: 128px;
  box-shadow: 0 14px 30px -12px rgba(15, 23, 42, .35);
}
.stat::before, .stat::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.stat::before { width: 140px; height: 140px; right: -40px; top: -50px; }
.stat::after { width: 90px; height: 90px; right: 30px; bottom: -50px; background: rgba(255,255,255,.1); }
.stat .label { font-weight: 600; opacity: .9; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; position: relative; z-index: 1; }
.stat .sub { font-size: 12.5px; opacity: .88; margin-top: 2px; position: relative; z-index: 1; }
.stat .badge-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.bg-violet { background: var(--grad-violet); } .bg-pink { background: var(--grad-pink); } .bg-cyan { background: var(--grad-cyan); }
.bg-green { background: var(--grad-green); } .bg-orange { background: var(--grad-orange); } .bg-blue { background: var(--grad-blue); }
.bg-brand { background: var(--grad-brand); }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-green { background: rgba(16,185,129,.12); color: #059669; }
.b-amber { background: rgba(245,158,11,.14); color: #b45309; }
.b-red { background: rgba(239,68,68,.12); color: #dc2626; }
.b-violet { background: rgba(124,58,237,.12); color: #7c3aed; }
.b-blue { background: rgba(59,130,246,.12); color: #2563eb; }
.b-cyan { background: rgba(6,182,212,.12); color: #0891b2; }
.b-pink { background: rgba(236,72,153,.12); color: #db2777; }
.b-orange { background: rgba(249,115,22,.12); color: #ea580c; }
.b-slate { background: rgba(100,116,139,.13); color: var(--muted); }
[data-theme="dark"] .b-green { color: #34d399; } [data-theme="dark"] .b-amber { color: #fbbf24; } [data-theme="dark"] .b-red { color: #f87171; }
[data-theme="dark"] .b-violet { color: #a78bfa; } [data-theme="dark"] .b-blue { color: #60a5fa; } [data-theme="dark"] .b-cyan { color: #22d3ee; }
[data-theme="dark"] .b-pink { color: #f472b6; } [data-theme="dark"] .b-orange { color: #fb923c; }
.dns-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dns-chip { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); display: inline-flex; gap: 4px; align-items: center; }
.dns-chip.ok { background: rgba(16,185,129,.12); color: #059669; border-color: transparent; }
.dns-chip .ic { width: 12px; height: 12px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-user { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.cell-user b { display: block; font-weight: 650; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13.5px; flex: none; text-transform: uppercase; }
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 17px; }

.progress { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); }
.progress.green > i { background: var(--grad-green); } .progress.cyan > i { background: var(--grad-cyan); } .progress.orange > i { background: var(--grad-orange); }

/* ---------- app shell ---------- */
.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; color: #c7cbe8;
  background: radial-gradient(120% 60% at 0% 0%, rgba(236,72,153,.22), transparent 60%), radial-gradient(90% 50% at 100% 100%, rgba(6,182,212,.18), transparent 60%), linear-gradient(180deg, #151032, #1d1747 60%, #120e2b);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; color: #fff; }
.brand img { width: 38px; height: 38px; }
.brand b { font-size: 17.5px; display: block; letter-spacing: -.01em; }
.brand small { font-size: 11.5px; color: #a5a9d6; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.nav { display: grid; gap: 3px; overflow-y: auto; }
.nav-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8287b8; font-weight: 700; padding: 14px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: #cfd2ef; font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad-brand); }
.nav .nav-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.nav .nav-ic .ic { width: 16px; height: 16px; }
.nav .count { margin-left: auto; background: var(--grad-brand); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.upgrade-box { border-radius: 16px; padding: 16px; background: linear-gradient(135deg, rgba(124,58,237,.55), rgba(236,72,153,.45)); color: #fff; margin-bottom: 12px; border: 1px solid rgba(255,255,255,.12); }
.upgrade-box b { display: block; font-size: 14px; }
.upgrade-box p { margin: 4px 0 12px; font-size: 12.5px; opacity: .9; }
.upgrade-box .btn { background: #fff; color: #1e1b4b; border: 0; height: 34px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; position: relative; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12.5px; }
.user-chip b { font-size: 13px; display: block; line-height: 1.2; }
.user-chip small { font-size: 11.5px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; color: var(--text); background: none; border: 0; cursor: pointer; font-weight: 600; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.content { padding: 26px 28px 60px; max-width: 1400px; width: 100%; }
.menu-toggle { display: none; }
.scrim { display: none; }

/* hero banner */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; color: #fff; background: var(--grad-brand); margin-bottom: 22px;
  box-shadow: 0 20px 40px -18px rgba(236,72,153,.6);
}
.hero::before { content: ""; position: absolute; width: 360px; height: 360px; right: -80px; top: -160px; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: 180px; bottom: -150px; border-radius: 50%; background: rgba(34,211,238,.35); filter: blur(4px); }
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 26px; font-weight: 800; }
.hero p { margin: 6px 0 18px; opacity: .92; max-width: 620px; }
.hero .btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(6px); }
.hero .btn.solid { background: #fff; color: #831843; border-color: #fff; }

.announce { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(6,182,212,.12), rgba(124,58,237,.12)); border: 1px solid var(--border); margin-bottom: 18px; font-weight: 600; }

/* list rows */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.list-item:last-child { border-bottom: 0; }
.dot-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.dot-ic .ic { width: 16px; height: 16px; }

.checklist .step { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.checklist .tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); color: transparent; flex: none; }
.checklist .step.done .tick { background: var(--grad-green); border-color: transparent; color: #fff; }
.checklist .step.done .t { text-decoration: line-through; color: var(--muted); }
.checklist .tick .ic { width: 14px; height: 14px; }

/* domain cards */
.domain-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.domain-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--grad-cyan); }
.domain-card.verified::before { background: var(--grad-green); }
.domain-card.suspended::before { background: var(--grad-pink); }
.domain-card h3 { font-size: 17px; word-break: break-all; }
.domain-card .meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; }

.dns-record { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); align-items: start; }
.dns-record:last-child { border-bottom: 0; }
.dns-type { font-weight: 800; font-size: 13px; padding: 8px; border-radius: 10px; text-align: center; color: #fff; }
.kv { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px 12px; align-items: center; margin-top: 10px; }
.kv .k { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kv .v { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; word-break: break-all; }

/* plans */
.plan-card { padding: 24px; position: relative; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.plan-card .top { height: 6px; position: absolute; left: 0; right: 0; top: 0; }
.plan-card .price { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.plan-card .price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan-card ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; }
.plan-card li { display: flex; gap: 9px; align-items: center; }
.plan-card li .ic { width: 16px; height: 16px; color: var(--green); }
.plan-card.current { outline: 2px solid var(--violet); }
.plan-card .ribbon { position: absolute; right: 14px; top: 16px; }

/* timeline */
.timeline { position: relative; padding-left: 8px; }
.tl-item { display: flex; gap: 14px; padding: 10px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 16px; top: 44px; bottom: -10px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }

/* webmail */
.mail { display: grid; grid-template-columns: 230px 380px 1fr; height: calc(100vh - 150px); min-height: 520px; overflow: hidden; }
.mail-side { border-right: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.folder { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; font-weight: 600; color: var(--text); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.folder:hover { background: var(--surface); }
.folder.active { background: var(--surface); box-shadow: var(--shadow); }
.folder .fi { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.folder .fi .ic { width: 14px; height: 14px; }
.folder .n { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--violet); }
.mail-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.mail-list .search { padding: 12px; border-bottom: 1px solid var(--border); }
.mail-items { overflow-y: auto; flex: 1; }
.mail-item { display: flex; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.active { background: linear-gradient(90deg, rgba(124,58,237,.1), transparent); }
.mail-item.unread::before { content: ""; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--pink); }
.mail-item .avatar { width: 38px; height: 38px; }
.mail-item .mi-body { min-width: 0; flex: 1; }
.mail-item .mi-top { display: flex; gap: 8px; align-items: baseline; }
.mail-item .mi-from { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.mail-item.unread .mi-from, .mail-item.unread .mi-subj { font-weight: 800; }
.mail-item .mi-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mail-item .mi-subj, .mail-item .mi-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item .mi-snip { color: var(--muted); font-size: 13px; }
.mail-read { overflow-y: auto; min-width: 0; display: flex; flex-direction: column; }
.mail-read .rd-head { padding: 20px 26px; border-bottom: 1px solid var(--border); }
.mail-read .rd-head h2 { font-size: 20px; margin-bottom: 14px; word-break: break-word; }
.mail-read .rd-body { padding: 24px 26px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.mail-read .rd-tools { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.delivery { margin: 0 26px 24px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.delivery div { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.delivery div:last-child { border-bottom: 0; }

/* empty */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .em-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: var(--grad-brand); box-shadow: 0 16px 30px -14px rgba(236,72,153,.7); }
.empty .em-ic .ic { width: 30px; height: 30px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 380px; }

/* tabs */
.tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px; border-radius: 13px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* charts */
.chart { width: 100%; height: 210px; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* modal + toast */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 30, .55); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.9,.3,1.2); border: 1px solid var(--border); }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head .m-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--grad-brand); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 14px 22px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 22px 20px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; }
.toast { display: flex; gap: 11px; align-items: center; min-width: 260px; max-width: 420px; padding: 13px 16px; border-radius: 14px; background: #111827; color: #fff; box-shadow: var(--shadow-lg); animation: slide .25s ease; font-weight: 600; }
.toast .t-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast.success .t-ic { background: var(--grad-green); } .toast.error .t-ic { background: var(--grad-pink); } .toast.info .t-ic { background: var(--grad-cyan); }
.toast .t-ic .ic { width: 14px; height: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }

/* ---------- auth page ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #0d0a24; color: #fff; position: relative; overflow: hidden; }
.auth .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 14s ease-in-out infinite; }
.auth .b1 { width: 460px; height: 460px; background: #7c3aed; left: -120px; top: -120px; }
.auth .b2 { width: 380px; height: 380px; background: #ec4899; left: 30%; bottom: -160px; animation-delay: -4s; }
.auth .b3 { width: 320px; height: 320px; background: #06b6d4; right: 10%; top: 10%; animation-delay: -8s; }
.auth .b4 { width: 260px; height: 260px; background: #f97316; right: -60px; bottom: 10%; animation-delay: -2s; }
@keyframes float { 50% { transform: translate(30px, -30px) scale(1.08); } }
.auth-left { position: relative; z-index: 1; padding: 48px 56px; display: flex; flex-direction: column; }
.auth-left .brand { padding: 0; }
.auth-left .brand img { width: 46px; height: 46px; }
.auth-left .brand b { font-size: 22px; }
.auth-left h1 { font-size: 46px; font-weight: 800; letter-spacing: -.03em; margin: 56px 0 16px; line-height: 1.08; }
.auth-left .lead { font-size: 17px; color: #cfd0ee; max-width: 520px; margin: 0 0 32px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 600px; }
.feature { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.feature .f-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.feature b { display: block; font-size: 14px; }
.feature span { font-size: 12.5px; color: #b9bbe0; }
.auth-left .foot { margin-top: auto; padding-top: 32px; color: #8f92c4; font-size: 13px; }
.auth-right { position: relative; z-index: 1; display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 430px; background: rgba(255,255,255,.97); color: #0f172a; border-radius: 26px; padding: 32px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); }
.auth-card h2 { font-size: 24px; font-weight: 800; }
.auth-card .sub { color: #64748b; margin: 6px 0 22px; }
.auth-card .tabs { width: 100%; margin-bottom: 22px; background: #f1f2f8; border-color: #e6e8f1; }
.auth-card .tabs button { flex: 1; color: #64748b; }
.auth-card .tabs button.active { background: #fff; color: #0f172a; }
.auth-card .input, .auth-card .input-group { background: #fff; border-color: #e2e5ef; color: #0f172a; }
.auth-card .input-group .btn { background: #f7f8fc; color: #64748b; }
.first-user { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: linear-gradient(90deg, rgba(124,58,237,.1), rgba(236,72,153,.1)); color: #6d28d9; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.coming { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 18px; color: #94a3b8; font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mail { grid-template-columns: 200px 320px 1fr; }
}
@media (max-width: 1080px) {
  .mail { grid-template-columns: 1fr; height: auto; }
  .mail-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .mail-side .folders { display: flex; flex-wrap: wrap; gap: 6px; }
  .mail-side .folder { width: auto; }
  .mail-list { border-right: 0; max-height: 420px; }
  .mail-read { border-top: 1px solid var(--border); min-height: 300px; }
  .auth { grid-template-columns: 1fr; }
  .auth-left h1 { font-size: 36px; margin-top: 32px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .menu-toggle { display: inline-flex; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .content { padding: 20px 16px 50px; }
  .topbar { padding: 12px 16px; }
  .user-chip .who { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .auth-left { padding: 32px 24px; }
  .dns-record { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr auto; }
  .kv .k { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
  .hero h2 { font-size: 21px; }
}
