/* ══════════════════════════════════════════════
   Email Enricher Pro — Dark SaaS Theme
   ══════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-body: #050507;
  --bg-sidebar: #0a0a0f;
  --bg-main: #0c0c11;
  --bg-card: #111118;
  --bg-surface: #16161e;
  --bg-hover: #1c1c26;
  --bg-input: #12121a;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --text-2: #9393a8;
  --text-3: #55556a;
  --accent: #7c5cfc;
  --accent-hover: #9b82fc;
  --accent-glow: rgba(124,92,252,0.15);
  --accent-glow-strong: rgba(124,92,252,0.25);
  --green: #34d399;
  --green-bg: rgba(52,211,153,0.08);
  --green-border: rgba(52,211,153,0.2);
  --amber: #fbbf24;
  --amber-bg: rgba(251,191,36,0.08);
  --amber-border: rgba(251,191,36,0.2);
  --red: #f87171;
  --red-bg: rgba(248,113,113,0.08);
  --red-border: rgba(248,113,113,0.2);
  --orange: #fb923c;
  --orange-bg: rgba(251,146,60,0.08);
  --orange-border: rgba(251,146,60,0.2);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font-family: var(--font); background: var(--bg-body); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.5; height: 100%; overflow: hidden; }

/* Force [hidden] to beat any display: flex/grid/block rule below */
[hidden] { display: none !important; }

/* ── App Layout ── */
.app-layout { display: flex; height: 100vh; }

/* ══════════════════════════════════
   Sidebar
   ══════════════════════════════════ */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; margin-bottom: 28px; }
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}
.brand-text { display: flex; align-items: baseline; gap: 5px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; color: var(--text); }
.brand-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), #a78bfa); color: #fff;
  padding: 1px 6px; border-radius: 4px; line-height: 1.6;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all var(--transition);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent-hover); font-weight: 600; }
.nav-item.active svg { stroke: var(--accent-hover); }

.sidebar-footer { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar-version { font-size: 10px; color: var(--text-3); text-align: center; letter-spacing: 0.05em; }

/* API Badge */
.api-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-2);
  padding: 6px 10px; border-radius: var(--radius);
  background: var(--bg-surface); border: 1px solid var(--border);
}
.api-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.api-badge.ok .api-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.api-badge.warn .api-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.api-badge.err .api-dot { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ══════════════════════════════════
   Main Content
   ══════════════════════════════════ */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  background: var(--bg-main);
  padding: 0 32px 60px;
}

/* ── Topbar ── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0 20px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(to bottom, var(--bg-main) 70%, transparent);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.page-subtitle { font-size: 13px; color: var(--text-3); margin-top: 2px; font-weight: 400; }

/* ══════════════════════════════════
   Upload Card
   ══════════════════════════════════ */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.upload-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.upload-card-icon {
  width: 42px; height: 42px; border-radius: var(--radius-lg);
  background: var(--accent-glow); border: 1px solid rgba(124,92,252,0.15);
  display: flex; align-items: center; justify-content: center; color: var(--accent-hover);
}
.upload-card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.upload-card-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.upload-card form { display: flex; gap: 14px; align-items: stretch; }

/* Dropzone */
.dropzone {
  flex: 1; display: flex; align-items: center; cursor: pointer;
  border: 1.5px dashed rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: var(--bg-input);
  transition: all var(--transition);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-glow); }
.dropzone.dragover { border-color: var(--accent-hover); background: var(--accent-glow-strong); box-shadow: var(--shadow-glow); }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-inner { display: flex; align-items: center; gap: 14px; }
.drop-icon-ring {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-3);
  flex-shrink: 0; transition: all var(--transition);
}
.dropzone:hover .drop-icon-ring { border-color: var(--accent); color: var(--accent-hover); }
.drop-text { display: flex; flex-direction: column; }
.drop-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0; }
.drop-meta { font-size: 11px; color: var(--text-3); margin: 2px 0 0; }
.accent { color: var(--accent-hover); font-weight: 600; }

