:root {
    --bg: #0f0f23;
    --bg-elevated: #16162a;
    --bg-card: #1a1a35;
    --border: #2a2a4a;
    --text: #e2e2f0;
    --text-muted: #8a8ab0;
    --accent-primary: #7c3aed;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg: #f8f9fb;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #1a1a2e;
    --text-muted: #64748b;
    --accent-primary: #7c3aed;
    --accent-secondary: #0891b2;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background .3s, color .3s;
}

a { color: var(--accent-secondary); text-decoration: none; }

/* Navbar */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; height: 64px;
    background: rgba(15,15,35,0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
[data-theme="light"] .navbar { background: rgba(248,249,251,0.8); }

.nav-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; }
.logo-icon { font-size: 1.4rem; color: var(--accent-primary); }
.logo-tag { font-size: .75rem; color: var(--text-muted); font-weight: 400; margin-left: .3rem; }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; gap: .5rem; align-items: center; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .5rem 1rem; border-radius: 8px; border: none;
    font-family: inherit; font-size: .9rem; font-weight: 500;
    cursor: pointer; transition: all .2s; gap: .4rem;
}
.btn-primary { background: var(--accent-gradient); color: #fff; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Hero */
.hero { position: relative; padding: 140px 2rem 80px; overflow: hidden; text-align: center; }
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 60%, rgba(6,182,212,0.08) 0%, transparent 50%);
    pointer-events: none;
}
.hero-content { position: relative; max-width: 720px; margin: 0 auto; }
.hero-badge {
    display: inline-block; padding: .4rem 1rem; border-radius: 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: .85rem; color: var(--accent-secondary); margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.gradient-text { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; }
.hero-stats { display: flex; gap: 2rem; justify-content: center; }
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); }
.hero-stats span { font-size: .85rem; color: var(--text-muted); }

/* Sections */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section-title { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: .5rem; }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; }

/* Channels */
.channels { padding: 60px 0; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.channel-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; transition: transform .2s, border-color .2s;
}
.channel-card:hover { transform: translateY(-3px); border-color: var(--accent-primary); }
.channel-icon { font-size: 2rem; margin-bottom: .75rem; }
.channel-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.channel-card p { font-size: .85rem; color: var(--text-muted); }

/* Pricing */
.pricing { padding: 60px 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.pricing-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; position: relative;
}
.pricing-card.featured { border-color: var(--accent-primary); }
.pricing-card .badge {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: var(--accent-primary); color: #fff; padding: .2rem .8rem;
    border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.pricing-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.price { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-card ul { list-style: none; margin-bottom: 1.5rem; }
.pricing-card li { font-size: .9rem; color: var(--text-muted); padding: .3rem 0; }

/* Features */
.features { padding: 60px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.feature-item { display: flex; gap: 1rem; }
.feature-icon { font-size: 1.5rem; flex-shrink: 0; }
.feature-item h4 { font-size: 1rem; margin-bottom: .3rem; }
.feature-item p { font-size: .85rem; color: var(--text-muted); }

/* Footer */
.footer { padding: 60px 0 30px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand p { font-size: .85rem; color: var(--text-muted); margin-top: .5rem; }
.footer-links h4 { font-size: .9rem; margin-bottom: 1rem; }
.footer-links a { display: block; font-size: .85rem; color: var(--text-muted); padding: .3rem 0; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { text-align: center; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.footer-bottom p { font-size: .8rem; color: var(--text-muted); }

/* Portal Layout */
.portal-layout { display: flex; min-height: calc(100vh - 64px); margin-top: 64px; }
.sidebar { width: 220px; background: var(--bg-elevated); border-right: 1px solid var(--border); flex-shrink: 0; }
.sidebar-nav { padding: 1rem .5rem; }
.sidebar-nav a {
    display: block; padding: .6rem 1rem; border-radius: 8px; color: var(--text-muted);
    font-size: .9rem; transition: all .2s; margin-bottom: .2rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--bg-card); color: var(--text); }
.portal-content { flex: 1; padding: 2rem; overflow-y: auto; }
.section-panel.hidden { display: none; }

/* Auth Panel */
.auth-panel { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-card h2 { margin-bottom: .5rem; }
.auth-card p { color: var(--text-muted); margin-bottom: 1.5rem; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tab-btn { flex: 1; padding: .5rem; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid var(--border); font-family: inherit; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.auth-card input {
    width: 100%; padding: .7rem 1rem; margin-bottom: .75rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: inherit; font-size: .9rem;
}
.auth-card input:focus { outline: none; border-color: var(--accent-primary); }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .4rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; }

/* Charts */
.chart-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.chart-container h3 { font-size: 1rem; margin-bottom: 1rem; }

/* Tables */
.table-wrapper { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { text-align: left; padding: .8rem 1rem; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.data-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.action-bar { display: flex; gap: 1rem; margin-bottom: 1rem; }
.action-bar input { padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; }

/* Service Grid */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.service-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.service-card h4 { margin-bottom: .3rem; }
.service-card p { font-size: .85rem; color: var(--text-muted); margin-bottom: .8rem; }
.service-card .badge { display: inline-block; padding: .2rem .6rem; border-radius: 4px; font-size: .75rem; background: var(--bg); border: 1px solid var(--border); }

/* Compliance */
.compliance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.compliance-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.compliance-icon { font-size: 2rem; margin-bottom: .5rem; }
.compliance-card h4 { font-size: 1rem; margin-bottom: .3rem; }
.compliance-card p { font-size: .85rem; color: var(--text-muted); }

/* User Pill */
.user-pill { padding: .3rem .8rem; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border); font-size: .85rem; }
.badge-admin { background: var(--accent-primary); color: #fff; padding: .3rem .8rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .nav-links { display: none; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { flex-direction: column; gap: 1rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .sidebar { display: none; }
    .portal-content { padding: 1rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .hero { padding: 120px 1rem 60px; }
    .hero-cta { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
}
