/* ========================================
   AI Autopilot Ads - Global Styles
   ======================================== */

:root {
    /* ========================================
       NOTE: All color/visual tokens (colors, shadows, radius, transitions)
       are defined in theme.css with dark + light mode variants.
       This file only provides spacing overrides and component-size tokens.
       ======================================== */

    /* Layout override — keep full width (theme.css defaults to 1440px) */
    --content-max-width: 100%;

    /* ========================================
       BOX MODEL - Spacing System
       Standard: MARGIN → BORDER → PADDING → CONTENT
       ======================================== */
    
    /* MARGIN - External spacing between elements */
    --margin-xs: 4px;
    --margin-sm: 8px;
    --margin-md: 16px;
    --margin-lg: 24px;
    --margin-xl: 32px;
    --margin-2xl: 48px;
    --margin-3xl: 64px;
    
    /* BORDER - Element boundaries */
    --border-width-sm: 1px;
    --border-width-md: 2px;
    --border-width-lg: 3px;
    
    /* PADDING - Internal spacing within elements */
    --padding-xs: 4px;
    --padding-sm: 8px;
    --padding-md: 12px;
    --padding-lg: 16px;
    --padding-xl: 20px;
    --padding-2xl: 24px;
    --padding-3xl: 32px;
    
    /* CONTENT - Gaps between child elements */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 12px;
    --gap-lg: 16px;
    --gap-xl: 24px;
    --gap-2xl: 32px;
    
    /* ========================================
       Component Spacing (using box model)
       ======================================== */
    
    /* Cards */
    --card-padding: var(--padding-xl);
    --card-margin: var(--margin-md);
    --card-gap: var(--gap-lg);
    --card-border: var(--border-width-sm);
    
    /* Buttons */
    --btn-padding-y: var(--padding-md);
    --btn-padding-x: var(--padding-xl);
    --btn-gap: var(--gap-sm);
    
    /* Inputs */
    --input-padding-y: var(--padding-md);
    --input-padding-x: var(--padding-lg);
    --input-border: var(--border-width-sm);
    
    /* Sections */
    --section-margin: var(--margin-xl);
    --section-padding: var(--padding-2xl);
    --section-gap: var(--gap-xl);
    
    /* ========================================
       Extra token not in theme.css
       ======================================== */
    --radius-xs: 4px; /* theme.css starts from --radius-sm */

    /* ========================================
       Legacy spacing (for backwards compatibility)
       ======================================== */
    --space-xs: var(--padding-xs);
    --space-sm: var(--padding-sm);
    --space-md: var(--padding-md);
    --space-lg: var(--padding-lg);
    --space-xl: var(--padding-xl);
    --space-2xl: var(--padding-2xl);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    height: 100%;
    width: 100%;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1200px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    height: 100%;
    width: 100%;
    display: flex;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    letter-spacing: 0.01em;
}

p, li, td, th, label, input, textarea, select, button {
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: var(--padding-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--padding-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--padding-lg) var(--padding-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--margin-lg);
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 var(--padding-md);
    margin-bottom: var(--margin-sm);
}

.nav-gap {
    height: 1px;
    margin: 10px 12px;
    background: var(--glass-border);
    opacity: 0.4;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

/* Nav Group (collapsible sections) */
.nav-group {
    margin-bottom: 4px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: var(--transition-fast);
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-group-header .nav-icon {
    width: 18px;
    opacity: 0.5;
}

.nav-group-header .nav-icon svg {
    width: 16px;
    height: 16px;
}

.nav-group-header:hover {
    color: var(--text-primary);
}

/* When group has active child, tint the header */
.nav-group.has-active > .nav-group-header {
    color: var(--accent-secondary);
}
.nav-group.has-active > .nav-group-header .nav-icon {
    opacity: 0.8;
}

.nav-group-chevron {
    margin-left: auto;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.35;
    flex-shrink: 0;
}

.nav-group-header:hover .nav-group-chevron {
    opacity: 0.6;
}

.nav-group.open .nav-group-chevron {
    transform: rotate(180deg);
}

.nav-group-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
    margin-left: 14px;
    padding-left: 12px;
    border-left: 1.5px solid var(--border-primary);
}

.nav-group.open .nav-group-children {
    max-height: 500px;
    opacity: 1;
}

.nav-group.has-active .nav-group-children {
    border-left-color: rgba(99, 102, 241, 0.3);
}

.nav-child {
    font-size: 0.85rem;
    padding: 7px 12px;
}

.nav-child .nav-icon {
    width: 20px;
    height: 20px;
}

.nav-child .nav-icon svg {
    width: 16px;
    height: 16px;
}

/* Collapsed sidebar group support */
.sidebar.collapsed .nav-group-header .nav-label,
.sidebar.collapsed .nav-group-chevron {
    display: none;
}

.sidebar.collapsed .nav-group-children {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    margin-bottom: 2px;
    position: relative;
    font-size: 0.88rem;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-secondary);
    font-weight: 600;
    border-color: rgba(99, 102, 241, 0.12);
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-text {
    flex: 1;
    font-weight: 500;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.nav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.nav-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.nav-badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.sidebar.collapsed .nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 5px;
    font-size: 0.6rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--padding-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    flex: 1;
}

.sidebar.collapsed .user-info {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Page Selector - For page-centric navigation */
.page-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 10px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--glass-bg);
    border: 1px solid var(--border-primary);
}

