/* ============================================================================
   BOURSE WEB - Styles CSS
   ============================================================================
   Développé par : Killian Borowiec
   Design : Modern Dark Theme inspiré Bloomberg/Trading
   ============================================================================ */

/* === VARIABLES CSS === */
:root {
    /* Couleurs principales */
    --primary: #00d4aa;
    --primary-hover: #00b894;
    --secondary: #6c5ce7;
    --accent: #fdcb6e;
    
    /* Couleurs de fond */
    --bg-dark: #0a0e17;
    --bg-card: #141b2d;
    --bg-card-hover: #1a2235;
    --bg-input: #1e2738;
    
    /* Couleurs de texte */
    --text-primary: #ffffff;
    --text-secondary: #8b95a5;
    --text-muted: #5a6578;
    
    /* Couleurs d'état */
    --success: #00d4aa;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --info: #74b9ff;
    
    /* Bordures */
    --border-color: #2d3748;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Ombres */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Typographie */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Scrollbar */
    --scrollbar-width: 8px;
    --scrollbar-track: rgba(45, 55, 72, 0.3);
    --scrollbar-thumb: rgba(0, 212, 170, 0.4);
    --scrollbar-thumb-hover: rgba(0, 212, 170, 0.7);
}

/* === CUSTOM SCROLLBAR === */

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    transition: background 0.3s ease;
}

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

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Scrollbar spéciale pour les conteneurs sombres */
.log-table-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, 0.4);
}

.log-table-container::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 92, 231, 0.7);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* === APP CONTAINER === */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === LOADING SCREEN === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-status {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    min-height: 20px;
    opacity: 0;
    animation: fadeInStatus 0.3s ease forwards 0.5s;
}

@keyframes fadeInStatus {
    to { opacity: 1; }
}

.loading-progress-container {
    width: 200px;
    height: 4px;
    background: var(--surface-light);
    border-radius: 2px;
    margin: 15px auto 0;
    overflow: hidden;
    opacity: 0;
    animation: fadeInStatus 0.3s ease forwards 0.7s;
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--info), var(--primary));
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: shimmerProgress 1.5s linear infinite;
}

@keyframes shimmerProgress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === ANALYSIS START OVERLAY (Glassmorphism) === */
.analysis-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analysis-start-overlay.visible {
    opacity: 1;
}

.analysis-start-card {
    background: rgba(30, 32, 40, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.analysis-start-overlay.visible .analysis-start-card {
    transform: scale(1) translateY(0);
}

.analysis-start-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: rocket 1s ease-in-out infinite;
}

@keyframes rocket {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.analysis-start-card h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.analysis-start-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.analysis-start-loader {
    width: 60px;
    height: 4px;
    margin: 0 auto;
    background: var(--surface-light);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.analysis-start-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60px;
    width: 60px;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dim));
    border-radius: 2px;
    animation: loader-slide 1s ease-in-out infinite;
}

@keyframes loader-slide {
    0% { left: -60px; }
    100% { left: 60px; }
}

/* === NAVBAR === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 1.75rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-input);
    color: var(--text-primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
}

.nav-user .avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    padding: 2rem;
}

/* === AUTH SECTION === */
.auth-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 4px;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

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

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.label-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

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

.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

.form-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--border-radius-sm);
    color: var(--danger);
    font-size: 0.9rem;
}

.form-success {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--border-radius-sm);
    color: var(--success);
    font-size: 0.9rem;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Bouton désactivé / en chargement */
