/* ═══════════════════════════════════════════════════════
   DataScraper Pro — Main Stylesheet
   Font: Syne (headings) + DM Sans (body)
   Theme: Deep navy / Electric cyan accent
═══════════════════════════════════════════════════════ */

:root {
  --bg-base:       #0d0f1a;
  --bg-surface:    #13162a;
  --bg-card:       #181c30;
  --bg-raised:     #1e2238;
  --bg-hover:      #232742;

  --accent:        #00d4ff;
  --accent-dim:    rgba(0,212,255,0.12);
  --accent-glow:   0 0 20px rgba(0,212,255,0.35);
  --accent2:       #7c3aed;
  --accent2-dim:   rgba(124,58,237,0.12);

  --green:         #10b981;
  --green-dim:     rgba(16,185,129,0.12);
  --amber:         #f59e0b;
  --amber-dim:     rgba(245,158,11,0.12);
  --red:           #ef4444;
  --red-dim:       rgba(239,68,68,0.12);
  --blue:          #3b82f6;
  --blue-dim:      rgba(59,130,246,0.12);
  --cyan:          #06b6d4;
  --purple:        #8b5cf6;

  --text-primary:  #f0f4ff;
  --text-secondary:#a8b4cc;
  --text-muted:    #5f6b82;

  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(0,212,255,0.25);

  --sidebar-w:     240px;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     18px;
  --radius-xl:     24px;

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.5);

  --transition:    all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg-base); color: var(--text-primary); font-size: 14px; line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { opacity: 0.85; }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-raised); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ── App Layout ─────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: var(--accent-glow);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; color: var(--text-primary); letter-spacing: 0.3px; }
.brand-tag { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: var(--accent); background: var(--accent-dim); padding: 1px 6px; border-radius: 3px; width: fit-content; }

.sidebar-nav { flex: 1; padding: 12px 12px; overflow-y: auto; }
.nav-section-label { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; padding: 8px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
  transition: var(--transition);
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item:hover { background: var(--bg-raised); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); border-left: 3px solid var(--accent); padding-left: 9px; }
.nav-item.new-scrape-btn { background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(124,58,237,0.1)); color: var(--accent); font-weight: 600; border: 1px solid var(--border-accent); }
.nav-item.new-scrape-btn:hover { background: linear-gradient(135deg, rgba(0,212,255,0.25), rgba(124,58,237,0.2)); }

