/* ============================================================
   Marketplace Profit Intelligence Tool - Design System
   Premium Dark Theme with Glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2a;
    --bg-card: rgba(18, 18, 48, 0.7);
    --bg-card-hover: rgba(28, 28, 68, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(99, 102, 241, 0.5);

    --text-primary: #f0f0ff;
    --text-secondary: #9d9db8;
    --text-muted: #5a5a7a;
    --text-accent: #818cf8;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --accent-glow: 0 0 30px rgba(99, 102, 241, 0.3);

    --profit-green: #22c55e;
    --profit-green-bg: rgba(34, 197, 94, 0.1);
    --loss-red: #ef4444;
    --loss-red-bg: rgba(239, 68, 68, 0.1);
    --warning-yellow: #f59e0b;
    --warning-yellow-bg: rgba(245, 158, 11, 0.1);
    --info-blue: #3b82f6;
    --info-blue-bg: rgba(59, 130, 246, 0.1);

    --amazon-color: #FF9900;
    --flipkart-color: #2874F0;
    --meesho-color: #F43397;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --sidebar-width: 280px;
    --header-height: 70px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ── Layout ────────────────────────────────────────────────── */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-brand h1 {
    font-size: 17px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.sidebar-brand p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-accent);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    /* Prevents flexbox child from growing beyond viewport */
}

.content-area {
    min-width: 0;
    max-width: 100%;
}

/* ── Header ────────────────────────────────────────────────── */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* GST Toggle */
.gst-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    padding: 6px 16px;
}

.gst-toggle label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.gst-toggle .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.gst-toggle .toggle-switch input {
    display: none;
}

.gst-toggle .toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: var(--transition-normal);
}

.gst-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.gst-toggle .toggle-switch input:checked+.toggle-slider {
    background: var(--accent-primary);
}

.gst-toggle .toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

.gst-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.gst-status.registered {
    background: var(--profit-green-bg);
    color: var(--profit-green);
}

.gst-status.not-registered {
    background: var(--warning-yellow-bg);
    color: var(--warning-yellow);
}

/* ── Content Area ──────────────────────────────────────────── */
.content-area {
    padding: 32px;
}

.module-panel {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.module-panel.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Module Header ─────────────────────────────────────────── */
.module-header {
    margin-bottom: 28px;
}

.module-header h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.module-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 18px;
}

/* ── Grid Layouts ──────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ── Form Elements ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-group label .required {
    color: var(--loss-red);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.05);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239d9db8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-active);
}

.btn-danger {
    background: var(--loss-red);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ── Result Cards ──────────────────────────────────────────── */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.result-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.result-card:hover::before {
    opacity: 1;
}

.result-card .result-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.result-card .result-value {
    font-size: 28px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
}

.result-card .result-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.result-card.profit .result-value {
    color: var(--profit-green);
}

.result-card.loss .result-value {
    color: var(--loss-red);
}

.result-card.warning .result-value {
    color: var(--warning-yellow);
}

.result-card.info .result-value {
    color: var(--info-blue);
}

.result-card.accent .result-value {
    color: var(--text-accent);
}

/* ── Tables ────────────────────────────────────────────────── */
.data-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    max-width: 100%;
}

.module-panel {
    max-width: 100%;
    min-width: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: rgba(99, 102, 241, 0.08);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-accent);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

.data-table .positive {
    color: var(--profit-green);
    font-weight: 600;
}

.data-table .negative {
    color: var(--loss-red);
    font-weight: 600;
}

/* ── Suggestion Cards ──────────────────────────────────────── */
.suggestion-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.suggestion-card.tip {
    background: var(--profit-green-bg);
    border-left: 3px solid var(--profit-green);
}

.suggestion-card.warning {
    background: var(--warning-yellow-bg);
    border-left: 3px solid var(--warning-yellow);
}

.suggestion-card.danger {
    background: var(--loss-red-bg);
    border-left: 3px solid var(--loss-red);
}

.suggestion-card.info {
    background: var(--info-blue-bg);
    border-left: 3px solid var(--info-blue);
}

.suggestion-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.suggestion-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.suggestion-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

/* ── Range Slider ──────────────────────────────────────────── */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    transition: var(--transition-fast);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
    transition: var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

.range-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.slider-value {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-accent);
    margin: 12px 0;
}

/* ── Risk Gauge ────────────────────────────────────────────── */
.risk-gauge {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin: 12px 0;
    overflow: hidden;
}

