* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==================== Material Icons Utility Classes ==================== */
.material-icons-outlined {
    font-size: 20px;
    vertical-align: middle;
    line-height: 1;
    color: inherit;
    transition: color 0.15s ease;
}
.nav-icon .material-icons-outlined { font-size: 22px; }
.feature-icon .material-icons-outlined { font-size: 36px; }
.preset-icon .material-icons-outlined { font-size: 18px; }
.quick-action-icon .material-icons-outlined { font-size: 18px; }
.alert-icon .material-icons-outlined { font-size: 20px; }
.interaction-icon .material-icons-outlined { font-size: 16px; }
.btn-icon .material-icons-outlined { font-size: 20px; }
.tree-node-icon .material-icons-outlined { font-size: 16px; }
.batch-result-icon .material-icons-outlined { font-size: 18px; }
.batch-queue-icon .material-icons-outlined { font-size: 18px; }

/* ==================== Van Gogh Theme System ==================== */
/* Single light theme — Canvas and warm tones, mature Van Gogh 2026 */
:root {
    /* Primary backgrounds — Van Gogh canvas */
    --bg-primary: #f5f5dc;         /* Canvas cream */
    --bg-secondary: #fafafa;
    --bg-tertiary: #ffffff;

    /* Accent colors — Van Gogh palette */
    --accent-primary: #f9a825;     /* Darker sunflower */
    --accent-primary-hover: #fbc02d;
    --accent-secondary: #33691e;   /* Darker cypress */
    --accent-secondary-hover: #558b2f;
    --accent-warm: #e65100;        /* Warm cafe orange */

    /* Text colors */
    --text-primary: #1a237e;       /* Deep blue text */
    --text-secondary: #3949ab;
    --text-muted: #5c6bc0;

    /* Semantic colors */
    --success-color: #2e7d32;
    --warning-color: #f9a825;
    --danger-color: #c62828;

    /* UI colors */
    --border-color: #e0e0e0;
    --border-color-light: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-overlay: rgba(0, 0, 0, 0.04);

    /* Legacy variable mapping */
    --primary-color: var(--accent-primary);
    --primary-hover: var(--accent-primary-hover);
    --accent-color: var(--accent-primary);
    --accent-hover: var(--accent-primary-hover);
    --secondary-color: var(--text-muted);
    --secondary-hover: var(--text-secondary);
    --bg-color: var(--bg-secondary);
    --card-bg: var(--bg-tertiary);
    --text-color: var(--text-primary);

    /* Status colors */
    --status-hidden: #c62828;
    --status-visible: #2e7d32;
    --status-default: #616161;
    --status-mixed: #e65100;

    /* Sidebar — keeps deep blue (Starry Night canvas) */
    --sidebar-bg: linear-gradient(180deg, #1a237e 0%, #283593 100%);
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 60px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Border radius — 2026 soft rounded trend */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Extended Van Gogh palette — Mature period */
    --vg-iris-violet: #7b1fa2;
    --vg-rhone-cobalt: #1976d2;
    --vg-wheat-amber: #e65100;
    --vg-impasto-gold: #f9a825;
    --vg-shadow-warm: rgba(120, 90, 50, 0.15);
    --canvas-grain-opacity: 0.05;

    /* Tab accent colors */
    --tab-filter-accent: #f9a825;
    --tab-layer-accent: #33691e;
    --tab-interactions-accent: #1976d2;
    --tab-batch-accent: #e65100;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 50px;
}

/* Heading font — Van Gogh era serif with modern refinement */
.welcome-title,
.header-title,
.modal-header h2,
h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
    letter-spacing: 0.02em;
}

/* Van Gogh artistic background — confident, expressive swirl pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        /* Sunflower golden glow — bottom left */
        radial-gradient(ellipse at 10% 90%, rgba(249, 168, 37, 0.12) 0%, transparent 50%),
        /* Cypress green — top right */
        radial-gradient(ellipse at 85% 15%, rgba(51, 105, 30, 0.10) 0%, transparent 40%),
        /* Iris violet — center-right */
        radial-gradient(ellipse at 70% 60%, rgba(123, 31, 162, 0.06) 0%, transparent 35%),
        /* Rhone cobalt — upper-center */
        radial-gradient(ellipse at 40% 20%, rgba(25, 118, 210, 0.08) 0%, transparent 45%),
        /* Warm amber base */
        radial-gradient(ellipse at 50% 50%, rgba(230, 81, 0, 0.05) 0%, transparent 60%);
    animation: swirlBreathing 20s ease-in-out infinite alternate;
}

