/* ==========================================================================
   GEOMETRY & SEO DASHBOARD STYLE SYSTEM
   Curated HSL Palette, Glassmorphism, Dark/Light Themes & Micro-animations
   ========================================================================== */

/* --- Design Tokens & CSS Variables --- */
:root {
    /* Fonts */
    --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Theme-independent colors */
    --color-brand: hsl(260, 95%, 68%);       /* Vibrant Violet/Purple */
    --color-brand-glow: hsla(260, 95%, 68%, 0.45);
    --color-brand-dark: hsl(260, 85%, 55%);
    --color-teal:  hsl(175, 90%, 45%);       /* Neon Teal */
    --color-teal-glow: hsla(175, 90%, 45%, 0.4);
    --color-blue:  hsl(210, 100%, 55%);      /* Electric Blue */
    --color-blue-glow: hsla(210, 100%, 55%, 0.4);
    --color-coral: hsl(15, 95%, 60%);        /* Bright Coral */
    --color-coral-glow: hsla(15, 95%, 60%, 0.4);
    --color-gold:  hsl(45, 95%, 50%);        /* Amber/Gold */
    --color-gold-glow: hsla(45, 95%, 50%, 0.4);

    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-elastic: all 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* --- Dark Theme Variables (Default) --- */
.dark-theme {
    --bg-app: hsl(224, 25%, 7%);
    --bg-sidebar: hsl(224, 25%, 10%);
    --bg-card: hsla(224, 20%, 12%, 0.85);
    --bg-card-hover: hsla(224, 20%, 15%, 0.95);
    --bg-input: hsl(224, 20%, 9%);
    
    --border-color: hsla(224, 15%, 20%, 0.5);
    --border-color-glow: hsla(260, 95%, 68%, 0.25);
    
    --text-primary: hsl(210, 20%, 95%);
    --text-secondary: hsl(215, 12%, 65%);
    --text-tertiary: hsl(215, 8%, 45%);
    
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-shadow-hover: 0 12px 40px 0 rgba(108, 92, 231, 0.15);
    --glass-blur: blur(12px);
}

/* --- Light Theme Variables --- */
.light-theme {
    --bg-app: hsl(210, 20%, 96%);
    --bg-sidebar: hsl(0, 0%, 100%);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --bg-input: hsl(210, 20%, 98%);
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-glow: hsla(260, 95%, 68%, 0.15);
    
    --text-primary: hsl(225, 25%, 12%);
    --text-secondary: hsl(225, 12%, 45%);
    --text-tertiary: hsl(225, 8%, 65%);
    
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 16px 40px rgba(108, 92, 231, 0.08);
    --glass-blur: blur(12px);
}

/* --- Base Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* --- Core Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar Styling --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-brand), var(--color-teal));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px var(--color-brand-glow);
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.menu-item {
    background: none;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    width: 100%;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
}

.menu-item i {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.menu-item:hover i {
    transform: translateX(3px);
}

.menu-item.active {
    color: white;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-dark));
    box-shadow: 0 4px 15px var(--color-brand-glow);
}

.menu-item.active i {
    color: white;
}

.menu-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 16px 12px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    width: 100%;
}

.status-badge.connected {
    background-color: hsla(140, 80%, 40%, 0.1);
    color: hsl(140, 80%, 45%);
    border: 1px solid hsla(140, 80%, 40%, 0.2);
}

.status-badge.disconnected {
    background-color: hsla(0, 80%, 50%, 0.1);
    color: hsl(0, 80%, 55%);
    border: 1px solid hsla(0, 80%, 50%, 0.2);
}

.status-badge.demo {
    background-color: hsla(45, 95%, 50%, 0.1);
    color: hsl(45, 95%, 50%);
    border: 1px solid hsla(45, 95%, 50%, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
    box-shadow: 0 0 6px currentColor;
}

/* --- Main Layout --- */
.main-content {
    flex-grow: 1;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
    max-height: 100vh;
}

/* --- Header Styling --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.header h2 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-brand-glow);
}

.theme-toggle i {
    width: 18px;
    height: 18px;
}

.dark-theme .theme-toggle .moon-icon { display: none; }
.light-theme .theme-toggle .sun-icon { display: none; }

.active-config-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Beautiful Card UI (Glassmorphic) --- */
.card {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    padding: 24px;
    transition: var(--transition-smooth);
}

.card:hover {
    background-color: var(--bg-card-hover);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-color-glow);
}