.page-selector:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

/* Page Avatar */
.page-selector-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.page-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.page-selector-initial {
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-selector-info {
    flex: 1;
    min-width: 0;
}

.page-selector-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    line-height: 1.3;
}

.page-selector-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.page-selector-chevron {
    opacity: 0.4;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.page-selector:hover .page-selector-chevron {
    opacity: 0.8;
}

/* Page selected state */
.page-selector.has-page {
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.06);
}

.page-selector.has-page .page-selector-avatar {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.sidebar.collapsed .page-selector {
    padding: 8px;
    justify-content: center;
    margin: 8px;
}

.sidebar.collapsed .page-selector-info,
.sidebar.collapsed .page-selector-chevron {
    display: none;
}

/* ================================
   Page Dropdown - Premium Design
   ================================ */
.page-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--border-primary);
    overflow: hidden;
    z-index: 1000;
    animation: pdSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

@keyframes pdSlideDown {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
}

.pd-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pd-count {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 10px;
}

.pd-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 6px;
}

.pd-list::-webkit-scrollbar {
    width: 4px;
}

.pd-list::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

/* Page Item */
.pd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.pd-item:hover {
    background: var(--bg-hover);
}

.pd-item-active {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.pd-item-active:hover {
    background: rgba(99, 102, 241, 0.15);
}

/* Item Avatar */
.pd-item-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: visible;
    flex-shrink: 0;
}

