/* ═══════════════════════════════════════════════════════════════════════════
   EON — Stripe / Notion Inspired Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ───────────────────────────────────────────────────────── */

:root {
  /* Surface */
  --bg-page:      #f4f5f7;
  --bg-card:      #ffffff;
  --bg-sidebar:   #ffffff;
  --bg-input:     #ffffff;
  --bg-hover:     #f9fafb;
  --bg-active:    #f3f4f6;
  --bg-selected:  #eef2ff;

  /* Borders */
  --border:       #e5e7eb;
  --border-light: #f0f0f0;
  --border-focus: #5046e5;

  /* Text */
  --text-primary:    #111827;
  --text-secondary:  #4b5563;
  --text-tertiary:   #6b7280;
  --text-muted:      #9ca3af;
  --text-placeholder: #c4c8d0;

  /* Accent — Stripe Indigo */
  --accent:        #5046e5;
  --accent-hover:  #4338ca;
  --accent-light:  #eef2ff;
  --accent-text:   #4338ca;

  /* Status */
  --green:       #16a34a;
  --green-bg:    #f0fdf4;
  --green-border:#bbf7d0;
  --yellow:      #ca8a04;
  --yellow-bg:   #fefce8;
  --yellow-border:#fef08a;
  --red:         #dc2626;
  --red-bg:      #fef2f2;
  --red-border:  #fecaca;
  --blue:        #2563eb;
  --blue-bg:     #eff6ff;

  /* Shape */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

  /* Layout */
  --sidebar-w: 248px;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection { background: var(--accent-light); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   SCREENS
   ═══════════════════════════════════════════════════════════════════════════ */

.screen        { min-height: 100vh; }
.screen[hidden] { display: none !important; }
.screen-center { display:flex; align-items:center; justify-content:center; background: var(--bg-page); }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH (LOGIN / REGISTER / VERIFY)
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form[hidden] { display: none !important; }
.auth-toggle[hidden] { display: none !important; }
.alert[hidden] { display: none !important; }

.auth-toggle {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 20px;
}

.auth-toggle a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle a:hover { text-decoration: underline; }

/* ─── Verify Screen ───────────────────────────────────────────────────────── */

.verify-hero { text-align: center; margin-bottom: 24px; }

.verify-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.verify-hero h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.verify-hero p { font-size: 14px; color: var(--text-tertiary); margin-bottom: 2px; }
.verify-addr { font-weight: 600; color: var(--text-primary); font-size: 14px; margin: 4px 0 12px; }
.verify-hint { font-size: 13px; color: var(--text-muted); }

.verify-status { text-align:center; font-size:13px; min-height:20px; margin-bottom:8px; }
.verify-status.success { color: var(--green); }
.verify-status.error { color: var(--red); }

.verify-actions { display:flex; flex-direction:column; gap:10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-layout[hidden] { display: none !important; }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-top { flex:1; overflow-y:auto; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.sidebar-nav { padding: 0 12px; }

.nav-section-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 16px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius);
  background: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
  text-align: left;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-item.active {
  background: var(--bg-selected);
  color: var(--accent-text);
}

.nav-item svg { flex-shrink:0; width:18px; height:18px; }

/* ─── Sidebar Footer ─────────────────────────────────────────────────────── */

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-email-text {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Main Content ────────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 36px 48px 60px;
  max-width: calc(var(--sidebar-w) + 920px);
}

/* ─── Page Header ─────────────────────────────────────────────────────────── */

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-head p { font-size: 14px; color: var(--text-tertiary); }

/* ─── Tabs ────────────────────────────────────────────────────────────────── */

.tab-content        { display: none; }
.tab-content.active { display: block; animation: fadeUp .2s var(--ease); }

@keyframes fadeUp {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.card-head h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 24px; }

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

form { display:flex; flex-direction:column; gap:16px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

input::placeholder, textarea::placeholder { color: var(--text-placeholder); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(80,70,229,.1);
}

textarea {
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.7;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-actions { display: flex; gap: 10px; }

.help-text {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.help-text code {
  font-size: 12px;
  background: var(--bg-active);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'SF Mono', ui-monospace, monospace;
}

/* ─── File Upload ─────────────────────────────────────────────────────────── */

.file-upload {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
  margin-bottom: 12px;
}

.file-upload:hover, .file-upload.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.file-upload-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.file-upload.dragover .file-upload-icon { background: rgba(80,70,229,.1); color: var(--accent); }

.file-upload-text { font-size: 13px; color: var(--text-tertiary); }
.file-hidden { position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.file-link { color: var(--accent); cursor:pointer; font-weight:500; }
.file-link:hover { text-decoration:underline; }
.file-name { display:block; font-size:12px; color: var(--accent); font-weight:500; margin-top:2px; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled { opacity:.4; cursor:not-allowed; }
.btn:active:not(:disabled) { transform:scale(.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-hover); border-color: #d1d5db; }

/* Kept for JS compatibility */
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }

.btn-danger-ghost {
  background: none;
  color: var(--red);
  border-color: transparent;
}
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-bg); }

.btn-ghost {
  background: none;
  color: var(--text-tertiary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }

.btn-full  { width:100%; }
.btn-small { padding:6px 12px; font-size:12px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

.alert-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════════════════════════════════════ */

.result-area { padding: 20px 24px; }
.result-area[hidden] { display: none !important; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  transition: box-shadow .12s var(--ease);
}

.result-card:hover { box-shadow: var(--shadow-sm); }

/* ── Result Card Header ──────── */

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.result-person {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
}

.result-name   { font-weight: 600; color: var(--text-primary); }
.result-company { font-weight: 600; color: var(--text-primary); }
.result-title  { color: var(--text-secondary); }
.result-sep    { color: var(--text-muted); font-size: 13px; }

.result-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.result-meta code {
  font-size: 12px;
  background: var(--bg-active);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', ui-monospace, monospace;
}

/* Keep for backwards compat with JS */
.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.result-detail {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.result-detail code {
  font-size: 12px;
  background: var(--bg-active);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', ui-monospace, monospace;
}

/* ── Email Result Rows ───────── */

.email-results, .people-results {
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
  padding-top: 4px;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 2px -10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .1s var(--ease);
}

.email-row:hover { background: var(--bg-hover); }
.email-row.copied { background: var(--green-bg); }

.email-addr {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.copy-icon {
  margin-left: auto;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .12s var(--ease);
  flex-shrink: 0;
}

.email-row:hover .copy-icon,
.person-row:hover .copy-icon { opacity: 1; }

.email-row.copied .copy-icon { opacity: 1; color: var(--green); }

.verify-detail {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Hover-Expandable Possible Emails ──────── */

.possible-emails-hover {
  position: relative;
  margin-top: 6px;
}

.possible-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  cursor: default;
  transition: background 0.15s;
}

.possible-trigger:hover { background: #fef3c7; }

.possible-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--yellow);
}

.chevron-icon {
  color: var(--yellow);
  transition: transform 0.2s ease;
}

.possible-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
  margin-top: 0;
}

.possible-emails-hover:hover .possible-content {
  max-height: 300px;
  opacity: 1;
  margin-top: 4px;
}

.possible-emails-hover:hover .chevron-icon {
  transform: rotate(180deg);
}

/* ── Person Result Rows ──────── */

.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 2px -10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .1s var(--ease);
  border-bottom: 1px solid var(--border-light);
}

.person-row:last-child { border-bottom: none; }
.person-row:hover { background: var(--bg-hover); }
.person-row.copied { background: var(--green-bg); }

.person-info { display: flex; flex-direction: column; gap: 1px; }
.person-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.person-title { font-size: 12px; color: var(--text-tertiary); }

.person-row.copied .copy-icon { opacity: 1; color: var(--green); }

/* Keep for backwards compat */
.person-list { list-style:none; margin-top:8px; }

.person-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
}

.person-list li:last-child { border-bottom:none; }
.person-list li strong { color: var(--text-primary); }

.no-results {
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
  padding: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.badge.green  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge.red    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-border); }
.badge.gray   { background: var(--bg-active); color: var(--text-tertiary); border: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════════════════════════════════════ */

.progress-area {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  font-size: 13px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-light);
}

.progress-area[hidden] { display: none !important; }

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-active);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.progress-bar-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
  0%   { left: -40%; width: 40%; }
  50%  { left: 20%;  width: 50%; }
  100% { left: 100%; width: 40%; }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY
   ═══════════════════════════════════════════════════════════════════════════ */

.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.history-controls select { width:auto; min-width:170px; }

.history-search { flex: 1; }
.history-search .input {
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
}

.history-actions { display:flex; gap:8px; }

.history-list { padding: 0 24px 20px; min-height:60px; }

/* ── History Table Layout ── */

.history-table-header {
  display: grid;
  grid-template-columns: 130px 1fr 1fr 1.5fr 90px;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}

.history-table-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr 1.5fr 90px;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.history-table-row:hover { background: var(--bg-hover); }
.history-table-row:last-of-type { border-bottom: none; }

.ht-col { overflow: hidden; text-overflow: ellipsis; }
.ht-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ht-result { display: flex; flex-wrap: wrap; gap: 4px; }
.ht-status { text-align: right; }

.text-muted { color: var(--text-muted); }

.history-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state svg { margin-bottom: 10px; display:block; margin-left:auto; margin-right:auto; }

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

.history-page-info {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-small {
  padding: 6px 14px;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE SEARCH PROGRESS CIRCLE
   ═══════════════════════════════════════════════════════════════════════════ */

.single-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
}

.single-progress[hidden] { display: none !important; }

.progress-circle {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.progress-track {
  fill: none;
  stroke: var(--bg-active);
  stroke-width: 3;
}

.progress-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s ease;
}

.progress-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BATCH PROGRESS (real-time counter)
   ═══════════════════════════════════════════════════════════════════════════ */

.batch-progress-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.batch-counter {
  font-weight: 600;
  color: var(--accent);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.progress-area {
  flex-direction: column;
  align-items: stretch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CREDIT COST LABELS
   ═══════════════════════════════════════════════════════════════════════════ */

.credit-cost {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-active);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR CREDITS WIDGET
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar-credits {
  margin: 0 12px 12px;
  padding: 14px;
  background: var(--bg-page);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.credits-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.credits-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.credits-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CREDITS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.credits-balance-card {
  background: linear-gradient(135deg, #5046e5, #7c3aed);
  border: none;
  color: white;
}

.credits-balance {
  text-align: center;
  padding: 20px 0;
}

.credits-big {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.credits-balance-label {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 4px;
}

/* Pricing grid */
.pricing-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pricing-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.pricing-item:last-child { border-bottom: none; }

.pricing-tool {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 120px;
}

.pricing-desc {
  flex: 1;
  font-size: 13px;
  color: var(--text-tertiary);
}

.pricing-cost {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.pricing-per {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
}

/* Purchase options */
.purchase-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.purchase-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  transition: all .15s var(--ease);
  font-family: inherit;
}

.purchase-option:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(80,70,229,.08);
}

.purchase-option.popular {
  border-color: var(--accent);
  background: var(--accent-light);
}

.purchase-badge {
  position: absolute;
  top: -9px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent);
  color: white;
  padding: 2px 10px;
  border-radius: 100px;
}

.purchase-credits {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.purchase-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.purchase-per {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.history-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-emails, .history-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.history-email {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  cursor: pointer;
  transition: background .1s var(--ease);
}

.history-email:hover { background: #dcfce7; }
.history-email.copied { background: #bbf7d0; }

.history-email.possible {
  background: var(--yellow-bg);
  color: var(--yellow);
  border-color: var(--yellow-border);
}

.history-email.possible:hover { background: #fef9c3; }

.history-person {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
  cursor: pointer;
  transition: background .1s var(--ease);
}

.history-person:hover { background: #dbeafe; }
.history-person.copied { background: #bfdbfe; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.inline-row { display:flex; align-items:center; gap:12px; }

.error-msg {
  background: var(--red-bg);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--red-border);
}

.success-msg {
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
}

.batch-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 860px) {
  .main-content {
    padding: 28px 24px 48px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
    /* TODO: hamburger menu for mobile */
  }

  .main-content {
    margin-left: 0;
    padding: 24px 16px 48px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    margin: 16px;
    padding: 32px 24px;
  }

  .history-controls { flex-wrap:wrap; }
  .page-head h1 { font-size:18px; }
  .purchase-options { grid-template-columns: 1fr; }
  .pricing-item { flex-direction: column; align-items: flex-start; gap: 4px; }
}
