:root {
    --vg-primary: #1e3a8a;
    --vg-primary-dark: #14265c;
    --vg-primary-light: #3b5bdb;
    --vg-accent: #0ea5b7;
    --vg-success: #16a34a;
    --vg-warning: #f59e0b;
    --vg-danger: #dc2626;
    --vg-bg: #f5f7fb;
    --vg-surface: #ffffff;
    --vg-surface-2: #f1f4f9;
    --vg-border: #e4e8f1;
    --vg-text: #1a2230;
    --vg-text-muted: #667085;
    --vg-sidebar-bg: #101a34;
    --vg-sidebar-text: #b9c2da;
    --vg-sidebar-active: #1e3a8a;
    --vg-radius: 14px;
    --vg-shadow: 0 1px 3px rgba(16, 24, 45, 0.06), 0 8px 24px rgba(16, 24, 45, 0.04);
}

[data-theme="dark"] {
    --vg-bg: #0b1220;
    --vg-surface: #121a2e;
    --vg-surface-2: #17203a;
    --vg-border: #22304f;
    --vg-text: #e7ecf7;
    --vg-text-muted: #93a0bd;
    --vg-sidebar-bg: #08101f;
    --vg-sidebar-text: #8b96b5;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--vg-bg);
    color: var(--vg-text);
}

a { text-decoration: none; }

.text-muted { color: var(--vg-text-muted) !important; }
h1, h2, h3, h4, h5, h6, .fw-bold, .fw-semibold { color: var(--vg-text); }
.dropdown-menu { background: var(--vg-surface); border-color: var(--vg-border); }
.dropdown-item, .dropdown-item-text { color: var(--vg-text); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--vg-surface-2); color: var(--vg-text); }
.accordion-item, .accordion-button { background: var(--vg-surface); color: var(--vg-text); border-color: var(--vg-border); }
.accordion-button:not(.collapsed) { background: var(--vg-surface-2); color: var(--vg-primary); box-shadow: none; }
.accordion-button::after { filter: none; }
[data-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(1) brightness(2); }

.vg-brand {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.vg-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--vg-primary), var(--vg-accent));
    color: #fff;
    font-weight: 800;
    font-size: 15px;
}

/* ---------- Landing ---------- */
.vg-landing-nav {
    background: color-mix(in srgb, var(--vg-surface) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--vg-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.vg-hero {
    background:
        radial-gradient(circle at 15% 0%, rgba(30, 58, 138, 0.08), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(14, 165, 183, 0.10), transparent 45%);
    padding: 6rem 0 4rem;
}

.vg-hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.vg-btn-primary {
    background: var(--vg-primary);
    border-color: var(--vg-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.65rem 1.4rem;
}

.vg-btn-primary:hover {
    background: var(--vg-primary-dark);
    border-color: var(--vg-primary-dark);
    color: #fff;
}

.vg-btn-outline {
    border: 1.5px solid var(--vg-border);
    color: var(--vg-text);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.65rem 1.4rem;
    background: transparent;
}

.vg-btn-outline:hover {
    border-color: var(--vg-primary);
    color: var(--vg-primary);
}

.vg-feature-card, .vg-card {
    background: var(--vg-surface);
    border: 1px solid var(--vg-border);
    border-radius: var(--vg-radius);
    box-shadow: var(--vg-shadow);
}

.vg-feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 58, 138, 0.08);
    color: var(--vg-primary);
    font-size: 1.2rem;
}

footer.vg-footer {
    background: var(--vg-sidebar-bg);
    color: var(--vg-sidebar-text);
}

/* ---------- Auth ---------- */
.vg-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vg-bg);
    padding: 2rem 1rem;
}

.vg-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--vg-surface);
    border: 1px solid var(--vg-border);
    border-radius: 18px;
    box-shadow: var(--vg-shadow);
    padding: 2.25rem;
}

.vg-auth-wide-card {
    max-width: 720px;
}

.form-control, .form-select {
    background: var(--vg-surface);
    border: 1px solid var(--vg-border);
    color: var(--vg-text);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--vg-primary-light);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
    background: var(--vg-surface);
    color: var(--vg-text);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--vg-text-muted);
}

/* ---------- App shell ---------- */
.vg-app-shell {
    display: flex;
    min-height: 100vh;
}

.vg-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--vg-sidebar-bg);
    color: var(--vg-sidebar-text);
    transition: width 0.2s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.vg-sidebar.collapsed {
    width: 78px;
}

.vg-sidebar.collapsed .vg-sidebar-label,
.vg-sidebar.collapsed .vg-brand-text {
    display: none;
}

.vg-sidebar-overlay {
    display: none;
}

@media (max-width: 991.98px) {
    .vg-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1040;
    }

    .vg-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Ignore the desktop narrow-collapse state on mobile - there the
       sidebar is either fully hidden or fully shown as an overlay. */
    .vg-sidebar.collapsed {
        width: 260px;
    }

    .vg-sidebar.collapsed .vg-sidebar-label,
    .vg-sidebar.collapsed .vg-brand-text {
        display: inline;
    }

    .vg-sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(8, 12, 24, 0.5);
        z-index: 1030;
    }

    .vg-content {
        padding: 1.25rem;
    }
}

.vg-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1.25rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.vg-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: var(--vg-sidebar-text);
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.vg-nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.vg-nav-link.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--vg-accent);
}

.vg-nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5b6789;
    padding: 1.1rem 1.25rem 0.4rem;
}

.vg-topbar {
    background: var(--vg-surface);
    border-bottom: 1px solid var(--vg-border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.vg-main {
    flex: 1;
    min-width: 0;
}

.vg-content {
    padding: 1.75rem;
}

.vg-search-input {
    background: var(--vg-surface-2);
    border: 1px solid var(--vg-border);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    min-width: 280px;
}

.vg-kpi-card {
    background: var(--vg-surface);
    border: 1px solid var(--vg-border);
    border-radius: var(--vg-radius);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--vg-shadow);
}

.vg-kpi-label {
    font-size: 0.8rem;
    color: var(--vg-text-muted);
    font-weight: 600;
}

.vg-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.vg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--vg-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.vg-badge-trial {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

[data-theme="dark"] .vg-badge-trial {
    color: #fbbf24;
}
