@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #080808;
  --surface: #111111;
  --surface-2: #1a1a1a;
  --surface-3: #222222;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --red: #dc2626;
  --red-hover: #ef4444;
  --red-dim: rgba(220,38,38,0.1);
  --red-glow: rgba(220,38,38,0.25);
  --red-dark: #7f1d1d;
  --text: #f0f0f0;
  --text-dim: #a1a1aa;
  --text-muted: #52525b;
  --green: #22c55e;
  --orange: #f97316;
  --blue: #3b82f6;
  --yellow: #eab308;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-hover); }
input, select, textarea { font-family: inherit; }

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius); font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: all .2s; white-space: nowrap;
}
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 0 20px var(--red-glow);
}
.btn-primary:hover { background: var(--red-hover); color: #fff; box-shadow: 0 0 30px var(--red-glow); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface-2); }
.btn-danger { background: rgba(220,38,38,.15); color: var(--red); border: 1px solid rgba(220,38,38,.3); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.form-label .api-badge { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.badge-both { background: rgba(59,130,246,.2); color: #60a5fa; }
.badge-brixhub { background: rgba(249,115,22,.2); color: #fb923c; }
.badge-breach { background: rgba(220,38,38,.2); color: #f87171; }

.form-input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 9px 13px; font-size: 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }

select.form-input { cursor: pointer; }
select.form-input option { background: var(--surface-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.col-span-2 { grid-column: span 2; }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; transition: border-color .2s;
}
.card:hover { border-color: var(--border-hover); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(220,38,38,.3); }
.badge-orange { background: rgba(249,115,22,.1); color: var(--orange); border: 1px solid rgba(249,115,22,.3); }
.badge-green { background: rgba(34,197,94,.1); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.badge-blue { background: rgba(59,130,246,.1); color: var(--blue); border: 1px solid rgba(59,130,246,.3); }
.badge-gray { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }

/* ─── ALERTS ─────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-error { background: rgba(220,38,38,.1); border: 1px solid rgba(220,38,38,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-warning { background: rgba(234,179,8,.1); border: 1px solid rgba(234,179,8,.3); color: #fde68a; }
.alert-info { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }
.hidden { display: none !important; }

/* ─── LOADING ─────────────────────────────────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2px solid var(--surface-3); border-top-color: var(--red); border-radius: 50%; animation: spin .6s linear infinite; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 40px; flex-direction: column; gap: 12px; color: var(--text-dim); font-size: 14px; }

/* ─── TOGGLE ─────────────────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle-input { display: none; }
.toggle-slider {
  width: 42px; height: 24px; background: var(--surface-3); border-radius: 12px;
  position: relative; transition: background .2s; border: 1px solid var(--border);
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--text-dim);
  transition: transform .2s, background .2s;
}
.toggle-input:checked + .toggle-slider { background: var(--red-dim); border-color: var(--red); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(18px); background: var(--red); }
.toggle-label { font-size: 13px; color: var(--text-dim); }

/* ─── ACCORDION ──────────────────────────────────────────────────────────── */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion + .accordion { margin-top: -1px; }
.acc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; background: var(--surface); transition: background .15s;
  user-select: none;
}
.acc-header:hover { background: var(--surface-2); }
.acc-title { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.acc-count { font-size: 11px; background: var(--red-dim); color: var(--red); padding: 1px 7px; border-radius: 10px; }
.acc-icon { color: var(--text-muted); font-size: 12px; transition: transform .2s; }
.acc-body { padding: 16px; background: var(--surface-2); display: none; }
.accordion.open .acc-body { display: block; }
.accordion.open .acc-icon { transform: rotate(180deg); }

/* ─── NAVBAR ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,8,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text); }
.nav-logo span { color: var(--red); }
.nav-logo svg { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 8px; }

/* ─── LANDING PAGE ───────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(220,38,38,.12) 0%, transparent 70%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 48px, rgba(255,255,255,.015) 48px, rgba(255,255,255,.015) 49px),
              repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(255,255,255,.015) 48px, rgba(255,255,255,.015) 49px);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--red-dim); border: 1px solid rgba(220,38,38,.3); color: var(--red); padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 24px; }
.hero-title { font-size: clamp(48px, 8vw, 88px); font-weight: 800; line-height: 1.05; margin-bottom: 20px; letter-spacing: -.03em; }
.hero-title .red { color: var(--red); text-shadow: 0 0 60px var(--red-glow); }
.hero-sub { font-size: 18px; color: var(--text-dim); max-width: 560px; margin: 0 auto 40px; }
.hero-ctas { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 40px; margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.hero-stat-num { font-size: 32px; font-weight: 800; color: var(--red); }
.hero-stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.section { padding: 80px 24px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 32px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-dim); margin-bottom: 48px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--red); transform: translateY(-3px); }
.feature-icon { width: 48px; height: 48px; background: var(--red-dim); border: 1px solid rgba(220,38,38,.3); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--red); font-size: 22px; }
.feature-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; }

.warning-banner {
  background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.25);
  border-radius: var(--radius-lg); padding: 20px 28px; margin: 0 auto 60px; max-width: 800px;
  display: flex; gap: 16px; align-items: flex-start;
}
.warning-banner .icon { font-size: 20px; margin-top: 2px; }
.warning-banner p { font-size: 14px; color: #fde68a; line-height: 1.6; }
.warning-banner strong { color: #fef08a; }

.footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.footer a { color: var(--text-dim); }

/* ─── AUTH PAGES ─────────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(220,38,38,.08) 0%, transparent 60%); }
.auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; width: 100%; max-width: 420px; }
.auth-logo { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.auth-logo span { color: var(--red); }
.auth-tagline { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.auth-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--red); }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 12px; margin: 16px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: calc(50% - 30px); height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }

/* ─── DASHBOARD ──────────────────────────────────────────────────────────── */
.dashboard-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 380px; min-width: 340px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.sidebar-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-topbar { padding: 0 24px; height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: var(--surface); }
.main-content { flex: 1; overflow-y: auto; padding: 24px; }

.api-selector { display: flex; gap: 8px; background: var(--surface-2); padding: 4px; border-radius: var(--radius); border: 1px solid var(--border); }
.api-opt { flex: 1; text-align: center; padding: 7px 10px; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all .15s; border: none; background: transparent; }
.api-opt.active { background: var(--red); color: #fff; box-shadow: 0 0 12px var(--red-glow); }
.api-opt:not(.active):hover { background: var(--surface-3); color: var(--text); }

.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.results-title { font-size: 16px; font-weight: 700; }
.results-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.result-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 12px; overflow: hidden; transition: border-color .2s;
}
.result-card:hover { border-color: var(--border-hover); }
.result-card-header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.result-name { font-size: 15px; font-weight: 700; color: var(--text); }
.result-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.result-body { padding: 14px 16px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.result-field { }
.result-field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.result-field-value { font-size: 13px; color: var(--text); font-family: 'JetBrains Mono', monospace; word-break: break-all; }
.result-field-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.result-expand-btn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 8px 16px; border-top: 1px solid var(--border); background: transparent; border: none; width: 100%; text-align: left; transition: color .15s; }
.result-expand-btn:hover { color: var(--text); }
.result-extra { padding: 0 16px 14px; }
.result-extra .result-grid { margin-top: 12px; }
.result-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

.source-brixhub { background: rgba(249,115,22,.15); color: #fb923c; border-color: rgba(249,115,22,.4); }
.source-breach2bz { background: rgba(220,38,38,.15); color: #f87171; border-color: rgba(220,38,38,.4); }
.source-brixhub_lookup { background: rgba(234,179,8,.15); color: #fbbf24; border-color: rgba(234,179,8,.4); }

.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state-icon { margin-bottom: 12px; opacity: .4; line-height: 1; }
.empty-state-icon svg { width: 48px; height: 48px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

.cache-indicator { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; }
.cache-hit { background: rgba(34,197,94,.1); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.cache-miss { background: rgba(59,130,246,.1); color: var(--blue); border: 1px solid rgba(59,130,246,.3); }

.breakdown-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.breakdown-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; font-size: 12px; }
.breakdown-item .bi-name { color: var(--text-muted); margin-bottom: 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.breakdown-item .bi-value { font-weight: 700; font-size: 14px; }
.breakdown-item .bi-took { color: var(--text-muted); font-size: 11px; }
.breakdown-error { border-color: rgba(220,38,38,.3); }
.breakdown-error .bi-value { color: var(--red); font-size: 12px; font-weight: 500; }

.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--red-dim); border: 1px solid rgba(220,38,38,.3); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--red); }

/* ─── ADMIN PAGE ─────────────────────────────────────────────────────────── */
.admin-layout { min-height: 100vh; }
.admin-content { max-width: 1200px; margin: 0 auto; padding: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--red); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--surface-2); }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.code-cell { font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: .05em; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; background: transparent; border: none; border-bottom: 2px solid transparent; transition: all .15s; margin-bottom: -1px; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--red); }
.tab-btn:hover:not(.active) { color: var(--text-dim); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: color .15s; }
.modal-close:hover { color: var(--text); }

/* ─── CENTERED DASHBOARD ─────────────────────────────────────────────────── */
.dash-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Search card */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
}
.search-card-header {
  padding: 28px 32px 24px;
}
.search-card-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -.02em;
}
.search-card-header > p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.search-options-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Search tab bar */
.search-tabs-bar {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  overflow-x: auto;
  padding: 0 20px;
  scrollbar-width: none;
}
.search-tabs-bar::-webkit-scrollbar { display: none; }

.stab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.stab.active { color: var(--text); border-bottom-color: var(--red); }
.stab:hover:not(.active) { color: var(--text-dim); }
.stab svg { flex-shrink: 0; }

.stab-panel { display: none; padding: 24px 32px; }
.stab-panel.active { display: block; }

/* Search card footer */
.search-card-footer {
  padding: 14px 32px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.search-hint { font-size: 13px; color: var(--text-muted); }

/* RBID chip in navbar */
.rbid-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 9px;
  letter-spacing: .06em;
  user-select: all;
}

/* Fiche button on result cards */
.fiche-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(59,130,246,.1);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,.3);
  cursor: pointer;
  transition: background .15s;
}
.fiche-btn:hover { background: rgba(59,130,246,.2); }

/* Fiche count badge */
.fiche-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
}

/* Fiche cards in Mes Fiches view */
.fiche-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.fiche-card:hover { border-color: var(--border-hover); }
.fiche-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}
.fiche-title { font-size: 15px; font-weight: 700; }
.fiche-notes {
  font-size: 13px;
  color: var(--text-dim);
  white-space: pre-wrap;
  margin-bottom: 10px;
  line-height: 1.6;
}
.fiche-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fiche-tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.fiche-meta { font-size: 11px; color: var(--text-muted); }

/* Wider modal for fiches */
.modal-lg { max-width: 560px; }

/* Fiches view header */
.fiches-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.fiches-view-header h2 { font-size: 22px; font-weight: 800; }
.fiches-view-header p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Admin user search bar */
.admin-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.admin-search-input {
  flex: 1;
  max-width: 360px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 13px;
  font-size: 13px;
  transition: border-color .2s;
}
.admin-search-input:focus { outline: none; border-color: var(--red); }
.admin-search-input::placeholder { color: var(--text-muted); }

/* Search log params preview */
.params-preview {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Person data snapshot inside fiche cards */
.fiche-snapshot-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.fiche-snapshot-section .result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}
.fiche-snapshot-section .result-field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}
.fiche-snapshot-section .result-field span {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

/* Wide admin profile modal */
.profile-modal {
  max-width: 820px;
  width: 100%;
}


/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; max-height: 50vh; min-width: unset; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .dash-content { padding: 16px 16px 60px; }
  .search-card-header { padding: 20px 20px 16px; }
  .stab-panel { padding: 16px 20px; }
  .search-card-footer { padding: 12px 20px; }
  .search-card-header h1 { font-size: 24px; }
}