.risk-gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease, background 0.6s ease;
}

.risk-gauge-fill.low {
    background: var(--profit-green);
}

.risk-gauge-fill.medium {
    background: var(--warning-yellow);
}

.risk-gauge-fill.high {
    background: var(--loss-red);
}

/* ── Comparison Badges ─────────────────────────────────────── */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.platform-badge.amazon {
    background: rgba(255, 153, 0, 0.15);
    color: var(--amazon-color);
}

.platform-badge.flipkart {
    background: rgba(40, 116, 240, 0.15);
    color: var(--flipkart-color);
}

.platform-badge.meesho {
    background: rgba(244, 51, 151, 0.15);
    color: var(--meesho-color);
}

.verdict-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.verdict-badge.scale {
    background: var(--profit-green-bg);
    color: var(--profit-green);
}

.verdict-badge.monitor {
    background: var(--warning-yellow-bg);
    color: var(--warning-yellow);
}

.verdict-badge.stop {
    background: var(--loss-red-bg);
    color: var(--loss-red);
}

/* ── CSV Upload Zone ───────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-zone h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Marketplace Tab Bar ───────────────────────────────────── */
.marketplace-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.marketplace-tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.marketplace-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.marketplace-tab.active {
    color: white;
    box-shadow: var(--shadow-sm);
}

.marketplace-tab.active.amazon {
    background: var(--amazon-color);
}

.marketplace-tab.active.flipkart {
    background: var(--flipkart-color);
}

.marketplace-tab.active.meesho {
    background: var(--meesho-color);
}

/* ── Stat Mini Cards (Dashboard style) ─────────────────────── */
.stat-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-mini {
    flex: 1;
    min-width: 140px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
}

.stat-mini .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-mini .stat-value {
    font-size: 22px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 4px;
    color: var(--text-primary);
}

/* ── Section Divider ───────────────────────────────────────── */
.section-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 28px 0;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ── Comparison Card ───────────────────────────────────────── */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.comparison-platform-card {
    border-radius: var(--radius-lg);
    padding: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    position: relative;
    transition: all var(--transition-normal);
}

.comparison-platform-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.comparison-platform-card.best {
    border-color: var(--profit-green);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.1);
}

.comparison-platform-card .best-tag {
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--profit-green);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Cash Flow Timeline ────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-glass);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-primary);
}

.timeline-item h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-item p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Pulse Animation ───────────────────────────────────────── */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .content-area {
        padding: 20px 16px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 0 16px;
    }

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .marketplace-tabs {
        flex-direction: column;
    }

    .gst-toggle {
        display: none;
    }
}

@media (max-width: 480px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .module-header h2 {
        font-size: 20px;
    }

    .result-card .result-value {
        font-size: 22px;
    }
}

/* ── Overlay for mobile ────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

/* ── Loader ────────────────────────────────────────────────── */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Tooltip ───────────────────────────────────────────────── */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.tooltip:hover::after {
    opacity: 1;
}

/* ── Number Formatting ─────────────────────────────────────── */
.currency {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.positive-value {
    color: var(--profit-green) !important;
}

.negative-value {
    color: var(--loss-red) !important;
}

/* ── Download Actions ─────────────────────────────────────── */
.download-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
    flex-wrap: wrap;
    justify-content: center;
}

.btn-download {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-accent);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-download:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-download:active {
    transform: translateY(0);
}

