/* TokenVault — dark credential panel */
:root {
  --bg: #060a11;
  --bg-soft: #0a111c;
  --panel: rgba(13, 22, 36, .72);
  --panel-solid: #0d1624;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --border: rgba(126, 168, 255, .12);
  --border-strong: rgba(126, 168, 255, .24);
  --text: #e9f1ff;
  --muted: #8b9bb5;
  --dim: #5b6a83;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --accent-3: #a78bfa;
  --accent-soft: rgba(94, 234, 212, .12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .12);
  --purple-soft: rgba(167, 139, 250, .12);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .55);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 248px;
  --topbar-h: 74px;
}

[data-theme="light"] {
  --bg: #f3f7fd;
  --bg-soft: #eaf1fa;
  --panel: rgba(255, 255, 255, .82);
  --panel-solid: #ffffff;
  --surface: rgba(15, 35, 66, .035);
  --surface-2: rgba(15, 35, 66, .055);
  --surface-3: rgba(15, 35, 66, .085);
  --border: rgba(20, 55, 100, .12);
  --border-strong: rgba(20, 55, 100, .22);
  --text: #0d1b2e;
  --muted: #52627a;
  --dim: #7a8aa0;
  --accent: #0f9f8f;
  --accent-2: #2563eb;
  --accent-3: #7c3aed;
  --accent-soft: rgba(15, 159, 143, .1);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, .1);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, .1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .1);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, .1);
  --purple-soft: rgba(124, 58, 237, .1);
  --shadow: 0 18px 50px rgba(27, 52, 86, .12);
  --shadow-lg: 0 30px 90px rgba(27, 52, 86, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(94, 234, 212, .25); }

.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.ambient-orb-a { width: 48vw; height: 48vw; top: -18vw; left: 18vw; background: radial-gradient(circle, rgba(37, 99, 235, .28), transparent 65%); }
.ambient-orb-b { width: 42vw; height: 42vw; bottom: -22vw; right: -8vw; background: radial-gradient(circle, rgba(20, 184, 166, .18), transparent 65%); }
.ambient-grid {
  position: absolute; inset: 0; opacity: .28;
  background-image: linear-gradient(rgba(120, 170, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 170, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
[data-theme="light"] .ambient-grid { opacity: .5; background-image: linear-gradient(rgba(20, 55, 100, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 55, 100, .05) 1px, transparent 1px); }

.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, rgba(9, 16, 27, .96), rgba(7, 12, 21, .92));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  z-index: 40;
  transition: transform .25s var(--ease);
}
[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(244, 248, 253, .9)); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; color: var(--accent);
  display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(94, 234, 212, .16), rgba(96, 165, 250, .08));
  border: 1px solid rgba(94, 234, 212, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(94, 234, 212, .06);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1rem; letter-spacing: -.02em; }
.brand-text small { color: var(--dim); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; margin-top: 4px; }

.side-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding-right: 2px; }
.nav-group-label { color: var(--dim); font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; padding: 16px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 38px; padding: 8px 10px; border-radius: 10px;
  color: var(--muted); font-size: .83rem; font-weight: 500;
  border: 1px solid transparent;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(94, 234, 212, .13), rgba(96, 165, 250, .05));
  border-color: rgba(94, 234, 212, .16);
}
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-icon { width: 17px; height: 17px; display: grid; place-items: center; color: currentColor; opacity: .85; flex: 0 0 auto; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-item span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count { font-size: .68rem; color: var(--dim); background: var(--surface); border: 1px solid var(--border); padding: 1px 6px; border-radius: 20px; font-variant-numeric: tabular-nums; }
.nav-count-muted { opacity: .7; }
.nav-item.active .nav-count { color: var(--accent); border-color: rgba(94, 234, 212, .2); background: rgba(94, 234, 212, .08); }

.side-foot { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 10px; }
.vault-health { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); flex: 0 0 auto; }
.health-copy { display: flex; flex-direction: column; line-height: 1.2; }
.health-copy strong { font-size: .72rem; font-weight: 600; }
.health-copy small { color: var(--dim); font-size: .64rem; }
.keyline { color: var(--dim); font-family: var(--mono); font-size: .62rem; padding: 8px 10px 0; letter-spacing: .04em; }