.pd-item-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.pd-item-initial {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-item:nth-child(2) .pd-item-initial { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.pd-item:nth-child(3) .pd-item-initial { background: linear-gradient(135deg, #14b8a6, #06b6d4); }
.pd-item:nth-child(4) .pd-item-initial { background: linear-gradient(135deg, #f59e0b, #f97316); }
.pd-item:nth-child(5) .pd-item-initial { background: linear-gradient(135deg, #22c55e, #10b981); }

.pd-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

/* Item Info */
.pd-item-info {
    flex: 1;
    min-width: 0;
}

.pd-item-name {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.pd-item-id {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.pd-item-active .pd-item-name {
    color: #818cf8;
}

/* Check Mark */
.pd-item-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

/* Footer */
.pd-footer {
    border-top: 1px solid var(--border-primary);
    padding: 6px;
}

.pd-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pd-add-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Empty State */
.pd-empty {
    padding: 24px 16px;
    text-align: center;
}

.pd-empty-icon {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 12px;
}

.pd-empty p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.pd-connect-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pd-connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
    background: var(--border-primary);
}

.selected-page-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-secondary);
}

.page-switcher-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.page-switcher-content {
    width: min(560px, 100%);
    background: linear-gradient(180deg, rgba(21, 27, 35, 0.96), rgba(14, 20, 26, 0.98));
    border: 1px solid var(--border-secondary);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 16px;
}

.page-switcher-header {
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.page-switcher-header h2 {
    font-size: 1.45rem;
    letter-spacing: -0.02em;
}

.page-switcher-list {
    max-height: 440px;
    overflow-y: auto;
    padding: 8px 2px;
}

.page-switcher-loading {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
}

.page-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--border-primary);
    transition: var(--transition-fast);
}

.page-item:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.08);
}

.page-item.selected {
    border-color: rgba(34, 197, 94, 0.75);
    background: rgba(34, 197, 94, 0.12);
}

.page-item-avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(24, 119, 242, 0.35), rgba(66, 183, 42, 0.32));
    border: 1px solid var(--border-secondary);
    flex-shrink: 0;
}

.page-item-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-item-avatar-fallback {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.page-item-body {
    flex: 1;
    min-width: 0;
}

.page-item-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-item-id,
.page-item-category {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-item-category {
    color: var(--text-muted);
}

.page-item-check {
    color: var(--success);
    font-size: 1.15rem;
    font-weight: 700;
}

.page-switcher-footer {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Account Selector */
.account-selector {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--padding-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.account-selector:hover {
    background: var(--bg-hover);
}

.account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.account-avatar.has-account {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.sidebar.collapsed .account-info {
    display: none;
}

.account-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-menu-btn {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    transition: var(--transition-fast);
}

.account-selector:hover .account-menu-btn {
    opacity: 1;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 4px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.logout-btn:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar.collapsed .logout-btn .logout-text {
    display: none;
}

.sidebar.collapsed .logout-btn {
    padding: 10px;
}

/* Account Dropdown */
.account-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    z-index: 1000;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--padding-md) var(--padding-lg);
    border-bottom: 1px solid var(--border-primary);
}

.account-dropdown .dropdown-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.account-dropdown .dropdown-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-full);
}

.account-dropdown .dropdown-accounts {
    max-height: 200px;
    overflow-y: auto;
}

.account-dropdown .dropdown-empty {
    padding: var(--padding-xl);
    text-align: center;
}

.account-dropdown .dropdown-empty p {
    color: var(--text-muted);
    margin-bottom: var(--gap-md);
}

.account-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--padding-md) var(--padding-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
}

.account-dropdown .dropdown-item:hover {
    background: var(--bg-hover);
}

.account-dropdown .dropdown-item.selected {
    background: var(--accent-primary-alpha);
}

.account-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-primary);
    margin: var(--gap-xs) 0;
}

.account-option {
    padding: var(--padding-md) var(--padding-lg);
}

.account-option-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

.account-option-info {
    flex: 1;
    min-width: 0;
}

.account-option-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-option-id {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.account-check {
    color: var(--success);
    font-weight: 600;
}

.add-account {
    color: var(--accent-primary) !important;
}

.add-account:hover {
    background: var(--accent-primary-alpha) !important;
}

/* ========================================
   Main Content - Centered like Facebook
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    height: 100%;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-normal), width var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Inner content wrapper */
.main-content-inner {
    width: 100%;
    padding: 0;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
    max-width: calc(100% - var(--sidebar-collapsed));
}

/* ========================================
   Page Header - Standardized
   Use .top-header for all pages
   ======================================== */
.top-header,
.header,
.page-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    box-sizing: border-box;
}

/* ========================================
   Page Content - Standardized Padding
   Use .page-content for all pages
   Centered with max-width like Facebook
   ======================================== */
.page-content,
.dashboard-content {
    padding: 16px;
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure consistent spacing for sections */
.page-content > *:not(:last-child),
.dashboard-content > *:not(:last-child) {
    margin-bottom: var(--space-6);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.page-subtitle,
.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: var(--gap-sm);
}

.breadcrumb .separator {
    color: var(--border-secondary);
}

.breadcrumb .current {
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--gap-lg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: var(--input-padding-y) var(--input-padding-x) var(--input-padding-y) 42px;
    background: var(--bg-card);
    border: var(--input-border) solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.date-btn {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.date-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-card);
    border: var(--card-border) solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--padding-lg) var(--padding-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-primary);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-link {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    transition: var(--transition-fast);
}

.card-link:hover {
    color: var(--accent-primary);
}

.card-body {
    padding: var(--padding-lg) var(--padding-xl);
}

/* ========================================
   Tables
   ======================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--padding-lg) var(--padding-lg);
    text-align: left;
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-primary);
}

.data-table td {
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

/* ========================================
   Status Pills
   ======================================== */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.active {
    background: var(--success-bg);
    color: var(--success);
}

.status-pill.paused {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-pill.error {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-pill.learning {
    background: var(--info-bg);
    color: var(--info);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--btn-gap);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* ========================================
   Utilities
   ======================================== */
.cpo-good {
    color: var(--success);
    font-weight: 600;
}

.cpo-ok {
    color: var(--warning);
    font-weight: 600;
}

.cpo-bad {
    color: var(--danger);
    font-weight: 600;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .mobile-overlay.show {
        display: block;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }
    
    .top-header {
        padding: 0 16px;
        flex-wrap: wrap;
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Nav badge alert style (alias for warning) */
.nav-badge.alert {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ========================================
   Modern Sidebar Enhancements
   ======================================== */

/* Sidebar Glass Effect */
.sidebar {
    background: var(--glass-bg, rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Nav Icon for SVG */
.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-label {
    flex: 1;
    font-weight: 500;
}

/* Sidebar logo styles */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--gap-md, 12px);
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sidebar-logo:hover .sidebar-logo-icon {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
    transform: scale(1.02);
}

.sidebar-logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Collapse button */
.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md, 10px);
    background: var(--glass-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary);
    transition: all 0.25s ease;
}

.sidebar-collapse-btn:hover {
    background: var(--glass-bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary);
}

.sidebar-collapse-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.sidebar-collapse-btn.rotated svg {
    transform: rotate(180deg);
}

/* Close button (mobile) */
.sidebar-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md, 10px);
    background: transparent;
    color: var(--text-secondary);
}

.sidebar-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Theme Toggle in Sidebar */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: transparent;
    border-radius: 8px;
    border: none;
    gap: 10px;
}

.theme-mode {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: capitalize;
    letter-spacing: 0;
}

/* Account chevron */
.account-chevron {
    opacity: 0.35;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.account-selector:hover .account-chevron {
    opacity: 0.7;
}

.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(15, 23, 42, 0.8));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.theme-toggle:active {
    transform: scale(0.97);
}

.theme-toggle-track {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.theme-toggle-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.7;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.theme-toggle-icon.sun svg {
    color: var(--text-muted);
}

.theme-toggle-icon.moon svg {
    color: #c4b5fd;
}

[data-theme="dark"] .theme-toggle-icon.moon svg {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle-icon.sun svg {
    opacity: 0.45;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme="light"] .theme-toggle-thumb {
    left: calc(100% - 23px);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.28);
}

[data-theme="light"] .theme-toggle {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(226, 232, 240, 0.95));
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .theme-toggle-icon.sun svg {
    color: #f59e0b;
    opacity: 1;
}

[data-theme="light"] .theme-toggle-icon.moon svg {
    color: var(--text-muted);
    opacity: 0.45;
}

/* User Profile Enhanced */
.user-profile {
    position: relative;
}

.user-menu-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md, 10px);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--glass-bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: var(--danger-bg);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border, rgba(255, 255, 255, 0.08));
    margin: 6px 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 14px);
    color: var(--text-primary);
    margin-right: 16px;
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Collapsed state enhancements */
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .theme-toggle-wrapper,
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-menu-btn,
.sidebar.collapsed .account-info,
.sidebar.collapsed .account-chevron,
.sidebar.collapsed .account-menu-btn {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar.collapsed .sidebar-collapse-btn {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .user-profile,
.sidebar.collapsed .account-selector {
    justify-content: center;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 100;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-collapse-btn {
        display: none;
    }
    
    .sidebar-close-btn {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .header-left {
        flex-direction: row;
        align-items: center;
    }
    
    .breadcrumb {
        display: none;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .search-box {
        display: none;
    }
    
    .date-selector {
        display: none;
    }
}

/* ========================================
   Light Mode Component Enhancements
   Applied globally — makes ALL pages look crisp
   and beautiful in day (light) mode
   ======================================== */

/* Sidebar — clean white with gentle shadow */
[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid rgba(15, 23, 42, 0.09);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.05);
}
[data-theme="light"] .sidebar-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .sidebar-footer {
    border-top-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .nav-section-title {
    color: var(--text-muted);
}
[data-theme="light"] .nav-item:hover {
    background: rgba(79, 70, 229, 0.07);
    color: var(--text-primary);
}
[data-theme="light"] .nav-item.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.13), rgba(139, 92, 246, 0.07)) !important;
    color: var(--accent-primary) !important;
    border: 1px solid rgba(79, 70, 229, 0.18);
    box-shadow: none;
}
[data-theme="light"] .nav-gap {
    background: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .nav-group-header {
    color: var(--text-muted);
}
[data-theme="light"] .nav-group-header:hover {
    color: var(--text-primary);
}
[data-theme="light"] .nav-group.has-active > .nav-group-header {
    color: var(--accent-primary);
}
[data-theme="light"] .nav-group-children {
    border-left-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .nav-group.has-active .nav-group-children {
    border-left-color: rgba(79, 70, 229, 0.3);
}

/* Top header — frosted glass */
[data-theme="light"] .top-header,
[data-theme="light"] .header,
[data-theme="light"] .ads-manager-header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.05);
}
[data-theme="light"] .filter-tabs-bar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: rgba(15, 23, 42, 0.07);
}
[data-theme="light"] .filter-tab:hover {
    background: rgba(79, 70, 229, 0.07);
    color: var(--text-primary);
}

/* Cards — clean white with natural elevation */
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .chart-card,
[data-theme="light"] .module-card,
[data-theme="light"] .glass-card,
[data-theme="light"] .metric-card,
[data-theme="light"] .setting-card,
[data-theme="light"] .recommendation-card,
[data-theme="light"] .ai-activity-card,
[data-theme="light"] .connection-status-card,
[data-theme="light"] .setup-step,
[data-theme="light"] .integration-card,
[data-theme="light"] .suggestion-card,
[data-theme="light"] .chat-container,
[data-theme="light"] .status-card,
[data-theme="light"] .ai-summary-card {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(15, 23, 42, 0.07);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .card:hover,
[data-theme="light"] .stat-card:hover,
[data-theme="light"] .glass-card:hover,
[data-theme="light"] .module-card:hover,
[data-theme="light"] .metric-card:hover,
[data-theme="light"] .integration-card:hover,
[data-theme="light"] .suggestion-card:hover {
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.11);
    border-color: rgba(79, 70, 229, 0.22);
}

/* Card headers */
[data-theme="light"] .card-header {
    border-bottom-color: rgba(15, 23, 42, 0.07);
}

/* Table containers */
[data-theme="light"] .table-container {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(15, 23, 42, 0.07);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}
[data-theme="light"] .data-table th,
[data-theme="light"] .table th {
    background: rgba(238, 242, 249, 0.7);
    color: var(--text-muted);
    border-bottom-color: rgba(15, 23, 42, 0.09);
}
[data-theme="light"] .data-table td,
[data-theme="light"] .table td {
    border-bottom-color: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
}
[data-theme="light"] .data-table tr:hover td,
[data-theme="light"] .table tbody tr:hover td {
    background: rgba(79, 70, 229, 0.04);
}

/* Form inputs — crisp bordered */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="search"],
[data-theme="light"] textarea,
[data-theme="light"] select,
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .search-box input,
[data-theme="light"] .search-input-wrapper input,
[data-theme="light"] .input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
    color: var(--text-primary);
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus,
[data-theme="light"] .form-input:focus,
[data-theme="light"] .input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.11);
    background: #ffffff;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}