/* ── Print Styles ─────────────────────────────────────────── */
@media print {

    .sidebar,
    .header,
    .sidebar-overlay,
    .download-actions,
    .btn,
    form {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .module-panel {
        display: block !important;
    }

    body {
        background: white;
        color: #1a1a2e;
    }

    .card {
        border: 1px solid #ddd;
        background: white;
    }

    .result-card {
        border: 1px solid #eee;
        background: #f9f9ff;
    }

    .data-table td {
        border-color: #eee;
    }

    .result-card .result-value {
        font-size: 20px;
    }

    .positive,
    .positive-value {
        color: #16a34a !important;
    }

    .negative,
    .negative-value {
        color: #dc2626 !important;
    }
}

/* ── Dashboard & Components ───────────────────────────────── */
.dashboard-welcome {
    text-align: center;
    padding: 60px 20px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 2s infinite ease-in-out;
}

.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.dashboard-tips {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.tip-card {
    background: var(--bg-glass);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.tip-icon {
    font-size: 18px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.best-card {
    border-top: 3px solid var(--profit-green);
}

.worst-card {
    border-top: 3px solid var(--loss-red);
}

.best-sku-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.best-sku-detail {
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    gap: 12px;
    align-items: center;
}

.warning-text {
    color: var(--accent-primary);
}

.live-preview-bar {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

@media (max-width: 600px) {
    .live-preview-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ── Alerts & Features ─────────────────────────────────────── */
.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid var(--accent-primary);
}

.alert-type-badge {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.alert-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 12px;
}

/* ── Simulator Slider ──────────────────────────────────────── */
.slider-value {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    margin: 20px 0;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    outline: none;
    margin: 20px 0;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 8px;
}

/* ── Toast Notifications ───────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--profit-green);
}

.toast-error {
    border-left: 4px solid var(--loss-red);
}

.toast-info {
    border-left: 4px solid var(--accent-primary);
}

/* ── Keyboard Shortcuts Modal ──────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    margin: 0;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-accent);
    box-shadow: 0 2px 0 var(--border-glass);
}

/* ── Light Theme Variables ─────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
}

[data-theme="light"] .card {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .form-control {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme="light"] .form-control:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
}

[data-theme="light"] select.form-control {
    background-color: #ffffff;
}

[data-theme="light"] .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
}

[data-theme="light"] .data-table th {
    background: #f1f5f9;
    color: #334155;
}

[data-theme="light"] .data-table tr {
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] .nav-item:hover {
    background: #f1f5f9;
}

[data-theme="light"] .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .toast {
    background: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .modal-card {
    background: #ffffff;
}

[data-theme="light"] .comparison-platform-card {
    background: #ffffff;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ── Heatmap & Forecast (Phase 2) ────────────────────────── */
.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}

.heatmap-cell {
    padding: 24px;
    text-align: center;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 700;
    font-size: 16px;
    font-family: 'JetBrains Mono', monospace;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.heatmap-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.heatmap-cell.empty {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.row-label {
    font-weight: 600;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border-glass);
}

.insight-icon {
    font-size: 20px;
}

.target-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--radius-md);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
}

.forecast-chart-container canvas {
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.3));
}

.value-highlight {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* ── Bundle & Recon (Phase 2) ────────────────────────────── */
.bundle-selector-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}

.bundle-sku-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--border-glass);
}

.bundle-sku-item:last-child {
    border-bottom: none;
}

.recon-meter {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
}

.meter-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
    transition: width 0.5s ease-out;
}

/* ── Ad Day-Parting (Phase 2) ───────────────────────────── */
.dayparting-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
}

@media (max-width: 768px) {
    .dayparting-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.hour-block {
    padding: 15px 5px;
    text-align: center;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s;
    cursor: default;
}

.hour-block:hover {
    transform: scale(1.1);
    z-index: 5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.hour-label {
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
}

.hour-score {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

/* ── Profile Switcher ────────────────────────────────────── */
.profile-switcher {
    padding: 0 20px 20px;
}

.profile-switcher select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

/* ── Subscription Sandbox (Phase 4) ───────────────────────── */
.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header h2 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    position: relative;
    backdrop-filter: blur(10px);
}

.pricing-card.premium {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.pricing-card.premium.active {
    border-color: var(--profit-green);
}

.premium-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    padding: 5px 15px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
}

.plan-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.price {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 30px;
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
    flex-grow: 1;
}

.plan-features li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ── Form Extensions ───────────────────────────────────────── */
.btn-google {
    background: white;
    color: #444;
    font-weight: 700;
    width: 250px;
    padding: 12px;
}

.btn-google:hover {
    background: #f1f1f1;
}

/* ── Mobile Responsiveness ─────────────────────────────────── */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 900px) {

    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Layout */
    .sidebar {
        transform: translateX(-100%);
        z-index: 100;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .content-area {
        padding: 16px;
    }

    .header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
        height: auto;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Grids & Forms */
    .grid-2,
    .grid-3,
    .grid-4,
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Adjust cards */
    .card {
        padding: 16px;
    }

    .module-header h2 {
        font-size: 22px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* Feature Gating Overlay */
.module-panel {
    position: relative;
}

.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.95);
    z-index: 100;
    display: grid;
    place-items: center;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(15px);
}

.locked-content {
    text-align: center;
    padding: 40px;
}

.locked-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}