@keyframes swirlBreathing {
    0% { opacity: 1; }
    100% { opacity: 0.85; }
}

/* Van Gogh canvas grain — mature impasto feel, confident and expressive */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--canvas-grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    mix-blend-mode: overlay;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: lowercase;
}

.header-center {
    text-align: center;
    flex: 1;
}

.header-center h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.header-right {
    min-width: 120px;
    display: flex;
    justify-content: flex-end;
}

.manual-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manual-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.manual-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.warning {
    background-color: #fff8e1;
    border: 1px solid var(--warning-color);
    color: #856404;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* ==================== Buttons - 2026 Soft Rounded Style ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Primary button - Van Gogh yellow gradient */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #f9a825 100%);
    color: #0d1b4d;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-primary) 100%);
    box-shadow:
        0 4px 16px rgba(249, 168, 37, 0.4),
        0 0 40px rgba(249, 168, 37, 0.15);
    transform: translateY(-1px);
}

/* Secondary button - Glass effect */
.btn-secondary {
    background: rgba(26, 35, 126, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(26, 35, 126, 0.12);
    border-color: var(--accent-primary);
}

/* Action button */
.btn-action {
    background: #f5f5f5;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-action:hover:not(:disabled) {
    background: #e8eaf6;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Folder Section */
.folder-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    flex-wrap: wrap;
}

.folder-path {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 200px;
}

/* Summary Section */
.summary-section {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    background: var(--bg-color);
    border-radius: 6px;
    min-width: 100px;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Actions Section */
.actions-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.actions-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.selection-actions,
.bulk-actions {
    display: flex;
    gap: 10px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.filter-actions label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-actions select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-actions select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(253, 216, 53, 0.2);
}

/* Table Section */
.table-section {
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.visuals-table {
    width: 100%;
    border-collapse: collapse;
}

.visuals-table th,
.visuals-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.visuals-table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
}

.visuals-table tbody tr:hover {
    background-color: #f1f3f4;
}

.visuals-table tbody tr.selected {
    background-color: #e3f2fd;
}

.col-checkbox {
    width: 40px;
    text-align: center;
}

.col-expand {
    width: 40px;
    text-align: center;
}

.col-path {
    min-width: 200px;
    max-width: 350px;
    word-break: break-all;
}

.col-file {
    width: 120px;
}

.col-type {
    width: 120px;
}

.col-filters {
    width: 80px;
    text-align: center;
}

.col-status {
    width: 120px;
}

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    color: var(--text-muted);
    padding: 5px;
    transition: transform var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.expand-btn .material-icons-outlined {
    font-size: 18px;
    transition: transform var(--transition-fast);
}

.expand-btn.expanded .material-icons-outlined {
    transform: rotate(90deg);
}

.expand-btn:hover {
    color: var(--primary-color);
}

/* Status Badges - Theme aware */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.status-hidden {
    background-color: #ffebee;
    color: var(--status-hidden);
}

.status-visible {
    background-color: #e8f5e9;
    color: var(--status-visible);
}

.status-default {
    background-color: #f5f5f5;
    color: var(--status-default);
}

.status-mixed {
    background-color: #fff3e0;
    color: var(--status-mixed);
}

.status-no-filters {
    background-color: var(--hover-overlay);
    color: var(--text-muted);
    font-style: italic;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

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

.tab-content {
    display: none;
}

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

/* Layer Order table - simpler layout without expand column */
.layer-table .col-page {
    width: 20%;
}

.layer-table .col-visual {
    width: 30%;
}

.layer-table .col-type {
    width: 20%;
}

.layer-table .col-status {
    width: 20%;
}

/* Filter Details Row */
.filter-details-row {
    background-color: #f8f9fa;
}

.filter-details-row td {
    padding: 0;
}

.filter-details {
    padding: 15px 20px 15px 80px;
}

.filter-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.filter-details-table th,
.filter-details-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.filter-details-table th {
    background-color: #e9ecef;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.filter-status-select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: white;
    color: var(--text-primary);
}

/* Save Section */
.save-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.save-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modified-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modified-status.has-changes {
    color: var(--warning-color);
    font-weight: 500;
}

/* History Section */
.history-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.history-status {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 10px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background-color: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background-color: var(--success-color);
}

.toast.error {
    background-color: var(--danger-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 750px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--primary-color);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

.modal-body {
    padding: 25px;
    overflow-y: auto;
    line-height: 1.7;
}

.modal-body h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 12px;
    color: var(--text-color);
}

.modal-body ul, .modal-body ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 8px;
}

.requirement-box {
    background: #fff3cd;
    border-left: 4px solid var(--accent-primary);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
    color: #856404;
}

.requirement-box strong {
    color: #664d03;
}

.step-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: 8px;
}

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

.step-content {
    flex: 1;
}

.status-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.status-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 6px;
}