.card-header {
    margin-bottom: 20px;
}

.card-header h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.card-header.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Buttons System --- */
.btn {
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-dark));
    color: white;
    box-shadow: 0 4px 15px var(--color-brand-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--color-brand-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn-text {
    background: none;
    border: none;
    color: var(--color-brand);
    padding: 4px 8px;
    font-size: 0.85rem;
}

.btn-text:hover {
    color: white;
    background-color: var(--color-brand-glow);
}

/* Loading/Rotating animation on sync */
.btn-sync i.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- KPI Dashboard --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
}

.kpi-icon-container {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.kpi-icon-container i {
    width: 22px;
    height: 22px;
}

.bg-clicks {
    background: linear-gradient(135deg, var(--color-brand), hsl(260, 95%, 55%));
    box-shadow: 0 4px 12px var(--color-brand-glow);
}
.bg-impressions {
    background: linear-gradient(135deg, var(--color-teal), hsl(175, 90%, 35%));
    box-shadow: 0 4px 12px var(--color-teal-glow);
}
.bg-position {
    background: linear-gradient(135deg, var(--color-gold), hsl(45, 95%, 40%));
    box-shadow: 0 4px 12px var(--color-gold-glow);
}
.bg-users {
    background: linear-gradient(135deg, var(--color-blue), hsl(210, 100%, 45%));
    box-shadow: 0 4px 12px var(--color-blue-glow);
}
.bg-sessions {
    background: linear-gradient(135deg, var(--color-coral), hsl(15, 95%, 50%));
    box-shadow: 0 4px 12px var(--color-coral-glow);
}
.bg-views {
    background: linear-gradient(135deg, hsl(325, 95%, 60%), hsl(325, 95%, 50%));
    box-shadow: 0 4px 12px hsla(325, 95%, 60%, 0.35);
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.kpi-subtext {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* --- Layout Grids --- */
.chart-double-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.grid-three-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.grid-two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* --- Simple Lists --- */
.simple-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simple-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.simple-list li:hover {
    transform: translateX(4px);
    border-color: var(--border-color-glow);
}

.list-item-title {
    font-weight: 500;
    font-size: 0.85rem;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-value {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-brand);
}

.centered-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* --- Dynamic Theme Config Forms --- */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-brand-glow);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.form-group small {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* --- Setup Guide Layout --- */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.step-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.step-num {
    width: 28px;
    height: 28px;
    background-color: var(--color-brand-glow);
    color: var(--color-brand);
    border: 1px solid var(--color-brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-text h5 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.step-text ul {
    list-style: none;
    margin-top: 6px;
    padding-left: 4px;
}

.step-text ul li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.text-important {
    color: var(--color-coral) !important;
    font-weight: 600;
}

code {
    background-color: var(--bg-input);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    font-family: monospace;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* --- Onboarding Welcome Card --- */
.onboarding-card {
    background: linear-gradient(135deg, hsla(260, 85%, 20%, 0.25), hsla(175, 80%, 20%, 0.15));
    border-color: hsla(260, 80%, 65%, 0.2);
}

.onboarding-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    align-items: center;
    gap: 32px;
}

.onboarding-text h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.onboarding-text p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.onboarding-actions {
    margin-top: 24px;
    display: flex;
    gap: 16px;
}

.onboarding-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
}

.graphic-element {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--color-brand-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--color-brand-glow);
}

.large-icon {
    width: 48px;
    height: 48px;
    color: var(--color-brand);
}

.animate-pulse {
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* --- Table styling --- */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 280px;
}

.table-search-box i {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

.table-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.table-search-box input:focus {
    border-color: var(--color-brand);
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-input);
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--bg-input);
}

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-brand { color: var(--color-brand); }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

/* --- Special Engagement View (GA4 Metrics Circles) --- */
.flex-col-justify-center {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flex-grow-1 { flex-grow: 1; }
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.metrics-engagement-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    padding: 20px 0;
}

.engagement-metric-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-brand), var(--color-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px var(--color-brand-glow);
    padding: 4px;
    animation: orbit 10s linear infinite;
}

.circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.circle-inner h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.circle-inner span {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 2px;
}

.engagement-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: 320px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.stat-item h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-teal);
}

