/* ============================================================
   ERODEA HUB — Main Stylesheet
   Modern, light gradient design with professional feel
   ============================================================ */

/* === CSS Variables === */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: rgba(99,102,241,0.08);
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --orange: #f97316;
    
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-input: #f1f5f9;
    
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.85em; background: var(--bg-input); padding: 2px 6px; border-radius: 4px; color: var(--primary-dark); }
pre { background: #1e293b; color: #e2e8f0; padding: 16px 20px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.85rem; line-height: 1.7; }
pre code { background: none; padding: 0; color: inherit; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
table { width: 100%; border-collapse: collapse; }

/* === Utility === */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-link { color: var(--text-secondary); font-size: 0.875rem; }
.text-link:hover { color: var(--primary); }
.mb-4 { margin-bottom: 24px; }
.max-w-600 { max-width: 600px; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing-page { background: #f8fafc; overflow-x: hidden; }

/* Animated Background */
.landing-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.gradient-orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, #818cf8, transparent); top: -200px; right: -100px; }
.orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, #22d3ee, transparent); bottom: -150px; left: -100px; animation-delay: -7s; }
.orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, #a78bfa, transparent); top: 40%; left: 30%; animation-delay: -14s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

.grid-overlay {
    position: absolute; inset: 0;
    background-image: 
        linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Navigation */
.landing-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 16px 0; transition: all 0.3s;
}
.landing-nav.scrolled {
    background: rgba(255,255,255,0.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); padding: 10px 0;
    box-shadow: var(--shadow-sm);
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 40px;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
    color: var(--text);
}
.brand-icon-landing {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1rem;
}
.accent { color: var(--primary); }
.nav-links { display: flex; gap: 32px; flex: 1; }
.nav-link-landing { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-link-landing:hover { color: var(--text); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.btn-landing { padding: 8px 18px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; transition: all 0.2s; }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--bg-input); }
.btn-primary-landing {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary-landing:hover { color: white; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.3rem; color: var(--text); cursor: pointer; }

/* Hero */
.hero-section { position: relative; z-index: 1; padding: 160px 0 80px; }
.hero-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; text-align: center; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 20px; border-radius: 100px;
    background: var(--primary-bg); color: var(--primary); font-size: 0.85rem; font-weight: 600;
    margin-bottom: 24px; border: 1px solid rgba(99,102,241,0.15);
}
.hero-title {
    font-family: var(--font-display); font-size: 4rem; font-weight: 800;
    line-height: 1.1; margin-bottom: 24px; letter-spacing: -0.02em;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.2rem; color: var(--text-secondary); max-width: 640px;
    margin: 0 auto 40px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 80px; }
.btn-hero {
    padding: 14px 28px; border-radius: var(--radius); font-size: 1rem;
    font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.3s;
}
.btn-hero-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.btn-hero-primary:hover { color: white; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.45); }
.btn-hero-secondary {
    background: white; color: var(--text); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn-hero-secondary:hover { color: var(--text); background: var(--bg-input); transform: translateY(-2px); }

/* Hero Visual */
.hero-visual { position: relative; max-width: 800px; margin: 0 auto; }
.hero-card-stack { position: relative; padding: 40px 0; }
.hero-float-card {
    position: absolute; display: flex; align-items: center; gap: 12px;
    background: white; padding: 14px 20px; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 5; border: 1px solid var(--border-light);
    animation: floatCard 6s ease-in-out infinite;
}
.card-1 { top: 20px; left: -20px; animation-delay: 0s; }
.card-2 { top: 80px; right: -30px; animation-delay: -2s; }
.card-3 { bottom: 40px; left: 10px; animation-delay: -4s; }
@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.float-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--primary-bg); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.float-card-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.float-card-icon.orange { background: rgba(249,115,22,0.1); color: var(--orange); }
.float-card-text { text-align: left; }
.float-card-text strong { display: block; font-size: 1.2rem; font-weight: 700; }
.float-card-text span { font-size: 0.8rem; color: var(--text-secondary); }

.dashboard-preview {
    background: white; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-xl); border: 1px solid var(--border);
}
.preview-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--bg-input); border-bottom: 1px solid var(--border);
}
.preview-dots { display: flex; gap: 6px; }
.preview-dots span { width: 10px; height: 10px; border-radius: 50%; }
.preview-dots span:nth-child(1) { background: #ef4444; }
.preview-dots span:nth-child(2) { background: #f59e0b; }
.preview-dots span:nth-child(3) { background: #10b981; }
.preview-url { font-size: 0.75rem; color: var(--text-muted); flex: 1; text-align: center; }
.preview-body { display: flex; min-height: 200px; }
.preview-sidebar-mini { width: 50px; background: #0f172a; padding: 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.mini-item { height: 6px; border-radius: 3px; background: #334155; }
.mini-item.active { background: var(--primary); }
.preview-content-mini { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mini-stat-row { display: flex; gap: 8px; }
.mini-stat { flex: 1; height: 40px; border-radius: 8px; background: linear-gradient(135deg, var(--primary-bg), rgba(6,182,212,0.08)); }
.mini-chart { height: 60px; border-radius: 8px; background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(6,182,212,0.05)); }
.mini-table { display: flex; flex-direction: column; gap: 6px; }
.mini-row { height: 14px; border-radius: 4px; background: var(--bg-input); }

/* Features */
.section-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.features-section { position: relative; z-index: 1; padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-badge {
    display: inline-block; padding: 6px 16px; border-radius: 100px;
    background: var(--primary-bg); color: var(--primary); font-size: 0.8rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.section-header h2 {
    font-family: var(--font-display); font-size: 2.8rem; font-weight: 700;
    line-height: 1.2; margin-bottom: 16px;
}
.section-header p { font-size: 1.1rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
    background: white; border-radius: var(--radius); padding: 32px;
    border: 1px solid var(--border); transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,0.2); }
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.2rem;
    background: var(--primary-bg); color: var(--primary); margin-bottom: 20px;
}
.feature-icon.purple { background: rgba(168,85,247,0.1); color: #a855f7; }
.feature-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.feature-icon.orange { background: rgba(249,115,22,0.1); color: var(--orange); }
.feature-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.feature-icon.cyan { background: rgba(6,182,212,0.1); color: var(--accent); }
.feature-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* Steps */
.how-section { position: relative; z-index: 1; padding: 100px 0; background: rgba(248,250,252,0.5); }
.steps-grid { display: flex; align-items: center; justify-content: center; gap: 16px; }
.step-card {
    background: white; border-radius: var(--radius); padding: 36px; text-align: center;
    border: 1px solid var(--border); flex: 1; max-width: 280px;
}
.step-number {
    font-family: var(--font-display); font-size: 2.5rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}
.step-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 0.9rem; color: var(--text-secondary); }
.step-connector { color: var(--text-muted); font-size: 1.2rem; }

/* Security */
.security-section { position: relative; z-index: 1; padding: 100px 0; }
.security-content { display: flex; gap: 60px; align-items: center; }
.security-text { flex: 1; }
.security-text h2 { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; margin-bottom: 24px; line-height: 1.2; }
.security-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.security-list li { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; color: var(--text-secondary); }
.security-list i { color: var(--success); font-size: 1rem; }
.security-visual { flex: 1; display: flex; justify-content: center; }
.shield-graphic { position: relative; width: 300px; height: 300px; }
.shield-ring {
    position: absolute; border-radius: 50%; border: 2px solid rgba(99,102,241,0.15);
    animation: pulse-ring 4s ease-in-out infinite;
}
.ring-1 { inset: 0; }
.ring-2 { inset: 30px; border-color: rgba(99,102,241,0.25); animation-delay: -1.3s; }
.ring-3 { inset: 60px; border-color: rgba(99,102,241,0.35); animation-delay: -2.6s; }
@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.7; }
}
.shield-center {
    position: absolute; inset: 90px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2.5rem; box-shadow: 0 8px 32px rgba(99,102,241,0.4);
}

/* CTA */
.cta-section { position: relative; z-index: 1; padding: 80px 0; }
.cta-card {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    border-radius: 20px; padding: 60px; text-align: center; color: white;
    box-shadow: 0 16px 48px rgba(99,102,241,0.3);
}
.cta-card h2 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; margin-bottom: 12px; }
.cta-card p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 32px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; }
.cta-card .btn-hero-primary { background: white; color: var(--primary-dark); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.cta-card .btn-hero-primary:hover { color: var(--primary-dark); transform: translateY(-2px); }
.cta-card .btn-hero-secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }
.cta-card .btn-hero-secondary:hover { background: rgba(255,255,255,0.25); color: white; }

