:root {
  --brand: #7C3AED;
  --brand-light: #EDE9FE;
  --brand-dark: #5B21B6;
  --accent: #F59E0B;
  --success: #10B981;
  --error: #EF4444;
  --bg: #F5F3FF;
  --surface: #FFFFFF;
  --surface2: #FAFAFA;
  --border: #E5E7EB;
  --text: #111827;
  --text2: #6B7280;
  --text3: #9CA3AF;
  --sidebar-w: 240px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }

/* ── SPLASH ── */
.splash {
  position: fixed; inset: 0; background: var(--brand);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px;
  z-index: 9999;
}
.splash-logo { display: flex; align-items: center; gap: 12px; color: white; font-size: 28px; font-weight: 700; }
.splash-icon { font-size: 36px; }
.spinner {
  width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AUTH ── */
.auth-bg {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%); padding: 24px;
}
.auth-card {
  background: white; border-radius: 20px; padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-badge { font-size: 32px; margin-bottom: 8px; }
.auth-logo h1 { font-size: 26px; font-weight: 800; color: var(--text); }
.auth-logo h1 span { color: var(--brand); }
.auth-logo p { color: var(--text2); font-size: 14px; margin-top: 4px; }
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { color: var(--text2); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input, .date-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none; transition: border 0.2s;
}
.form-group input:focus, .date-input:focus { border-color: var(--brand); }
.auth-note { text-align: center; font-size: 12px; color: var(--text3); margin-top: 16px; }
.error-message { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
/* OTP */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; }
.otp-digit {
  width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 700;
  border: 2px solid var(--border); border-radius: 10px; outline: none; transition: border 0.2s;
}
.otp-digit:focus { border-color: var(--brand); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.4); }
.btn-primary:disabled { background: var(--text3); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: white; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--border); }
.btn-full { width: 100%; }
.btn-pay { font-size: 16px; padding: 16px; margin-bottom: 12px; }
.btn-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }

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

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); background: white; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo {
  padding: 24px 20px; display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; border-bottom: 1px solid var(--border);
}
.sidebar-logo strong { color: var(--brand); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text2); transition: all 0.15s; cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-details { flex: 1; min-width: 0; }
.user-email { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 11px; color: var(--text3); }
.btn-logout { background: none; border: none; cursor: pointer; color: var(--text3); padding: 6px; border-radius: 8px; }
.btn-logout:hover { background: #FEF2F2; color: var(--error); }
.btn-logout svg { width: 18px; height: 18px; }

/* Mobile header */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  background: white; border-bottom: 1px solid var(--border); padding: 14px 16px;
  align-items: center; gap: 12px;
}
.mobile-logo { font-size: 18px; font-weight: 800; }
.mobile-logo strong { color: var(--brand); }
.menu-toggle { background: none; border: none; cursor: pointer; padding: 4px; }
.menu-toggle svg { width: 22px; height: 22px; }

