/* ==========================================================================
   橙猫邮箱 · 设计系统
   ========================================================================== */

:root {
  --brand: #f97316;
  --brand-strong: #ea580c;
  --brand-soft: #fff3e8;
  --brand-ring: rgba(249, 115, 22, 0.28);
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5e9f2;
  --line-strong: #d5dce9;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.16);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, monospace;

  --sidebar-w: 248px;
  --list-w: 392px;
  --topbar-h: 64px;
}

[data-theme="dark"] {
  --brand-soft: rgba(249, 115, 22, 0.14);
  --bg: #080d18;
  --bg-elevated: #0e1524;
  --surface: #111a2c;
  --surface-2: #152034;
  --surface-3: #1b2740;
  --ink: #eef2f9;
  --ink-2: #c8d3e6;
  --muted: #8b9ab5;
  --muted-2: #64748b;
  --line: #1f2b44;
  --line-strong: #2b3a58;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.9; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ */
/* 按钮                                                                */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #fb8a3c, var(--brand-strong));
  color: #fff; box-shadow: 0 6px 18px rgba(234, 88, 12, .24);
}
.btn-primary:hover { background: linear-gradient(135deg, #fb8a3c, #d94d0a); box-shadow: 0 8px 22px rgba(234, 88, 12, .3); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1e293b; }

.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, .1); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.active { color: var(--brand-strong); background: var(--brand-soft); }

/* ------------------------------------------------------------------ */
/* 表单                                                                */
/* ------------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label {
  font-size: 12px; font-weight: 600; letter-spacing: .2px; color: var(--muted);
  text-transform: uppercase;
}
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 88px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input[disabled] { background: var(--surface-2); color: var(--muted); }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .input { flex: 1; }
.hint { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12.5px; color: var(--danger); }
.success-text { font-size: 12.5px; color: var(--success); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong);
  transition: background .18s ease; position: relative; flex: none;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }

/* ------------------------------------------------------------------ */
/* 通用结构                                                            */
/* ------------------------------------------------------------------ */

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #fdba74, var(--brand-strong) 65%);
  box-shadow: 0 8px 18px rgba(234, 88, 12, .26);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-size: 16px; font-weight: 750; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .4px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 650; letter-spacing: .1px;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge-success { background: rgba(16, 185, 129, .12); color: #047857; }
.badge-warning { background: rgba(245, 158, 11, .14); color: #b45309; }
.badge-danger { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.badge-muted { background: var(--surface-3); color: var(--muted); }
[data-theme="dark"] .badge-success { color: #34d399; }
[data-theme="dark"] .badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge-danger { color: #f87171; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }

.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(140deg, #94a3b8, #64748b);
  letter-spacing: .2px;
}
.avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.card-pad { padding: 22px; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.empty-state {
  display: grid; place-items: center; gap: 10px; padding: 64px 24px;
  text-align: center; color: var(--muted);
}
.empty-state .empty-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted-2); border: 1px dashed var(--line-strong);
}
.empty-state h3 { font-size: 15px; color: var(--ink); }
.empty-state p { font-size: 13px; max-width: 320px; line-height: 1.7; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------------------------------------------ */
/* 登录 / 引导页                                                       */
/* ------------------------------------------------------------------ */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.auth-aside {
  position: relative; overflow: hidden; padding: 56px 60px; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #ffb26b 0%, #f97316 38%, #c2410c 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::before, .auth-aside::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .12); filter: blur(2px);
}
.auth-aside::before { width: 520px; height: 520px; right: -220px; top: -180px; }
.auth-aside::after { width: 360px; height: 360px; left: -140px; bottom: -160px; background: rgba(255,255,255,.08); }
.auth-aside .brand { position: relative; z-index: 1; }
.auth-aside .brand-mark { background: rgba(255,255,255,.18); box-shadow: none; backdrop-filter: blur(6px); }
.auth-copy { position: relative; z-index: 1; max-width: 460px; }
.auth-copy h1 { font-size: 34px; line-height: 1.25; letter-spacing: -.8px; font-weight: 760; }
.auth-copy p { margin-top: 14px; font-size: 14.5px; line-height: 1.8; color: rgba(255,255,255,.86); }
.auth-points { display: grid; gap: 12px; margin-top: 30px; }
.auth-point { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.92); }
.auth-point .icon { color: #fff; margin-top: 2px; }
.auth-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.7); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: min(420px, 100%); }
.auth-card-head { margin-bottom: 26px; }
.auth-card-head h2 { font-size: 24px; letter-spacing: -.5px; font-weight: 760; }
.auth-card-head p { margin-top: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.sso-box {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.sso-provider { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.sso-provider .sso-logo {
  width: 38px; height: 38px; border-radius: 10px; background: #111; color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.sso-provider strong { display: block; font-size: 14px; }
.sso-provider span { font-size: 12px; color: var(--muted); }
.sso-note { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.alert {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.65; border: 1px solid transparent;
}
.alert-warning { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .3); color: #92400e; }
.alert-danger { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .25); color: #b91c1c; }
.alert-info { background: rgba(14, 165, 233, .08); border-color: rgba(14, 165, 233, .22); color: #075985; }
[data-theme="dark"] .alert-warning { color: #fbbf24; }
[data-theme="dark"] .alert-danger { color: #fca5a5; }
[data-theme="dark"] .alert-info { color: #7dd3fc; }

.onboarding { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
  background: radial-gradient(1000px 500px at 50% -10%, var(--brand-soft), transparent 60%), var(--bg); }
.onboarding-card { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 34px; }
.onboarding-step { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.step-index { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand-strong); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.onboarding h1 { font-size: 24px; letter-spacing: -.5px; }
.onboarding .lead { margin-top: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.address-builder { display: grid; grid-template-columns: 1fr 200px; gap: 10px; margin-top: 22px; }
.address-preview { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2);
  border: 1px dashed var(--line-strong); font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.quota-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.quota-strip .quota-dots { display: flex; gap: 6px; }
.quota-dot { width: 26px; height: 6px; border-radius: 99px; background: var(--line-strong); }
.quota-dot.on { background: var(--brand); }
.onboarding-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }

/* ------------------------------------------------------------------ */
/* 邮箱主框架                                                          */
/* ------------------------------------------------------------------ */

.mail-app { height: 100vh; display: grid; grid-template-rows: var(--topbar-h) 1fr; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--line); position: relative; z-index: 30;
}
.topbar .brand { min-width: 200px; }
.search-box {
  flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.search-box:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-ring); }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13.5px; }
.search-box kbd {
  font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong);
  padding: 1px 6px; border-radius: 5px; background: var(--surface);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mailbox-switch {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.mailbox-switch:hover { border-color: var(--line-strong); background: var(--surface-2); }
.mailbox-switch .avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; }
.user-chip:hover { background: var(--surface-3); }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.user-chip .who { display: none; }
@media (min-width: 1100px) { .user-chip .who { display: block; line-height: 1.2; } }
.user-chip .who strong { display: block; font-size: 12.5px; }
.user-chip .who span { font-size: 11px; color: var(--muted); }

.mail-body { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 0; }

.sidebar {
  border-right: 1px solid var(--line); background: var(--bg-elevated);
  display: flex; flex-direction: column; min-height: 0; padding: 16px 12px 12px;
}
.sidebar-compose { width: 100%; height: 44px; border-radius: 12px; margin-bottom: 14px; justify-content: flex-start; padding-left: 16px; }
.folder-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.folder-nav .nav-label {
  font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2);
  font-weight: 700; padding: 10px 12px 6px;
}
.folder-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px;
  border-radius: 9px; color: var(--ink-2); font-size: 13px; font-weight: 550;
  border: 0; background: transparent; text-align: left; width: 100%;
}
.folder-item:hover { background: var(--surface-2); }
.folder-item.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; }
.folder-item .icon { color: currentColor; opacity: .8; }
.folder-item .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.folder-item.active .count { color: var(--brand-strong); }
.folder-item .count.strong { color: var(--brand-strong); }
.storage-card { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.storage-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fb923c, var(--brand-strong)); }
.storage-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.storage-actions a { font-size: 11.5px; font-weight: 600; }

.list-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-elevated); }
.list-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.list-title-row { display: flex; align-items: center; gap: 10px; }
.list-title-row h1 { font-size: 18px; letter-spacing: -.3px; font-weight: 720; }
.list-title-row .badge { margin-left: 2px; }
.list-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.list-sub { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 26px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink-2); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.bulk-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 20px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12px;
}
.bulk-bar .selected-count { font-weight: 650; color: var(--ink-2); margin-right: 4px; }
.bulk-bar .btn { height: 30px; padding: 0 10px; }

.thread-list { flex: 1; overflow-y: auto; min-height: 0; }
.thread-row {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: flex-start;
  padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
  transition: background .12s ease;
}
.thread-row:hover { background: var(--surface-2); }
.thread-row.active { background: var(--brand-soft); }
.thread-row.unread { background: var(--surface); }
.thread-row.unread.active { background: var(--brand-soft); }
.thread-row.unread .thread-subject { font-weight: 720; color: var(--ink); }
.thread-row.unread .thread-sender { color: var(--ink); }
.thread-row .unread-dot { position: absolute; left: 8px; top: 22px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.thread-main { min-width: 0; }
.thread-sender-row { display: flex; align-items: center; gap: 8px; }
.thread-sender { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-count { font-size: 10.5px; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 0 6px; height: 16px; display: inline-flex; align-items: center; }
.thread-subject { font-size: 13px; font-weight: 550; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-snippet { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.thread-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.thread-flags { display: flex; align-items: center; gap: 5px; color: var(--muted-2); }
.thread-flags .icon { width: 14px; height: 14px; }
.star-btn { color: var(--muted-2); transition: color .15s ease, transform .15s ease; }
.star-btn:hover { color: var(--warning); transform: scale(1.08); }
.star-btn.on { color: var(--warning); }
.thread-tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.list-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.reader-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.reader-empty { flex: 1; display: grid; place-items: center; }
.reader-head {
  display: flex; align-items: center; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  min-height: 58px; flex-wrap: wrap;
}
.reader-head .subject-line { flex: 1; min-width: 200px; }
.reader-head h2 { font-size: 17px; letter-spacing: -.3px; font-weight: 720; }
.reader-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 24px 28px 40px; }
.thread-message { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 22px; }
.thread-message:last-child { border-bottom: 0; }
.message-head { display: flex; gap: 12px; align-items: flex-start; }
.message-head .who { flex: 1; min-width: 0; }
.message-from { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.message-from strong { font-size: 14px; }
.message-from .addr { font-size: 12px; color: var(--muted); }
.message-to { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.message-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.message-body { margin-top: 16px; font-size: 14px; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; }
.message-body p { margin: 0 0 12px; }
.message-body ul, .message-body ol { margin: 0 0 12px; padding-left: 22px; }
.message-body blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--line-strong); color: var(--muted); background: var(--surface-2); }
.message-body table { border-collapse: collapse; margin: 12px 0; max-width: 100%; }
.message-body td, .message-body th { border: 1px solid var(--line); padding: 6px 10px; }
.message-body pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; font-family: var(--mono); font-size: 12px; }
.message-body a { color: var(--accent); text-decoration: underline; }
.message-collapsed { cursor: pointer; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; gap: 12px; }
.message-collapsed:hover { border-color: var(--line-strong); }
.message-collapsed .summary { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-banner {
  display: flex; gap: 10px; padding: 12px 14px; margin-bottom: 18px; border-radius: 12px;
  background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .28); color: #92400e; font-size: 12.5px; line-height: 1.6;
}
.security-banner.danger { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .28); color: #b91c1c; }
[data-theme="dark"] .security-banner { color: #fbbf24; }
[data-theme="dark"] .security-banner.danger { color: #fca5a5; }
.attachments { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.attachment {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); min-width: 180px; max-width: 280px;
}
.attachment:hover { border-color: var(--line-strong); }
.attachment .file-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.attachment .file-info { min-width: 0; }
.attachment .file-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment .file-size { font-size: 11px; color: var(--muted); }
.reply-bar { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* 邮件编写器                                                          */
/* ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 13, 24, .5); backdrop-filter: blur(4px);
  z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 20px;
  animation: fade-in .16s ease;
}
.modal {
  width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: pop-in .18s ease;
}
.modal.modal-sm { width: min(460px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.compose-field { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.compose-field > span { width: 52px; font-size: 12.5px; color: var(--muted); flex: none; }
.compose-field input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13.5px; height: 30px; }
.compose-subject input { font-size: 15px; font-weight: 650; }
.recipient-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-height: 30px; }
.recipient-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px;
  border-radius: 8px; background: var(--surface-3); font-size: 12px;
}
.recipient-chip button { border: 0; background: none; color: var(--muted); display: grid; place-items: center; padding: 0; }
.recipient-chip button:hover { color: var(--danger); }
.recipient-chips input { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; font-size: 13px; height: 28px; }
.suggestions {
  position: absolute; z-index: 100; width: min(340px, 90vw); max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px;
}
.suggestion { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.suggestion:hover { background: var(--surface-2); }
.suggestion strong { display: block; font-weight: 600; }
.suggestion span { font-size: 11px; color: var(--muted); }
.editor-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.editor-toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.editor {
  min-height: 240px; max-height: 42vh; overflow-y: auto; padding: 14px 2px; outline: none;
  font-size: 14px; line-height: 1.8; color: var(--ink-2);
}
.editor:empty::before { content: attr(data-placeholder); color: var(--muted-2); }
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12px;
}
.attach-chip button { border: 0; background: none; color: var(--muted); padding: 0; }
.attach-chip button:hover { color: var(--danger); }
.compose-foot { display: flex; align-items: center; gap: 8px; }
.compose-foot .spacer { flex: 1; }
.compose-signature { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.drop-hint { font-size: 11.5px; color: var(--muted-2); margin-left: auto; }

/* ------------------------------------------------------------------ */
/* 设置 / 安全 / 计费 / 联系人                                         */
/* ------------------------------------------------------------------ */

.page { max-width: 1000px; margin: 0 auto; padding: 30px 28px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; letter-spacing: -.5px; font-weight: 760; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.section { margin-bottom: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; font-weight: 700; }
.section-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: 160px 1fr; gap: 14px 20px; align-items: center; }
.form-grid .field { display: contents; }
.form-grid label { font-size: 12.5px; color: var(--muted); }
.form-grid .control { max-width: 460px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .setting-text strong { display: block; font-size: 13px; font-weight: 650; }
.setting-row .setting-text span { font-size: 12px; color: var(--muted); }
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.radio-card {
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface-2);
}
.radio-card input { display: none; }
.radio-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.radio-card strong { display: block; font-size: 13px; }
.radio-card span { font-size: 11.5px; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.plan-card .plan-name { font-size: 15px; font-weight: 720; }
.plan-card .plan-price { font-size: 26px; font-weight: 780; letter-spacing: -.6px; margin: 8px 0 2px; }
.plan-card .plan-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; }
.plan-features li { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.plan-features .icon { color: var(--success); width: 15px; height: 15px; margin-top: 2px; }
.order-row, .mail-row, .log-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.order-row:last-child, .mail-row:last-child, .log-row:last-child { border-bottom: 0; }
.log-row .log-main { flex: 1; min-width: 0; }
.log-row .log-time { color: var(--muted); font-size: 11.5px; }
.session-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.session-card .meta { flex: 1; min-width: 0; }
.session-card .meta strong { font-size: 12.5px; }
.session-card .meta span { display: block; font-size: 11.5px; color: var(--muted); }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.contact-card .meta { min-width: 0; flex: 1; }
.contact-card .meta strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card .meta span { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* 下拉菜单 / 提示                                                     */
/* ------------------------------------------------------------------ */

.menu {
  position: absolute; z-index: 80; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
  animation: pop-in .14s ease;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; background: transparent; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); text-align: left;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.active { background: var(--brand-soft); color: var(--brand-strong); }
.menu-item .menu-sub { font-size: 10.5px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.menu-label { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted-2); padding: 8px 10px 4px; font-weight: 700; }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 240px; max-width: 380px; padding: 12px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-md); font-size: 12.5px; line-height: 1.5;
  display: flex; align-items: center; gap: 10px; animation: slide-up .2s ease;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
.toast .toast-action { margin-left: auto; color: #fbbf24; font-weight: 650; background: none; border: 0; font-size: 12px; }
.toast .close { background: none; border: 0; color: rgba(255,255,255,.6); padding: 0; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ */
/* 响应式                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  :root { --sidebar-w: 220px; --list-w: 340px; }
  .mail-body { grid-template-columns: var(--sidebar-w) 1fr; }
}

@media (max-width: 900px) {
  .mail-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .list-pane { border-right: 0; }
  .reader-pane { display: none; }
  .mail-app.reader-open .list-pane { display: none; }
  .mail-app.reader-open .reader-pane { display: flex; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .page { padding: 22px 18px 50px; }
  .plan-grid, .radio-cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .control { max-width: none; }
}

@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar .brand { min-width: 0; }
  .brand-sub { display: none; }
  .search-box kbd { display: none; }
  .thread-row { padding: 12px 14px; grid-template-columns: 38px 1fr auto; }
  .reader-scroll { padding: 18px 16px 32px; }
  .address-builder { grid-template-columns: 1fr; }
  .onboarding-card { padding: 24px; }
}

/* ------------------------------------------------------------------ */
/* 布局补充                                                            */
/* ------------------------------------------------------------------ */

.app-root { height: 100%; }
.main-area { min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--list-w) 1fr; }
.main-area.page-mode { display: block; overflow-y: auto; background: var(--bg); }
.page-loading { color: var(--muted); font-size: 13px; }
.reader-pane { background: var(--surface); }
.reader-back { display: none; }
.message-body img { max-width: 100%; height: auto; border-radius: 6px; }
.message-body a { word-break: break-all; }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line-strong); padding: 1px 6px; border-radius: 5px; background: var(--surface);
}
code { font-family: var(--mono); }

@media (max-width: 900px) {
  .reader-back { display: inline-grid !important; }
  .main-area { grid-template-columns: 1fr; }
  .mail-app.reader-open .reader-pane { display: flex; }
}

@media (max-width: 560px) {
  .list-footer { padding: 10px 14px; }
  .list-head { padding: 14px 14px 10px; }
}

/* ================================================================== */
/* 管理后台                                                            */
/* ================================================================== */

.admin-login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.admin-aside {
  position: relative; overflow: hidden; padding: 52px 56px; color: #fff;
  background: linear-gradient(160deg, #0a1120 0%, #101d33 52%, #1d2d4a 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.admin-aside::before { content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  right: -260px; top: -240px; background: radial-gradient(circle, rgba(249,115,22,.28), transparent 65%); }
.admin-aside::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  left: -160px; bottom: -180px; background: radial-gradient(circle, rgba(14,165,233,.22), transparent 65%); }
.admin-aside .brand, .admin-aside .admin-copy, .admin-aside .admin-foot { position: relative; z-index: 1; }
.admin-copy h1 { font-size: 32px; line-height: 1.3; letter-spacing: -.8px; font-weight: 760; margin-top: 40px; }
.admin-copy p { margin-top: 14px; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.8; max-width: 440px; }
.admin-points { display: grid; gap: 14px; margin-top: 32px; }
.admin-point { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.85); }
.admin-point .icon { color: #fb923c; margin-top: 2px; }
.admin-foot { font-size: 12px; color: rgba(255,255,255,.45); }
.admin-login-main { display: grid; place-items: center; padding: 40px 24px; }
.admin-login-card { width: min(420px, 100%); }
.admin-login-card h2 { font-size: 24px; letter-spacing: -.5px; }
.admin-login-card .lead { color: var(--muted); font-size: 13.5px; margin-top: 8px; line-height: 1.7; }
.admin-login-form { margin-top: 26px; display: grid; gap: 14px; }
.demo-credential { margin-top: 16px; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--line-strong);
  background: var(--surface-2); font-size: 12px; color: var(--muted); line-height: 1.7; }
.demo-credential code { color: var(--brand-strong); }

.admin-app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  background: #0a1120; color: #b9c6dd; padding: 20px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; gap: 4px;
}
.admin-sidebar .brand { padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.admin-sidebar .brand-name { color: #fff; font-size: 15px; }
.admin-sidebar .brand-sub { color: rgba(255,255,255,.4); }
.admin-nav-label { font-size: 10px; letter-spacing: .9px; text-transform: uppercase; color: rgba(255,255,255,.35);
  padding: 12px 12px 6px; font-weight: 700; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #b9c6dd; font-size: 13px; font-weight: 550; text-decoration: none; border: 0; background: transparent; width: 100%;
}
.admin-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.admin-nav-item.active { background: linear-gradient(100deg, rgba(249,115,22,.22), rgba(249,115,22,.08)); color: #fdba74; }
.admin-nav-item .badge { margin-left: auto; }
.admin-sidebar-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-operator { display: flex; align-items: center; gap: 10px; }
.admin-operator .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.admin-operator .who { flex: 1; min-width: 0; line-height: 1.3; }
.admin-operator .who strong { display: block; color: #fff; font-size: 12.5px; }
.admin-operator .who span { font-size: 11px; color: rgba(255,255,255,.45); }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 26px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { font-size: 16px; font-weight: 720; letter-spacing: -.2px; }
.admin-topbar .crumb { font-size: 12px; color: var(--muted); }
.admin-content { padding: 24px 28px 70px; width: 100%; max-width: 1480px; }
.admin-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.kpi .kpi-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .kpi-value { font-size: 27px; font-weight: 780; letter-spacing: -.8px; margin-top: 8px; }
.kpi .kpi-foot { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi .kpi-foot strong { color: var(--success); }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.chart { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #fdba74, var(--brand-strong)); min-height: 3px; transition: height .3s ease; }
.chart-label { font-size: 10.5px; color: var(--muted-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 780px; }
table.data th { text-align: left; padding: 11px 14px; background: var(--surface-2); color: var(--muted);
  font-weight: 650; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data .cell-main { font-weight: 600; color: var(--ink); }
table.data .cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
table.data .cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.table-toolbar .input { width: 240px; height: 36px; }
.table-toolbar .select { width: 150px; height: 36px; }
.dns-records { display: grid; gap: 8px; }
.dns-record { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.dns-record code { font-family: var(--mono); font-size: 11px; color: var(--ink-2); word-break: break-all; }
.dns-record .verified { color: var(--success); font-weight: 600; }
.check-list { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.check-row .ok { color: var(--success); }
.check-row .fail { color: var(--muted-2); }
.audit-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row .audit-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex: none; }
.audit-row .audit-main { flex: 1; min-width: 0; font-size: 12.5px; }
.audit-row .audit-main strong { font-weight: 600; }
.audit-row pre { margin: 6px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px;
  font-size: 11px; overflow-x: auto; color: var(--muted); }
.filter-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.filter-tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filter-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .admin-app { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-login { grid-template-columns: 1fr; }
  .admin-aside { display: none; }
  .admin-content { padding: 18px 16px 60px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-topbar { padding: 0 16px; }
}