/* Footer */
.landing-footer { position: relative; z-index: 1; padding: 60px 0 30px; border-top: 1px solid var(--border); }
.footer-content { display: flex; justify-content: space-between; margin-bottom: 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand span { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links { display: flex; gap: 60px; }
.footer-links div { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); }
.footer-bottom span { color: var(--text-muted); font-size: 0.85rem; }

/* AOS Animations */
[data-aos] { opacity: 0; transform: translateY(24px); transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
[data-aos].aos-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f8fafc; }
.auth-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.auth-bg .gradient-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.auth-bg .orb-1 { width: 400px; height: 400px; background: var(--primary); top: -10%; right: -5%; }
.auth-bg .orb-2 { width: 300px; height: 300px; background: var(--accent); bottom: -8%; left: -3%; }
.auth-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
    background: white; border-radius: 24px; padding: 44px 36px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-brand { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; text-decoration: none; }
.auth-logo {
    width: 56px; height: 56px; border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.auth-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.auth-header p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-form .form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }

/* Input with icon */
.input-icon-wrapper {
    position: relative; display: flex; align-items: center;
}
.input-icon {
    position: absolute; left: 14px; color: var(--text-muted); font-size: 0.9rem;
    pointer-events: none; transition: color 0.2s;
}
.input-with-icon {
    width: 100%; padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border); border-radius: 12px;
    font-size: 0.92rem; font-family: var(--font-main); background: #f8fafc;
    transition: all 0.2s;
}
.input-with-icon:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1); background: #fff;
}
.input-with-icon:focus + .password-toggle,
.input-icon-wrapper:focus-within .input-icon { color: var(--primary); }

