/* CSS Variables - Bold Minimal Design System */
:root {
    /* Primary Brand Colors - Refined */
    --blue-primary: #0052CC;
    --blue-accent: #2684FF;
    --blue-light: #DEEBFF;
    --blue-dark: #003D99;
    
    --yellow-primary: #FFAB00;
    --yellow-light: #FFF0B3;
    --yellow-dark: #FF991F;
    
    --red-primary: #DE350B;
    --red-light: #FFEBE6;
    --red-dark: #BF2600;
    
    /* Neutral Palette */
    --white: #FFFFFF;
    --surface: #FAFBFC;
    --surface-raised: #FFFFFF;
    --surface-hover: #F4F5F7;
    --border-subtle: #DFE1E6;
    --border-medium: #C1C7D0;
    
    /* Text Colors */
    --text-primary: #172B4D;
    --text-secondary: #5E6C84;
    --text-tertiary: #97A0AF;
    --text-inverse: #FFFFFF;
    
    /* Semantic Colors */
    --success: #00875A;
    --success-light: #E3FCEF;
    --warning: #FF991F;
    --warning-light: #FFFAE6;
    --error: #DE350B;
    --error-light: #FFEBE6;
    
    /* Shadows - Subtle and Modern */
    --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.08);
    --shadow-md: 0 4px 8px -2px rgba(9, 30, 66, 0.08), 0 0 0 1px rgba(9, 30, 66, 0.04);
    --shadow-lg: 0 8px 16px -4px rgba(9, 30, 66, 0.12), 0 0 0 1px rgba(9, 30, 66, 0.04);
    --shadow-xl: 0 16px 32px -8px rgba(9, 30, 66, 0.16), 0 0 0 1px rgba(9, 30, 66, 0.04);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* =====================================================
   LOGIN SCREEN - Bold Minimal
   ===================================================== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.login-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

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

.login-branding {
    margin-bottom: var(--space-lg);
}

.login-logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto;
}

.login-container h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-xl);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-form input[type="password"] {
    padding: 14px 16px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
    background: var(--surface);
}

.login-form input[type="password"]:focus {
    border-color: var(--blue-primary);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--blue-light);
}

.login-button {
    padding: 14px 28px;
    background: var(--blue-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-button:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.login-button:active {
    transform: translateY(0);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    min-height: 20px;
    text-align: center;
}

/* =====================================================
   DASHBOARD LAYOUT
   ===================================================== */
.dashboard {
    min-height: 100vh;
    background: var(--surface);
}

/* =====================================================
   HEADER - Dark Top Bar with Logos
   ===================================================== */
.dashboard-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Dark logo bar at top */
.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-md) var(--space-xl);
    background: var(--text-primary);
}

.header-logo {
    max-height: 48px;
    width: auto;
}

.criste-logo {
    max-height: 44px;
}

.client-logo {
    max-height: 56px;
}

.header-content {
    text-align: center;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.title-row {
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.dashboard .title-row .logout-button {
    position: absolute;
    right: var(--space-xl);
}

.dashboard .header-content {
    position: relative;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.month-selector label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.date-range-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.month-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235E6C84' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.month-select:hover {
    border-color: var(--blue-primary);
}

.month-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 2px var(--blue-light);
}

/* =====================================================
   SECTIONS
   ===================================================== */
section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    letter-spacing: -0.01em;
}

/* =====================================================
   EXECUTIVE SUMMARY CARDS
   ===================================================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.summary-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    border: 1px solid var(--border-subtle);
}

.summary-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Accent borders - left side only */
.card-reach {
    border-left: 4px solid var(--blue-primary);
}

.card-engagement {
    border-left: 4px solid var(--yellow-primary);
}

.card-platform {
    border-left: 4px solid var(--red-primary);
}

.card-highlights {
    border-left: 4px solid var(--success);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
}

.card-reach .card-icon {
    background: var(--blue-light);
    color: var(--blue-primary);
}

.card-engagement .card-icon {
    background: var(--yellow-light);
    color: var(--yellow-dark);
}

.card-platform .card-icon {
    background: var(--red-light);
    color: var(--red-primary);
}