.tip-box {
    background: #e3f2fd;
    border-left: 4px solid var(--accent-primary);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
    color: #0d47a1;
}

/* Folder Help Text */
.folder-help {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
    flex-basis: 100%;
    margin-top: 10px;
}

/* Action Hint */
.action-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 10px 0 0 0;
    font-style: italic;
}

/* Legend Section */
.legend-section {
    padding: 10px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.legend-details summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 5px 0;
}

.legend-details summary:hover {
    color: var(--primary-color);
}

.legend-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 15px;
    align-items: center;
    padding: 10px 0;
    font-size: 0.85rem;
}

.legend-grid .status-badge {
    justify-self: start;
}

/* Empty State Improvements */
.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 15px;
}

.empty-state ul {
    text-align: left;
    display: inline-block;
    margin: 10px 0;
}

.empty-state li {
    margin-bottom: 8px;
}

/* Main Layout with Sidebar */
.main-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.main-layout .app-container {
    flex: 1;
    min-width: 0;
}

/* Sponsor Sidebar */
.sponsor-sidebar {
    width: 160px;
    padding: 15px 10px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
}

.sponsor-header {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.sponsor-placeholder {
    padding: 15px 10px;
    background: var(--bg-color);
    border-radius: 8px;
    text-align: center;
    border: 2px dashed var(--border-color);
}

.sponsor-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.btn-sponsor {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    font-size: 0.8rem;
    display: inline-block;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-sponsor:hover {
    background: var(--primary-hover);
}

.sponsor-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.sponsor-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.sponsor-info a:hover {
    text-decoration: underline;
}

/* App Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: #f1f3f5;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 6px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-separator {
    color: var(--border-color);
    margin: 0 3px;
}

.footer-title {
    color: var(--text-muted);
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-left > a {
    color: #000;
}

.app-footer a:hover {
    text-decoration: underline;
}

.linkedin-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #0077b5;
    color: white !important;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.linkedin-link:hover {
    background: #005582;
    text-decoration: none !important;
}

.linkedin-icon {
    width: 14px;
    height: 14px;
}

/* ==================== Presets Section ==================== */
.presets-section {
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.presets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.presets-title {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.presets-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: #fff8e1;
    color: #f57c00;
    border-color: #f9a825;
    transform: translateY(-1px);
}

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

.custom-presets-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.custom-presets-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-preset-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-preset-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.custom-preset-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    color: inherit;
    cursor: pointer;
    margin-left: 2px;
}

.custom-preset-delete:hover {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ==================== Batch Processing Section ==================== */
.batch-intro-section {
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.batch-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.batch-queue-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.batch-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.batch-queue-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.batch-queue-list {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.batch-queue-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.batch-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.batch-queue-item:last-child {
    border-bottom: none;
}

.batch-queue-icon {
    font-size: 1.2rem;
}

.batch-queue-info {
    flex: 1;
}

.batch-queue-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.batch-queue-details {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.batch-queue-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.batch-queue-status.ready {
    background: #e3f2fd;
    color: var(--primary-color);
}

.batch-queue-status.processing {
    background: #fff3cd;
    color: #856404;
}

.batch-queue-status.done {
    background: #d4edda;
    color: var(--success-color);
}

.batch-queue-status.error {
    background: #f8d7da;
    color: var(--danger-color);
}

.batch-queue-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.batch-queue-remove:hover {
    background: #f8d7da;
    color: var(--danger-color);
}

.batch-settings-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.batch-settings-section h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--text-color);
}

.batch-settings-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.batch-settings-row label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.batch-settings-row select {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
    color: var(--text-primary);
}

.batch-manual-settings {
    padding: 15px;
    background: var(--hover-overlay);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.batch-manual-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.batch-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.batch-checkbox-row:last-child {
    margin-bottom: 0;
}

.batch-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.batch-checkbox-row label {
    font-size: 0.9rem;
    color: var(--text-color);
}

.batch-checkbox-row select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: white;
    color: var(--text-primary);
}

.batch-checkbox-row select:disabled {
    background: #f5f5f5;
    color: var(--text-muted);
    opacity: 0.6;
}

.batch-action-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1rem;
}

.batch-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.batch-progress-section {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.batch-progress-section h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--text-color);
}

.batch-progress-bar {
    height: 20px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #64b5f6);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.batch-progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.batch-results-list {
    max-height: 200px;
    overflow-y: auto;
}

.batch-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: 6px;
    margin-bottom: 8px;
}

.batch-result-item:last-child {
    margin-bottom: 0;
}

.batch-result-icon {
    font-size: 1.1rem;
}

.batch-result-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
}