.upload-actions { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.upload-meta-row { display: flex; align-items: center; gap: 8px; }
.chip-row { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  background: var(--accent-glow); color: var(--accent-hover);
  font-weight: 600; letter-spacing: 0.01em;
}
.chip.dim { background: rgba(255,255,255,0.03); color: var(--text-3); }

/* ══════════════════════════════════
   Buttons
   ══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius); padding: 8px 16px;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition); line-height: 1.4; white-space: nowrap;
}
.btn-lg { padding: 12px 22px; font-size: 14px; border-radius: var(--radius-lg); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9b6dfc);
  color: #fff; box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #8b6ffc, #a98bfc); box-shadow: 0 4px 16px var(--accent-glow-strong); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: var(--bg-surface); color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-hover); }

/* ══════════════════════════════════
   Banner
   ══════════════════════════════════ */
.banner { margin-top: 14px; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; font-weight: 500; display: none; }
.banner.visible { display: block; }
.banner.success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.banner.error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.banner.info { background: var(--accent-glow); color: var(--accent-hover); border: 1px solid rgba(124,92,252,0.2); }

/* ══════════════════════════════════
   Jobs Panel
   ══════════════════════════════════ */
.jobs-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head-left { display: flex; align-items: center; gap: 10px; }
.panel-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.panel-badge {
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  background: var(--accent-glow); color: var(--accent-hover);
  padding: 2px 8px; border-radius: 999px; min-width: 22px; text-align: center;
}
.panel-badge:empty { display: none; }

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
#jobs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#jobs-table th {
  padding: 11px 14px; text-align: left;
  font-weight: 700; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  background: rgba(255,255,255,0.02); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
#jobs-table td {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
#jobs-table tbody tr { transition: background var(--transition); }
#jobs-table tbody tr:hover { background: rgba(124,92,252,0.04); }
#jobs-table tbody tr:first-child td { border-top: none; }

.col-name { min-width: 190px; } .col-status { width: 100px; } .col-num { width: 75px; text-align: center; } .col-progress { min-width: 150px; } .col-actions { min-width: 260px; }
#jobs-table th.col-num, #jobs-table td.col-num { text-align: center; }
.file-cell strong { font-size: 13px; display: block; font-weight: 600; word-break: break-word; color: var(--text); }
.file-cell .meta { font-size: 10px; color: var(--text-3); margin-top: 3px; display: block; letter-spacing: 0.01em; }

/* ── Status Pills ── */
.pill {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pill.run { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.pill.done { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.pill.failed, .pill.stop { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.pill.pause { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-border); }
.pill.pending { background: var(--accent-glow); color: var(--accent-hover); border: 1px solid rgba(124,92,252,0.2); }
.pill.stopping, .pill.pausing { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-border); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Progress Bar ── */
.progress-cell { display: flex; flex-direction: column; gap: 5px; }
.progress-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.04); overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--accent-glow);
}
.progress-text { font-size: 11px; color: var(--text-2); font-family: var(--mono); font-weight: 500; }
.rate-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 8px;
  font-size: 10px; font-weight: 600; font-family: var(--mono);
  background: var(--accent-glow); color: var(--accent-hover); border: 1px solid rgba(124,92,252,0.25);
  animation: rate-pulse 2s ease-in-out infinite;
}
@keyframes rate-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ── Action Buttons ── */
.action-row { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.btn-action {
  height: 28px; padding: 0 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600; font-family: var(--font);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-2); cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn-action:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-hover); transform: translateY(-1px); }