.btn:disabled,
.btn.btn-loading {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

.btn-primary:disabled,
.btn-primary.btn-loading {
    background: var(--text-muted);
    color: var(--bg-card);
}

.btn-loading {
    position: relative;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

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

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e55555;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: rgba(255, 107, 107, 0.15);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === FEATURES GRID === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === DASHBOARD === */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

.stat-change {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* === S&P 500 COMPARISON === */
.sp500-comparison-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sp500-comparison-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sp500-comparison-section .section-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.period-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.period-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.period-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.comparison-container {
    min-height: 150px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.comparison-card {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.comparison-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.comparison-card .card-icon {
    font-size: 1.5rem;
}

.comparison-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.comparison-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.comparison-card .card-value.negative {
    color: var(--danger);
}

.comparison-card .card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comparison-card .detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.comparison-card .detail-row span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

.comparison-card .detail-row span.positive {
    color: var(--success);
}

.comparison-card .detail-row span.negative {
    color: var(--danger);
}

.comparison-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.comparison-vs .vs-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.comparison-vs .outperformance {
    font-size: 1.5rem;
    font-weight: 700;
}

.comparison-vs .outperformance.positive {
    color: var(--success);
}

.comparison-vs .outperformance.negative {
    color: var(--danger);
}

.comparison-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.comparison-footer .period-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.comparison-footer .period-info-row:hover {
    background: var(--bg-input);
}

.comparison-footer .period-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.comparison-footer .expand-arrow {
    color: var(--primary);
    font-size: 0.8rem;
    transition: var(--transition);
}

.positions-detail-dropdown {
    margin-top: 1rem;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 1rem;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.positions-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.positions-detail-header .sp500-ref {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85rem;
}

.positions-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.position-detail-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.position-ticker {
    display: flex;
    flex-direction: column;
}

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

.position-ticker .ticker-qty {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.position-prices {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.position-prices .price-label {
    color: var(--text-muted);
}

.position-prices .price-value {
    color: var(--text-secondary);
}

.position-prices .price-arrow {
    color: var(--text-muted);
}

.position-return {
    text-align: right;
    font-weight: 600;
    font-size: 0.95rem;
}

.position-return.positive {
    color: var(--success);
}

.position-return.negative {
    color: var(--danger);
}

.position-return .return-amount {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.8;
}

.no-positions {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
}

/* === LANGUAGE SELECTOR === */
.language-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 1rem;
}

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

.language-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.language-btn .lang-flag {
    font-size: 1.5rem;
}

.language-btn .lang-name {
    font-weight: 500;
}

/* === LANGUAGE SWITCH (Simple flags) === */
.lang-switch {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-flag {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.5;
    filter: grayscale(50%);
}

.lang-flag:hover {
    opacity: 0.8;
    filter: grayscale(0%);
    transform: scale(1.1);
}

.lang-flag.active {
    opacity: 1;
    filter: grayscale(0%);
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.1);
}

/* Settings page - larger flags */
.lang-switch-settings {
    gap: 1rem;
}

.lang-switch-settings .lang-flag {
    font-size: 2.5rem;
    padding: 0.75rem 1rem;
}

/* === LANGUAGE SELECTOR (Registration form) === */
.language-selector {
    display: flex;
    gap: 0.75rem;
}

.lang-option {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.lang-option:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.lang-option.active {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.15);
    color: var(--primary);
    font-weight: 500;
}

/* Responsive positions detail */
@media (max-width: 768px) {
    .position-detail-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: left;
    }
    
    .position-return {
        text-align: left;
    }
    
    .position-prices {
        flex-wrap: wrap;
    }
}

.comparison-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--warning);
}

.comparison-error .error-icon {
    font-size: 1.5rem;
}

.comparison-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.comparison-empty .empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.comparison-empty .empty-message {
    font-size: 0.95rem;
}

/* Responsive S&P 500 Comparison */
@media (max-width: 768px) {
    .sp500-comparison-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-vs {
        flex-direction: row;
        padding: 0.5rem 0;
    }
}

/* === TABLES === */
.table-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
}

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

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
}

th {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

tr:hover {
    background: var(--bg-card-hover);
}

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

.ticker-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ticker-symbol {
    font-weight: 600;
    color: var(--primary);
}

.ticker-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.badge-neutral {
    background: rgba(139, 149, 165, 0.15);
    color: var(--text-secondary);
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

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

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* === MODAL DE CONFIRMATION === */
.confirm-modal {
    max-width: 420px;
}

.confirm-modal .modal-header {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.confirm-modal .modal-title {
    font-size: 1.3rem;
}

.confirm-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    padding: 0.5rem 0 1rem;
}

.confirm-modal .modal-footer {
    border-top: none;
    padding-top: 0.5rem;
    justify-content: center;
}

.confirm-modal .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
}

/* === SIDEBAR (Settings) === */
.settings-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.settings-sidebar {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.settings-nav-item:hover,
.settings-nav-item.active {
    background: var(--bg-input);
    color: var(--text-primary);
}

.settings-nav-item.active {
    border-left: 3px solid var(--primary);
}

.settings-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.settings-section {
    margin-bottom: 2rem;
}

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

.settings-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* === API KEY CARDS === */
.api-key-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.api-key-card {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.api-key-service {
    font-weight: 600;
}

.api-key-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}

.api-key-status.inactive {
    background: var(--text-muted);
}

.api-key-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.api-key-actions {
    display: flex;
    gap: 0.5rem;
}

.api-key-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Coming Soon Cards */
.api-key-card.coming-soon {
    opacity: 0.7;
    border-style: dashed;
    background: linear-gradient(135deg, var(--bg-input) 0%, rgba(108, 92, 231, 0.1) 100%);
}

.api-key-card.coming-soon:hover {
    opacity: 0.85;
}

.coming-soon-badge {
    background: var(--secondary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === LOADING === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === UTILITIES === */
.hidden {
    display: none !important;
}

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

.text-right {
    text-align: right;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* === FOOTER === */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-layout {
        grid-template-columns: 1fr;
    }
    
    .settings-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .settings-nav-item {
        flex: 1;
        min-width: fit-content;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

/* === TICKER VALIDATION === */
.ticker-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ticker-input-wrapper input {
    padding-right: 2.5rem;
    text-transform: uppercase;
}

.ticker-status {
    position: absolute;
    right: 0.75rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticker-valid {
    color: var(--success);
    font-weight: bold;
}

.ticker-invalid {
    color: var(--danger);
    font-weight: bold;
}

.ticker-loading {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ticker-info {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ticker-info:not(:empty) {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}

.ticker-info .ticker-name {
    color: var(--primary);
    font-weight: 500;
}

.ticker-info .ticker-price {
    color: var(--success);
}

.ticker-info .ticker-exchange {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ticker-help {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.ticker-help .help-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ticker-help .help-text {
    line-height: 1.4;
}

.ticker-help a {
    color: var(--info);
    text-decoration: underline;
}

.ticker-help a:hover {
    color: var(--primary);
}

.ticker-help strong {
    color: var(--text-primary);
    font-family: monospace;
    background: var(--bg-input);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* ============================================================================
   AGGREGATOR STYLES
   ============================================================================ */

/* === CACHE INFO === */
.cache-info {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cache-info .cache-detail {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.cache-valid {
    background: rgba(0, 255, 135, 0.1);
    border: 1px solid rgba(0, 255, 135, 0.3);
    color: var(--success);
}

.cache-expired {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--warning);
}

.cache-none {
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    color: var(--info);
}

.cache-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--danger);
}

/* === AGGREGATOR LAYOUT === */
.aggregator-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 1200px) {
    .aggregator-layout {
        grid-template-columns: 1fr;
    }
}

/* === CONFIG PANEL === */
.aggregator-config {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    height: fit-content;
}

.config-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

/* === FORM ELEMENTS === */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.label-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--primary);
    font-style: italic;
}

/* === RANGE SLIDER === */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-value {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.range-value span {
    color: var(--primary);
    font-weight: 600;
    margin-right: 0.25rem;
}

.symbols-count-hint,
.symbols-count-warning {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.symbols-count-hint {
    background: var(--surface);
    color: var(--text-secondary);
}

.symbols-count-hint strong {
    color: var(--primary);
}

.symbols-count-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* === TOGGLE SWITCHES === */
.checkbox-group {
    margin-bottom: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: var(--surface);
    border: 1px solid var(--border-color);
}

.checkbox-label:hover {
    background: var(--surface-light);
    border-color: var(--primary-dim);
}

/* Cacher la checkbox native */
.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Toggle switch container */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

/* Toggle switch knob */
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state */
.checkbox-label input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
    background: white;
}

/* Focus state */
.checkbox-label input[type="checkbox"]:focus + .toggle-switch {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Label text */
.checkbox-label .toggle-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;
}

.checkbox-label .toggle-text .toggle-desc {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Icon for toggle */
.checkbox-label .toggle-icon {
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

/* Disabled state */
.checkbox-label input[type="checkbox"]:disabled + .toggle-switch {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Backward compatibility - simple checkboxes */
.checkbox-label.simple input[type="checkbox"] {
    position: relative;
    opacity: 1;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

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

/* === ELITE SECTION === */
.elite-section {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.05) 0%, rgba(108, 92, 231, 0.05) 100%);
    border: 1px solid rgba(253, 203, 110, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.elite-section .section-subtitle {
    color: var(--warning);
}

.elite-main-toggle {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.1) 0%, rgba(108, 92, 231, 0.1) 100%) !important;
    border-color: rgba(253, 203, 110, 0.4) !important;
}

.elite-main-toggle:hover {
    border-color: var(--warning) !important;
}

.elite-options {
    margin-top: 1rem;
}

/* Elite options grid */
.elite-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .elite-options-grid {
        grid-template-columns: 1fr;
    }
}

/* Elite option cards */
.elite-option-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.elite-option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.elite-option-card:hover {
    border-color: var(--warning);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 203, 110, 0.15);
}

.elite-option-card input[type="checkbox"]:checked ~ .elite-option-content {
    color: var(--text-primary);
}

.elite-option-card input[type="checkbox"]:checked ~ .elite-check {
    opacity: 1;
    transform: scale(1);
}

.elite-option-card input[type="checkbox"]:checked + .elite-option-content + .elite-check,
.elite-option-card:has(input:checked) {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.1) 0%, rgba(108, 92, 231, 0.05) 100%);
}

.elite-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    text-align: center;
    min-width: 0;
}

.elite-option-icon {
    font-size: 1.5rem;
}

.elite-option-label {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.elite-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warning);
    color: var(--bg-dark);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Checked state for elite cards */
.elite-option-card:has(input:checked) .elite-check {
    opacity: 1;
    transform: scale(1);
}

.elite-option-card:has(input:checked) {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.1) 0%, rgba(108, 92, 231, 0.05) 100%);
}

/* === PORTFOLIO TICKERS === */
.portfolio-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ticker-badge {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
}

/* === CONFIG ACTIONS === */
.config-actions {
    padding-top: 1rem;
}

/* === RESULTS PANEL === */
.aggregator-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* === JOB STATUS === */
.job-status {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 212, 170, 0.05) 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--primary);
    padding: 1.5rem;
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.1);
    animation: panel-glow 2s ease-in-out infinite alternate;
}

@keyframes panel-glow {
    from { box-shadow: 0 0 20px rgba(0, 212, 170, 0.1); }
    to { box-shadow: 0 0 40px rgba(0, 212, 170, 0.2); }
}

/* Header avec animation de barres */
.job-status-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.loading-animation {
    flex-shrink: 0;
}

.loading-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
}

.loading-bars span {
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
    animation: loading-wave 1s ease-in-out infinite;
}

.loading-bars span:nth-child(1) { height: 10px; animation-delay: 0s; }
.loading-bars span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.loading-bars span:nth-child(3) { height: 30px; animation-delay: 0.2s; }
.loading-bars span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.loading-bars span:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes loading-wave {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.job-status-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.job-status-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}

/* Progress bar améliorée */
.progress-container {
    margin: 1rem 0;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    animation: progress-shimmer 2s linear infinite;
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: glow-sweep 2s ease-in-out infinite;
}

@keyframes glow-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.progress-percent {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 212, 170, 0.3);
}

.progress-eta {
    font-size: 1rem;
    font-weight: 600;
    color: var(--warning);
    background: rgba(253, 203, 110, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(253, 203, 110, 0.3);
    animation: pulse-eta 2s ease-in-out infinite;
}

@keyframes pulse-eta {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Footer avec indicateur live */
.job-status-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.7);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(0, 212, 170, 0);
    }
}