/* ── MAIN CONTENT ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 32px; max-width: calc(100vw - var(--sidebar-w)); }

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text2); margin-top: 4px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: white; border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.purple { background: var(--brand-light); color: var(--brand); }
.stat-icon.orange { background: #FEF3C7; color: #D97706; }
.stat-icon.green { background: #D1FAE5; color: var(--success); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 18px; font-weight: 700; }
.see-all { font-size: 14px; color: var(--brand); font-weight: 600; }
.see-all:hover { text-decoration: underline; }

/* ── CAMPAIGN CARDS ── */
.campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 32px; }
.campaigns-list { display: flex; flex-direction: column; gap: 12px; }
.campaign-card {
  background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  border: 1px solid var(--border); transition: transform 0.15s; position: relative; overflow: hidden;
}
.campaign-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.campaign-card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.campaign-type-badge { display: flex; align-items: center; gap: 8px; }
.campaign-icon { font-size: 22px; }
.campaign-type-name { font-size: 15px; font-weight: 700; }
.campaign-type-sub { font-size: 12px; color: var(--text2); }
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.status-active { background: #D1FAE5; color: #065F46; }
.status-pending_upload { background: #FEF3C7; color: #92400E; }
.status-expired { background: #F3F4F6; color: var(--text3); }
.status-payment_pending { background: #DBEAFE; color: #1E40AF; }
.campaign-meta { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; gap: 16px; flex-wrap: wrap; }
.campaign-meta-item { font-size: 12px; color: var(--text2); }
.campaign-meta-item strong { color: var(--text); display: block; font-size: 13px; }
.campaign-ad-preview { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-top: 12px; }
.upload-now-btn { margin-top: 12px; width: 100%; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; background: white; border-radius: var(--radius); border: 2px dashed var(--border); }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text2); font-size: 14px; max-width: 320px; margin: 0 auto 20px; }

/* ── HOW IT WORKS ── */
.how-it-works { background: white; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin-top: 32px; }
.how-it-works h2 { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.steps-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.step-card { flex: 1; min-width: 160px; }
.step-num { width: 36px; height: 36px; background: var(--brand); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; margin-bottom: 12px; }
.step-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.step-card p { font-size: 13px; color: var(--text2); line-height: 1.5; }
.step-arrow { font-size: 24px; color: var(--text3); padding-top: 6px; }

/* ── WIZARD ── */
.wizard-progress { display: flex; align-items: center; margin-bottom: 32px; }
.progress-step { display: flex; align-items: center; gap: 8px; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--text3);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; transition: all 0.3s;
}
.progress-step.active .step-dot { background: var(--brand); color: white; }
.progress-step.done .step-dot { background: var(--success); color: white; }
.progress-step span { font-size: 13px; font-weight: 600; color: var(--text3); }
.progress-step.active span { color: var(--brand); }
.progress-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.wizard-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.wizard-subtitle { font-size: 14px; color: var(--text2); margin-bottom: 24px; }
.wizard-step { background: white; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.wizard-nav { display: flex; gap: 12px; margin-top: 24px; justify-content: space-between; }
.wizard-next { margin-top: 24px; min-width: 160px; }

/* ── TYPE CARDS ── */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.type-card {
  border: 2px solid var(--border); border-radius: var(--radius); padding: 24px; cursor: pointer;
  transition: all 0.2s; background: white;
}
.type-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.type-card.selected { border-color: var(--brand); background: var(--brand-light); }
.type-icon { font-size: 36px; margin-bottom: 12px; }
.type-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.type-card p { font-size: 13px; color: var(--text2); margin-bottom: 16px; line-height: 1.5; }
.type-features { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.type-features li { font-size: 13px; color: var(--text); }
.type-price-hint { font-size: 14px; font-weight: 700; color: var(--brand); }

/* ── PLANS ── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.plan-card {
  border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer;
  transition: all 0.2s; background: white; text-align: center;
}
.plan-card:hover { border-color: var(--brand); }
.plan-card.selected { border-color: var(--brand); background: var(--brand-light); }
.plan-price { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--text2); }
.plan-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.plan-duration { font-size: 13px; color: var(--text2); }

/* ── DATE / SUMMARY ── */
.date-picker-wrap { margin-bottom: 24px; }
.date-picker-wrap label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.date-avail { font-size: 13px; margin-top: 8px; }
.campaign-summary { background: var(--surface2); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.campaign-summary h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary-row:last-child { border-bottom: none; }
.summary-row.total { font-weight: 700; color: var(--brand); font-size: 16px; }
.summary-row span { color: var(--text2); }

/* ── PAYMENT ── */
.payment-summary { background: linear-gradient(135deg, var(--brand) 0%, #4F46E5 100%); color: white; border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.payment-logo { font-size: 20px; font-weight: 800; margin-bottom: 20px; opacity: 0.9; }
.pay-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.15); font-size: 14px; }
.pay-row:last-child { border-bottom: none; }
.pay-row span { opacity: 0.8; }
.pay-row.total { font-size: 18px; font-weight: 800; margin-top: 4px; }
.payment-secure { text-align: center; font-size: 12px; color: var(--text3); margin-bottom: 20px; }

/* ── UPLOAD ── */
.success-header { text-align: center; margin-bottom: 28px; }
.success-icon { font-size: 56px; margin-bottom: 12px; }
.success-header h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.success-header p { color: var(--text2); font-size: 15px; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; margin-bottom: 20px; transition: border 0.2s; }
.upload-zone:hover { border-color: var(--brand); }
.file-input { display: none; }
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-placeholder h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.upload-placeholder p { font-size: 13px; color: var(--text2); margin-bottom: 16px; }
.upload-preview { max-width: 100%; max-height: 300px; border-radius: 10px; object-fit: contain; }
.upload-note { text-align: center; font-size: 12px; color: var(--text3); margin-top: 12px; }

/* ── FILTER TABS ── */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tab { padding: 8px 16px; border-radius: 20px; background: white; border: 1.5px solid var(--border); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text2); transition: all 0.15s; font-family: inherit; }
.filter-tab.active { background: var(--brand); border-color: var(--brand); color: white; }
.filter-tab:hover:not(.active) { border-color: var(--brand); color: var(--brand); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: white; border-radius: 20px; padding: 28px; width: 100%; max-width: 480px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text2); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--border); }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; color: white; animation: slideIn 0.3s ease; max-width: 320px; }
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--brand); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Loading */
.loading-spinner { display: flex; justify-content: center; padding: 60px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 16px; padding-top: 72px; max-width: 100vw; }
  .stats-grid { grid-template-columns: 1fr; }
  .type-cards { grid-template-columns: 1fr; }
  .steps-row { flex-direction: column; }
  .step-arrow { display: none; }
  .page-header { flex-direction: column; }
}
@media (max-width: 480px) {
  .plans-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 28px 20px; }
}