/* Password toggle */
.password-toggle {
    position: absolute; right: 12px; background: none; border: none;
    color: var(--text-muted); cursor: pointer; padding: 4px 6px;
    font-size: 0.95rem; border-radius: 6px; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.password-toggle:hover { color: var(--primary); background: rgba(99,102,241,0.06); }

/* Forgot link */
.forgot-link { font-size: 0.82rem; color: var(--primary); font-weight: 500; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* Auth divider */
.auth-divider {
    display: flex; align-items: center; gap: 12px; margin: 8px 0 0;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-divider span { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.auth-footer { text-align: center; margin-top: 12px; font-size: 0.88rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 500; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.form-control {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.9rem; font-family: var(--font-main); background: var(--bg-input);
    transition: all 0.2s; width: 100%;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); background: white; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; background: white; cursor: pointer; }

.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; color: var(--text-secondary); }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.form-row { display: flex; justify-content: space-between; align-items: center; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-inline-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-inline-row .form-group { flex: 1; min-width: 160px; }

.btn-auth {
    padding: 14px; border: none; border-radius: 12px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.25s ease; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white; box-shadow: 0 2px 12px rgba(99,102,241,0.25); margin-top: 4px;
    letter-spacing: 0.01em;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.35); }
.btn-auth:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(99,102,241,0.2); }

/* Toggle Switch */
.toggle-group { margin-bottom: 12px; }
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.9rem; }
.toggle-label input { display: none; }
.toggle-switch {
    width: 44px; height: 24px; background: var(--border); border-radius: 12px;
    position: relative; transition: background 0.3s; flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    background: white; top: 3px; left: 3px; transition: transform 0.3s; box-shadow: var(--shadow-sm);
}
.toggle-label input:checked + .toggle-switch { background: var(--primary); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(20px); }
.toggle-group small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; margin-left: 56px; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-layout { background: var(--bg); }
.dash-container { display: flex; min-height: 100vh; }

/* Sidebar */
.dash-sidebar {
    width: var(--sidebar-width); background: var(--bg-sidebar); color: var(--text-sidebar);
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 50; transition: all 0.3s;
}
.sidebar-header {
    padding: 20px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px; color: white; font-family: var(--font-display);
    font-size: 1.2rem; font-weight: 700;
}
.brand-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.9rem;
}
.brand-text .accent { color: var(--primary-light); }
.sidebar-toggle { background: none; border: none; color: var(--text-sidebar); font-size: 1.1rem; cursor: pointer; display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 0; }
.nav-section { margin-bottom: 24px; }
.nav-section-title {
    padding: 0 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: rgba(255,255,255,0.3); margin-bottom: 8px; display: block;
}
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 9px 20px;
    color: var(--text-sidebar); font-size: 0.875rem; transition: all 0.2s; border-left: 3px solid transparent;
}
.nav-link:hover { background: var(--bg-sidebar-hover); color: white; }
.nav-link.active { background: var(--bg-sidebar-hover); color: white; border-left-color: var(--primary); }
.nav-link i { width: 18px; text-align: center; font-size: 0.9rem; }