[data-theme="light"] .search-input-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] .filter-group select {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
}

/* Secondary / outline buttons */
[data-theme="light"] .btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.15);
    color: var(--text-secondary);
}
[data-theme="light"] .btn-secondary:hover:not(:disabled) {
    background: rgba(238, 242, 249, 0.95);
    border-color: rgba(79, 70, 229, 0.35);
    color: var(--accent-primary);
}
[data-theme="light"] .btn-outline {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.15);
    color: var(--text-secondary);
}
[data-theme="light"] .btn-outline:hover {
    background: rgba(238, 242, 249, 0.9);
    border-color: rgba(79, 70, 229, 0.3);
    color: var(--accent-primary);
}

/* Header icon buttons */
[data-theme="light"] .header-btn,
[data-theme="light"] .btn-icon,
[data-theme="light"] .sync-btn,
[data-theme="light"] .date-btn,
[data-theme="light"] .date-range-picker {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--text-secondary);
}
[data-theme="light"] .header-btn:hover,
[data-theme="light"] .btn-icon:hover,
[data-theme="light"] .sync-btn:hover,
[data-theme="light"] .date-btn:hover {
    background: rgba(238, 242, 249, 0.95);
    border-color: rgba(79, 70, 229, 0.3);
    color: var(--accent-primary);
}