/* --- Notifications & Alert UI --- */
#alert-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--card-shadow);
    animation: slideIn 0.3s ease forwards;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: hsla(140, 80%, 40%, 0.15);
    color: hsl(140, 80%, 45%);
    border: 1px solid hsla(140, 80%, 40%, 0.3);
}

.alert-danger {
    background-color: hsla(0, 80%, 50%, 0.15);
    color: hsl(0, 80%, 55%);
    border: 1px solid hsla(0, 80%, 50%, 0.3);
}

.alert-close {
    cursor: pointer;
    background: none;
    border: none;
    color: currentColor;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* --- Tab Transitions --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    .sidebar-brand {
        padding-bottom: 12px;
        border-bottom: none;
    }
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 12px;
        gap: 6px;
    }
    .menu-item {
        width: auto;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .menu-separator {
        display: none;
    }
    .main-content {
        padding: 24px;
        max-height: none;
        overflow-y: visible;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
    .chart-double-column {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   SERP RANK TRACKER & MODALS (SERPBEAR COMPATIBILITY)
   ========================================================================== */

/* --- Serp Ranking Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: hsla(140, 80%, 40%, 0.15);
    color: hsl(140, 80%, 45%);
}

.badge-danger {
    background-color: hsla(0, 80%, 50%, 0.15);
    color: hsl(0, 80%, 55%);
}

.badge-neutral {
    background-color: var(--bg-input);
    color: var(--text-secondary);
}

/* --- Modal Overlay & Dialog Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color-glow);
    animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.modal-close-btn {
    background: none;
    border: none;
    outline: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.modal-close-btn i {
    width: 20px;
    height: 20px;
}

/* Sparkline containers */
.serp-sparkline {
    min-height: 30px;
    display: flex;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Premium V1.3 Channel Acquisition Center Styles --- */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.channel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.channel-card:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-color-glow);
    transform: translateY(-2px);
}

.channel-card.active-channel {
    background-color: hsla(250, 60%, 15%, 0.15);
    border-color: var(--color-brand);
    box-shadow: 0 4px 20px rgba(140, 122, 230, 0.25);
}

.channel-card.active-channel::before {
    background-color: var(--color-brand);
}

.channel-card.active-channel-cpc {
    background-color: rgba(0, 206, 201, 0.05);
    border-color: var(--color-teal);
}
.channel-card.active-channel-cpc::before {
    background-color: var(--color-teal);
}

.channel-card.active-channel-organic {
    background-color: rgba(140, 122, 230, 0.05);
    border-color: var(--color-brand);
}
.channel-card.active-channel-organic::before {
    background-color: var(--color-brand);
}

.channel-card.active-channel-social {
    background-color: rgba(253, 150, 68, 0.05);
    border-color: var(--color-gold);
}
.channel-card.active-channel-social::before {
    background-color: var(--color-gold);
}

.channel-card.active-channel-direct {
    background-color: rgba(69, 170, 242, 0.05);
    border-color: var(--color-blue);
}
.channel-card.active-channel-direct::before {
    background-color: var(--color-blue);
}

.channel-card.active-channel-ai {
    background-color: rgba(32, 191, 107, 0.05);
    border-color: #20bf6b;
}
.channel-card.active-channel-ai::before {
    background-color: #20bf6b;
}

.channel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-card-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.channel-card-metric {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.channel-card-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.channel-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-card-icon i {
    width: 14px;
    height: 14px;
}