.sidebar-usage { padding: 12px 16px; margin: 0 8px 8px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.usage-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.usage-bar-wrap { background: var(--bg-raised); border-radius: 3px; height: 5px; overflow: hidden; margin-bottom: 5px; }
.usage-bar { background: linear-gradient(90deg, var(--accent), var(--accent2)); height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.usage-text { font-size: 11px; color: var(--text-secondary); }

.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.su-avatar { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent2), var(--accent)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.su-info { min-width: 0; }
.su-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-role { font-size: 10px; color: var(--text-muted); }
.logout-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: var(--red-dim); color: var(--red); border-radius: var(--radius-sm); flex-shrink: 0; transition: var(--transition); }
.logout-btn:hover { background: var(--red); color: #fff; opacity: 1; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle { display: none; background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-secondary); padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.topbar-title { flex: 1; }
.topbar-title h1 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; line-height: 1.2; }
.topbar-sub { font-size: 12px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-time { font-family: 'Syne', sans-serif; font-size: 14px; color: var(--text-muted); }

/* ── Content Area ───────────────────────────────────────── */
.content-area { padding: 24px 28px; flex: 1; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; transition: var(--transition); white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #0099bb); color: #fff; box-shadow: 0 2px 12px rgba(0,212,255,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,212,255,0.45); opacity: 1; color: #fff; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); opacity: 1; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-raised); color: var(--text-primary); opacity: 1; }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; opacity: 1; }
.btn-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.btn-amber:hover { background: var(--amber); color: #000; opacity: 1; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--text-secondary); border: 1px solid var(--border); cursor: pointer; transition: var(--transition); font-size: 12px; }
.btn-icon:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--border-accent); opacity: 1; }
.btn-icon-green:hover { background: var(--green-dim); color: var(--green); border-color: rgba(16,185,129,0.25); }
.btn-icon-red:hover { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.25); }
.btn-icon-amber:hover { background: var(--amber-dim); color: var(--amber); border-color: rgba(245,158,11,0.25); }

/* ── Stats Grid ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card::after { content:''; position:absolute; top:0; left:0; right:0; height:2px; }
.stat-blue::after { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.stat-cyan::after { background: linear-gradient(90deg, var(--cyan), var(--accent)); }
.stat-green::after { background: linear-gradient(90deg, var(--green), #34d399); }
.stat-amber::after { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.stat-purple::after { background: linear-gradient(90deg, var(--purple), #a78bfa); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.12); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-blue .stat-icon { background: var(--blue-dim); color: var(--blue); }
.stat-cyan .stat-icon { background: var(--accent-dim); color: var(--accent); }
.stat-green .stat-icon { background: var(--green-dim); color: var(--green); }
.stat-amber .stat-icon { background: var(--amber-dim); color: var(--amber); }
.stat-purple .stat-icon { background: rgba(139,92,246,0.12); color: var(--purple); }
.stat-value { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-trend { position: absolute; right: 16px; top: 16px; color: var(--green); font-size: 12px; }

/* ── Dashboard Grid ─────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.dash-wide { grid-column: 1; }

/* ── Card Header ────────────────────────────────────────── */
.card-header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--accent); }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.card-table { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 20px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { background: var(--bg-raised); }
.data-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-raised); }
.data-table-sm td, .data-table-sm th { padding: 8px 12px; font-size: 12px; }
.empty-row { text-align: center; color: var(--text-muted); padding: 32px !important; }
.table-note { padding: 10px 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-raised); }