.status-live {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.job-status-footer .btn {
    margin-left: auto;
}

/* === EXPORTS LIST === */
.results-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* === SAVED ANALYSES === */
.saved-analyses-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.saved-analyses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.saved-analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.saved-analysis-item:hover {
    border-color: var(--primary);
}

.analysis-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.analysis-date {
    font-weight: 500;
    color: var(--text-primary);
}

.analysis-model {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.analysis-badge {
    font-size: 0.9rem;
}

.analysis-actions {
    display: flex;
    gap: 0.5rem;
}

.exports-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.export-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.export-item:hover {
    border-color: var(--primary);
}

.export-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.export-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.export-actions {
    display: flex;
    gap: 0.5rem;
}

.export-actions .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* === DATA PREVIEW === */
.data-preview {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-stat {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    text-align: center;
}

.preview-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.preview-stat .stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.preview-section {
    margin-bottom: 1.5rem;
}

.preview-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

/* === ECONOMIC GRID === */
.economic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.economic-item {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    text-align: center;
}

.econ-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.econ-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--success);
}

/* === MARKET TABLE === */
.market-table-container {
    overflow-x: auto;
}

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

.market-table th {
    background: var(--bg-input);
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.market-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.market-table tr:hover {
    background: var(--bg-input);
}

/* === SIGNAL BADGES === */
.signal-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.signal-bullish {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}

.signal-bearish {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
}

.signal-neutral {
    background: rgba(139, 149, 165, 0.15);
    color: var(--text-secondary);
}

/* === BUTTON SIZES === */
.btn-sm {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.85rem !important;
}

/* === SYMBOL INPUT WITH SUGGESTIONS === */
.symbol-input-container {
    position: relative;
}

.ticker-suggestion {
    margin-top: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.suggestion-item:hover {
    background: var(--bg-card-hover);
    border-left-color: var(--primary);
}

.suggestion-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.suggestion-symbol {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.suggestion-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.suggestion-price {
    color: var(--success);
    font-weight: 500;
    font-size: 0.85rem;
}

.suggestion-exchange {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.suggestion-action {
    display: block;
    color: var(--info);
    font-size: 0.8rem;
    font-style: italic;
}

/* === SELECTED SYMBOLS LIST === */
.selected-symbols {
    margin-top: 0.75rem;
}

.selected-symbols-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.selected-symbol-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    animation: tagAppear 0.2s ease-out;
}

@keyframes tagAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.selected-symbol-tag .symbol-text {
    color: white;
}

.selected-symbol-tag .symbol-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.selected-symbol-tag .symbol-remove:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: scale(1.1);
}

.selected-count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === RESPONSIVE AGGREGATOR === */
@media (max-width: 768px) {
    .preview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .economic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .export-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .export-actions {
        width: 100%;
    }
    
    .export-actions .btn {
        flex: 1;
    }
}

/* === API KEYS WARNING === */
.api-keys-warning {
    display: flex;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.15), rgba(253, 203, 110, 0.05));
    border: 1px solid var(--warning);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.api-keys-warning .warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.api-keys-warning .warning-content {
    flex: 1;
}

.api-keys-warning .warning-content strong {
    color: var(--warning);
}

.api-keys-warning .warning-content p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-keys-warning .warning-link {
    display: inline-block;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.api-keys-warning .warning-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Info box pour limite API */
.api-limit-info {
    display: flex;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(99, 179, 237, 0.12), rgba(99, 179, 237, 0.05));
    border: 1px solid rgba(99, 179, 237, 0.4);
    border-radius: var(--border-radius);
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
}

.api-limit-info .info-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.api-limit-info .info-content {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.api-limit-info .info-content strong {
    color: #63b3ed;
}

/* ============================================================================
   CLAUDE AI ANALYSIS
   ============================================================================ */

/* Layout - Vertical: Config en haut, Résultats en dessous (full width) */
.analysis-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.analysis-config {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.analysis-config .config-section {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-self: start;
}

/* Tailles des sections */
.analysis-config .config-section.section-small {
    grid-column: span 1;
}

.analysis-config .config-section.section-medium {
    grid-column: span 2;
}

.analysis-config .config-section.section-large {
    grid-column: span 3;
}

.analysis-config .config-section h2.section-title {
    font-size: 0.85rem;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.analysis-config .config-actions {
    grid-column: span 1;
    display: flex;
    align-items: stretch;
}

.analysis-config .config-actions .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.analysis-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Full width results panel */
.analysis-results .results-panel {
    width: 100%;
    min-height: 400px;
}

@media (max-width: 1200px) {
    .analysis-config {
        grid-template-columns: repeat(3, 1fr);
    }
    .analysis-config .config-section.section-large {
        grid-column: span 3;
    }
    .analysis-config .config-section.section-medium {
        grid-column: span 2;
    }
    .analysis-config .config-section.section-small,
    .analysis-config .config-actions {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .analysis-config {
        grid-template-columns: 1fr;
    }
    .analysis-config .config-section.section-large,
    .analysis-config .config-section.section-medium,
    .analysis-config .config-section.section-small,
    .analysis-config .config-actions {
        grid-column: span 1;
    }
}

/* Checkbox toggle amélioré pour fractions */
.checkbox-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.checkbox-toggle:hover {
    border-color: var(--primary-dim);
    background: rgba(0, 212, 170, 0.05);
}

.checkbox-toggle input[type="checkbox"] {
    display: none;
}

.checkbox-toggle .toggle-track {
    width: 40px;
    height: 22px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 11px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-toggle .toggle-track::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s ease;
}

.checkbox-toggle input[type="checkbox"]:checked + .toggle-track {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-toggle input[type="checkbox"]:checked + .toggle-track::after {
    transform: translateX(18px);
    background: white;
}

.checkbox-toggle .toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.checkbox-toggle input[type="checkbox"]:checked ~ .toggle-label {
    color: var(--primary);
    font-weight: 500;
}

.checkbox-toggle .toggle-status {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.checkbox-toggle input[type="checkbox"]:checked ~ .toggle-status {
    background: rgba(0, 212, 170, 0.15);
    color: var(--primary);
}

/* Claude Status Badge */
.claude-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.claude-status.configured {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.claude-status.not-configured {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ============================================================================
   CUSTOM EXPORT DROPDOWN
   ============================================================================ */

.export-dropdown {
    position: relative;
    width: 100%;
}

.export-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--bg-input) 0%, rgba(30, 30, 50, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-dropdown-trigger:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--bg-input) 100%);
}

.export-dropdown.open .export-dropdown-trigger {
    border-color: var(--primary);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.dropdown-placeholder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-placeholder .dropdown-icon {
    font-size: 1.1rem;
}

.dropdown-placeholder.has-selection {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-placeholder.has-selection .selected-date {
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-placeholder.has-selection .selected-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-placeholder.has-selection .selected-size {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dropdown-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.export-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.export-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.export-dropdown.open .export-dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
}

.export-dropdown-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.export-dropdown-empty .empty-icon {
    font-size: 1.2rem;
}

.export-dropdown-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

.export-dropdown-item:last-child {
    border-bottom: none;
}

.export-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.export-dropdown-item.selected {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-left: 3px solid var(--primary);
}

.export-item-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.export-item-icon {
    font-size: 1.1rem;
}

.export-item-date {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.export-item-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.export-item-badge.ultra {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.export-item-badge.stocks {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.dropdown-placeholder.has-selection .selected-stocks {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}

.export-item-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 1.7rem;
}

.export-item-size,
.export-item-reduction,
.export-item-original {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.export-item-reduction {
    color: #10b981;
    font-weight: 600;
}

.export-item-original .original-label {
    color: var(--text-muted);
    opacity: 0.7;
}

.size-icon,
.reduction-icon {
    font-size: 0.85rem;
}

/* Form hint avec icône */
.form-hint .hint-icon {
    margin-right: 0.3rem;
}

.form-hint .hint-ultra {
    display: block;
    margin-top: 0.25rem;
    color: #f59e0b;
    font-size: 0.8rem;
}

/* Scrollbar pour le dropdown */
.export-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.export-dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.export-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* ============================================================================
   CUSTOM DROPDOWN GÉNÉRIQUE
   ============================================================================ */

.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown .dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--bg-input) 0%, rgba(30, 30, 50, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-dropdown .dropdown-trigger:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--bg-input) 100%);
}

.custom-dropdown.open .dropdown-trigger {
    border-color: var(--primary);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.custom-dropdown .dropdown-selected {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
}

.custom-dropdown .dropdown-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.custom-dropdown.open .dropdown-menu {
    max-height: 350px;
    overflow-y: auto;
    opacity: 1;
}

.custom-dropdown .dropdown-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

.custom-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.custom-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.custom-dropdown .dropdown-item.selected {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-left: 3px solid var(--primary);
}

.custom-dropdown .dropdown-item-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.custom-dropdown .item-icon {
    font-size: 1.1rem;
    min-width: 1.5rem;
    text-align: center;
}

.custom-dropdown .item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.custom-dropdown .item-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-dropdown .item-badge.default {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.custom-dropdown .item-badge.thinking {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
}

.custom-dropdown .item-badge.web {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

.custom-dropdown .item-badge.count {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
}

.custom-dropdown .dropdown-item-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 2.1rem;
    flex-wrap: wrap;
}

.custom-dropdown .item-desc {
    flex: 1;
    min-width: 150px;
}

.custom-dropdown .item-tokens,
.custom-dropdown .item-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Styles pour le bouton sélectionné */
.custom-dropdown .model-icon,
.custom-dropdown .mode-icon {
    font-size: 1.1rem;
}

.custom-dropdown .model-name,
.custom-dropdown .mode-name {
    font-weight: 600;
    color: var(--text-primary);
}

.custom-dropdown .model-badge {
    font-size: 0.85rem;
}

.custom-dropdown .model-badge.thinking {
    color: #a78bfa;
}

.custom-dropdown .model-badge.web {
    color: #60a5fa;
}

/* Scrollbar */
.custom-dropdown .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown .dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.custom-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Dropdown Compact (pour les filtres) */
.custom-dropdown.compact {
    width: auto;
    min-width: 180px;
}

.custom-dropdown.compact .dropdown-trigger {
    padding: 0.5rem 0.875rem;
}

.custom-dropdown.compact .dropdown-item {
    padding: 0.5rem 0.875rem;
}

.custom-dropdown.compact .dropdown-item-header {
    margin-bottom: 0;
}

.custom-dropdown.compact .dropdown-item-details {
    display: none;
}

.custom-dropdown.compact .filter-icon {
    font-size: 0.9rem;
}

.custom-dropdown.compact .filter-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Prompt Actions */
.prompt-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Recap Actions */
.recap-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.recap-saved {
    color: var(--success);
    font-size: 0.85rem;
}

/* Form Textarea */
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.prompt-textarea {
    min-height: 400px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Modal Large */
.modal.modal-large {
    max-width: 900px;
    width: 95%;
}

/* Analysis Placeholder */
.analysis-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.analysis-placeholder .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.analysis-placeholder p {
    margin: 0.25rem 0;
}

/* Analysis Loading */
.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.analysis-loading p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Analysis Error */
.analysis-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 107, 107, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.analysis-error .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header-left {
    flex: 1;
    min-width: 0;
}

.results-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.results-close-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.results-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-meta .meta-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
}

/* Claude Response */
.claude-response {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.45;
}

.claude-response h2 {
    color: var(--primary);
    font-size: 1.15rem;
    margin: 0.9rem 0 0.4rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

.claude-response h2:first-child {
    margin-top: 0;
}

.claude-response h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0.7rem 0 0.3rem 0;
}

.claude-response h4 {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.5rem 0 0.25rem 0;
}

.claude-response p {
    margin: 0.35rem 0;
}

.claude-response strong {
    color: var(--primary);
}

.claude-response ul, .claude-response ol {
    margin: 0.35rem 0;
    padding-left: 1.25rem;
}

.claude-response li {
    margin: 0.15rem 0;
}

/* Réduire les espaces entre sections */
.claude-response hr {
    margin: 0.6rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.claude-response code {
    background: rgba(0, 212, 170, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.claude-response pre {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin: 1rem 0;
}

.claude-response pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* Markdown Table */
/* Tableaux améliorés */
.claude-response .markdown-table,
.claude-response table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.82rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.claude-response .markdown-table th,
.claude-response .markdown-table td,
.claude-response table th,
.claude-response table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.claude-response .markdown-table th,
.claude-response table th {
    background: var(--primary);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.claude-response .markdown-table tr:nth-child(even),
.claude-response table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.claude-response .markdown-table tr:hover,
.claude-response table tr:hover {
    background: rgba(0, 212, 170, 0.08);
}

/* Responsive table scroll */
.claude-response .table-wrapper {
    overflow-x: auto;
    margin: 0.5rem 0;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* === STREAMING STYLES === */

/* Curseur de streaming clignotant */
.stream-cursor {
    display: inline-block;
    animation: blink 0.8s infinite;
    color: var(--primary);
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Indicateur de streaming (3 points) */
.streaming-indicator {
    display: inline-flex;
    gap: 3px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.streaming-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: streaming-dots 1.4s infinite ease-in-out both;
}

.streaming-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.streaming-indicator .dot:nth-child(2) { animation-delay: -0.16s; }
.streaming-indicator .dot:nth-child(3) { animation-delay: 0; }

@keyframes streaming-dots {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Style pour le contenu en streaming */
#stream-content {
    min-height: 100px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Animation d'apparition du texte */
.stream-text-appear {
    animation: fadeIn 0.2s ease-out;
}

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

/* Info Box */
.info-box {
    background: rgba(99, 179, 237, 0.1);
    border: 1px solid rgba(99, 179, 237, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-box a {
    color: var(--primary);
}

/* Responsive Analysis */
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions .btn {
        width: 100%;
    }
    
    .prompt-actions {
        flex-direction: column;
    }
    
    .prompt-actions .btn {
        width: 100%;
    }
}

/* === CLAUDE MODELS MANAGEMENT === */
.claude-models-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.claude-model-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    transition: var(--transition);
}

.claude-model-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.claude-model-card.is-default {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.05);
}

.model-info {
    flex: 1;
}

.model-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.default-badge {
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.thinking-badge {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.claude-model-card.has-thinking {
    border-left: 3px solid #6c5ce7;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-message {
    opacity: 0.7;
}

/* === GLOBAL INSTRUCTIONS === */
.instructions-info {
    margin-bottom: 1rem;
}

.instructions-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
}

.instructions-status.configured {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.instructions-status.not-configured {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.instructions-status .status-icon {
    font-size: 1.5rem;
}

.instructions-status .status-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.instructions-status .status-info p {
    margin: 0;
    font-size: 0.85rem;
}

.instructions-preview {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    max-height: 150px;
    overflow-y: auto;
}

.instructions-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
}

.instructions-actions {
    display: flex;
    gap: 0.5rem;
}

/* Instructions badge dans la page Analyse */
.instructions-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}

.instructions-badge.configured {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--primary);
}

.instructions-badge.not-configured {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
    color: var(--warning);
}

.instructions-badge .badge-icon {
    font-size: 1.1rem;
}

.instructions-badge a {
    color: var(--primary);
    text-decoration: underline;
}

/* === THINKING BLOCK === */
.thinking-block {
    margin-bottom: 1rem;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(108, 92, 231, 0.3);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(162, 155, 254, 0.05));
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(108, 92, 231, 0.15);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.thinking-header:hover {
    background: rgba(108, 92, 231, 0.25);
}

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

.thinking-title {
    font-weight: 600;
    color: #a29bfe;
    flex: 1;
}

.thinking-toggle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.thinking-content {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

.thinking-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    line-height: 1.6;
}

/* === WEB SEARCH === */
.web-search-badge {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.claude-model-card.has-web-search {
    border-right: 3px solid #00b894;
}

.web-search-block {
    margin-bottom: 1rem;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 184, 148, 0.3);
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(0, 206, 201, 0.05));
}

.web-search-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 184, 148, 0.15);
}

.web-search-icon {
    font-size: 1.2rem;
}

.web-search-title {
    font-weight: 600;
    color: #00b894;
    flex: 1;
}

.web-search-toggle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-queries {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 184, 148, 0.2);
}

.search-query-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 184, 148, 0.1);
    border-radius: 4px;
    font-style: italic;
}

.search-query-item .query-icon {
    font-size: 0.9rem;
}

.search-query-item .query-text {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.web-search-results {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.web-search-results .results-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(0, 184, 148, 0.2);
}

.search-result-item .result-title {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.search-result-item .result-url {
    color: var(--text-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === WEB SEARCHES BLOCK (for saved analyses) === */
.web-searches-block {
    margin-bottom: 1rem;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 184, 148, 0.3);
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(0, 206, 201, 0.05));
}

.web-searches-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 184, 148, 0.15);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.web-searches-header:hover {
    background: rgba(0, 184, 148, 0.25);
}

.web-searches-icon {
    font-size: 1.2rem;
}

.web-searches-title {
    font-weight: 600;
    color: #00b894;
    flex: 1;
}

.web-searches-toggle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.web-searches-content {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

.web-searches-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.web-searches-list li {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 184, 148, 0.1);
    border-radius: 4px;
}

.web-searches-list li a {
    color: #00cec9;
    text-decoration: none;
    font-size: 0.9rem;
}

.web-searches-list li a:hover {
    text-decoration: underline;
}

.web-searches-list .search-age {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.search-result-item .result-age {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

/* Streaming animations for web search */
.search-query-item.streaming {
    animation: fadeInSlide 0.3s ease-out;
}

.search-result-item.streaming {
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.query-status {
    margin-left: auto;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.search-result-item .result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.web-search-results h4,
.search-queries h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* === PROPOSED NOTES (IA Notes) === */
.proposed-notes-block {
    margin: 1rem 0;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.proposed-notes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(108, 92, 231, 0.2);
    cursor: pointer;
    transition: background 0.2s;
}

.proposed-notes-header:hover {
    background: rgba(108, 92, 231, 0.3);
}

.proposed-notes-icon {
    font-size: 1.2rem;
}

.proposed-notes-title {
    font-weight: 600;
    color: #a29bfe;
    flex: 1;
}

.proposed-notes-toggle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.proposed-notes-content {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.notes-section {
    margin-bottom: 1.5rem;
}

.notes-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.proposed-note-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    border-left: 3px solid var(--text-muted);
    transition: all 0.2s;
}

.proposed-note-card.rec-buy {
    border-left-color: var(--success);
}

.proposed-note-card.rec-sell {
    border-left-color: var(--danger);
}

.proposed-note-card.rec-hold {
    border-left-color: var(--warning);
}

.proposed-note-card.validated {
    opacity: 0.6;
    background: rgba(0, 212, 170, 0.1);
}

.proposed-note-card.ignored {
    opacity: 0.4;
    background: rgba(255, 107, 107, 0.1);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.note-ticker {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.note-recommendation {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.note-recommendation.rec-buy {
    background: rgba(0, 212, 170, 0.2);
    color: var(--success);
}

.note-recommendation.rec-sell {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
}

.note-recommendation.rec-hold {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
}

.note-card-body {
    margin-bottom: 0.5rem;
}

.note-prices {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.note-justification {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.note-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.validated-badge,
.ignored-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.validated-badge {
    background: rgba(0, 212, 170, 0.2);
    color: var(--success);
}

.ignored-badge {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
}

/* Warning sections for missing notes */
.notes-warning {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    margin-top: 1rem;
}

.notes-warning h4 {
    color: var(--warning);
    border-bottom-color: rgba(253, 203, 110, 0.3);
}

.notes-warning-block {
    background: rgba(253, 203, 110, 0.1);
    border-color: rgba(253, 203, 110, 0.3);
}

.notes-warning-block .proposed-notes-header {
    background: rgba(253, 203, 110, 0.2);
}

.notes-warning-block .proposed-notes-title {
    color: var(--warning);
}

.missing-notes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.missing-ticker {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.85rem;
}

.text-small {
    font-size: 0.75rem;
}

/* Note details modal */
.note-detail-grid {
    display: grid;
    gap: 0.75rem;
}

.note-detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.note-detail-full {
    margin-top: 0.5rem;
}

.note-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.note-value {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.note-value.rec-buy {
    color: var(--success);
}

.note-value.rec-sell {
    color: var(--danger);
}

.note-value.rec-hold {
    color: var(--warning);
}

/* === POSITIONS AGRÉGÉES === */
.aggregated-row {
    cursor: pointer;
}

.lots-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.sold-badge {
    background: var(--warning);
    color: var(--bg-dark);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 0.25rem;
}

.btn-icon {
    padding: 0.3rem 0.5rem !important;
    font-size: 1rem !important;
    min-width: auto;
}

.btn-icon.has-notes {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    border-color: var(--primary);
}

.lots-detail-row {
    background: rgba(0, 0, 0, 0.3) !important;
}

.lots-detail-row.hidden {
    display: none;
}

.lots-detail {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.lots-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.lots-table {
    width: 100%;
    font-size: 0.85rem;
    background: transparent;
}

.lots-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.lots-table th {
    padding: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.lots-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lots-table .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.lot-comment {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

.lot-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lot-actions .btn-primary {
    font-weight: 500;
}

.realized-pnl {
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: right;
}

.realized-pnl.positive {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
}

.realized-pnl.negative {
    background: rgba(255, 61, 87, 0.15);
    color: var(--danger);
}

/* === SOLD LOTS TABLE === */
.sold-header {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 183, 77, 0.2), rgba(255, 143, 0, 0.1));
    border-left: 3px solid var(--warning);
}

.sold-table {
    background: rgba(255, 183, 77, 0.05);
}

.sold-table thead th {
    background: rgba(255, 183, 77, 0.15);
    color: var(--warning);
}

.sold-row td {
    color: var(--text-muted);
}

.sold-row td.positive {
    color: var(--success);
    font-weight: 600;
}

.sold-row td.negative {
    color: var(--danger);
    font-weight: 600;
}

/* === MODAL VENTE AMÉLIORÉ === */
.sell-lot-info,
.edit-position-info {
    margin-bottom: 1rem;
}

.lot-info-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
}

.lot-info-card .lot-ticker {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.lot-info-card .lot-details {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.lot-info-card .lot-details span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lot-info-card .lot-details strong {
    color: var(--text-primary);
}

.quantity-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quantity-input-wrapper input {
    flex: 1;
}

.sell-summary {
    margin-top: 1rem;
}

.sell-summary-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
}

.sell-summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sell-summary-card .summary-row:last-child {
    border-bottom: none;
}

.sell-summary-card .summary-row.positive strong {
    color: var(--success);
}

.sell-summary-card .summary-row.negative strong {
    color: var(--danger);
}

.sell-summary-card .partial-info {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    margin-top: 0.5rem;
    padding: 0.5rem;
    color: var(--warning);
}

.sell-summary-card .partial-info strong {
    color: var(--warning);
}

/* === NOTES IA === */
.modal-large {
    max-width: 700px;
    width: 90%;
}

.modal-large textarea {
    width: 100%;
    min-height: 250px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bg-darker);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    resize: vertical;
}

.modal-large textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.modal-large textarea::placeholder {
    color: var(--text-muted);
}

.notes-position-info {
    margin-bottom: 1rem;
}

.notes-info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
}

.notes-info-card .notes-ticker {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.notes-info-card .notes-details {
    color: var(--text-secondary);
}

.ai-notes-row {
    background: rgba(99, 102, 241, 0.05) !important;
}

.ai-notes-preview {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ai-notes-preview .ai-notes-icon {
    flex-shrink: 0;
}

.ai-notes-preview .ai-notes-text {
    flex: 1;
    line-height: 1.4;
    white-space: pre-wrap;
}

.ai-notes-preview .btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ai-notes-preview .btn-link:hover {
    text-decoration: underline;
}

/* === CASH DISPONIBLE === */
.cash-available-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.cash-info {
    flex: 1;
}

.cash-info .cash-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.cash-info .cash-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success);
}

.cash-info .cash-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.cash-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.cash-summary .summary-item {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
}

.cash-summary .summary-item .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cash-summary .summary-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.cash-summary .summary-item .value.highlight {
    color: var(--primary);
    font-size: 1.1rem;
}

/* === JOB STATUS ERROR === */
.job-status-error {
    padding: 1rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.job-status-error p {
    margin: 0 0 0.5rem 0;
}

.job-status-error .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.job-status-error .btn {
    margin-top: 0.5rem;
}

/* === CONFIRM MODAL AMÉLIORÉ === */
.confirm-modal .confirm-message {
    white-space: pre-wrap;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.confirm-modal .modal {
    max-width: 500px;
}

.model-id {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.model-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.model-tokens {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.model-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .claude-model-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .model-actions {
        justify-content: flex-end;
    }
}

/* === TOKEN COSTS === */
.token-costs-form {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.token-costs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.token-costs-info {
    background: rgba(0, 212, 170, 0.05);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.token-costs-info p {
    margin: 0;
    line-height: 1.6;
}

.token-cost {
    color: var(--accent);
    font-weight: 500;
}

.results-meta .token-cost {
    background: rgba(255, 215, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .token-costs-grid {
        grid-template-columns: 1fr;
    }
}

/* === ADMINISTRATION === */
.nav-admin {
    color: var(--accent) !important;
    font-weight: 600;
}

.avatar-admin {
    background: linear-gradient(135deg, var(--accent), #00b894) !important;
}

.avatar-superadmin {
    background: linear-gradient(135deg, #ffd700, #ff6b6b) !important;
}

.superadmin-badge {
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.admin-role-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-role-badge.superadmin {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 107, 107, 0.2));
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.admin-role-badge.admin {
    background: rgba(0, 212, 170, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-performers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.performers-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.performers-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.performers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.performer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.performer-item .rank {
    font-weight: 600;
    width: 2rem;
    color: var(--text-muted);
}

.performer-item .username {
    flex: 1;
    font-weight: 500;
}

.performer-item .pnl {
    font-weight: 600;
    min-width: 6rem;
    text-align: right;
}

.performer-item .trades {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-section h2 {
    margin-bottom: 1rem;
}

.admin-users-table {
    width: 100%;
}

.admin-users-table th,
.admin-users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-cell .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.inactive-user {
    opacity: 0.5;
}

.role-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.superadmin {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 107, 107, 0.3));
    color: #ffd700;
}

.role-badge.admin {
    background: rgba(0, 212, 170, 0.2);
    color: var(--primary);
}

.role-badge.user {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.status-badge.inactive {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
}

.status-badge.active {
    background: rgba(0, 212, 170, 0.2);
    color: var(--primary);
}

.status-badge.sold {
    background: rgba(255, 193, 7, 0.2);
    color: var(--accent);
}

.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.user-stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
}

.stat-mini {
    display: flex;
    justify-content: space-between;
}

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

.stat-mini .value {
    font-weight: 600;
}

.sold-position {
    opacity: 0.7;
}

@media (max-width: 1200px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-performers-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-users-table {
        font-size: 0.85rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* === ACTIVITIES (Admin) === */

.activity-count {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activities-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
}

.activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.activities-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.activity-column {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
}

.activity-column h5 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary);
}

.activity-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .activities-container {
        grid-template-columns: 1fr;
    }
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
    color: var(--text-primary);
}

.toast-info {
    border-left: 4px solid var(--info);
}

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

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* ============================================================================
   LOGS SECTION - Admin Panel
   ============================================================================ */

.logs-controls {
    margin-bottom: 1.5rem;
}

.logs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.logs-filters select,
.logs-filters input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.logs-filters input {
    min-width: 200px;
}

.log-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Conteneurs des logs */
#log-content-container {
    width: 100% !important;
    display: block !important;
}

.log-info {
    margin-bottom: 1rem;
}

.log-table-container {
    width: 100% !important;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.log-table {
    width: 100% !important;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.log-table thead {
    background: var(--bg-card);
}

.log-table th,
.log-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.log-table th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    z-index: 1;
    white-space: nowrap;
}

/* Cellules de données */
.log-table td.log-timestamp {
    white-space: nowrap;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.8rem;
    min-width: 150px;
}

.log-table td.log-level {
    min-width: 70px;
}

.log-table td.log-source {
    color: var(--secondary);
    font-size: 0.8rem;
    min-width: 100px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-table td.log-message {
    word-break: break-word;
}

.log-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.level-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.level-error {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
}

.level-warning {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
}

.level-info {
    background: rgba(116, 185, 255, 0.2);
    color: var(--info);
}

.level-debug {
    background: rgba(139, 149, 165, 0.2);
    color: var(--text-muted);
}

.log-error {
    background: rgba(255, 107, 107, 0.05);
}

.log-warning {
    background: rgba(253, 203, 110, 0.05);
}

/* Log Stats */
.log-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.log-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    text-align: center;
}

.log-stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.log-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.log-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.log-stat-card.error {
    border-color: var(--danger);
}

.log-stat-card.warning {
    border-color: var(--warning);
}

#log-stats-container {
    margin-bottom: 1.5rem;
}


/* ============================================================================
   TUTORIEL / ONBOARDING
   ============================================================================ */

/* === OVERLAY DU TUTORIEL === */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.7);
    /* Pas de blur pour ne pas affecter le spotlight */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

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

/* === SPOTLIGHT (Zone mise en évidence) === */
.tutorial-spotlight {
    position: fixed;
    z-index: 9999;
    border-radius: 12px;
    box-shadow: 
        0 0 0 9999px rgba(10, 14, 23, 0.85),
        0 0 30px rgba(0, 212, 170, 0.4),
        inset 0 0 0 2px rgba(0, 212, 170, 0.6);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.tutorial-spotlight.active {
    opacity: 1;
}

/* Animation pulsation du spotlight */
@keyframes spotlightPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 9999px rgba(10, 14, 23, 0.85),
            0 0 30px rgba(0, 212, 170, 0.4),
            inset 0 0 0 2px rgba(0, 212, 170, 0.6);
    }
    50% {
        box-shadow: 
            0 0 0 9999px rgba(10, 14, 23, 0.85),
            0 0 50px rgba(0, 212, 170, 0.6),
            inset 0 0 0 3px rgba(0, 212, 170, 0.8);
    }
}

.tutorial-spotlight.pulse {
    animation: spotlightPulse 2s ease-in-out infinite;
}

/* === POPUP DU TUTORIEL (Glassmorphisme) === */
.tutorial-popup {
    position: fixed;
    z-index: 10000;
    background: rgba(20, 27, 45, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 420px;
    min-width: 320px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 212, 170, 0.15);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-popup.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header du popup */
.tutorial-popup-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-popup-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(108, 92, 231, 0.2));
    border-radius: 10px;
}

.tutorial-popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.tutorial-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.tutorial-popup-close:hover {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
}

/* Contenu du popup */
.tutorial-popup-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.tutorial-popup-content strong {
    color: var(--primary);
}

.tutorial-popup-content .highlight {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(108, 92, 231, 0.15));
    padding: 0.75rem;
    border-radius: 8px;
    margin: 0.75rem 0;
    border-left: 3px solid var(--primary);
}

/* Indicateur de progression */
.tutorial-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tutorial-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s;
}

.tutorial-progress-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.tutorial-progress-dot.completed {
    background: var(--primary);
    opacity: 0.5;
}

.tutorial-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Footer avec boutons */
.tutorial-popup-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.tutorial-btn {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
}

.tutorial-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.tutorial-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.tutorial-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.tutorial-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tutorial-btn-skip {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tutorial-btn-skip:hover {
    color: var(--danger);
}

.tutorial-btn-group {
    display: flex;
    gap: 0.5rem;
}

/* === MODAL DE BIENVENUE (Premier lancement) === */
.tutorial-welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

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

.tutorial-welcome-modal {
    background: rgba(20, 27, 45, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(0, 212, 170, 0.1);
    transform: scale(0.9) translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.tutorial-welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tutorial-welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tutorial-welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tutorial-welcome-btn {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tutorial-welcome-btn-start {
    background: linear-gradient(135deg, var(--primary), #00b894);
    color: white;
}

.tutorial-welcome-btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 212, 170, 0.4);
}

.tutorial-welcome-btn-later {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.tutorial-welcome-btn-later:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tutorial-welcome-btn-skip {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tutorial-welcome-btn-skip:hover {
    color: var(--danger);
}

/* === BADGES DE STATUT TUTORIEL === */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.status-success {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.status-badge.status-warning {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.status-badge.status-pending {
    background: rgba(139, 149, 165, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(139, 149, 165, 0.3);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .tutorial-popup {
        max-width: 90%;
        min-width: 280px;
        padding: 1.25rem;
    }
    
    .tutorial-popup-footer {
        flex-direction: column;
    }
    
    .tutorial-btn-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .tutorial-welcome-modal {
        padding: 1.75rem;
    }
    
    .tutorial-welcome-icon {
        font-size: 3rem;
    }
    
    .tutorial-welcome-title {
        font-size: 1.5rem;
    }
}


