/* ── Aletheia OSINT — Dark theme ────────────────────────────────────────── */
:root {
  --bg:        #0d0d1a;
  --bg2:       #13132a;
  --bg3:       #1a1a35;
  --border:    #2a2a50;
  --text:      #c9d1e0;
  --text-dim:  #6b7a99;
  --accent:    #4a9eff;
  --green:     #3fb950;
  --red:       #f85149;
  --yellow:    #d29922;
  --purple:    #d2a8ff;
  --teal:      #39d0d8;
  --radius:    8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(74,158,255,.35));
}
.sidebar-logo-text { min-width: 0; }
.sidebar-logo .wordmark {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .3px;
  line-height: 1.2;
}
.sidebar-logo .tagline {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg3); text-decoration: none; }
.nav-item.active { background: rgba(74,158,255,.12); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-account {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-email {
  color: var(--text);
  font-weight: 600;
}
.sidebar-footer a {
  font-size: 12px;
  color: var(--text-dim);
}
.attribution {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.5;
  line-height: 1.4;
}
.attribution a {
  font-size: 10px;
  color: var(--text-dim);
  text-decoration: underline;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  position: relative;
  z-index: 1;
}
.topbar-title {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}
.topbar-actions { display: flex; gap: 8px; }

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, filter .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: .9; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--accent);  color: #fff; box-shadow: 0 2px 8px rgba(74,158,255,.25); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(74,158,255,.35); }
.btn-success  { background: var(--green);   color: #000; }
.btn-danger   { background: var(--red);     color: #fff; }
.btn-ghost    { background: var(--bg3);     color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-purple   { background: #5a3d7a;        color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.checkbox-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.checkbox-row label { font-size: 13px; cursor: pointer; }

/* ── Type selector ───────────────────────────────────────────────────────── */
.type-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.type-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.type-btn:hover { border-color: var(--accent); color: var(--accent); }
.type-btn.active { border-color: var(--accent); background: rgba(74,158,255,.12); color: var(--accent); }

/* ── Log / stream panel ─────────────────────────────────────────────────── */
.log-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.7;
  padding: 12px 14px;
  height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-found   { color: var(--green); }
.log-notfound{ color: #444d63; }
.log-error   { color: var(--red); }
.log-warning { color: var(--yellow); }
.log-info    { color: var(--accent); }

/* ── Results grid ────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.result-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.25); transform: translateY(-1px); }
.result-card.found  { border-left: 3px solid var(--green); }
.result-card.info   { border-left: 3px solid var(--accent); }
.result-card.not_found { border-left: 3px solid #2a2a50; opacity: .5; }

.rc-site {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.rc-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-found  { background: rgba(63,185,80,.22);  color: #6fd985; }
.badge-info   { background: rgba(74,158,255,.22); color: #7ab6ff; }
.badge-sherlock { background: rgba(210,168,255,.2); color: #dfbaff; }
.badge-deep     { background: rgba(57,208,216,.2); color: #6fe3e9; }
.badge-email    { background: rgba(210,153,34,.2);  color: #e6b64a; }
.badge-phone    { background: rgba(63,185,80,.2);   color: #6fd985; }
.badge-name     { background: rgba(74,158,255,.2);  color: #7ab6ff; }
.badge-domain   { background: rgba(57,208,216,.2);  color: #6fe3e9; }
.badge-breach   { background: rgba(248,81,73,.2);   color: #ff8f87; }
.badge-creator_index { background: rgba(57,208,216,.2); color: #6fe3e9; }

/* ── Connection map ──────────────────────────────────────────────────────── */
.conn-graph-wrap {
  position: relative;
  width: 100%;
  min-height: 360px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.conn-node-label {
  font-size: 11px;
  fill: var(--text);
}
.conn-suggestion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.conn-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.conn-arrow { color: var(--text-dim); }
.conn-reason { color: var(--text-dim); font-size: 12px; margin-top: 3px; }

.rc-url { font-size: 14px; color: #9db1d9; word-break: break-all; line-height: 1.45; }
.rc-bio { font-size: 15px; color: var(--text); opacity: .9; margin-top: 8px; line-height: 1.55; }
.rc-meta { font-size: 13.5px; color: #9db1d9; margin-top: 8px; }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-wrap { margin: 8px 0; }
.progress-bar {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s;
  width: 0%;
}
.progress-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── Stats row ───────────────────────────────────────────────────────────── */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 120px;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: border-color .15s;
}
.stat-box:hover { border-color: rgba(74,158,255,.35); }
.stat-val { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .4px; }

/* ── History table ───────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.table tr:hover td { background: var(--bg3); }

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-done    { background: rgba(63,185,80,.2);  color: var(--green); }
.status-running { background: rgba(74,158,255,.2); color: var(--accent); }
.status-pending { background: rgba(210,153,34,.2); color: var(--yellow); }
.status-error   { background: rgba(248,81,73,.2);  color: var(--red); }

/* ── Input type icon tags ─────────────────────────────────────────────────── */
.type-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.type-username { background: rgba(210,168,255,.15); color: var(--purple); }
.type-email    { background: rgba(210,153,34,.15);  color: var(--yellow); }
.type-phone    { background: rgba(63,185,80,.15);   color: var(--green); }
.type-name     { background: rgba(74,158,255,.15);  color: var(--accent); }
.type-domain   { background: rgba(57,208,216,.15);  color: var(--teal); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 900px 600px at 50% 15%, rgba(74,158,255,.10), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 44px 36px 36px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(74,158,255,.04);
}
.login-logo {
  text-align: center;
  margin-bottom: 30px;
}
.login-lockup {
  width: 170px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(74,158,255,.25));
}
.login-logo .tagline  { font-size: 12px; color: var(--text-dim); margin-top: 10px; letter-spacing: .2px; }
.login-error {
  background: rgba(248,81,73,.15);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: var(--radius);
  color: var(--red);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 20px 0 10px;
}

.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-dim { color: var(--text-dim); }
.text-sm  { font-size: 12px; }
.bold { font-weight: 600; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .results-grid { grid-template-columns: 1fr; }
}