/* ── Badges ─────────────────────────────────────────────── */
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-pending { background: var(--amber-dim); color: var(--amber); }
.status-running { background: var(--blue-dim); color: var(--blue); }
.status-completed { background: var(--green-dim); color: var(--green); }
.status-failed { background: var(--red-dim); color: var(--red); }
.status-cancelled { background: rgba(100,100,100,0.15); color: #888; }

.plan-badge { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.plan-free { background: rgba(100,100,100,0.15); color: #888; }
.plan-basic { background: var(--blue-dim); color: var(--blue); }
.plan-pro { background: var(--accent-dim); color: var(--accent); }
.plan-enterprise { background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(0,212,255,0.2)); color: var(--purple); }

.bool-badge { padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.bool-yes { background: var(--green-dim); color: var(--green); }
.bool-no { background: var(--red-dim); color: var(--red); }

.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; background: var(--bg-raised); color: var(--text-secondary); border: 1px solid var(--border); }
.tag-sm { font-size: 10px; padding: 1px 6px; }
.tag-blue { background: var(--blue-dim); color: var(--blue); border-color: rgba(59,130,246,0.2); }
.source-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.cnt-badge { background: var(--accent-dim); color: var(--accent); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.user-badge { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.date-small { font-size: 11px; color: var(--text-muted); }
.job-title-cell { font-weight: 600; color: var(--text-primary); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-link { color: var(--accent); font-size: 12px; }
.web-link { color: var(--blue); font-size: 12px; }

/* ── User list (dashboard) ──────────────────────────────── */
.user-list { padding: 8px; }
.user-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: var(--radius-sm); margin-bottom: 4px; }
.user-list-item:hover { background: var(--bg-raised); }
.ul-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ul-info { flex: 1; min-width: 0; }
.ul-name { font-size: 13px; font-weight: 600; }
.ul-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar { margin-bottom: 16px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; flex: 1; min-width: 200px; }
.search-box i { color: var(--text-muted); font-size: 13px; }
.search-box input { background: none; border: none; outline: none; color: var(--text-primary); font-size: 13px; flex: 1; }
.filter-select { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; color: var(--text-primary); font-size: 13px; cursor: pointer; outline: none; }
.filter-select:focus { border-color: var(--accent); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.alert-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; color: inherit; opacity: 0.7; padding: 0 4px; }
.alert-close:hover { opacity: 1; }

/* ── Modals ─────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-dialog { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; gap: 10px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; flex: 1; }
.modal-header button { background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-muted); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-form { padding: 20px 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }

/* ── Form elements ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-primary); font-size: 13.5px; outline: none;
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-group small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.req { color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

/* ── Auth Pages ─────────────────────────────────────────── */
.auth-page { background: var(--bg-base); }
.auth-container { display: flex; min-height: 100vh; }
.auth-left {
  flex: 1; background: linear-gradient(135deg, #0d0f1a 0%, #13162a 40%, #0d1525 100%);
  padding: 60px 48px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  border-right: 1px solid var(--border);
}
.auth-left::before { content:''; position:absolute; top:-50%; left:-20%; width:200%; height:200%; background: radial-gradient(ellipse 40% 30% at 30% 40%, rgba(0,212,255,0.08) 0%, transparent 70%); pointer-events:none; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 60px; }
.auth-logo { width: 48px; height: 48px; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; box-shadow: var(--accent-glow); }
.auth-brand h1 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--text-primary); }
.auth-brand h1 span { color: var(--accent); }
.auth-tagline { margin-bottom: 40px; }
.auth-tagline h2 { font-family: 'Syne', sans-serif; font-size: 36px; font-weight: 800; line-height: 1.15; color: var(--text-primary); margin-bottom: 16px; }
.auth-tagline p { color: var(--text-secondary); font-size: 15px; line-height: 1.7; max-width: 400px; }
.auth-features { display: flex; flex-direction: column; gap: 12px; }
.af-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); }
.af-item i { color: var(--accent); width: 16px; }
.auth-particles { position: absolute; bottom: 0; right: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; background: var(--accent); opacity: 0.06; animation: float 8s infinite ease-in-out; }
.particle:nth-child(1) { width: 200px; height: 200px; bottom: -50px; right: -50px; animation-delay: 0s; }
.particle:nth-child(2) { width: 120px; height: 120px; bottom: 150px; right: 200px; animation-delay: 2s; }
.particle:nth-child(3) { width: 80px; height: 80px; top: 100px; right: 80px; animation-delay: 4s; }
.particle:nth-child(4) { width: 60px; height: 60px; top: 200px; right: 350px; animation-delay: 1s; }
.particle:nth-child(5) { width: 150px; height: 150px; top: -40px; right: 100px; animation-delay: 3s; }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-20px) scale(1.05); } }