.card-highlights .card-icon {
    background: var(--success-light);
    color: var(--success);
}

.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.card-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.card-change {
    font-size: 0.875rem;
    font-weight: 600;
}

.card-change.positive {
    color: var(--success);
}

.card-change.negative {
    color: var(--error);
}

.card-change.seasonal {
    color: var(--text-secondary);
}

.seasonal-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seasonal-context {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #6366f1;
    border-radius: 0 8px 8px 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.highlights-list {
    list-style: none;
    margin-top: var(--space-sm);
}

.highlights-list li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-lg);
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.highlights-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.card-metrics {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.metric-item-small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-mini-chart {
    height: 64px;
    margin-top: var(--space-sm);
}

.card-mini-chart canvas {
    max-height: 64px;
}

.card-click-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
    text-align: center;
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover .card-click-hint {
    color: var(--blue-primary);
}

/* =====================================================
   PLATFORM CARDS
   ===================================================== */
.platforms-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.platform-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.platform-card:hover {
    box-shadow: var(--shadow-lg);
}

.platform-card-header {
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: var(--white);
    transition: all var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.platform-card-header:hover {
    background: var(--surface-hover);
}

.platform-card-header.expanded {
    border-bottom-color: var(--border-subtle);
}

.platform-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.platform-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-svg-icon {
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.platform-card:hover .platform-svg-icon {
    color: var(--blue-primary);
}

.platform-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.platform-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.platform-badge {
    background: var(--blue-light);
    color: var(--blue-primary);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.platform-toggle {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1rem;
    cursor: pointer;
    padding: var(--space-sm);
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.platform-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.platform-card-header.expanded .platform-toggle {
    transform: rotate(0deg);
}

.platform-card-header:not(.expanded) .platform-toggle {
    transform: rotate(-90deg);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

/* Platform Card Content */
.platform-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
}

.platform-card-content.expanded {
    max-height: 8000px;
    padding: var(--space-xl);
    transition: max-height 0.8s ease-in-out;
}

/* Platform Tabs */
.platform-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.platform-tab {
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.platform-tab:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.platform-tab.active {
    color: var(--blue-primary);
    background: var(--blue-light);
}

.platform-tab.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue-primary);
    border-radius: 2px;
}

.tab-content {
    display: none;
}

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

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

/* Platform Metrics */
.platform-metrics {
    margin-bottom: var(--space-xl);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
}

.metric-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.metric-item:hover {
    background: var(--white);
    border-color: var(--border-subtle);
    transform: translateY(-1px);
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.metric-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.metric-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--error);
}

/* Platform Charts */
.platform-chart-container {
    margin-top: var(--space-xl);
    height: 280px;
    position: relative;
}

.platform-chart {
    max-height: 280px;
}

/* =====================================================
   INSIGHTS SECTION
   ===================================================== */
.platform-insights-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

.insights-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.insights-toggle-header:hover {
    background: var(--surface-hover);
}

.insights-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.insights-toggle-icon {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
}

.insights-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.insights-content.expanded {
    max-height: 1000px;
    padding: var(--space-md) 0;
}

.insights-list,
.recommendations-list {
    margin-top: var(--space-md);
}

.insights-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.insight-item,
.recommendation-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    padding-left: var(--space-md);
    position: relative;
}

.insight-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: 50%;
}

.recommendation-item {
    color: var(--success);
}

.recommendation-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: var(--success);
    border-radius: 50%;
}

/* =====================================================
   NEXT STEPS SECTION
   ===================================================== */
.next-steps-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.next-steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.next-step-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    border-left-width: 4px;
    transition: all var(--transition-normal);
}

.next-step-card.priority-high {
    border-left-color: var(--error);
}

.next-step-card.priority-medium {
    border-left-color: var(--warning);
}

.next-step-card.priority-low {
    border-left-color: var(--blue-primary);
}