/* ── Main ────────────────────────────────────────────────────────────────── */
.main-shell { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(6, 10, 17, .86), rgba(6, 10, 17, .55) 70%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}
[data-theme="light"] .topbar { background: linear-gradient(180deg, rgba(243, 247, 253, .92), rgba(243, 247, 253, .6) 70%, transparent); }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-id h1 { margin: 0; font-size: 1.18rem; letter-spacing: -.025em; font-weight: 650; white-space: nowrap; }
.page-id p { margin: 2px 0 0; color: var(--dim); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.global-search {
  display: flex; align-items: center; gap: 8px;
  width: 260px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--dim);
  transition: border-color .16s, background .16s, width .2s var(--ease);
}
.global-search:focus-within { border-color: var(--border-strong); background: var(--surface-2); width: 310px; }
.global-search svg { width: 15px; height: 15px; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .8rem; }
.global-search input::placeholder { color: var(--dim); }
.global-search kbd { font-family: var(--mono); font-size: .62rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--dim); }

.view { flex: 1; width: 100%; max-width: none; margin: 0; padding: 14px 24px 60px; outline: none; animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Buttons / inputs ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: .79rem; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(135deg, #5eead4, #38bdf8); border-color: transparent; color: #041014; box-shadow: 0 6px 20px rgba(94, 234, 212, .18); }
.btn-primary:hover { background: linear-gradient(135deg, #7ff0df, #5cc8fa); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn-danger { color: var(--danger); border-color: rgba(251, 113, 133, .2); background: var(--danger-soft); }
.btn-danger:hover { background: rgba(251, 113, 133, .18); border-color: rgba(251, 113, 133, .35); }
.btn-sm { height: 30px; padding: 0 10px; font-size: .72rem; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.icon-only { width: 36px; padding: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.mobile-only { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 9px; padding: 9px 11px; outline: none; font-size: .82rem;
  transition: border-color .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-strong); background: var(--surface-2); }
.textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: .76rem; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input-sm { height: 32px; padding: 0 10px; font-size: .76rem; }

.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--border); transition: .18s; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; border-radius: 50%; background: var(--muted); transition: .18s; }
.switch input:checked + span { background: rgba(94, 234, 212, .2); border-color: rgba(94, 234, 212, .35); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent); }

/* ── Layout blocks ───────────────────────────────────────────────────────── */
.section { margin-bottom: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: .95rem; font-weight: 650; letter-spacing: -.01em; }
.section-head p { margin: 3px 0 0; color: var(--dim); font-size: .74rem; }
.section-head .actions { display: flex; align-items: center; gap: 8px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(14px); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: .86rem; font-weight: 650; }
.card-head p { margin: 3px 0 0; color: var(--dim); font-size: .7rem; }

.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  min-height: 154px; padding: 26px 28px; margin-bottom: 22px;
  background:
    radial-gradient(1000px 200px at 10% -20%, rgba(94, 234, 212, .13), transparent 60%),
    radial-gradient(800px 240px at 90% 120%, rgba(96, 165, 250, .12), transparent 65%),
    var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(94, 234, 212, .14); box-shadow: 0 0 80px rgba(94, 234, 212, .08) inset; }
.hero-copy { position: relative; z-index: 1; max-width: 660px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 9px; }
.eyebrow::before { content: ""; width: 16px; height: 1px; background: var(--accent); }
.hero h2 { margin: 0; font-size: clamp(1.35rem, 2.2vw, 1.9rem); line-height: 1.14; letter-spacing: -.035em; font-weight: 650; }
.hero p { margin: 9px 0 0; color: var(--muted); font-size: .82rem; max-width: 550px; }
.hero-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; padding: 14px 15px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .69rem; font-weight: 600; }
.stat-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.stat-icon svg { width: 14px; height: 14px; }
.stat-value { margin-top: 10px; font-size: 1.75rem; line-height: 1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 7px; color: var(--dim); font-size: .68rem; }
.stat-card.accent .stat-icon { color: var(--accent); background: var(--accent-soft); border-color: rgba(94, 234, 212, .18); }
.stat-card.good .stat-icon { color: var(--success); background: var(--success-soft); border-color: rgba(52, 211, 153, .18); }
.stat-card.warn .stat-icon { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, .18); }
.stat-card.bad .stat-icon { color: var(--danger); background: var(--danger-soft); border-color: rgba(251, 113, 133, .18); }
.stat-card.info .stat-icon { color: var(--info); background: var(--info-soft); border-color: rgba(96, 165, 250, .18); }
.stat-card .mini-bar { position: absolute; left: 15px; right: 15px; bottom: 0; height: 2px; background: var(--surface-3); border-radius: 2px 2px 0 0; overflow: hidden; }
.stat-card .mini-bar i { display: block; height: 100%; border-radius: inherit; background: currentColor; opacity: .8; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr); gap: 16px; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface); }
.list-main { flex: 1; min-width: 0; }
.list-title { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { color: var(--dim); font-size: .7rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-aside { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.avatar-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.avatar-icon svg { width: 17px; height: 17px; }
.provider-avatar { border-color: transparent; font-size: .62rem; font-weight: 800; letter-spacing: -.02em; }

.provider-chip, .kind-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: .66rem; font-weight: 650; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.provider-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 20px; font-size: .65rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-valid { color: var(--success); background: var(--success-soft); border-color: rgba(52, 211, 153, .16); }
.status-expiring { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, .16); }
.status-expired { color: var(--danger); background: var(--danger-soft); border-color: rgba(251, 113, 133, .16); }
.status-invalid { color: var(--danger); background: var(--danger-soft); border-color: rgba(251, 113, 133, .16); }
.status-error { color: var(--danger); background: var(--danger-soft); border-color: rgba(251, 113, 133, .16); }
.status-unknown { color: var(--muted); background: var(--surface); border-color: var(--border); }
.status-needs_config { color: var(--info); background: var(--info-soft); border-color: rgba(96, 165, 250, .16); }
.status-unchecked { color: var(--dim); background: var(--surface); border-color: var(--border); }
.status-totp { color: var(--accent-3); background: var(--purple-soft); border-color: rgba(167, 139, 250, .18); }

.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.progress.warn i { background: linear-gradient(90deg, var(--warning), #f59e0b); }
.progress.bad i { background: linear-gradient(90deg, var(--danger), #f43f5e); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--dim); margin-bottom: 13px; }
.empty-icon svg { width: 24px; height: 24px; }
.empty h3 { margin: 0 0 5px; color: var(--text); font-size: .9rem; }
.empty p { margin: 0 0 15px; max-width: 360px; font-size: .76rem; color: var(--dim); }

/* ── Toolbar / filters ───────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 7px; width: 240px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--dim); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .78rem; }
.search-box svg { width: 14px; height: 14px; }
.segmented { display: inline-flex; align-items: center; padding: 2px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; }
.segmented button { border: 0; background: transparent; color: var(--dim); height: 28px; padding: 0 10px; border-radius: 7px; font-size: .7rem; font-weight: 600; }
.segmented button:hover { color: var(--text); }
.segmented button.active { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.filter-chip { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: .7rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.active { color: var(--accent); border-color: rgba(94, 234, 212, .3); background: var(--accent-soft); }
.filter-chip svg { width: 13px; height: 13px; }

.vault-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin: -4px 0 13px; color: var(--dim); font-size: .68rem; }
.vault-meta strong { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.vault-meta .latest-note { color: var(--accent); }
.vault-meta .latest-note::before { content: "●"; font-size: .5rem; margin-right: 5px; vertical-align: 1px; }

.menu-wrap { position: relative; display: inline-flex; align-items: center; }
.menu-wrap .icon-only { width: 26px; height: 30px; padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.menu-wrap > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 238px; display: flex; flex-direction: column; gap: 1px;
  padding: 5px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--panel-solid); box-shadow: var(--shadow-lg);
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 9px; border-radius: 7px; font-size: .73rem; text-align: left;
}
.dropdown-menu button:hover { background: var(--surface-2); color: var(--text); }
.dropdown-menu button svg { width: 13px; height: 13px; flex: 0 0 auto; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 3px; }

.profile-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 128px; max-width: 190px; }
.country-line { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.country-flag { font-size: .92rem; line-height: 1; flex: 0 0 auto; }
.sector-chip { display: inline-flex; align-items: center; max-width: 100%; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: .59rem; font-weight: 650; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dupe-badge { flex: 0 0 auto; font-size: .57rem; font-weight: 700; color: var(--dim); background: var(--surface-2); border: 1px solid var(--border); padding: 0 4px; border-radius: 4px; }
.bec-flag { flex: 0 0 auto; font-size: .52rem; font-weight: 800; letter-spacing: .06em; padding: 1px 4px; border-radius: 3px; }
.bec-flag.urgent { color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(251,113,133,.25); }
.bec-flag.watched { color: var(--warning); background: var(--warning-soft); border: 1px solid rgba(251,191,36,.25); }
.row-action.active { color: var(--warning); background: var(--warning-soft); }
.row-action.active.danger { color: var(--danger); background: var(--danger-soft); }
.name-text { overflow: hidden; text-overflow: ellipsis; }
.filter-chip:hover { background: var(--surface); color: var(--text); }
.filter-chip.active { background: var(--accent-soft); border-color: rgba(94, 234, 212, .25); color: var(--accent); }

.bulk-bar {
  display: none; align-items: center; gap: 9px; padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid rgba(94, 234, 212, .2); background: rgba(94, 234, 212, .06); border-radius: 10px;
}
.bulk-bar.show { display: flex; }
.bulk-count { color: var(--accent); font-size: .72rem; font-weight: 700; margin-right: 4px; }
.bulk-spacer { flex: 1; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; min-width: 1010px; }
.table th { position: sticky; top: 0; z-index: 2; text-align: left; padding: 10px 12px; background: var(--panel-solid); border-bottom: 1px solid var(--border); color: var(--dim); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: .77rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; cursor: pointer; }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr.selected { background: rgba(94, 234, 212, .055); }
.table .check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.table .col-check { width: 34px; padding-right: 0; }
.table .col-actions { width: 108px; text-align: right; }
.table .col-expiry { white-space: nowrap; }
.table .col-status { width: 108px; }
.table .col-checked { color: var(--dim); font-size: .7rem; white-space: nowrap; }
.table .col-profile { width: 170px; }
.table .col-country { width: 105px; }
.table .col-sector { width: 115px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.sort-mark { color: var(--accent); font-size: .72rem; }
.table .name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .name-copy { min-width: 0; }
.table .name-title { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.table .name-sub { color: var(--dim); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; margin-top: 1px; }
.row-actions { display: flex; align-items: center; gap: 3px; justify-content: flex-end; opacity: .18; transition: opacity .15s; }
.table tbody tr:hover .row-actions { opacity: 1; }
.row-action { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.row-action:hover { background: var(--surface-3); color: var(--text); }
.row-action svg { width: 14px; height: 14px; }
.row-action.danger:hover { color: var(--danger); background: var(--danger-soft); }
.table-empty { padding: 44px 20px; text-align: center; color: var(--dim); }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ── Tabs / code / secrets ───────────────────────────────────────────────── */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tab { border: 0; background: none; color: var(--dim); height: 42px; padding: 0 11px; font-size: .76rem; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { padding: 18px; }

.code-block { position: relative; background: rgba(0, 0, 0, .22); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; font-family: var(--mono); font-size: .72rem; line-height: 1.55; white-space: pre-wrap; word-break: break-all; color: #c8d7ee; max-height: 260px; overflow: auto; }
[data-theme="light"] .code-block { background: rgba(15, 35, 66, .035); color: #1e3a5f; }
.copy-btn { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-solid); color: var(--muted); display: grid; place-items: center; opacity: .7; }
.copy-btn:hover { opacity: 1; color: var(--text); }
.copy-btn svg { width: 13px; height: 13px; }

.secret-list { display: flex; flex-direction: column; gap: 7px; }
.secret-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.secret-label { width: 115px; flex: 0 0 auto; color: var(--dim); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.secret-value { flex: 1; min-width: 0; font-family: var(--mono); font-size: .73rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.secret-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.secret-actions button { width: 27px; height: 27px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); display: grid; place-items: center; }
.secret-actions button:hover { background: var(--surface-3); color: var(--text); }
.secret-actions svg { width: 14px; height: 14px; }

.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.meta-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .76rem; }
.meta-row dt { width: 120px; flex: 0 0 auto; color: var(--dim); font-size: .68rem; font-weight: 600; }
.meta-row dd { margin: 0; min-width: 0; word-break: break-word; }

.totp-box { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid rgba(167, 139, 250, .2); border-radius: 12px; background: linear-gradient(135deg, rgba(167, 139, 250, .1), rgba(96, 165, 250, .04)); }
.totp-code { font-family: var(--mono); font-size: 2rem; letter-spacing: .16em; font-weight: 700; color: var(--text); line-height: 1; }
.totp-timer { position: relative; width: 48px; height: 48px; flex: 0 0 auto; }
.totp-timer svg { transform: rotate(-90deg); }
.totp-timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .65rem; font-family: var(--mono); color: var(--muted); }

/* ── Drawer / modal ──────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(3, 7, 13, .58); backdrop-filter: blur(3px); z-index: 80; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 94vw); z-index: 90;
  background: var(--panel-solid); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: drawerIn .26s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.drawer-head .avatar-icon { width: 42px; height: 42px; border-radius: 12px; }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { margin: 0; font-size: 1.02rem; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-title p { margin: 4px 0 0; color: var(--dim); font-size: .72rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-foot { padding: 13px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--panel); }
.drawer-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--surface); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; }
.drawer-close:hover { color: var(--text); background: var(--surface-2); }
.drawer-close svg { width: 15px; height: 15px; }

.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal { width: min(520px, 96vw); max-height: 90vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); animation: modalIn .2s var(--ease); }
@keyframes modalIn { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 13px; }
.modal-head h3 { margin: 0; font-size: .95rem; font-weight: 650; }
.modal-body { padding: 0 18px 18px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.modal-body p { margin: 0 0 12px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }
.modal-close { width: 28px; height: 28px; border: 0; border-radius: 7px; background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 14px; height: 14px; }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; min-width: 250px; max-width: 380px; padding: 11px 13px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .78rem; pointer-events: auto; animation: toastIn .22s var(--ease); }
@keyframes toastIn { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast .toast-icon { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }
.toast-copy { flex: 1; min-width: 0; }
.toast-copy strong { display: block; color: var(--text); font-weight: 600; }
.toast-copy small { display: block; color: var(--dim); font-size: .7rem; margin-top: 2px; word-break: break-word; }
.toast-close { border: 0; background: transparent; color: var(--dim); width: 18px; height: 18px; padding: 0; display: grid; place-items: center; }
.toast-close:hover { color: var(--text); }

/* ── Forms / import / settings ───────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-note { color: var(--dim); font-size: .7rem; line-height: 1.5; }
.form-note code { font-family: var(--mono); background: var(--surface); padding: 1px 4px; border-radius: 4px; border: 1px solid var(--border); }
.help-card { padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 12px; color: var(--muted); font-size: .74rem; line-height: 1.6; }
.help-card strong { color: var(--text); }
.help-card ul { margin: 8px 0 0; padding-left: 18px; }
.help-card li { margin: 3px 0; }

.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 180px; padding: 26px; border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--surface); transition: .18s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); margin-bottom: 10px; }
.dropzone .dz-icon svg { width: 22px; height: 22px; }
.dropzone h3 { margin: 0 0 4px; font-size: .88rem; }
.dropzone p { margin: 0; color: var(--dim); font-size: .73rem; max-width: 440px; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.format-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.format-chip { font-size: .62rem; color: var(--dim); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; }

.preview-list { display: flex; flex-direction: column; max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.preview-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--border); font-size: .75rem; }
.preview-row:last-child { border-bottom: 0; }
.preview-row .check { width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
.preview-main { flex: 1; min-width: 0; }
.preview-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.preview-sub { color: var(--dim); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-aside { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.preview-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; color: var(--dim); font-size: .72rem; }

.settings-section { margin-bottom: 28px; }
.settings-section > h2 { margin: 0 0 4px; font-size: .9rem; font-weight: 650; }
.settings-section > p { margin: 0 0 13px; color: var(--dim); font-size: .73rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-main { min-width: 0; }
.setting-main strong { display: block; font-size: .79rem; font-weight: 600; }
.setting-main small { display: block; color: var(--dim); font-size: .7rem; margin-top: 2px; line-height: 1.45; }
.setting-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.setting-control .input, .setting-control .select { width: 150px; }
.setting-control .input-wide { width: 260px; }
.danger-zone { border-color: rgba(251, 113, 133, .25); }
.danger-zone .card-head { border-color: rgba(251, 113, 133, .18); }

.backup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.backup-card { padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.backup-card .backup-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); }
.backup-card .backup-icon svg { width: 17px; height: 17px; }
.backup-card h4 { margin: 0; font-size: .8rem; font-weight: 600; }
.backup-card p { margin: 0; color: var(--dim); font-size: .68rem; }
.backup-meta { display: flex; align-items: center; gap: 9px; color: var(--dim); font-size: .66rem; flex-wrap: wrap; }
.backup-actions { display: flex; align-items: center; gap: 5px; margin-top: auto; }

/* ── Utility / responsive ────────────────────────────────────────────────── */
.spinner { width: 18px; height: 18px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 38px; color: var(--dim); font-size: .75rem; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.hide { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--dim); font-size: .62rem; }
.notice { display: flex; gap: 9px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .73rem; line-height: 1.5; }
.notice svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.notice.warn { border-color: rgba(251, 191, 36, .2); background: var(--warning-soft); color: var(--warning); }
.notice.danger { border-color: rgba(251, 113, 133, .2); background: var(--danger-soft); color: var(--danger); }
.notice.info { border-color: rgba(96, 165, 250, .2); background: var(--info-soft); color: var(--info); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 248px; }
  .sidebar.open { transform: none; }
  .main-shell { margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { padding: 0 16px; }
  .view { padding: 14px 16px 50px; }
  .global-search { width: 190px; }
  .global-search:focus-within { width: 220px; }
  .form-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid .stat-card:last-child { grid-column: 1 / -1; }
  .three-col { grid-template-columns: 1fr; }
  .global-search { display: none; }
  .page-id p { display: none; }
  .hero { padding: 20px; flex-direction: column; align-items: flex-start; }
  .hero-actions { justify-content: flex-start; }
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-box { width: 100%; }
  .table { min-width: 900px; }
  .drawer { width: 100vw; }
  .secret-label { width: 85px; }
}

/* ── BEC suite ───────────────────────────────────────────────────────────── */
.drawer.wide { width: min(1320px, 97vw); }
.bec-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 6px 0 16px; }
.bec-hero h2 { margin: 4px 0 5px; font-size: 1.45rem; letter-spacing: -.03em; }
.bec-hero p { margin: 0; max-width: 640px; color: var(--muted); font-size: .79rem; line-height: 1.55; }
.bec-scan-controls { display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap; }
.bec-scan-controls label { display: flex; flex-direction: column; gap: 3px; color: var(--dim); font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.bec-scan-controls .select { width: 104px; }
.bec-stats { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.bec-stat { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); min-width: 0; }
.bec-stat-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.bec-stat strong { display: block; font-size: .95rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bec-stat small { display: block; color: var(--dim); font-size: .58rem; text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; white-space: nowrap; }
.bec-progress { display: none; padding: 11px 13px; border: 1px solid rgba(94,234,212,.2); border-radius: 10px; background: var(--accent-soft); margin-bottom: 14px; gap: 6px; flex-direction: column; }
.bec-progress.show { display: flex; }
.bec-table { min-width: 1240px; }
.bec-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 20px; font-size: .6rem; font-weight: 700; white-space: nowrap; }
.bec-score { display: flex; align-items: center; gap: 6px; min-width: 70px; }
.bec-score strong { font-size: .72rem; width: 20px; font-variant-numeric: tabular-nums; }
.capture-count { border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .66rem; font-variant-numeric: tabular-nums; padding: 2px 6px; cursor: pointer; }
.capture-count:hover { border-color: var(--accent); }
.bec-score > span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bec-score > span i { display: block; height: 100%; border-radius: inherit; }
.bec-rail { display: inline-flex; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; font-size: .57rem; color: var(--muted); white-space: nowrap; }
.bec-case-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.bec-case-stats div { padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); min-width: 0; }
.bec-case-stats strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bec-case-stats small { display: block; color: var(--dim); font-size: .58rem; text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }
.bec-summary { margin: 14px 20px 0; padding: 12px 14px; border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: 8px; background: var(--surface); }
.bec-summary p { margin: 5px 0 3px; font-size: .82rem; line-height: 1.55; }
.bec-opportunity { color: var(--warning); border-left: 2px solid var(--warning); padding-left: 8px; }
.bec-deal { margin: 14px 20px 0; padding: 12px 14px; border: 1px solid rgba(251,113,133,.25); border-radius: 10px; background: linear-gradient(160deg, rgba(251,113,133,.08), transparent); }
.bec-deal-amount { font-size: 1.35rem; font-weight: 750; letter-spacing: -.03em; margin: 3px 0; }
.bec-deal-parties { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.bec-deal-parties > div:not(.bec-arrow) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bec-deal-parties small { color: var(--dim); font-size: .56rem; text-transform: uppercase; letter-spacing: .09em; }
.bec-deal-parties strong { font-size: .76rem; }
.bec-deal-parties span { color: var(--muted); font-size: .66rem; }
.bec-arrow { color: var(--dim); }
.bec-timeline { display: flex; flex-direction: column; gap: 5px; }
.bec-timeline > div { display: grid; grid-template-columns: 110px 120px 1fr; gap: 8px; padding: 6px 8px; border-left: 2px solid var(--border); font-size: .66rem; }
.bec-timeline span { color: var(--dim); }
.bec-timeline small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bec-section { padding: 15px 20px; border-bottom: 1px solid var(--border); }
.bec-section:last-child { border-bottom: 0; }
.bec-section h3 { margin: 0 0 3px; font-size: .82rem; }
.bec-section-sub { margin: 0 0 9px; color: var(--dim); font-size: .68rem; }
.bec-card-list { display: flex; flex-direction: column; gap: 6px; }
.bec-evidence-row, .bec-target, .bec-plan, .bec-message, .bec-login, .bec-toggle { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); align-items: flex-start; }
.bec-evidence-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .72rem; }
.bec-evidence-main strong { font-size: .74rem; }
.bec-evidence-main span { font-size: .66rem; line-height: 1.4; }
.bec-login > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .7rem; }
.bec-login .mono { font-size: .66rem; overflow: hidden; text-overflow: ellipsis; }
.bec-target > div { display: flex; flex-direction: column; gap: 2px; font-size: .7rem; min-width: 0; }
.bec-plan { flex-direction: column; align-items: stretch; }
.bec-plan ol, .bec-list { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.bec-message { flex-direction: column; align-items: stretch; }
.bec-message .bec-evidence-main span[data-body] { white-space: pre-wrap; }
.bec-type { display: inline-flex; padding: 2px 7px; border: 1px solid rgba(251,113,133,.25); border-radius: 5px; background: var(--danger-soft); color: var(--danger); font-size: .62rem; font-weight: 650; }
.bec-toggle { align-items: center; cursor: pointer; }
.bec-toggle span { display: flex; flex-direction: column; gap: 2px; }
.bec-toggle strong { font-size: .74rem; }
.bec-toggle small { color: var(--dim); font-size: .64rem; }
.bec-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.bec-thread { padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: .72rem; }
@media (max-width: 1180px) { .bec-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .bec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bec-case-stats { grid-template-columns: repeat(2, 1fr); } .bec-table { min-width: 1000px; } }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 20%, rgba(37,99,235,.22), transparent 55%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 26px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--panel-solid); box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-brand .brand-mark { color: var(--accent); }
.login-brand strong { display: block; letter-spacing: -.02em; }
.login-brand small { color: var(--dim); font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; }
.login-card h2 { margin: 0 0 4px; font-size: 1.2rem; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 16px; color: var(--muted); font-size: .74rem; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card .field span { color: var(--muted); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.login-error { min-height: 16px; color: var(--danger); font-size: .68rem; }
.login-submit { width: 100%; margin-top: 2px; }
.login-card > small { display: block; margin-top: 12px; text-align: center; font-size: .62rem; }

/* ── Mailbox ─────────────────────────────────────────────────────────────── */
.account-tabs { display: flex; gap: 4px; padding: 0 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.account-tabs button { border: 0; background: transparent; color: var(--dim); padding: 6px 12px; border-radius: 7px; font-size: .76rem; font-weight: 650; display: inline-flex; gap: 6px; align-items: center; }
.account-tabs button:hover { color: var(--text); background: var(--surface); }
.account-tabs button.active { color: var(--accent); background: var(--accent-soft); }
.account-bec { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.account-bec-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.account-bec-head h2 { margin: 3px 0; font-size: 1.05rem; }
.account-bec-head p { margin: 0; color: var(--dim); font-size: .7rem; }
.account-bec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.account-bec-grid > div { min-width: 0; border-right: 1px solid var(--border); }
.account-bec-grid > div:last-child { border-right: 0; }
@media (max-width: 900px) { .account-bec-grid { grid-template-columns: 1fr; } .account-bec-grid > div { border-right: 0; } }
.mail-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; }
.mail-account { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; gap: 10px; align-items: stretch; min-height: calc(100vh - 190px); }
.mail-list-pane, .mail-reader-pane, .mail-chat-pane { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.mail-tools { display: flex; gap: 5px; padding: 8px; border-bottom: 1px solid var(--border); }
.mail-tools .select { width: 118px; }
.mail-list { flex: 1; overflow-y: auto; min-height: 300px; }
.mail-row { padding: 9px 11px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mail-row:hover { background: var(--surface); }
.mail-row.unread { border-left: 2px solid var(--accent); background: rgba(94,234,212,.035); }
.mail-row.flagged { box-shadow: inset 2px 0 var(--warning); }
.mail-row-top { display: flex; justify-content: space-between; gap: 8px; font-size: .68rem; color: var(--muted); }
.mail-row-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-top span { flex: 0 0 auto; color: var(--dim); font-size: .6rem; }
.mail-row-subject { margin-top: 2px; font-size: .74rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mail-row-subject { color: var(--accent); }
.mail-row-preview { color: var(--dim); font-size: .64rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-clip { display: inline-flex; align-items: center; gap: 3px; color: var(--dim); font-size: .58rem; margin-top: 3px; }
.mail-placeholder { margin: auto; text-align: center; color: var(--dim); padding: 30px; }
.mail-placeholder svg { width: 30px; height: 30px; margin-bottom: 8px; }
.mail-placeholder p { color: var(--muted); margin: 0 0 3px; }
.mail-reader { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
.mail-reader-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; }
.mail-reader-head h2 { margin: 0 0 5px; font-size: .95rem; }
.mail-reader-head p { margin: 2px 0; font-size: .7rem; color: var(--muted); }
.mail-read-badge { flex: 0 0 auto; height: 20px; padding: 0 7px; border-radius: 20px; font-size: .58rem; font-weight: 700; border: 1px solid var(--border); color: var(--dim); }
.mail-read-badge.unread { color: var(--accent); border-color: rgba(94,234,212,.25); background: var(--accent-soft); }
.mail-reader-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 7px 14px; border-bottom: 1px solid var(--border); }
.mail-attachments { padding: 9px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.mail-attachment { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: .7rem; }
.mail-attachment small { color: var(--dim); font-size: .6rem; }
.mail-body { padding: 16px; font-size: .78rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.mail-body a { color: var(--accent-2); text-decoration: underline; }
.mail-chat-pane { background: var(--panel-solid); }
.mail-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px; border-bottom: 1px solid var(--border); font-size: .72rem; }
.mail-chat-head strong { display: flex; align-items: center; gap: 5px; }
.mail-chat-log { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 260px; }
.chat-msg { padding: 7px 9px; border-radius: 8px; font-size: .71rem; line-height: 1.45; max-width: 95%; }
.chat-msg.user { align-self: flex-end; background: var(--accent-soft); color: var(--text); }
.chat-msg.assistant { background: var(--surface); border: 1px solid var(--border); }
.chat-msg.error { color: var(--danger); }
.chat-cites { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.chat-cite { border: 0; background: var(--surface-2); color: var(--muted); text-align: left; border-radius: 4px; padding: 3px 5px; font-size: .6rem; display: flex; gap: 5px; align-items: center; }
.chat-cite:hover { color: var(--text); }
.mail-chat-input { padding: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.mail-chat-input .textarea { min-height: 58px; resize: vertical; }
@media (max-width: 1250px) { .mail-layout { grid-template-columns: 280px minmax(0, 1fr); } .mail-chat-pane { grid-column: 1 / -1; min-height: 320px; } }
@media (max-width: 750px) { .mail-layout { grid-template-columns: 1fr; } .mail-list-pane { max-height: 320px; } .mail-chat-pane { grid-column: auto; } }

/* Density */
[data-density="compact"] .table td { padding: 8px 12px; }
[data-density="compact"] .list-row { padding: 9px 18px; }
[data-density="compact"] .stat-card { padding: 12px; }
[data-density="compact"] .card-pad { padding: 14px; }