/* Dropdown menus */
[data-theme="light"] .dropdown-menu,
[data-theme="light"] .page-dropdown,
[data-theme="light"] .user-dropdown,
[data-theme="light"] .account-dropdown {
    background: rgba(255, 255, 255, 0.99);
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.13);
}
[data-theme="light"] .dropdown-item:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--text-primary);
}
[data-theme="light"] .dropdown-divider {
    background: rgba(15, 23, 42, 0.07);
}

/* Page switcher modal */
[data-theme="light"] .page-switcher-content {
    background: rgba(255, 255, 255, 0.99);
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
}
[data-theme="light"] .page-switcher-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .page-item {
    background: rgba(248, 250, 252, 0.8);
    border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .page-item:hover {
    background: rgba(238, 242, 249, 0.9);
    border-color: rgba(79, 70, 229, 0.28);
}

/* AI banners */
[data-theme="light"] .ai-insight-banner {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.07), rgba(139, 92, 246, 0.04));
    border-color: rgba(79, 70, 229, 0.18);
}

/* Settings nav */
[data-theme="light"] .settings-nav {
    background: rgba(238, 242, 249, 0.6);
    border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .settings-nav-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}

/* Account badge / score widgets */
[data-theme="light"] .account-badge,
[data-theme="light"] .opportunity-score {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.12);
}

/* Theme toggle wrapper */
[data-theme="light"] .theme-toggle-wrapper {
    background: transparent;
    border-color: transparent;
}

/* Scrollbars */
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.14);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.22);
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-btn,
    .theme-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