.next-step-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.next-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.next-step-platform {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.priority-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.priority-badge.priority-high {
    background: var(--error-light);
    color: var(--error);
}

.priority-badge.priority-medium {
    background: var(--warning-light);
    color: var(--yellow-dark);
}

.priority-badge.priority-low {
    background: var(--blue-light);
    color: var(--blue-primary);
}

.next-step-items {
    list-style: none;
}

.next-step-items li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-lg);
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.next-step-items li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* =====================================================
   DASHBOARD TAB BAR
   ===================================================== */
.dashboard-tab-bar {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-xl);
    background: var(--white);
    border-bottom: 2px solid var(--border-subtle);
    justify-content: center;
}

.dashboard-tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.dashboard-tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.dashboard-tab-btn.active {
    color: var(--blue-primary);
    background: var(--blue-light);
}

.dashboard-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue-primary);
}

.dashboard-tab-content {
    animation: fadeIn 0.3s ease;
}

.dashboard-tab-content.hidden {
    display: none;
}

.tab-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

/* =====================================================
   ACTION MENU TAB
   ===================================================== */
.action-menu-tab-section {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.am-form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: var(--space-lg);
}

.am-form-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.am-count {
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--blue-light);
    color: var(--blue-primary);
    padding: 2px 10px;
    border-radius: 100px;
}

.am-form-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.am-select-row {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    flex-wrap: wrap;
}

.am-select {
    flex: 1;
    min-width: 200px;
}

.am-custom-input {
    flex: 1;
    min-width: 200px;
}

.am-add-btn {
    padding: 8px 24px;
    white-space: nowrap;
}

.am-empty-state {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-align: center;
    padding: var(--space-xl);
    font-style: italic;
}