.batch-result-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== Save Preset Modal ==================== */
.modal-sm {
    max-width: 400px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 25px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    color: var(--text-primary);
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.2);
}

.preset-config-summary {
    background: var(--bg-color);
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.preset-config-summary strong {
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 992px) {
    .sponsor-sidebar {
        display: none;
    }

    .main-layout {
        min-height: calc(100vh - 100px);
    }
}

@media (max-width: 768px) {
    .actions-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-actions {
        margin-left: 0;
        margin-top: 10px;
    }

    .summary-section {
        justify-content: center;
    }

    .history-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-status {
        margin-left: 0;
        margin-top: 10px;
    }

    .app-footer {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-title {
        display: none;
    }
}

/* ==================== Visual Interactions Section ==================== */

/* Page Selector */
.page-selector-section {
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-selector-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-selector-row label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.page-selector-row select {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    color: var(--text-primary);
}

.page-selector-row select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(253, 216, 53, 0.2);
}

/* View Toggle */
.view-toggle-section {
    padding: 10px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.view-btn:nth-child(2) {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.view-btn:hover {
    background: #e9ecef;
}

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

.view-hint {
    margin-left: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Naming Alert */
.naming-alert-section {
    margin-bottom: 15px;
}

.alert-warning {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    background: #fff8e1;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--warning-color);
}

.alert-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    color: #856404;
    display: block;
    margin-bottom: 5px;
}

.alert-content p {
    color: #856404;
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

.alert-content details {
    font-size: 0.85rem;
}

.alert-content summary {
    cursor: pointer;
    color: #856404;
    font-weight: 500;
}

.unnamed-list {
    margin: 10px 0 0 20px;
    color: #856404;
}

.unnamed-list li {
    margin-bottom: 4px;
}

/* Interaction Legend */
.interactions-legend .interaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.interaction-default {
    background: #e9ecef;
    color: var(--text-muted);
}

.interaction-filter {
    background: #e3f2fd;
    color: var(--primary-color);
}

.interaction-highlight {
    background: #fff3cd;
    color: #856404;
}

.interaction-none {
    background: #f8d7da;
    color: var(--danger-color);
}

/* Matrix Section */
.matrix-section {
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.interaction-matrix-container {
    overflow: auto;
    max-height: 500px;
    padding: 15px;
}

.interaction-list-container {
    padding: 15px;
}

/* Interaction Matrix Table */
.interaction-matrix {
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 100%;
}

.interaction-matrix th,
.interaction-matrix td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    min-width: 90px;
    max-width: 120px;
}

.interaction-matrix .corner-cell {
    background: var(--bg-color);
    position: sticky;
    left: 0;
    top: 0;
    z-index: 20;
}

.interaction-matrix thead th {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.interaction-matrix .target-header {
    writing-mode: horizontal-tb;
}

.interaction-matrix tbody th {
    background: var(--bg-color);
    position: sticky;
    left: 0;
    z-index: 5;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.interaction-matrix .source-header {
    max-width: 150px;
}

/* Matrix Cells */
.interaction-cell {
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.interaction-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1;
}

.interaction-cell.interaction-cell-disabled {
    background: #f1f3f5;
    cursor: default;
    color: var(--border-color);
}

.interaction-cell.interaction-cell-disabled:hover {
    transform: none;
    box-shadow: none;
}

.interaction-cell.selected {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
}

.interaction-cell .interaction-icon {
    font-size: 1.1rem;
}

/* Cell colors by type */
.interaction-cell.interaction-default {
    background: #f5f5f5;
}

.interaction-cell.interaction-filter {
    background: #e3f2fd;
}

.interaction-cell.interaction-highlight {
    background: #fff8e1;
}

.interaction-cell.interaction-none {
    background: #ffebee;
}

/* Restricted interaction cells (limited capabilities) */
.interaction-cell.interaction-restricted {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    );
    opacity: 0.7;
}

.interaction-cell.interaction-restricted:hover {
    opacity: 0.85;
}

/* Visual type badges */
.visual-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

.visual-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.visual-type-slicer {
    background: #ff9800;
    color: white;
}

.visual-type-line {
    background: #2196f3;
    color: white;
}

.visual-type-scatter {
    background: #9c27b0;
    color: white;
}

.visual-type-map {
    background: #4caf50;
    color: white;
}

.visual-type-default {
    background: #757575;
    color: white;
}

/* Interaction tooltip for restricted cells */
.interaction-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.4;
    max-width: 250px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Unnamed visual styling */
.unnamed-visual {
    font-style: italic;
    opacity: 0.7;
}

/* Interaction Type Selector Popup */
.interaction-type-selector {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.interaction-type-selector .type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.interaction-type-selector .type-option:hover {
    background: var(--bg-color);
}

.interaction-type-selector .type-option.active {
    background: var(--primary-color);
    color: white;
}

.interaction-type-selector .type-option.disabled,
.interaction-type-selector .type-option:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.interaction-type-selector .type-option.disabled:hover,
.interaction-type-selector .type-option:disabled:hover {
    background: transparent;
}

/* Interaction List Table */
.interaction-list-table {
    width: 100%;
    border-collapse: collapse;
}

.interaction-list-table th,
.interaction-list-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.interaction-list-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.interaction-list-table tbody tr:hover {
    background: #f8f9fa;
}

.interaction-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.no-visuals,
.no-interactions {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-style: italic;
}

/* ==================== Preset Description Panel ==================== */

.preset-description {
    margin: 8px 0 15px 0;
    padding: 10px 14px;
    background: #f0f4f8;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==================== Refresh Button ==================== */

#refresh-btn {
    margin-left: 10px;
}

#refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Left Sidebar ==================== */
.left-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width var(--transition-slow), transform var(--transition-slow);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.left-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.left-sidebar.collapsed .nav-label,
.left-sidebar.collapsed .sidebar-title,
.left-sidebar.collapsed .quick-actions-title,
.left-sidebar.collapsed .quick-actions-list,
.left-sidebar.collapsed .tree-title,
.left-sidebar.collapsed .report-tree-content {
    display: none;
}

.left-sidebar.collapsed .sidebar-nav-btn {
    justify-content: center;
    padding: 14px;
}

.left-sidebar.collapsed .collapse-icon {
    transform: rotate(180deg);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
    flex: 1;
}

.sidebar-collapse-btn {
    background: #fdd835;
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px;
    cursor: pointer;
    color: #1a237e;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-collapse-btn:hover {
    background: #ffee58;
    color: #1a237e;
    box-shadow: 0 0 8px rgba(253, 216, 53, 0.6);
}

.collapse-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
}

.collapse-icon .material-icons-outlined {
    font-size: 22px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.sidebar-nav-btn:hover {
    background: linear-gradient(90deg,
        rgba(249, 168, 37, 0.12) 0%,
        rgba(249, 168, 37, 0.04) 100%);
    color: #ffffff;
}

/* Tab-specific color accents */
.sidebar-nav-btn[data-tab="filter-visibility"].active {
    --current-tab-accent: var(--tab-filter-accent);
}
.sidebar-nav-btn[data-tab="layer-order"].active {
    --current-tab-accent: var(--tab-layer-accent);
}
.sidebar-nav-btn[data-tab="visual-interactions"].active {
    --current-tab-accent: var(--tab-interactions-accent);
}
.sidebar-nav-btn[data-tab="batch-processing"].active {
    --current-tab-accent: var(--tab-batch-accent);
}

.sidebar-nav-btn.active {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--current-tab-accent, var(--accent-primary)) 25%, transparent) 0%,
        color-mix(in srgb, var(--current-tab-accent, var(--accent-primary)) 8%, transparent) 100%);
    color: var(--current-tab-accent, var(--accent-primary));
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-left: -12px;
    padding-left: 20px;
    position: relative;
}

.sidebar-nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--current-tab-accent, var(--accent-primary));
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 16px;
}

/* Quick Actions */
.sidebar-quick-actions {
    padding: 0 12px;
    flex-shrink: 0;
}

.quick-actions-header {
    padding: 8px 8px 12px;
}

.quick-actions-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.quick-action-btn:hover {
    background: rgba(253, 216, 53, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.quick-action-icon {
    font-size: 1rem;
}

/* Report Tree */
.sidebar-report-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
    min-height: 100px;
}

.report-tree-header {
    padding: 8px;
}

.tree-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.report-tree-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.tree-node {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.tree-node:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tree-node.active {
    background: rgba(253, 216, 53, 0.15);
    color: var(--accent-primary);
}

.tree-node-icon {
    margin-right: 6px;
}

.tree-page {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.tree-visual {
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.tree-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 4px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* ==================== Welcome Dashboard ==================== */
.welcome-dashboard {
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.welcome-dashboard.hidden {
    display: none;
}

.welcome-hero {
    text-align: center;
    margin-bottom: 48px;
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(253, 216, 53, 0.3);
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Feature Cards */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--shadow-color);
    border-color: var(--accent-primary);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        rgba(249, 168, 37, 0.15),
        rgba(51, 105, 30, 0.1));
    margin-bottom: 16px;
    transition: box-shadow var(--transition-normal);
}

.feature-icon .material-icons-outlined {
    font-size: 32px;
    color: var(--accent-primary);
}

.feature-card:hover .feature-icon {
    box-shadow: 0 0 20px rgba(249, 168, 37, 0.25);
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Welcome CTA */
.welcome-cta {
    text-align: center;
    margin-bottom: 32px;
}

.cta-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 1rem;
}

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

/* Welcome Requirements */
.welcome-requirements {
    max-width: 500px;
    margin: 0 auto;
}

.welcome-requirements details {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.welcome-requirements summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
}

.welcome-requirements ul {
    margin: 12px 0 0 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.welcome-requirements li {
    margin-bottom: 6px;
}

/* ==================== Updated Main Layout with Sidebar ==================== */
body {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-slow);
}

body.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.main-layout {
    min-height: calc(100vh - 60px);
}

/* Header Updates */
.app-header {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px var(--shadow-color);
}

.header-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ==================== Updated Cards and Sections for Theme ==================== */
.summary-section,
.actions-section,
.table-section,
.save-section,
.history-section,
.legend-section,
.presets-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.summary-item {
    background: var(--hover-overlay);
    border-radius: var(--radius-sm);
}

.summary-value {
    color: var(--accent-primary);
}

.summary-label {
    color: var(--text-muted);
}

/* Table Updates */
.visuals-table th {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.visuals-table td {
    border-color: var(--border-color);
}

.visuals-table tbody tr:hover {
    background: var(--hover-overlay);
}

.visuals-table tbody tr.selected {
    background: rgba(253, 216, 53, 0.1);
}

/* Tab navigation styling (if visible) */
.tab-btn {
    color: var(--text-secondary);
}

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

.tab-btn.active {
    background: var(--accent-primary);
    color: #0d1b4d;
}

/* ==================== Sponsor Sidebar Updates ==================== */
.sponsor-sidebar {
    width: 90px;
    background: var(--bg-tertiary);
    border-left: 1px solid var(--border-color);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 50px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    z-index: 150;
}

.main-layout {
    margin-right: 90px;
}

.sponsor-header {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.sponsor-placeholder {
    background: var(--hover-overlay);
    border-color: var(--border-color);
    padding: 10px 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sponsor-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-sponsor {
    background: var(--accent-primary);
    color: #0d1b4d;
    font-size: 0.65rem;
    padding: 6px 8px;
}

.sponsor-info {
    font-size: 0.65rem;
    margin-top: auto;
}

/* Footer Updates */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-left: var(--sidebar-width);
    margin-right: 0;
    transition: margin-left var(--transition-slow), margin-right var(--transition-slow);
}

body.sidebar-collapsed .app-footer {
    margin-left: var(--sidebar-collapsed-width);
}

/* ==================== Modal Theme Updates ==================== */
.modal-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.modal-header {
    background: linear-gradient(135deg, var(--accent-primary), #f9a825);
    color: #0d1b4d;
}

.modal-body {
    color: var(--text-primary);
}

.modal-body h3 {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-secondary);
}

.modal-body p {
    color: var(--text-secondary);
}

.modal-footer {
    background: var(--bg-secondary);
    border-top-color: var(--border-color);
}

/* ==================== Toast Updates ==================== */
.toast {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.toast.success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* ==================== Responsive Updates ==================== */
@media (max-width: 1200px) {
    .feature-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .left-sidebar {
        transform: translateX(-100%);
    }

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

    body {
        margin-left: 0;
    }

    body.sidebar-collapsed {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .app-footer {
        margin-left: 0;
        margin-right: 0;
    }

    body.sidebar-collapsed .app-footer {
        margin-left: 0;
    }

    .sponsor-sidebar {
        display: none;
    }

    .main-layout {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .welcome-title {
        font-size: 1.6rem;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        font-size: 2rem;
    }
}

/* ==================== Van Gogh Artistic Touches ==================== */

/* Impasto gradient border — thicker, textured feel */
.summary-section::before,
.actions-section::before,
.presets-section::before,
.history-section::before,
.save-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--accent-primary) 0%,
        var(--vg-impasto-gold) 25%,
        var(--accent-secondary) 50%,
        var(--vg-iris-violet) 75%,
        var(--accent-warm) 100%);
    border-radius: 2px 2px 0 0;
    opacity: 0.9;
}

.summary-section,
.actions-section,
.presets-section {
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--vg-shadow-warm);
}

.history-section,
.save-section {
    position: relative;
    overflow: hidden;
}

/* Subtle brushstroke hover effect */
.feature-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(
        to top,
        rgba(253, 216, 53, 0.05) 0%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover::after {
    opacity: 1;
}

/* Starry night glow for primary elements */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transition: all var(--transition-normal);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.btn-primary:hover::after {
    width: 120%;
    height: 120%;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
}

/* Animated gradient for sidebar */
.left-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 90%, rgba(253, 216, 53, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 10%, rgba(85, 139, 47, 0.06) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
}

/* Starry night decorative accents in sidebar */
.left-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 15% 25%, rgba(253, 216, 53, 0.6), transparent),
        radial-gradient(1px 1px at 45% 65%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 75% 15%, rgba(253, 216, 53, 0.5), transparent),
        radial-gradient(1px 1px at 60% 85%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 25% 50%, rgba(25, 118, 210, 0.5), transparent);
    animation: starTwinkle 8s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Swirl pattern on welcome dashboard */
.welcome-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(253, 216, 53, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 80%, rgba(85, 139, 47, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 35, 126, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.welcome-dashboard > * {
    position: relative;
    z-index: 1;
}

/* Enhanced focus states */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Pulse animation for important buttons */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 2px 8px var(--shadow-color);
    }
    50% {
        box-shadow: 0 4px 16px rgba(253, 216, 53, 0.3);
    }
}

.cta-button {
    animation: subtlePulse 3s ease-in-out infinite;
}

.cta-button:hover {
    animation: none;
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--hover-overlay) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Sidebar nav button needs relative positioning for ::before indicator */
.sidebar-nav-btn {
    position: relative;
}

/* Smooth card lift on hover */
.summary-section:hover,
.table-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.summary-section,
.table-section {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Gold glow for active/success states */
.toast.success {
    box-shadow: 0 4px 20px rgba(102, 187, 106, 0.4);
}

.toast.error {
    box-shadow: 0 4px 20px rgba(239, 83, 80, 0.4);
}

/* ==================== Report-Level Settings Styles ==================== */

.report-default-info {
    color: #0066cc;
    font-weight: 500;
    padding: 4px 8px;
    background: #e6f2ff;
    border-radius: 4px;
    font-size: 0.9em;
}

.legend-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: #666;
    line-height: 1.6;
}

.legend-note strong {
    color: var(--text-primary);
}