.btn-action.danger { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.btn-action.danger:hover { background: rgba(248,113,113,0.15); color: #fca5a5; }
.btn-action.stop { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.btn-action.stop:hover { background: rgba(248,113,113,0.15); color: #fca5a5; }
.btn-action.pause { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.btn-action.pause:hover { background: rgba(251,191,36,0.15); color: #fde68a; }
.btn-action.rerun { color: var(--accent-hover); border-color: rgba(124,92,252,0.25); background: var(--accent-glow); }
.btn-action.rerun:hover { background: var(--accent-glow-strong); color: #c4b5fd; }
.btn-action.issues { color: var(--orange); border-color: var(--orange-border); background: var(--orange-bg); }
.btn-action.issues:hover { background: rgba(251,146,60,0.15); color: #fdba74; }
.btn-action.download { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.btn-action.download:hover { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.btn-action.stopping-label { color: var(--orange); border-color: var(--orange-border); background: var(--orange-bg); cursor: default; pointer-events: none; animation: pulse 1.5s ease-in-out infinite; }

/* ── Stat Numbers ── */
.stat-num { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.stat-num.green { color: var(--green); }
.stat-num.amber { color: var(--amber); }
.stat-num.red { color: var(--red); }
.stat-num.orange { color: var(--orange); }
.stat-num.muted { color: var(--text-3); }
.other-stat-btn { font-family: var(--mono); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; padding: 0; color: var(--text-3); transition: color var(--transition); }
.other-stat-btn.has-issues { color: #a78bfa; text-decoration: underline dotted; text-underline-offset: 3px; }
.other-stat-btn.has-issues:hover { color: #c4b5fd; }
.issue-badge {
  min-width: 17px; height: 17px; padding: 0 5px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); line-height: 1;
}

/* Empty State */
.empty { color: var(--text-3); text-align: center; padding: 48px 0 40px; font-size: 14px; }
.empty-icon { display: block; margin: 0 auto 12px; color: var(--text-3); opacity: 0.4; }

/* ══════════════════════════════════
   Overlays / Drawers
   ══════════════════════════════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000; display: flex; justify-content: flex-end;
  backdrop-filter: blur(6px);
}
.overlay[hidden] { display: none; }
.drawer {
  width: min(620px, 92vw); height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: slideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 15px; font-weight: 700; }
.drawer-close-btn {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); line-height: 1;
}
.drawer-close-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-hover); }
.logs-pre {
  flex: 1; overflow: auto; padding: 18px 22px; margin: 0;
  font-family: var(--mono); font-size: 11px; line-height: 1.8;
  color: var(--text-2); white-space: pre-wrap; word-break: break-all;
  background: var(--bg-surface);
}

/* ── Issues Drawer ── */
.issues-content { flex: 1; overflow: auto; padding: 22px; }
.issues-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }
.issues-summary-card { border-radius: var(--radius-lg); padding: 18px 20px; border: 1px solid; }
.issues-card-bad { background: var(--red-bg); border-color: var(--red-border); }
.issues-card-good { background: var(--green-bg); border-color: var(--green-border); }
.issues-card-num { font-size: 30px; font-weight: 800; font-family: var(--mono); line-height: 1; }
.issues-card-bad .issues-card-num { color: var(--red); }
.issues-card-good .issues-card-num { color: var(--green); }
.issues-card-label { font-size: 11px; font-weight: 600; color: var(--text-2); margin-top: 6px; letter-spacing: 0.02em; }
.issues-card-pct { font-size: 11px; color: var(--text-3); margin-top: 2px; font-family: var(--mono); }
.issues-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 8px; }
.issues-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.issues-table th {
  padding: 9px 12px; text-align: left; font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3);
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.issues-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); vertical-align: middle; }
.issues-table tbody tr:hover { background: rgba(124,92,252,0.04); }
.issues-table tr.issues-total td { border-top: 2px solid var(--border); border-bottom: none; padding-top: 10px; }
.issue-type-label { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.issue-type-label.orange { color: var(--orange); } .issue-type-label.amber { color: var(--amber); } .issue-type-label.red { color: var(--red); }
.issue-desc { font-size: 12px; color: var(--text-3); }
.issues-job-meta { margin-top: 22px; font-size: 11px; color: var(--text-3); padding-top: 16px; border-top: 1px solid var(--border); }
.issues-job-meta span { color: var(--text-2); font-weight: 500; }

/* ══════════════════════════════════
   Scrollbar
   ══════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ══════════════════════════════════
   Auth Gate (login / register / credits)
   ══════════════════════════════════ */
.auth-gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, rgba(124,92,252,0.12), transparent 60%), var(--bg-body);
  z-index: 1000; padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-3); margin-bottom: 22px; }
.auth-label {
  display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-2); margin-bottom: 6px;
}
.auth-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  transition: all var(--transition);
  margin-bottom: 14px;
}
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-input::placeholder { color: var(--text-3); }
.auth-btn { width: 100%; justify-content: center; }
.auth-error {
  margin-top: 12px;
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
}
.auth-success {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 12px;
  word-break: break-all;
}
.auth-success code {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  padding: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  user-select: all;
}
.auth-links {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}
.auth-links a { color: var(--accent-hover); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Credits + Logout in topbar */
.credits-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--accent-hover);
  padding: 9px 14px; border-radius: var(--radius);
  background: var(--accent-glow);
  border: 1px solid rgba(124,92,252,0.25);
  white-space: nowrap;
  box-shadow: 0 0 12px var(--accent-glow);
}
.credits-badge svg { stroke: var(--accent-hover); }
.credits-badge.low { color: var(--red); background: var(--red-bg); border-color: var(--red-border); box-shadow: 0 0 12px rgba(248,113,113,0.15); }
.credits-badge.low svg { stroke: var(--red); }
.credits-badge.warn { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-border); box-shadow: 0 0 12px rgba(251,191,36,0.15); }
.credits-badge.warn svg { stroke: var(--amber); }

.logout-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  padding: 9px 14px; border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.logout-btn:hover {
  color: var(--red);
  border-color: var(--red-border);
  background: var(--red-bg);
}
.logout-btn:hover svg { stroke: var(--red); }

/* ══════════════════════════════════
   Responsive
   ══════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { padding: 0 16px 60px; }
  .upload-card form { flex-direction: column; }
  .upload-actions { flex-direction: column; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
}
