/* ─── Global Variables & Reset ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1629;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(99,102,241,0.5);
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99,102,241,0.25);
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --sidebar-width: 260px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-glow); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-glow); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── Form Elements ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; letter-spacing: 0.5px; text-transform: uppercase; }
.form-control { width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--accent); background: rgba(99,102,241,0.05); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.input-error { border-color: var(--red) !important; }
.error-msg { font-size: 12px; color: var(--red); margin-top: 5px; }

/* ─── Cards ─────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(12px); }
.card:hover { border-color: var(--border-hover); }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

/* ─── Alerts ────────────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info    { background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3); color: #818cf8; }

/* ─── Badges ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success  { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-danger   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.badge-warning  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-info     { background: rgba(99,102,241,0.15); color: #6366f1; }
.badge-neutral  { background: rgba(255,255,255,0.08);color: var(--text-secondary); }

/* ─── Stat Cards ────────────────────────────────────────────────── */
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; align-items: center; gap: 18px; transition: var(--transition); }
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.purple { background: rgba(99,102,241,0.15); }
.stat-icon.green  { background: rgba(16,185,129,0.15); }
.stat-icon.red    { background: rgba(239,68,68,0.15);  }
.stat-icon.yellow { background: rgba(245,158,11,0.15); }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ─── Progress Bar ──────────────────────────────────────────────── */
.progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s ease; }
.progress-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }

/* ─── Table ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 12px; color: var(--text-secondary); font-weight: 600; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; }
tbody td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Layout: Sidebar + Main ────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; height: 100vh; overflow-y: auto; z-index: 100; }
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo .logo-text { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-logo .logo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; 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: 14px; font-weight: 500; margin-bottom: 4px; transition: var(--transition); cursor: pointer; }
.nav-item:hover, .nav-item.active { background: rgba(99,102,241,0.1); color: var(--text-primary); }
.nav-item.active { border-left: 3px solid var(--accent); padding-left: 9px; }
.nav-item .nav-icon { font-size: 18px; width: 22px; flex-shrink: 0; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.topbar { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 90; }
.topbar-title { font-size: 20px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.page-content { padding: 32px; }

/* ─── Auth Pages ────────────────────────────────────────────────── */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); position: relative; overflow: hidden; }
.auth-wrapper::before { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%); top: -200px; left: -200px; pointer-events: none; }
.auth-wrapper::after { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%); bottom: -100px; right: -100px; pointer-events: none; }
.auth-box { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 440px; position: relative; z-index: 1; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-text { font-size: 28px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-logo p { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); font-weight: 500; }
.admin-hint { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: 13px; }
.admin-hint strong { color: var(--accent); }

/* ─── OTP Step ──────────────────────────────────────────────────── */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.otp-input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); transition: var(--transition); }
.otp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ─── Landing Page ──────────────────────────────────────────────── */
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 200; padding: 20px 48px; display: flex; align-items: center; justify-content: space-between; backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255,255,255,0.05); }
.landing-nav .logo-text { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.landing-nav .nav-links { display: flex; align-items: center; gap: 28px; }
.landing-nav .nav-links a { font-size: 14px; color: var(--text-secondary); font-weight: 500; transition: var(--transition); }
.landing-nav .nav-links a:hover { color: var(--text-primary); }
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 120px 24px 80px; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(99,102,241,0.2) 0%, transparent 60%); pointer-events: none; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3); border-radius: 999px; font-size: 13px; font-weight: 500; color: #818cf8; margin-bottom: 28px; }
.hero h1 { font-size: clamp(40px, 7vw, 72px); font-weight: 800; line-height: 1.1; margin-bottom: 24px; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent-2), #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: clamp(16px, 2vw, 20px); color: var(--text-secondary); max-width: 560px; margin: 0 auto 40px; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 72px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 36px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.features { padding: 100px 48px; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 12px; }
.section-header p { font-size: 16px; color: var(--text-secondary); max-width: 500px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 1100px; margin: 0 auto; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: var(--transition); }
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.feature-icon { width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2)); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 20px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.cta-section { padding: 80px 48px; text-align: center; }
.cta-box { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15)); border: 1px solid rgba(99,102,241,0.3); border-radius: 24px; padding: 64px 40px; max-width: 700px; margin: 0 auto; }
.landing-footer { padding: 32px 48px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-muted); }

/* ─── Dashboard ─────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }

/* ─── Dropzone ──────────────────────────────────────────────────── */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; transition: var(--transition); }
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-glow); }
.dropzone-icon { font-size: 40px; margin-bottom: 12px; }
.dropzone-text { font-size: 15px; font-weight: 500; }
.dropzone-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.dropzone input { display: none; }

/* ─── Recipient Tabs ────────────────────────────────────────────── */
.tab-btns { display: flex; gap: 8px; margin-bottom: 20px; }
.tab-btn { padding: 8px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── SMTP Toggle ───────────────────────────────────────────────── */
.smtp-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 16px; }
.toggle-switch { width: 40px; height: 22px; background: var(--border); border-radius: 999px; position: relative; transition: var(--transition); }
.toggle-switch.on { background: var(--accent); }
.toggle-knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: var(--transition); }
.toggle-switch.on .toggle-knob { left: 21px; }

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.fade-up { animation: fadeUp 0.5s ease forwards; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .landing-nav { padding: 16px 20px; }
  .landing-nav .nav-links { display: none; }
  .hero { padding: 100px 20px 60px; }
  .features, .cta-section { padding: 60px 20px; }
  .page-content { padding: 20px; }
  .topbar { padding: 14px 20px; }
}