/* Priority List */
.priority-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.priority-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.priority-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.priority-rank {
    width: 28px;
    height: 28px;
    background: var(--blue-primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.priority-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.priority-controls {
    display: flex;
    gap: var(--space-xs);
}

.priority-control-btn {
    background: var(--white);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.priority-control-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.priority-control-btn.remove {
    color: var(--error);
}

.priority-control-btn.remove:hover {
    background: var(--error-light);
    border-color: var(--error);
}

.am-save-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    justify-content: center;
}

.am-save-status {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--success);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.am-save-status.visible {
    opacity: 1;
}

/* =====================================================
   GEOFENCING TAB
   ===================================================== */
.geo-tab-section {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

.geo-form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: var(--space-lg);
}

.geo-form-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.geo-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-hint-inline {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.geo-custom-type {
    margin-top: var(--space-xs);
}

.geo-custom-type.hidden {
    display: none;
}

/* URL link rows */
.geo-url-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.geo-url-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.geo-url-input {
    flex: 1;
}

.geo-url-remove {
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--error);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.geo-url-remove:hover {
    background: var(--error-light);
    border-color: var(--error);
}

.geo-url-remove.hidden {
    display: none;
}

.geo-add-url-btn {
    background: none;
    border: none;
    color: var(--blue-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: var(--space-xs) 0;
    transition: color var(--transition-fast);
}

.geo-add-url-btn:hover {
    color: var(--blue-dark);
}

.geo-submit-row {
    margin-top: var(--space-lg);
    text-align: center;
}

/* Submitted events */
.geo-submitted-section {
    margin-top: var(--space-lg);
}

.geo-events-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.geo-event-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--blue-primary);
    position: relative;
}

.geo-event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.geo-event-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.geo-event-type-badge {
    background: var(--blue-light);
    color: var(--blue-primary);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.geo-event-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xs) var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.geo-event-label {
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    padding-top: 2px;
}

.geo-event-value {
    color: var(--text-primary);
}

.geo-event-value a {
    color: var(--blue-primary);
    text-decoration: none;
    word-break: break-all;
}

.geo-event-value a:hover {
    text-decoration: underline;
}

.geo-event-delete {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.geo-event-delete:hover {
    color: var(--error);
    background: var(--error-light);
}

/* =====================================================
   ADMIN SUBMISSIONS
   ===================================================== */
.admin-submissions-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.admin-sub-month {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.admin-sub-month-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.admin-sub-section {
    margin-bottom: var(--space-lg);
}

.admin-sub-section:last-child {
    margin-bottom: 0;
}

.admin-sub-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-md);
}

.admin-sub-priority-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.admin-sub-priority {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.admin-sub-rank {
    width: 22px;
    height: 22px;
    background: var(--blue-primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-sub-custom {
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.6;
    border-left: 3px solid var(--blue-primary);
}

.admin-sub-timestamp {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
    font-style: italic;
}

.admin-sub-event {
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border-left: 3px solid var(--yellow-primary);
}

.admin-sub-event-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.admin-sub-event-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =====================================================
   SUBMIT BUTTON (shared)
   ===================================================== */
.submit-button {
    padding: 12px 32px;
    background: var(--blue-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.submit-button:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.submit-button:active {
    transform: translateY(0);
}

/* =====================================================
   FOOTER
   ===================================================== */
.dashboard-footer {
    background: var(--white);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-2xl);
}

.dashboard-footer p {
    margin: var(--space-xs) 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dashboard-footer strong {
    color: var(--blue-primary);
    font-weight: 600;
}

.footer-note {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* =====================================================
   MODAL STYLES
   ===================================================== */

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: rgba(9, 30, 66, 0.54);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    padding: var(--space-lg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overscroll-behavior: contain;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    max-height: 85dvh; /* Dynamic viewport height for mobile */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    overscroll-behavior: contain;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
    touch-action: pan-y; /* Allow vertical scrolling within modal */
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: var(--space-xl);
}

.breakdown-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.breakdown-chart-container {
    height: 280px;
    position: relative;
}

.breakdown-chart-container canvas {
    max-height: 280px;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.breakdown-item {
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.breakdown-item:hover {
    background: var(--surface-hover);
}

.breakdown-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.breakdown-platform-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.breakdown-platform-value {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.breakdown-item-bar {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.breakdown-item-fill {
    height: 100%;
    background: var(--blue-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.breakdown-item-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.breakdown-item-percentage {
    font-weight: 500;
}

.breakdown-item-rate {
    color: var(--success);
    font-weight: 600;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .login-container {
        padding: var(--space-xl);
    }

    .login-container h1 {
        font-size: 1.5rem;
    }

    .login-logo {
        max-width: 140px;
    }

    .dashboard-header {
        padding: var(--space-md);
    }

    .header-logos {
        gap: var(--space-md);
        margin-bottom: var(--space-sm);
    }

    .header-logo {
        max-height: 40px;
    }

    .criste-logo {
        max-height: 36px;
    }

    .client-logo {
        max-height: 44px;
    }

    .dashboard-title {
        font-size: 1.375rem;
    }

    .month-selector {
        flex-direction: column;
        gap: var(--space-sm);
    }

    section {
        padding: var(--space-xl) var(--space-md);
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: var(--space-lg);
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .summary-card {
        padding: var(--space-lg);
    }

    .card-value {
        font-size: 1.75rem;
    }

    .platform-card-header {
        padding: var(--space-md) var(--space-lg);
    }

    .platform-name {
        font-size: 1rem;
    }

    .platform-card-content.expanded {
        padding: var(--space-lg);
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .metric-item {
        padding: var(--space-sm);
    }

    .metric-value {
        font-size: 1.125rem;
    }

    .platform-chart-container {
        height: 220px;
    }

    .next-steps-container {
        grid-template-columns: 1fr;
    }

    .dashboard-tab-bar {
        padding: var(--space-sm) var(--space-md);
    }

    .dashboard-tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }

    .am-select-row {
        flex-direction: column;
    }

    .am-select,
    .am-custom-input {
        min-width: 100%;
    }

    .geo-form-grid {
        grid-template-columns: 1fr;
    }

    /* Modal styles for tablets */
    .modal-overlay {
        padding: var(--space-md);
    }

    .modal-content {
        max-width: 90%;
        max-height: 85vh;
        max-height: 85dvh;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .header-logos {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .dashboard .title-row .logout-button {
        position: static;
    }

    .dashboard .title-row {
        flex-wrap: wrap;
    }

    .month-selector {
        width: 100%;
    }

    .month-select {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .platform-header-right {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-end;
    }

    /* Mobile modal fixes */
    .modal-overlay {
        padding: var(--space-sm);
        align-items: flex-start;
        padding-top: env(safe-area-inset-top, var(--space-md));
        padding-bottom: env(safe-area-inset-bottom, var(--space-md));
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        margin: 0;
        border-radius: var(--radius-lg);
        margin-top: var(--space-md);
    }

    .modal-header {
        padding: var(--space-md);
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-close {
        width: 44px;
        height: 44px;
        font-size: 1.75rem;
        min-width: 44px;
        min-height: 44px;
    }

    .modal-body {
        padding: var(--space-md);
    }

    .breakdown-chart-container {
        height: 200px;
    }

    .breakdown-chart-container canvas {
        max-height: 200px;
    }
}

/* =====================================================
   ANIMATIONS - Page Load
   ===================================================== */
@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-card {
    animation: staggerFadeIn 0.5s ease-out backwards;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.2s; }
.summary-card:nth-child(3) { animation-delay: 0.3s; }
.summary-card:nth-child(4) { animation-delay: 0.4s; }

.platform-card {
    animation: staggerFadeIn 0.5s ease-out backwards;
}

.platform-card:nth-child(1) { animation-delay: 0.15s; }
.platform-card:nth-child(2) { animation-delay: 0.25s; }
.platform-card:nth-child(3) { animation-delay: 0.35s; }
.platform-card:nth-child(4) { animation-delay: 0.45s; }
.platform-card:nth-child(5) { animation-delay: 0.55s; }

.next-step-card {
    animation: staggerFadeIn 0.5s ease-out backwards;
}

.next-step-card:nth-child(1) { animation-delay: 0.1s; }
.next-step-card:nth-child(2) { animation-delay: 0.2s; }
.next-step-card:nth-child(3) { animation-delay: 0.3s; }
.next-step-card:nth-child(4) { animation-delay: 0.4s; }
.next-step-card:nth-child(5) { animation-delay: 0.5s; }
.next-step-card:nth-child(6) { animation-delay: 0.6s; }

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .login-screen,
    .dashboard-footer,
    .platform-toggle,
    .modal-overlay,
    .dashboard-tab-bar {
        display: none !important;
    }

    .dashboard {
        background: var(--white);
    }

    .summary-card,
    .platform-card,
    .next-step-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-medium);
    }

    .platform-card-content {
        max-height: none !important;
        padding: var(--space-lg) !important;
    }
}

/* =====================================================
   ADMIN PANEL STYLES
   ===================================================== */
.admin-panel {
    min-height: 100vh;
    background: var(--surface);
}

.admin-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-md) var(--space-xl);
    background: var(--text-primary);
}

.admin-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.admin-header .title-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: 0;
}

.admin-badge {
    background: var(--blue-primary);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logout-button {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--white);
    border-bottom: 1px solid var(--border-subtle);
}

.admin-nav-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-nav-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.admin-nav-btn.active {
    background: var(--blue-light);
    color: var(--blue-primary);
}

/* Admin Tab Content */
.admin-tab-content {
    padding: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.admin-tab-content.hidden {
    display: none;
}

/* Months List */
.months-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.month-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.month-item:hover {
    box-shadow: var(--shadow-md);
}

.month-item.latest {
    border-left: 4px solid var(--blue-primary);
}

.month-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.month-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.latest-badge {
    background: var(--blue-light);
    color: var(--blue-primary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.month-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Admin Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.admin-btn.primary {
    background: var(--blue-primary);
    color: var(--white);
}

.admin-btn.primary:hover {
    background: var(--blue-dark);
}

.admin-btn.secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.admin-btn.secondary:hover {
    background: var(--surface-hover);
}

.admin-btn.small {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-icon {
    font-size: 1rem;
}

/* Quick Actions */
.admin-quick-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

/* JSON Generator Form */
.json-generator {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

/* Form Sections */
.form-section {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.form-subsection-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: var(--space-lg) 0 var(--space-sm);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group.flex-2 {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px var(--blue-light);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-textarea {
    padding: var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--white);
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px var(--blue-light);
}

/* Platform Tabs */
.platform-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.platform-tab-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.platform-tab-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.platform-tab-btn.active {
    background: var(--blue-primary);
    color: var(--white);
    border-color: var(--blue-primary);
}

.platform-form {
    padding: var(--space-lg);
    background: var(--surface);
    border-radius: var(--radius-md);
}

.platform-form.hidden {
    display: none;
}

/* =====================================================
   CHART TABS (Views/Engagement Separation)
   ===================================================== */
.chart-tabs-container {
    margin-top: var(--space-md);
}

.chart-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.chart-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.chart-tab:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.chart-tab.active {
    color: var(--blue-primary);
    background: var(--blue-light);
}

.chart-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue-primary);
    border-radius: 2px 2px 0 0;
}

.chart-tab-content {
    display: none;
}

.chart-tab-content.active {
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

/* JSON Preview */
.json-preview {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.json-preview.hidden {
    display: none;
}

.json-code {
    background: var(--text-primary);
    color: var(--success-light);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: var(--space-md);
}

/* Help Content */
.help-content {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.help-section {
    margin-bottom: var(--space-xl);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.help-steps {
    list-style-position: inside;
    color: var(--text-secondary);
    line-height: 1.8;
}

.help-steps li {
    margin-bottom: var(--space-sm);
}

.help-steps code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--blue-primary);
}

.help-note {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: var(--space-sm);
}

.error-text {
    color: var(--error);
    padding: var(--space-lg);
    text-align: center;
}

.no-data {
    color: var(--text-tertiary);
    padding: var(--space-xl);
    text-align: center;
}

/* =====================================================
   AD SPEND BANNER
   ===================================================== */
.ad-spend-banner {
    margin-top: var(--space-lg);
}

.ad-spend-content {
    background: linear-gradient(135deg, #172B4D 0%, #0052CC 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.ad-spend-total {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ad-spend-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-spend-value {
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.ad-spend-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
}

.ad-spend-change.positive {
    background: rgba(0, 135, 90, 0.2);
    color: #36B37E;
}

.ad-spend-change.negative {
    background: rgba(222, 53, 11, 0.2);
    color: #FF5630;
}

.ad-spend-breakdown {
    display: flex;
    gap: var(--space-lg);
}

.ad-spend-item {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
}

.ad-spend-item strong {
    color: var(--white);
    font-weight: 600;
}

/* =====================================================
   ACTION EXPORT CONTROLS
   ===================================================== */
.action-export-controls {
    margin-top: var(--space-lg);
    text-align: center;
}

.secondary-btn {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.secondary-btn:hover {
    background: var(--surface-hover);
}

/* =====================================================
   DEEP DIVE SECTIONS
   ===================================================== */
.deep-dive-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.dd-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dd-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Row-based visualizations (progress bars) */
.dd-row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.dd-row-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dd-ts-label {
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.dd-row-bar-wrap {
    height: 8px;
    background: var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.dd-row-bar {
    height: 100%;
    background: var(--blue-primary);
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.dd-row-values {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.dd-pct {
    color: var(--text-tertiary);
    font-weight: 600;
}

.dd-ts-events {
    color: var(--success);
    font-weight: 600;
    font-size: 0.75rem;
}

/* Split bar (follower/non-follower) */
.dd-split-bar {
    display: flex;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 36px;
    margin-bottom: var(--space-md);
}

.dd-split-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white);
    padding: 0 var(--space-sm);
    min-width: 0;
    overflow: hidden;
}

.dd-fill-primary {
    background: var(--blue-primary);
}

.dd-fill-secondary {
    background: var(--yellow-dark);
}

/* Metric pairs / boxes */
.dd-metric-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.dd-metric-box {
    text-align: center;
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.dd-metric-box.dd-metric-highlight {
    border-color: var(--blue-primary);
    background: var(--blue-light);
}

.dd-metric-val {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dd-metric-lbl {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: var(--space-xs);
}

/* Benchmark bar */
.dd-benchmark {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
}

.dd-benchmark-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.dd-benchmark-bar {
    height: 8px;
    background: var(--border-subtle);
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.dd-benchmark-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
}

.dd-benchmark-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 16px;
    background: var(--error);
    border-radius: 1px;
}

.dd-benchmark-note {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    margin-top: var(--space-sm);
}

/* Additional metrics grid */
.dd-am-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-sm);
}

.dd-am-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

.dd-am-label {
    color: var(--text-secondary);
    flex: 1;
    font-weight: 500;
}

.dd-am-val {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
}

.dd-am-change {
    font-size: 0.75rem;
    font-weight: 600;
}

.dd-am-change.positive { color: var(--success); }
.dd-am-change.negative { color: var(--error); }

/* Tags (search queries) */
.dd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.dd-tag {
    background: var(--surface);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-md);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-subtle);
}

/* Tables */
.dd-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.dd-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-subtle);
    white-space: nowrap;
}

.dd-table td {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.dd-table tbody tr:hover {
    background: var(--surface-hover);
}

.dd-kw-name {
    font-weight: 600;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ad breakdown cards */
.dd-ad-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-subtle);
}

.dd-ad-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.dd-ad-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: var(--space-sm);
}

.dd-ad-stat {
    text-align: center;
}

.dd-ad-val {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dd-ad-lbl {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Biggest changes */
.dd-changes {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.dd-change-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

.dd-change-item.positive {
    background: var(--success-light);
}

.dd-change-item.negative {
    background: var(--error-light);
}

.dd-change-name {
    font-weight: 500;
    color: var(--text-primary);
}

.dd-change-val {
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
}

.dd-change-item.positive .dd-change-val { color: var(--success); }
.dd-change-item.negative .dd-change-val { color: var(--error); }

/* Network distribution */
.dd-network-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    font-size: 0.8rem;
}

.dd-network-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dd-network-stats {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Device distribution stacked bars */
.dd-device-row {
    margin-bottom: var(--space-md);
}

.dd-device-metric {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-xs);
}

.dd-device-bars {
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 28px;
}

.dd-device-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--white);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 4px;
}

.dd-device-segment:nth-child(1) { background: var(--blue-primary); }
.dd-device-segment:nth-child(2) { background: var(--yellow-dark); }
.dd-device-segment:nth-child(3) { background: var(--success); }

/* Demographics */
.dd-demo-group {
    margin-bottom: var(--space-md);
}

.dd-demo-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.dd-demo-bar-item {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    align-items: center;
    gap: var(--space-sm);
}

.dd-demo-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Top content items */
.dd-content-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-subtle);
}

.dd-content-rank {
    width: 28px;
    height: 28px;
    background: var(--blue-primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dd-content-info {
    flex: 1;
    min-width: 0;
}

.dd-content-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.dd-content-stats {
    display: flex;
    gap: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Viewer activity */
.dd-activity-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.dd-activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

.dd-activity-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.dd-activity-val {
    font-weight: 500;
    color: var(--text-primary);
}

/* =====================================================
   DEEP DIVE RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .dd-row {
        grid-template-columns: 100px 1fr auto;
        gap: var(--space-sm);
    }

    .dd-metric-pair {
        grid-template-columns: repeat(2, 1fr);
    }

    .dd-ad-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dd-split-fill span {
        font-size: 0.6rem;
    }

    .ad-spend-content {
        flex-direction: column;
        text-align: center;
    }

    .ad-spend-total {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .ad-spend-breakdown {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .dd-demo-bar-item {
        grid-template-columns: 70px 1fr 45px;
    }
}

@media (max-width: 480px) {
    .dd-row {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }

    .dd-row-label {
        white-space: normal;
    }

    .dd-metric-pair {
        grid-template-columns: 1fr;
    }

    .dd-am-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Responsive */
@media (max-width: 768px) {
    .admin-header .header-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-tab-content {
        padding: var(--space-md);
    }

    .admin-quick-actions {
        flex-direction: column;
    }

    .admin-quick-actions .admin-btn {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group.flex-2 {
        grid-column: span 1;
    }

    .month-item {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .month-actions {
        width: 100%;
        justify-content: center;
    }
}