.auth-right { width: 480px; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg-surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card-header { margin-bottom: 28px; }
.auth-card-header h3 { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.auth-card-header p { color: var(--text-muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-switch { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--accent); font-weight: 600; }

/* ── Scrape Form ────────────────────────────────────────── */
.scrape-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.scrape-col { display: flex; flex-direction: column; gap: 20px; }
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.form-card-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg-raised); }
.form-card-header h3 { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; flex: 1; }
.fch-icon { width: 32px; height: 32px; background: var(--accent-dim); color: var(--accent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.fch-green { background: var(--green-dim); color: var(--green); }
.fch-cyan { background: rgba(6,182,212,0.12); color: var(--cyan); }
.fch-amber { background: var(--amber-dim); color: var(--amber); }
.fch-hint { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.form-card-body { padding: 20px; }

/* Checkbox cards (data fields) */
.checkbox-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-card { display: flex; align-items: center; gap: 0; cursor: pointer; position: relative; }
.checkbox-card input { position: absolute; opacity: 0; pointer-events: none; }
.cc-content { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: var(--transition); }
.cc-icon { font-size: 15px; color: var(--text-muted); width: 18px; text-align: center; }
.cc-text { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.cc-check { position: absolute; right: 10px; width: 18px; height: 18px; background: var(--green); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; opacity: 0; transition: var(--transition); }
.checkbox-card input:checked ~ .cc-content { background: var(--green-dim); border-color: rgba(16,185,129,0.3); }
.checkbox-card input:checked ~ .cc-content .cc-icon { color: var(--green); }
.checkbox-card input:checked ~ .cc-content .cc-text { color: var(--green); }
.checkbox-card input:checked ~ .cc-check { opacity: 1; }

/* Source cards */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 8px; }
.source-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.source-card { position: relative; cursor: pointer; }
.source-card input { position: absolute; opacity: 0; pointer-events: none; }
.sc-inner { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.sc-favicon { width: 16px; height: 16px; border-radius: 3px; }
.sc-ico { font-size: 15px; width: 16px; text-align: center; }
.sc-check { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; background: var(--accent); border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; opacity: 0; transition: var(--transition); }
.source-card input:checked ~ .sc-inner { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); }
.source-card input:checked ~ .sc-check { opacity: 1; }

/* Categories */
.category-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-tab { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.cat-tab.active, .cat-tab:hover { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); }
.cat-group { display: none; flex-wrap: wrap; gap: 6px; }
.cat-group.active { display: flex; }
.cat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: var(--transition); }
.cat-chip input { display: none; }
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-chip:has(input:checked) { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); font-weight: 600; }
.cat-chip-custom:has(input:checked) { background: var(--accent2-dim); border-color: rgba(124,58,237,0.3); color: var(--purple); }
.custom-cat-row { display: flex; gap: 8px; margin-top: 12px; }
.custom-cat-input { flex: 1; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; color: var(--text-primary); font-size: 13px; outline: none; }
.custom-cat-input:focus { border-color: var(--accent); }

/* Range slider */
.limit-row { display: flex; align-items: center; gap: 12px; }
.limit-row input[type="range"] { flex: 1; appearance: none; height: 4px; background: var(--bg-raised); border-radius: 2px; outline: none; cursor: pointer; }
.limit-row input[type="range"]::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 8px rgba(0,212,255,0.4); }
.limit-display { display: flex; align-items: center; gap: 6px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; }
.limit-display input { width: 70px; background: none; border: none; outline: none; color: var(--text-primary); font-size: 14px; font-weight: 700; text-align: center; }
.limit-display span { font-size: 12px; color: var(--text-muted); }

/* Submit bar */
.form-submit-bar { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 24px; gap: 16px; }
.submit-info { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.submit-info i { color: var(--accent); }
.submit-actions { display: flex; gap: 10px; }
.quota-indicator { font-size: 13px; color: var(--text-muted); background: var(--bg-card); padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.quota-indicator strong { color: var(--accent); }

/* ── Client Dashboard extras ────────────────────────────── */
.quota-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 24px; margin-bottom: 24px; }
.quota-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.quota-header h3 { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.quota-header p { font-size: 13px; color: var(--text-muted); }
.quota-used { color: var(--accent); font-weight: 700; }
.quota-total { color: var(--text-primary); font-weight: 700; }
.quota-bar-outer { background: var(--bg-raised); border-radius: 4px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.quota-bar-inner { background: linear-gradient(90deg, var(--accent), var(--accent2)); height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.quota-footer { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.qa-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 20px; transition: var(--transition); color: var(--text-secondary); }
.qa-card:hover { border-color: var(--border-accent); background: var(--accent-dim); transform: translateY(-2px); box-shadow: var(--shadow-sm); opacity: 1; color: var(--text-primary); }
.qa-icon { width: 40px; height: 40px; background: var(--accent-dim); color: var(--accent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.qa-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.qa-sub { font-size: 11px; color: var(--text-muted); }

/* ── Jobs Grid ──────────────────────────────────────────── */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.job-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; transition: var(--transition); }
.job-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.jc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.jc-title { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; flex: 1; }
.jc-meta { margin-bottom: 14px; }
.jc-stats { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.jcs-item { flex: 1; text-align: center; padding: 10px 8px; border-right: 1px solid var(--border); }
.jcs-item:last-child { border-right: none; }
.jcs-val { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 800; }
.jcs-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.jc-progress { margin-bottom: 14px; }
.jcp-bar { background: var(--bg-raised); border-radius: 3px; height: 5px; overflow: hidden; margin-bottom: 4px; }
.jcp-fill { background: linear-gradient(90deg, var(--blue), var(--cyan)); height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.jcp-text { font-size: 11px; color: var(--text-muted); }
.jc-error { background: var(--red-dim); color: var(--red); font-size: 11px; padding: 8px 10px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.jc-actions { display: flex; gap: 8px; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.es-icon { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; }
.empty-state h3 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ── Detail pages ───────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.detail-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.detail-list { padding: 16px 20px; }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dl-row:last-child { border-bottom: none; }
.dl-row > span:first-child { color: var(--text-muted); flex-shrink: 0; }

/* ── Profile page ───────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.profile-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 28px; grid-column: 1; grid-row: span 2; }
.profile-avatar-section { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; flex-shrink: 0; }
.pa-info h3 { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.pa-info p { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.profile-stats { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 0; }
.ps-item { flex: 1; text-align: center; padding: 14px 8px; border-right: 1px solid var(--border); }
.ps-item:last-child { border-right: none; }
.ps-val { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; color: var(--accent); }
.ps-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.plans-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.plan-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.plan-current { border-color: var(--border-accent); background: var(--accent-dim); }
.pli-name { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.current-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 3px; }
.pli-price { font-weight: 700; color: var(--accent); }
.pli-limit { font-size: 12px; color: var(--text-muted); }
.upgrade-note { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ── Running banner ─────────────────────────────────────── */
.running-banner { display: flex; align-items: center; gap: 16px; background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.2); border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 20px; }
.rb-icon { font-size: 22px; color: var(--blue); flex-shrink: 0; }
.rb-text { flex: 1; }
.rb-text strong { display: block; font-weight: 700; color: var(--blue); margin-bottom: 2px; }
.rb-text span { font-size: 12px; color: var(--text-muted); }
.rb-bar { width: 120px; background: var(--bg-raised); border-radius: 3px; height: 5px; overflow: hidden; flex-shrink: 0; }
.rb-fill { background: var(--blue); height: 100%; border-radius: 3px; transition: width 0.5s; }

/* ── Progress in table ──────────────────────────────────── */
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-mini { width: 60px; background: var(--bg-raised); border-radius: 2px; height: 4px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--accent), var(--accent2)); height: 100%; border-radius: 2px; }

/* ── Settings / Plans ───────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.plan-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg-raised); }
.plan-header h3 { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; }
.plan-price { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; color: var(--accent); }
.plan-form { padding: 20px; display: flex; flex-direction: column; gap: 0; }
.plan-form .form-group { margin-bottom: 12px; }
.plan-enterprise .plan-header { background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(0,212,255,0.1)); }

/* ── Notification bell ──────────────────────────────────── */
.notif-bell { position: relative; cursor: pointer; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; color: var(--text-secondary); }
.notif-count { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; background: var(--red); color: #fff; border-radius: 50%; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notif-dropdown { display: none; position: absolute; top: 46px; right: 0; width: 300px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 200; max-height: 300px; overflow-y: auto; }
.notif-bell:hover .notif-dropdown { display: block; }
.notif-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.ni-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.ni-msg { font-size: 11px; color: var(--text-muted); }
.notif-success .ni-title { color: var(--green); }
.notif-danger .ni-title { color: var(--red); }

/* ── User cell ──────────────────────────────────────────── */
.user-cell { display: flex; align-items: center; gap: 10px; }
.uc-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* ── Error pages ────────────────────────────────────────── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-container { text-align: center; padding: 40px; }
.error-code { font-family: 'Syne', sans-serif; font-size: 120px; font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; margin-bottom: 16px; }
.error-content h2 { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.error-content p { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .scrape-form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { width: 100%; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .content-area { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: 1fr; }
  .jobs-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-submit-bar { flex-direction: column; text-align: center; }
  .checkbox-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-right .topbar-time { display: none; }
}