.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06);
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.9rem;
}
.user-meta { display: flex; flex-direction: column; }
.user-name { color: white; font-size: 0.875rem; font-weight: 600; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.logout-link { color: var(--text-muted) !important; font-size: 0.8rem; }
.logout-link:hover { color: var(--danger) !important; }

/* Main Content */
.dash-main { flex: 1; margin-left: var(--sidebar-width); }
.dash-topbar {
    height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; background: white; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.mobile-toggle {
    display: none; background: none; border: none; font-size: 1.15rem;
    cursor: pointer; color: #0f172a; width: 40px; height: 40px;
    border-radius: 10px; transition: background 0.2s;
    align-items: center; justify-content: center;
}
.mobile-toggle:hover { background: rgba(0,0,0,0.05); }
.page-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-badge { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.topbar-badge .text-success { color: var(--success); font-size: 0.5rem; }

.dash-content { padding: 32px; }

/* Flash Messages */
.flash-container { padding: 0 32px; margin-top: 16px; }
.flash-msg {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.flash-success { background: rgba(16,185,129,0.1); color: #065f46; border: 1px solid rgba(16,185,129,0.2); }
.flash-danger { background: rgba(239,68,68,0.1); color: #991b1b; border: 1px solid rgba(239,68,68,0.2); }
.flash-warning { background: rgba(245,158,11,0.1); color: #92400e; border: 1px solid rgba(245,158,11,0.2); }
.flash-info { background: rgba(99,102,241,0.1); color: #3730a3; border: 1px solid rgba(99,102,241,0.2); }
.flash-close { background: none; border: none; cursor: pointer; margin-left: auto; opacity: 0.5; }
.flash-close:hover { opacity: 1; }

/* Cards */
.card {
    background: white; border-radius: var(--radius); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 24px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: white; border-radius: var(--radius); padding: 20px;
    border: 1px solid var(--border); display: flex; align-items: center; gap: 16px;
    position: relative; overflow: hidden;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-bg); color: var(--primary); }
.stat-icon.purple { background: rgba(168,85,247,0.1); color: #a855f7; }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(249,115,22,0.1); color: var(--orange); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-icon.cyan { background: rgba(6,182,212,0.1); color: var(--accent); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.stat-badge { position: absolute; top: 12px; right: 12px; font-size: 0.7rem; color: var(--text-muted); background: var(--bg-input); padding: 2px 8px; border-radius: 100px; }

/* Layout */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.section-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-topbar h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.platform-header-bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.platform-header-bar h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.platform-slug { font-size: 0.85rem; color: var(--text-muted); }

/* Tables */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    text-align: left; padding: 10px 14px; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.data-table tbody td {
    padding: 10px 14px; font-size: 0.875rem; border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(99,102,241,0.02); }
.row-muted { opacity: 0.5; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-green { background: rgba(16,185,129,0.1); color: #059669; }
.badge-red { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-orange { background: rgba(249,115,22,0.1); color: #ea580c; }
.badge-blue { background: var(--primary-bg); color: var(--primary); }
.badge-gray { background: var(--bg-input); color: var(--text-muted); }

.method-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; font-family: monospace;
}
.method-badge.get { background: rgba(16,185,129,0.1); color: #059669; }
.method-badge.post { background: rgba(99,102,241,0.1); color: var(--primary); }
.method-badge.put { background: rgba(245,158,11,0.1); color: #d97706; }
.method-badge.delete { background: rgba(239,68,68,0.1); color: #dc2626; }
.method-badge.log { background: var(--bg-input); color: var(--text-muted); }

/* Buttons */
.btn-sm {
    padding: 5px 14px; border-radius: var(--radius-xs); font-size: 0.8rem; font-weight: 500;
    border: 1px solid var(--border); background: white; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none;
}
.btn-sm:hover { background: var(--bg-input); color: var(--text); }
.btn-sm.btn-red { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #dc2626; }
.btn-sm.btn-red:hover { background: rgba(239,68,68,0.2); }
.btn-sm.btn-green { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: #059669; }
.btn-sm.btn-green:hover { background: rgba(16,185,129,0.2); }
.btn-sm.btn-gray { background: var(--bg-input); color: var(--text-muted); }
.btn-sm.btn-outline { background: transparent; }
.btn-primary-sm {
    padding: 8px 18px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn-primary-sm:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.3); color: white; }

/* Platform Cards */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.platform-card {
    background: white; border-radius: var(--radius); border: 1px solid var(--border);
    overflow: hidden; transition: all 0.3s; box-shadow: var(--shadow-sm);
}
.platform-card:hover { box-shadow: var(--shadow); }
.platform-card-header { padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; }
.platform-info h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.platform-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border-light); }
.mini-stat-item {
    display: flex; flex-direction: column; align-items: center; padding: 14px 8px;
    border-right: 1px solid var(--border-light);
}
.mini-stat-item:last-child { border-right: none; }
.mini-stat-item i { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.mini-stat-item span { font-weight: 700; font-size: 1rem; }
.mini-stat-item small { font-size: 0.7rem; color: var(--text-muted); }
.platform-card-actions { padding: 14px 20px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }

/* Quick Links */
.quick-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-link-card {
    background: white; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 20px; text-align: center; transition: all 0.2s; color: var(--text-secondary);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.quick-link-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); transform: translateY(-2px); }
.quick-link-card i { font-size: 1.3rem; }
.quick-link-card span { font-size: 0.85rem; font-weight: 500; }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-content strong { font-size: 0.85rem; }
.activity-content p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.activity-content small { font-size: 0.75rem; color: var(--text-muted); }

/* Alerts */
.alert {
    padding: 14px 20px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px;
    margin-bottom: 24px; font-size: 0.9rem;
}
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: #92400e; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #991b1b; }
.alert a { font-weight: 600; color: inherit; text-decoration: underline; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.page-link {
    padding: 6px 12px; border-radius: var(--radius-xs); font-size: 0.85rem;
    border: 1px solid var(--border); color: var(--text-secondary);
}
.page-link:hover { background: var(--bg-input); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-dots { padding: 6px 8px; color: var(--text-muted); }

/* Empty State */
.empty-state { text-align: center; color: var(--text-muted); padding: 24px; font-size: 0.9rem; }
.empty-state-large { text-align: center; padding: 60px 24px; }
.empty-state-large i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; }
.empty-state-large h3 { font-family: var(--font-display); margin-bottom: 8px; }
.empty-state-large p { color: var(--text-muted); margin-bottom: 20px; }

/* Tabs/Filter */
.filter-tabs { display: flex; gap: 4px; }
.tab {
    padding: 5px 14px; border-radius: var(--radius-xs); font-size: 0.8rem;
    color: var(--text-secondary); border: 1px solid transparent;
}
.tab:hover { background: var(--bg-input); }
.tab.active { background: var(--primary-bg); color: var(--primary); border-color: rgba(99,102,241,0.15); }
.filter-form { display: flex; gap: 8px; align-items: center; }
.search-form { display: flex; gap: 8px; }

/* Charts */
.chart-container { padding: 16px 0; }
.bar-chart { display: flex; align-items: flex-end; justify-content: center; gap: 16px; height: 240px; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar {
    width: 40px; min-height: 4px; border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    position: relative; transition: height 0.5s ease;
}
.bar-value {
    position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
    font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
}
.bar-label { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   DOCS PAGE
   ============================================================ */
.docs-page { background: white; }
.docs-layout { display: flex; max-width: 1400px; margin: 0 auto; padding-top: 72px; }
.docs-sidebar {
    width: 260px; position: sticky; top: 72px; height: calc(100vh - 72px);
    overflow-y: auto; padding: 32px 0 32px 24px; flex-shrink: 0;
    border-right: 1px solid var(--border);
}
.docs-sidebar-inner h4 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 16px; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; }
.docs-nav-link {
    padding: 7px 14px; border-radius: var(--radius-xs); font-size: 0.875rem;
    color: var(--text-secondary); transition: all 0.2s;
}
.docs-nav-link:hover { background: var(--bg-input); color: var(--text); }
.docs-nav-link.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.docs-nav-sub { padding-left: 20px; display: flex; flex-direction: column; gap: 1px; }
.docs-nav-sub a { font-size: 0.8rem; padding: 5px 14px; color: var(--text-muted); border-radius: var(--radius-xs); display: block; }
.docs-nav-sub a:hover { color: var(--primary); background: var(--primary-bg); }

.docs-content { flex: 1; padding: 32px 48px; max-width: 900px; }
.docs-section { margin-bottom: 60px; scroll-margin-top: 100px; }
.docs-section h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; margin-bottom: 12px; }
.docs-section h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin-bottom: 16px; padding-top: 24px; border-top: 1px solid var(--border-light); }
.docs-section h3 { font-size: 1.1rem; font-weight: 600; margin: 20px 0 10px; }
.docs-lead { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; }
.docs-info-box {
    display: flex; gap: 12px; align-items: center; padding: 16px 20px;
    background: var(--primary-bg); border-radius: var(--radius-sm); border: 1px solid rgba(99,102,241,0.15);
}
.docs-info-box i { color: var(--primary); font-size: 1.2rem; }
.docs-info-box strong { display: block; font-size: 0.85rem; }
.docs-info-box code { font-size: 0.9rem; }

.docs-card {
    background: var(--bg); border-radius: var(--radius-sm); padding: 20px;
    border: 1px solid var(--border); margin: 16px 0;
}
.docs-card h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 0.95rem; }
.docs-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.docs-card ul li { font-size: 0.9rem; color: var(--text-secondary); padding-left: 16px; position: relative; }
.docs-card ul li::before { content: '•'; position: absolute; left: 0; color: var(--primary); }
.docs-card.warning { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.04); }
.docs-card.warning h4 { color: #b45309; }
.docs-card.warning ul li { color: #78350f; }

.docs-section ol { padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.docs-section ol li { font-size: 0.9rem; color: var(--text-secondary); }

.code-block { margin: 16px 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid #334155; }
.code-header { background: #334155; padding: 8px 16px; font-size: 0.75rem; color: #94a3b8; }

.endpoint-doc { margin: 32px 0; }
.endpoint-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.docs-table { margin: 16px 0; }
.docs-table th { text-align: left; padding: 10px 14px; background: var(--bg); border-bottom: 2px solid var(--border); font-size: 0.8rem; text-transform: uppercase; }
.docs-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; }

/* ============================================================
   ERROR PAGES
   ============================================================ */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.error-container { text-align: center; padding: 40px; }
.error-icon { width: 80px; height: 80px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 24px; }
.error-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.error-icon.blue { background: var(--primary-bg); color: var(--primary); }
.error-icon.orange { background: rgba(249,115,22,0.1); color: var(--orange); }
.error-container h1 { font-family: var(--font-display); font-size: 5rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.error-container h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 8px; }
.error-container p { color: var(--text-secondary); margin-bottom: 24px; }

/* ============================================================
   RESPONSIVE UTILITY CLASSES
   ============================================================ */
.grid-responsive-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.grid-responsive-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}
.grid-responsive-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.grid-responsive-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Sidebar mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 49;
    cursor: pointer;
    transition: opacity 0.3s;
}
.sidebar-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   RESPONSIVE — 1200px (Large tablets / small desktops)
   ============================================================ */
@media (max-width: 1200px) {
    .footer-links { gap: 40px; }
}

/* ============================================================
   RESPONSIVE — 1024px (Tablets landscape)
   ============================================================ */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2col { grid-template-columns: 1fr; }
    .security-content { flex-direction: column; gap: 40px; }
    .hero-title { font-size: 3rem; }
    .section-header h2 { font-size: 2.2rem; }
    .docs-sidebar { display: none; }
    .docs-content { padding: 32px 24px; }
    .bar-chart { gap: 12px; }
    .bar { width: 34px; }
}

/* ============================================================
   RESPONSIVE — 768px (Tablets portrait / large phones)
   ============================================================ */
@media (max-width: 768px) {
    /* Landing Nav */
    .landing-nav .nav-links, .landing-nav .nav-actions {
        display: none; flex-direction: column; position: absolute;
        top: 100%; left: 0; right: 0; background: white; padding: 16px 24px;
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    }
    .landing-nav .nav-links.open, .landing-nav .nav-actions.open { display: flex; }
    .mobile-menu-btn { display: block; }
    .nav-container { gap: 16px; }

    /* Hero */
    .hero-section { padding: 120px 0 60px; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; margin-bottom: 28px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .btn-hero { width: 100%; max-width: 300px; justify-content: center; }
    .hero-float-card { display: none; }

    /* Features / Sections */
    .features-section, .how-section, .security-section { padding: 60px 0; }
    .features-grid { grid-template-columns: 1fr; }
    .section-header { margin-bottom: 40px; }
    .section-header h2 { font-size: 1.8rem; }
    .section-header p { font-size: 0.95rem; }
    .feature-card { padding: 24px; }
    .steps-grid { flex-direction: column; align-items: center; }
    .step-card { max-width: 100%; }
    .step-connector { transform: rotate(90deg); }
    .security-text h2 { font-size: 2rem; }

    /* CTA */
    .cta-card { padding: 36px 20px; }
    .cta-card h2 { font-size: 1.6rem; }
    .cta-card p { font-size: 0.95rem; }
    .cta-actions { flex-direction: column; align-items: center; }
    .cta-actions .btn-hero { width: 100%; max-width: 300px; justify-content: center; }

    /* Footer */
    .footer-content { flex-direction: column; gap: 32px; }
    .footer-links { flex-direction: column; gap: 24px; }
    .footer-bottom span { font-size: 0.75rem; }

    /* Shield */
    .shield-graphic { width: 200px; height: 200px; }
    .shield-center { inset: 60px; font-size: 1.8rem; }
    .ring-2 { inset: 20px; }
    .ring-3 { inset: 40px; }

    /* Dashboard Sidebar */
    .dash-sidebar {
        transform: translateX(-100%); position: fixed;
    }
    .dash-sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.3); }
    .dash-main { margin-left: 0; }
    .mobile-toggle { display: flex; order: 2; }
    .sidebar-toggle { display: block; }

    /* Dashboard Topbar — mobile: title left, hamburger right */
    .dash-topbar {
        padding: 0 12px 0 16px; height: 56px;
        border-bottom: 1px solid var(--border);
    }
    .topbar-left { order: 1; gap: 0; }
    .topbar-right { gap: 8px; }
    .topbar-badge { display: none; }
    .page-title { font-size: 1.05rem; font-weight: 600; }

    /* Dashboard Content */
    .dash-content { padding: 16px; }
    .flash-container { padding: 0 16px; }

    /* Cards */
    .card-header { padding: 12px 16px; }
    .card-body { padding: 16px; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 14px; gap: 12px; }
    .stat-value { font-size: 1.3rem; }
    .stat-icon { width: 38px; height: 38px; font-size: 1rem; }
    .stats-row.four-col { grid-template-columns: repeat(2, 1fr); }

    /* Platform */
    .platform-grid { grid-template-columns: 1fr; }
    .platform-header-bar { flex-direction: column; gap: 12px; }
    .section-topbar { flex-direction: column; gap: 12px; align-items: flex-start; }

    /* Forms */
    .form-row-2col { grid-template-columns: 1fr; }
    .form-grid-2col { grid-template-columns: 1fr; }
    .form-inline-row { flex-direction: column; align-items: stretch; }
    .search-form { flex-direction: column; }
    .search-form .form-control { width: 100%; }

    /* Tables */
    .data-table thead th { padding: 8px 10px; font-size: 0.7rem; }
    .data-table tbody td { padding: 8px 10px; font-size: 0.8rem; }

    /* Charts */
    .bar-chart { gap: 8px; height: 180px; }
    .bar { width: 28px; }
    .bar-value { font-size: 0.65rem; top: -18px; }
    .bar-label { font-size: 0.7rem; }

    /* Quick Links */
    .quick-links-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .quick-link-card { padding: 14px 8px; }
    .quick-link-card i { font-size: 1.1rem; }
    .quick-link-card span { font-size: 0.78rem; }

    /* Responsive Grid Classes */
    .grid-responsive-2col,
    .grid-responsive-1-2 {
        grid-template-columns: 1fr;
    }

    /* Legal Pages */
    .legal-container { padding: 80px 16px 40px; }
    .legal-content { padding: 1.5rem; }
    .legal-header h1 { font-size: 1.8rem; }
    .contact-grid { grid-template-columns: 1fr; }

    /* Email Templates */
    .templates-grid { grid-template-columns: 1fr; }
    .section-header-row { flex-direction: column; align-items: flex-start; }

    /* Pagination */
    .pagination { flex-wrap: wrap; }

    /* Docs */
    .docs-content { padding: 20px 16px; }
    .docs-section h1 { font-size: 1.6rem; }
    .docs-section h2 { font-size: 1.3rem; }
    .endpoint-header { flex-wrap: wrap; gap: 8px; }
}

/* ============================================================
   RESPONSIVE — 480px (Small phones)
   ============================================================ */
@media (max-width: 480px) {
    /* Hero extra-small */
    .hero-section { padding: 100px 0 40px; }
    .hero-title { font-size: 1.8rem; }
    .hero-badge { font-size: 0.75rem; padding: 6px 14px; }
    .section-header h2 { font-size: 1.5rem; }

    /* Stats single column */
    .stats-grid { grid-template-columns: 1fr; }
    .stats-row.four-col { grid-template-columns: 1fr; }

    /* Quick links 2 col */
    .quick-links-grid { grid-template-columns: repeat(2, 1fr); }

    /* Buttons full width */
    .btn-hero { padding: 12px 20px; font-size: 0.9rem; }
    .btn-primary-sm { font-size: 0.8rem; padding: 8px 14px; }

    /* Card bodies even tighter */
    .card-body { padding: 12px; }
    .card-header { padding: 10px 12px; }
    .card-header h3 { font-size: 0.9rem; }

    /* Tables: smaller */
    .data-table thead th { padding: 6px 8px; font-size: 0.65rem; }
    .data-table tbody td { padding: 6px 8px; font-size: 0.75rem; }

    /* Platform card stats */
    .platform-card-stats { grid-template-columns: repeat(2, 1fr); }
    .mini-stat-item { padding: 10px 6px; }
    .mini-stat-item span { font-size: 0.9rem; }

    /* Dashboard topbar */
    .dash-topbar { height: 50px; }
    .page-title { font-size: 1rem; }
    .topbar-badge { display: none; }

    /* Auth card tighter */
    .auth-card { padding: 32px 22px; }
    .auth-header h1 { font-size: 1.25rem; }
    .auth-logo { width: 48px; height: 48px; font-size: 20px; border-radius: 14px; }
    .input-with-icon { padding: 11px 14px 11px 40px; font-size: 16px; }
    .btn-auth { padding: 13px; }

    /* Charts even smaller */
    .bar-chart { height: 150px; gap: 6px; overflow-x: auto; }
    .bar { width: 24px; }

    /* CTA */
    .cta-card h2 { font-size: 1.3rem; }

    /* Footer */
    .footer-links { gap: 20px; }

    /* Step cards */
    .step-card { padding: 24px; }
    .step-number { font-size: 2rem; }

    /* Feature cards */
    .feature-card { padding: 20px; }
    .feature-icon { width: 40px; height: 40px; font-size: 1rem; margin-bottom: 14px; }
    .feature-card h3 { font-size: 1rem; }
    .feature-card p { font-size: 0.85rem; }

    /* Section padding */
    .features-section, .how-section, .security-section { padding: 40px 0; }
    .section-container { padding: 0 16px; }

    /* Activity feed */
    .activity-item { padding: 8px 0; }
    .activity-content strong { font-size: 0.8rem; }
    .activity-content p { font-size: 0.75rem; }

    /* Forms */
    .form-control { font-size: 16px; } /* prevents zoom on iOS */

    /* Legal */
    .legal-header h1 { font-size: 1.5rem; }
    .legal-content h2 { font-size: 1.1rem; }

    /* Docs */
    .docs-section h1 { font-size: 1.4rem; }
    .code-block { font-size: 0.8rem; }
    pre { font-size: 0.78rem; padding: 12px; }

    /* Filter / Tabs */
    .filter-tabs { flex-wrap: wrap; }
    .filter-bar { gap: 0.4rem; }
    .filter-chip { padding: 5px 12px; font-size: 0.75rem; }
}

/* ============================================================
   TOUCH-FRIENDLY & ACCESSIBILITY
   ============================================================ */
@media (pointer: coarse) {
    /* Larger tap targets for touch screens */
    .btn-sm { padding: 8px 16px; min-height: 40px; }
    .nav-link { padding: 11px 20px; }
    .checkbox-label { padding: 4px 0; }
    .page-link { padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; }
    .tab { padding: 8px 16px; }
    .toggle-label { padding: 6px 0; }
    .quick-link-card { padding: 18px 12px; }
    .filter-chip { padding: 8px 16px; }
}

/* iOS safe area support */
@supports (padding: env(safe-area-inset-bottom)) {
    .dash-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .landing-footer {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }
}


/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal-page { background: var(--bg); }
.legal-container {
    max-width: 800px; margin: 0 auto; padding: 100px 24px 60px;
}
.legal-header { text-align: center; margin-bottom: 3rem; }
.legal-header h1 {
    font-family: 'Space Grotesk', sans-serif; font-size: 2.5rem;
    font-weight: 700; color: var(--text); margin-bottom: .5rem;
}
.legal-updated { color: var(--text-muted); font-size: .9rem; }
.legal-content {
    background: var(--bg-card); border-radius: 16px; padding: 3rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.04); border: 1px solid var(--border);
    line-height: 1.8; color: var(--text-secondary);
}
.legal-content h2 {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 600;
    color: var(--text); margin: 2rem 0 .75rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.legal-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.legal-content h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 .5rem; }
.legal-content p { margin-bottom: 1rem; }
.legal-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content li { margin-bottom: .4rem; }
.legal-content a { color: var(--primary); text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }
.legal-content code { background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-size: .85em; }

.legal-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.legal-table th, .legal-table td {
    padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.legal-table th { background: var(--bg-input); font-weight: 600; color: var(--text); }

.legal-footer { padding: 2rem 0; text-align: center; }
.legal-footer .footer-bottom { font-size: .85rem; color: var(--text-muted); }
.legal-footer a { color: var(--text-secondary); text-decoration: none; }
.legal-footer a:hover { color: var(--primary); }

/* Contact Grid */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.contact-card {
    background: var(--bg-input); border-radius: 12px; padding: 1.5rem; text-align: center;
    transition: all .2s;
}
.contact-card:hover { box-shadow: 0 4px 16px rgba(99,102,241,.1); transform: translateY(-2px); }
.contact-icon { font-size: 2rem; color: var(--primary); margin-bottom: .75rem; }
.contact-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; color: var(--text); }
.contact-card p { font-size: .85rem; color: var(--text-secondary); margin-bottom: .5rem; }
.contact-link { color: var(--primary); font-weight: 500; text-decoration: none; font-size: .9rem; }
.contact-link:hover { text-decoration: underline; }


/* ============================================================
   EMAIL TEMPLATES
   ============================================================ */

/* Template Grid */
.templates-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem;
    margin-top: 1.5rem;
}
.template-card {
    background: var(--bg-card); border-radius: 14px; border: 1px solid var(--border);
    overflow: hidden; transition: all .25s; display: flex; flex-direction: column;
}
.template-card:hover { box-shadow: 0 8px 32px rgba(99,102,241,.12); transform: translateY(-3px); }

.template-preview-bar { padding: 1.25rem; }
.template-preview-header { padding-bottom: .75rem; display: flex; align-items: center; gap: .75rem; }
.preview-mini-logo { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.preview-mini-lines { flex: 1; }
.mini-line { height: 6px; background: rgba(0,0,0,.06); border-radius: 3px; margin-bottom: 4px; }
.mini-line.w40 { width: 40%; }
.mini-line.w60 { width: 60%; }
.mini-line.w80 { width: 80%; }
.mini-line.w100 { width: 100%; }
.preview-mini-body { padding-top: .75rem; }
.preview-mini-btn { width: 60px; height: 20px; border-radius: 4px; margin-top: 8px; }

.template-card-body { padding: 1rem 1.25rem; flex: 1; }
.template-card-top { display: flex; gap: .5rem; margin-bottom: .5rem; }
.template-card-body h3 { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; color: var(--text); }
.template-vars { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.var-tag {
    font-size: .65rem; padding: 1px 6px; background: rgba(99,102,241,.06); border-radius: 3px;
    color: var(--primary); border: 1px solid rgba(99,102,241,.15);
}
.var-tag code { background: transparent; padding: 0; font-size: inherit; }
.template-card-meta {
    display: flex; justify-content: space-between; margin-top: .75rem;
    font-size: .75rem; color: var(--text-muted);
}
.template-card-actions {
    padding: .75rem 1.25rem; border-top: 1px solid var(--border);
    display: flex; gap: .5rem; justify-content: flex-end;
}

/* Filter Chips */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.filter-chip {
    padding: 6px 16px; border-radius: 20px; font-size: .8rem; font-weight: 500;
    background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border);
    cursor: pointer; transition: all .15s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Section Header Row */
.section-header-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.action-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Form Utilities */
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-inline-row { display: flex; gap: .75rem; align-items: flex-end; }
.form-grid-2col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; align-items: start; }

/* Stats Row */
.stats-row { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.stats-row.four-col { grid-template-columns: repeat(4, 1fr); }
.stat-card {
    background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border);
    padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--primary-bg); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.green { background: rgba(16,185,129,.1); color: var(--success); }
.stat-icon.orange { background: rgba(249,115,22,.1); color: var(--orange); }
.stat-icon.red { background: rgba(239,68,68,.1); color: var(--danger); }
.stat-icon.purple { background: rgba(168,85,247,.1); color: #a855f7; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: .8rem; color: var(--text-muted); }

/* Detail Rows */
.detail-row {
    display: flex; justify-content: space-between; padding: .75rem 0;
    border-bottom: 1px solid var(--border); font-size: .9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 500; }
.detail-value { color: var(--text); font-weight: 500; }

/* Recipients */
.recipient-count-box {
    display: flex; align-items: center; gap: 1rem; padding: 1.25rem;
    background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(6,182,212,.04));
    border-radius: 12px; border: 1px solid rgba(99,102,241,.15); margin-top: 1rem;
}
.recipient-count-icon { font-size: 1.5rem; color: var(--primary); }
.recipient-count-number { font-size: 2rem; font-weight: 800; color: var(--primary); }
.recipient-count-label { font-size: .8rem; color: var(--text-muted); display: block; }

.recipients-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.recipient-chip {
    padding: 4px 10px; font-size: .75rem; background: var(--bg-input);
    border-radius: 6px; color: var(--text-secondary);
}
.recipient-chip.more { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* Variables Reference */
.vars-reference { display: flex; flex-direction: column; gap: .5rem; }
.var-ref-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem; background: var(--bg-input); border-radius: 8px; font-size: .85rem;
}
.var-ref-item code { background: rgba(99,102,241,.08); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: .8rem; }
.var-ref-item small { color: var(--text-muted); }

/* Empty State */
.empty-state-box {
    text-align: center; padding: 3rem 2rem;
}
.empty-icon { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; opacity: .5; }
.empty-state-box h3 { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.empty-state-box p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Button variants */
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .85rem; transition: all .15s; }
.btn-danger:hover { background: #dc2626; }
.btn-danger-sm { color: var(--danger); }
.btn-danger-sm:hover { background: rgba(239,68,68,.08); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .85rem; transition: all .15s; }
.btn-secondary:hover { background: var(--border); }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }

/* Bottom responsive already handled above */
