:root {
  --bg:        #0a0c10;
  --surface:   #111318;
  --card:      #161a22;
  --border:    #1e2430;
  --accent:    #e8442a;
  --accent2:   #ff6b4a;
  --gold:      #c9a84c;
  --text:      #e8eaf0;
  --muted:     #6b7280;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --info:      #3b82f6;
  --radius:    10px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Golos Text', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  font-family: 'Dela Gothic One', sans-serif;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.logo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 0.05em; text-transform: uppercase; }

.nav { padding: 12px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 14px;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-item.active { color: var(--text); border-left-color: var(--accent); background: rgba(232,68,42,.06); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(201,168,76,.12);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.user-info { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ── MAIN ── */
.main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-family: 'Dela Gothic One', sans-serif; font-size: 18px; }
.topbar-right { display: flex; gap: 8px; align-items: center; }

/* ── CONTENT ── */
.content { padding: 28px; flex: 1; }

/* ── AUTH SCREEN ── */
#auth-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.auth-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 420px;
  position: relative;
  overflow: hidden;
}
.auth-box::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(232,68,42,.15) 0%, transparent 70%);
  pointer-events: none;
}
.auth-logo {
  font-family: 'Dela Gothic One', sans-serif;
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 6px;
}
.auth-tagline { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.auth-tab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit; font-size: 15px;
  transition: border-color .15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,68,42,.3); }
.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.btn-ghost { background: rgba(255,255,255,.05); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.09); }
.btn-success { background: rgba(34,197,94,.15); color: var(--success); border: 1px solid rgba(34,197,94,.25); }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.red::after   { background: var(--accent); }
.stat-card.gold::after  { background: var(--gold); }
.stat-card.blue::after  { background: var(--info); }
.stat-card.green::after { background: var(--success); }

.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-value { font-family: 'Dela Gothic One', sans-serif; font-size: 32px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-delta { font-size: 11px; color: var(--accent); margin-top: 8px; font-weight: 600; }

/* ── PANELS ── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-title { font-weight: 700; font-size: 15px; }
.panel-body { padding: 20px; }

/* ── TWO-COL LAYOUT ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.full-col { margin-bottom: 20px; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(255,255,255,.01);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: rgba(232,68,42,.04); }
.upload-icon { font-size: 36px; margin-bottom: 12px; }
.upload-text { font-size: 14px; color: var(--muted); }
.upload-text strong { color: var(--text); }
.upload-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
#file-input { display: none; }

/* ── TABLE ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 14px; border-bottom: 1px solid rgba(30,36,48,.8); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,.02); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-new     { background: rgba(232,68,42,.15); color: var(--accent2); }
.badge-confirmed { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-ignored { background: rgba(107,114,128,.15); color: var(--muted); }
.badge-claim   { background: rgba(34,197,94,.15); color: var(--success); }
.badge-running { background: rgba(59,130,246,.15); color: var(--info); }
.badge-done    { background: rgba(34,197,94,.15); color: var(--success); }
.badge-failed  { background: rgba(232,68,42,.15); color: var(--accent); }
.badge-pending { background: rgba(107,114,128,.15); color: var(--muted); }

/* ── CONFIDENCE BAR ── */
.conf-bar { display: flex; align-items: center; gap: 8px; }
.conf-track { flex: 1; height: 4px; background: var(--border); border-radius: 2px; max-width: 80px; }
.conf-fill  { height: 100%; border-radius: 2px; background: var(--accent); }
.conf-pct   { font-size: 12px; color: var(--muted); min-width: 32px; }

/* ── PHOTO GRID ── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.photo-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.photo-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--border); display: flex; align-items: center; justify-content: center; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb-placeholder { font-size: 32px; color: var(--border); }
.photo-info { padding: 10px; }
.photo-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.photo-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 10px; font-weight: 700;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-text  { font-size: 14px; }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(232,68,42,.1); color: #ff8a75; border: 1px solid rgba(232,68,42,.2); }
.alert-success { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }

/* ── PROGRESS ── */
.scan-progress {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius);
  font-size: 13px; color: var(--info);
  margin-bottom: 16px; display: none;
}
.scan-progress.show { display: flex; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(59,130,246,.3);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ── PAGE VISIBILITY ── */
.page { display: none; }
.page.active { display: block; }

/* ── DOMAIN LINK ── */
.domain-link { color: var(--info); text-decoration: none; font-size: 13px; }
.domain-link:hover { text-decoration: underline; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transform: translateY(80px); opacity: 0;
  transition: all .3s; z-index: 9999;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--accent); }
