/**
 * ====================================================================
 * ALPHAVAULT AI - REAL ESTATE & TAX SIMULATOR - STYLES COMPLETS
 * ====================================================================
 * Design: Glassmorphism + Gradient Titles + Ultra Premium
 * 100% Responsive PC & Mobile
 */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --re-primary: #3b82f6;
    --re-secondary: #8b5cf6;
    --re-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --re-gradient-soft: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    --re-success: #10b981;
    --re-danger: #ef4444;
    --re-warning: #f59e0b;
    --re-info: #3b82f6;
    --re-purple: #8b5cf6;
    
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

body.dark-mode {
    --glass-bg: rgba(15, 23, 42, 0.95);
    --glass-border: rgba(100, 116, 139, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ========================================
   GRADIENT TITLES
   ======================================== */
.page-title {
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.section-title i {
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   HEADER BUTTONS
   ======================================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--re-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.dashboard-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.dashboard-btn:hover::before {
    left: 100%;
}

.dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.dashboard-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.dashboard-btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

@media (max-width: 768px) {
    .dashboard-btn .btn-text {
        display: none;
    }
    
    .dashboard-btn {
        padding: 10px 14px;
    }
}

/* ========================================
   SIMULATION INFO CARD
   ======================================== */
.simulation-info-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    margin-bottom: 32px;
    transition: var(--transition-smooth);
}

.simulation-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.25);
}

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item label i {
    color: var(--re-primary);
}

.info-item span {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-left: 8px;
}

.btn-icon-sm:hover {
    background: var(--re-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.15);
}

/* ========================================
   KPIs GRID
   ======================================== */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius);
    border: 2px solid var(--glass-border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--re-gradient);
    opacity: 0;
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.3);
    border-color: var(--re-primary);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.kpi-icon.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.kpi-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.kpi-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.kpi-icon.info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.kpi-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.kpi-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* ========================================
   SECTION STYLES
   ======================================== */
.section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 32px;
    margin-bottom: 32px;
    transition: var(--transition-smooth);
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.25);
}

.section-header {
    margin-bottom: 24px;
}

.section-body {
    /* No specific styles, acts as container */
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-group label i {
    color: var(--re-primary);
    font-size: 1rem;
}

.required {
    color: var(--re-danger);
    font-weight: 800;
}

.form-control {
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    transition: var(--transition-smooth);
    max-width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--re-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-control:read-only {
    background: rgba(100, 116, 139, 0.1);
    cursor: not-allowed;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--re-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 8px;
    transition: var(--transition-smooth);
}

.btn-link:hover {
    color: var(--re-secondary);
}

.form-section {
    background: var(--re-gradient-soft);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-top: 32px;
    margin-bottom: 24px;
}

.subsection-title {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection-title i {
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* ========================================
   BUTTONS - UNIFORM PREMIUM DESIGN
   ======================================== */
.btn,
button[class*="btn"],
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-cancel,
.btn-compare,
.btn-add {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
}

.btn::before,
button[class*="btn"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before,
button[class*="btn"]:hover::before {
    left: 100%;
}

/* Primary Button */
.btn-primary {
    background: var(--re-gradient);
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Secondary/Cancel Button */
.btn-secondary,
.btn-cancel {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 8px 24px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover,
.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(108, 117, 125, 0.5);
    background: linear-gradient(135deg, #5a6268, #3d4348);
}

.btn-secondary:active,
.btn-cancel:active {
    transform: translateY(0);
}

/* Success/Add Property Button */
.btn-success,
.btn-add {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-success:hover,
.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(16, 185, 129, 0.6);
}

.btn-success:active,
.btn-add:active {
    transform: translateY(0);
}

.btn-success:disabled {
    background: linear-gradient(135deg, #6c757d, #495057);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-success:disabled:hover {
    transform: none;
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(239, 68, 68, 0.6);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Info/Compare Button */
.btn-info,
.btn-compare {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-info:hover,
.btn-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(59, 130, 246, 0.6);
}

.btn-info:active,
.btn-compare:active {
    transform: translateY(0);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(245, 158, 11, 0.6);
}

.btn-warning:active {
    transform: translateY(0);
}

/* Button Sizes */
.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* ========================================
   BORROWING CAPACITY SECTION
   ======================================== */
.capacity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.capacity-card {
    background: var(--re-gradient-soft);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
}

.capacity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.2);
    border-color: var(--re-primary);
}

.capacity-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--re-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.capacity-content {
    flex: 1;
}

.capacity-content h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}

.capacity-value {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 6px;
}

.capacity-content small {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.capacity-bar-section {
    margin-top: 24px;
}

.capacity-bar-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.debt-ratio-bar {
    width: 100%;
    height: 32px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--glass-border);
}

.debt-ratio-fill {
    height: 100%;
    border-radius: 16px;
    transition: width 1s ease, background 0.5s ease;
    position: relative;
}

.debt-ratio-markers {
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ========================================
   TAX & FEES SECTION
   ======================================== */
.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--re-gradient);
    color: white;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    margin-left: auto;
}

.tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.tax-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.tax-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.2);
    border-color: var(--re-primary);
}

.tax-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--re-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.tax-content {
    flex: 1;
}

.tax-content h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.tax-amount {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 4px;
}

.tax-frequency {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

.tax-summary {
    background: var(--re-gradient-soft);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-top: 24px;
}

.tax-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 1rem;
}

.tax-summary-item:last-child {
    border-bottom: none;
}

.tax-summary-item span {
    color: var(--text-secondary);
    font-weight: 600;
}

.tax-summary-item strong {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.1rem;
}

.tax-summary-item.total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--glass-border);
    font-size: 1.1rem;
}

.tax-summary-item.total strong {
    font-size: 1.3rem;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   FINANCIAL RESULTS SECTION
   ======================================== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.result-card {
    background: var(--re-gradient-soft);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition-smooth);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.2);
    border-color: var(--re-primary);
}

.result-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-card h4 i {
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item span {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.breakdown-item strong {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1rem;
}

.breakdown-item.total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--glass-border);
    font-size: 1.05rem;
}

.breakdown-item.total strong {
    font-size: 1.2rem;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-danger {
    color: var(--re-danger) !important;
}

.text-success {
    color: var(--re-success) !important;
}

/* ========================================
   CHARTS SECTION
   ======================================== */
.chart-container {
    margin-bottom: 40px;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-title i {
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart {
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
}

/* ========================================
   COMPARISON TABLE
   ======================================== */
.comparison-table-wrapper {
    overflow-x: auto;
    margin-bottom: 32px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    max-width: 100%;
}

.comparison-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
}

.comparison-table thead {
    background: var(--re-gradient);
    color: white;
}

.comparison-table th {
    padding: 16px;
    text-align: left;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.comparison-table tbody tr {
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
}

.comparison-table tbody tr:hover {
    background: var(--re-gradient-soft);
}

.comparison-table td {
    padding: 14px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.comparison-table td:first-child {
    font-weight: 800;
    color: var(--text-secondary);
}

.comparison-chart-container {
    margin-top: 32px;
}

/* ========================================
   SAVED SIMULATIONS GRID
   ======================================== */
.simulations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.simulations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simulations-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--re-gradient-soft);
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius-lg);
}

.simulations-empty i {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.simulations-empty p {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.simulations-empty small {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.simulation-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.simulation-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.3);
    border-color: var(--re-primary);
}

.sim-header {
    background: var(--re-gradient);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.sim-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    word-break: break-word;
}

.sim-country {
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.sim-body {
    padding: 20px;
}

.sim-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.sim-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    word-break: break-word;
}

.sim-info i {
    color: var(--re-primary);
    width: 20px;
    flex-shrink: 0;
}

.sim-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.sim-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-metric small {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sim-metric strong {
    font-size: 1.1rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: break-word;
}

.sim-footer {
    padding: 16px 20px;
    background: rgba(241, 245, 249, 0.5);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

body.dark-mode .sim-footer {
    background: rgba(30, 41, 59, 0.5);
}

.sim-footer small {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sim-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--re-gradient-soft);
}

.modal-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--re-danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px;
    overflow-x: hidden;
    max-width: 100%;
}

.modal-body * {
    max-width: 100%;
    box-sizing: border-box;
}

.modal-body p {
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.modal-body ul,
.modal-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.modal-body h4 {
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 24px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--re-warning);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.warning-box i {
    color: var(--re-warning);
    margin-right: 8px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ========================================
   PORTFOLIO MANAGEMENT SECTION
   ======================================== */

/* Portfolio KPIs Grid */
.portfolio-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.portfolio-kpi-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius);
    border: 2px solid var(--glass-border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.portfolio-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--re-gradient);
    opacity: 0;
    transition: var(--transition-smooth);
}

.portfolio-kpi-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.3);
    border-color: var(--re-primary);
}

.portfolio-kpi-card:hover::before {
    opacity: 1;
}

.portfolio-kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.portfolio-kpi-card:hover .portfolio-kpi-icon {
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.portfolio-kpi-icon.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.portfolio-kpi-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.portfolio-kpi-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.portfolio-kpi-icon.info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.portfolio-kpi-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.portfolio-kpi-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.portfolio-kpi-content {
    flex: 1;
}

.portfolio-kpi-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.portfolio-kpi-value {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* Portfolio Filters */
.portfolio-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--re-gradient-soft);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.filter-group label i {
    color: var(--re-primary);
}

/* Portfolio Charts Grid */
.portfolio-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Portfolio Properties Grid */
.portfolio-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.portfolio-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--re-gradient-soft);
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius-lg);
}

.portfolio-empty i {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.portfolio-empty p {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.portfolio-empty small {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* Property Card */
.property-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
}

.property-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--re-gradient);
    opacity: 0;
    transition: var(--transition-smooth);
}

.property-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.35);
    border-color: var(--re-primary);
}

.property-card:hover::before {
    opacity: 1;
}

.property-card.active::before {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.property-card.paid_off::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Property Header */
.property-header {
    padding: 20px 24px;
    background: var(--re-gradient-soft);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.property-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.property-country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--re-gradient);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.property-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.property-status.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.property-status.paid_off {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.property-status i {
    font-size: 1rem;
}

/* Property Body */
.property-body {
    padding: 24px;
}

/* Property Main Stats */
.property-main-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--glass-border);
}

.property-main-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.property-main-stats .stat label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-main-stats .stat label i {
    color: var(--re-primary);
}

.property-main-stats .stat strong {
    font-size: 1.3rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.property-main-stats .stat small.appreciation {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--re-success);
    margin-top: -4px;
}

/* Property Timeline */
.property-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--re-gradient-soft);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
}

.timeline-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    border-color: var(--re-primary);
}

.timeline-item i {
    font-size: 1.5rem;
    color: var(--re-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

.timeline-item.text-success i {
    color: var(--re-success);
    background: rgba(16, 185, 129, 0.1);
}

.timeline-item > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-item label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-item span {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.timeline-item strong {
    font-size: 1.2rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-item small {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Property Progress Bar */
.property-progress {
    margin-top: 20px;
    padding: 20px;
    background: var(--re-gradient-soft);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-header span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.progress-header span:last-child {
    font-size: 1.1rem;
    font-weight: 900;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--glass-border);
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--re-gradient);
    border-radius: 12px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-footer small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

/* Property Actions */
.property-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(241, 245, 249, 0.5);
    border-top: 1px solid var(--glass-border);
}

body.dark-mode .property-actions {
    background: rgba(30, 41, 59, 0.5);
}

.btn-icon {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--re-gradient);
    border: none;
    color: white;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-icon.btn-danger:hover {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}

.btn-icon i {
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .kpis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .capacity-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .kpis-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-card {
        padding: 16px;
    }
    
    .kpi-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .info-row {
        grid-template-columns: 1fr;
    }
    
    .tax-grid {
        grid-template-columns: 1fr;
    }
    
    /* ✅ MY REAL ESTATE SIMULATIONS - MOBILE */
    .simulations-grid {
        grid-template-columns: 1fr;
    }
    
    .simulation-card {
        margin-bottom: 16px;
    }
    
    .sim-header {
        padding: 14px 16px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .sim-header h4 {
        font-size: 1rem;
        max-width: 60%;
    }
    
    .sim-country {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
    
    .sim-body {
        padding: 16px;
    }
    
    .sim-info span {
        font-size: 0.85rem;
    }
    
    .sim-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .sim-metric small {
        font-size: 0.7rem;
    }
    
    .sim-metric strong {
        font-size: 1rem;
    }
    
    .sim-footer {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    
     /* ✅ SIM ACTIONS - BOUTONS EN VERTICAL SUR MOBILE */
    .sim-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .sim-actions .btn-icon {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .sim-actions .btn-icon i {
        font-size: 1rem;
    }
    
    .sim-actions .btn-icon span {
        display: inline; /* Afficher le texte */
    }
    
    /* Couleurs spécifiques pour chaque bouton */
    .sim-actions .btn-icon:nth-child(1) {
        /* Bouton Upload/Download */
        background: linear-gradient(135deg, #667eea, #764ba2);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .sim-actions .btn-icon:nth-child(2) {
        /* Bouton Duplicate */
        background: linear-gradient(135deg, #667eea, #764ba2);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .sim-actions .btn-icon:nth-child(3),
    .sim-actions .btn-icon.btn-danger {
        /* Bouton Delete */
        background: linear-gradient(135deg, #ef4444, #dc2626);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }
    
    .btn-icon {
        flex: 1;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .btn-icon i {
        font-size: 0.9rem;
    }
    
    /* ✅ MODAL - MOBILE RESPONSIVE (AFFICHAGE VERTICAL COMPLET) */
    .modal.active {
        padding: 0;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--glass-bg);
        backdrop-filter: blur(40px) saturate(180%);
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 16px;
        overflow-x: hidden;
        width: 100%;
    }
    
    .modal-body > * {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* ✅ FORM DANS LES MODALS - AFFICHAGE VERTICAL */
    .modal-body .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-body .form-group {
        width: 100%;
    }
    
    .modal-body .form-control {
        width: 100%;
        max-width: 100%;
        font-size: 0.95rem;
    }
    
    /* ✅ MODAL TABLES - AFFICHAGE VERTICAL & SCROLLABLE */
    .modal-body .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .modal-body .comparison-table {
        min-width: 100%;
        font-size: 0.75rem;
        display: table;
    }
    
    .modal-body .comparison-table th,
    .modal-body .comparison-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
        white-space: normal;
        word-wrap: break-word;
        min-width: 80px;
    }
    
    .modal-body .comparison-table th {
        font-size: 0.7rem;
    }
    
    /* ✅ RESULTS CARDS DANS MODALS - AFFICHAGE VERTICAL */
    .modal-body .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-body .result-card {
        padding: 16px;
    }
    
    .modal-body .result-card h4 {
        font-size: 1rem;
    }
    
    .modal-body .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 0;
    }
    
    .modal-body .breakdown-item span,
    .modal-body .breakdown-item strong {
        font-size: 0.9rem;
    }
    
    /* ✅ MODAL ACTIONS - AFFICHAGE VERTICAL (TOUS LES BOUTONS) */
    .modal-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .modal-actions .btn,
    .modal-actions .btn-primary,
    .modal-actions .btn-secondary,
    .modal-actions .btn-success,
    .modal-actions .btn-danger,
    .modal-actions .btn-cancel,
    .modal-actions .btn-compare,
    .modal-actions .btn-add,
    .modal-actions button {
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 14px 24px;
        font-size: 0.95rem;
    }
    
    /* ✅ CHARTS DANS MODALS */
    .modal-body .chart-container {
        margin-bottom: 20px;
        overflow-x: hidden;
    }
    
    .modal-body .chart {
        min-height: 250px;
        max-width: 100%;
    }

    /* ========================================
       ✅ MODAL-OVERLAY - STYLE POUR LES MODALS JAVASCRIPT
       ======================================== */
    
    /* ✅ Fond modal overlay - scroll activé */
    .modal-overlay {
        padding: 16px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }
    
    /* ✅ Contenu modal overlay - NE PAS prendre 100% hauteur */
    .modal-overlay .modal-content {
        width: calc(100% - 32px) !important;
        max-width: 600px !important;
        min-height: auto !important; /* ❌ PAS 100vh */
        max-height: none !important; /* ❌ PAS de limite */
        height: auto !important; /* ✅ Hauteur automatique */
        margin: 16px auto !important;
        border-radius: 16px !important; /* ✅ Coins arrondis */
        overflow: visible !important;
        position: relative !important;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* ✅ Header sticky dans modal-overlay */
    .modal-overlay .modal-header {
        padding: 14px 16px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        background: var(--glass-bg) !important;
        backdrop-filter: blur(40px) saturate(180%) !important;
        border-bottom: 1px solid var(--glass-border) !important;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .modal-overlay .modal-header h2 {
        font-size: 1rem !important;
        gap: 8px !important;
    }
    
    .modal-overlay .btn-close {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.3rem !important;
    }
    
    /* ✅ Body modal overlay */
    .modal-overlay .modal-body {
        padding: 16px !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    /* ✅ Forms dans modal-overlay */
    .modal-overlay .form-row {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    
    .modal-overlay .form-group {
        width: 100% !important;
        margin-bottom: 16px !important;
    }
    
    .modal-overlay .form-control,
    .modal-overlay input,
    .modal-overlay select,
    .modal-overlay textarea {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.95rem !important;
        box-sizing: border-box !important;
    }
    
    /* ✅ Actions dans modal-overlay */
    .modal-overlay .modal-actions,
    .modal-overlay .form-actions {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 !important;
        margin-top: 16px !important;
    }
    
    .modal-overlay .modal-actions .btn,
    .modal-overlay .modal-actions button,
    .modal-overlay .form-actions .btn,
    .modal-overlay .form-actions button {
        width: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 12px 20px !important;
        font-size: 0.95rem !important;
    }
    
    /* ✅ Rent vs Buy results dans modal-overlay */
    .modal-overlay .rent-vs-buy-results {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* ✅ Comparison grid dans modal-overlay */
    .modal-overlay .comparison-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Tables générales */
    .comparison-table {
        font-size: 0.85rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px 12px;
    }
    
    .chart {
        min-height: 300px;
    }
    
    /* Portfolio Mobile */
    .portfolio-kpis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-filters {
        grid-template-columns: 1fr;
    }
    
    .portfolio-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-properties-grid {
        grid-template-columns: 1fr;
    }
    
    .property-card {
        margin-bottom: 16px;
    }
    
    .property-header {
        padding: 16px 20px;
    }
    
    .property-body {
        padding: 20px;
    }
    
    .property-main-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .property-timeline {
        gap: 12px;
    }
    
    .timeline-item {
        padding: 12px;
    }
    
    .property-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-icon {
        width: 100%;
    }
    
    /* Form Actions Mobile */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn,
    .form-actions button {
        width: 100%;
    }

    /* ========================================
       MY REAL ESTATE SIMULATIONS - MOBILE FIX
       ======================================== */
    
    /* ✅ HEADER ACTIONS - BOUTONS RESPONSIFS */
    .section .section-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 16px;
    }
    
    .section .header-actions {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }
    
    .section .header-actions .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
        justify-content: center;
    }
    
    .section .header-actions .btn i {
        font-size: 0.9rem;
    }
    
    /* Masquer texte des boutons secondaires sur très petit écran */
    .section .header-actions .btn .btn-text {
        display: inline;
    }
    
    /* ✅ SIMULATION CARD - ADAPTÉ MOBILE */
    .simulation-card {
        margin-bottom: 16px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* ✅ SIM HEADER - TITRE + BADGE PAYS */
    .sim-header {
        padding: 14px 16px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .sim-header h4 {
        font-size: 0.95rem;
        max-width: 65%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 0;
    }
    
    .sim-country {
        font-size: 0.75rem;
        padding: 4px 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* ✅ SIM BODY - INFO */
    .sim-body {
        padding: 16px;
    }
    
    .sim-info {
        gap: 10px;
    }
    
    .sim-info span {
        font-size: 0.85rem;
        display: flex;
        align-items: flex-start;
        gap: 8px;
        word-break: break-word;
    }
    
    .sim-info i {
        margin-top: 2px;
        flex-shrink: 0;
    }
    
    /* ✅ SIM METRICS - AFFICHAGE VERTICAL */
    .sim-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .sim-metric {
        padding: 12px;
        background: rgba(102, 126, 234, 0.05);
        border-radius: 8px;
        border: 1px solid var(--glass-border);
    }
    
    .sim-metric small {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    
    .sim-metric strong {
        font-size: 1.1rem;
        word-break: break-word;
    }
    
    /* ✅ SIM FOOTER - ACTIONS BOUTONS */
    .sim-footer {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .sim-footer small {
        font-size: 0.75rem;
        width: 100%;
        text-align: center;
    }
    
    /* ✅ SIM ACTIONS - BOUTONS HORIZONTAUX */
    .sim-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
    }
    
    .sim-actions .btn-icon {
        padding: 10px 8px;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
        justify-content: center;
        align-items: center;
    }
    
    .sim-actions .btn-icon i {
        font-size: 1rem;
        margin: 0;
    }
    
    .sim-actions .btn-icon span {
        display: none; /* Masquer texte pour gagner de la place */
    }
    
    /* ✅ SIMULATIONS EMPTY STATE */
    .simulations-empty {
        padding: 40px 20px;
        text-align: center;
    }
    
    .simulations-empty i {
        font-size: 3rem;
        margin-bottom: 12px;
    }
    
    .simulations-empty p {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .simulations-empty small {
        font-size: 0.85rem;
        display: block;
        margin-bottom: 16px;
    }
    
    .simulations-empty .btn-sm {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* ========================================
   EXTRA SMALL SCREENS (< 480px)
   ======================================== */
@media (max-width: 480px) {
    /* ✅ HEADER ACTIONS - 1 COLONNE SUR TRÈS PETIT ÉCRAN */
    .section .header-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .section .header-actions .btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .section .header-actions .btn .btn-text {
        display: inline; /* Afficher le texte en mode vertical */
    }
    
    /* ✅ SIM HEADER - VERTICAL SUR TRÈS PETIT ÉCRAN */
    .sim-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sim-header h4 {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }
    
    .sim-country {
        align-self: flex-end;
    }
    
    /* ✅ SIM ACTIONS - RESTE EN VERTICAL */
    .sim-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .sim-actions .btn-icon {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .sim-actions .btn-icon span {
        display: inline;
    }
}

@media (max-width: 480px) {
    .capacity-card {
        flex-direction: column;
        text-align: center;
    }
    
    .tax-card {
        flex-direction: column;
        text-align: center;
    }
    
    .result-card {
        padding: 16px;
    }
    
    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .sim-metrics {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio Extra Small */
    .portfolio-kpis-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-kpi-card {
        padding: 16px;
    }
    
    .portfolio-kpi-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .portfolio-kpi-value {
        font-size: 1.5rem;
    }
    
    .property-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .property-status {
        align-self: flex-end;
    }
    
    .property-main-stats {
        grid-template-columns: 1fr;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .timeline-item i {
        align-self: flex-start;
    }
    
    .property-progress {
        padding: 16px;
    }
    
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .progress-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    /* Sim Header Extra Small */
    .sim-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sim-header h4 {
        max-width: 100%;
    }
    
    .sim-country {
        align-self: flex-end;
    }
    
    /* Modal Tables Extra Small */
    .modal-body .comparison-table th,
    .modal-body .comparison-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
        min-width: 70px;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
.modal-content::-webkit-scrollbar,
.comparison-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-track,
.comparison-table-wrapper::-webkit-scrollbar-track {
    background: rgba(100, 116, 139, 0.1);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb,
.comparison-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--re-gradient);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--re-primary);
    outline-offset: 2px;
}

.property-card:focus-within {
    outline: 3px solid var(--re-primary);
    outline-offset: 2px;
}

.btn-icon:focus-visible {
    outline: 3px solid var(--re-primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .property-card {
        border-width: 3px;
    }
    
    .property-status {
        border: 2px solid currentColor;
    }
    
    .progress-bar {
        border-width: 3px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .sidebar,
    .top-header,
    .dashboard-btn,
    .btn-icon-sm,
    .modal,
    .sim-actions,
    .portfolio-filters,
    .property-actions,
    .btn-icon {
        display: none !important;
    }
    
    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .simulation-card,
    .property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .portfolio-charts-grid {
        break-inside: avoid;
    }
}

/* ========================================
   DARK MODE ENHANCEMENTS
   ======================================== */
body.dark-mode .property-card {
    background: rgba(15, 23, 42, 0.95);
}

body.dark-mode .timeline-item {
    background: rgba(30, 41, 59, 0.5);
}

body.dark-mode .property-progress {
    background: rgba(30, 41, 59, 0.5);
}

body.dark-mode .property-header {
    background: rgba(30, 41, 59, 0.3);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes propertyCardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.property-card {
    animation: propertyCardAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.property-card:nth-child(1) { animation-delay: 0.05s; }
.property-card:nth-child(2) { animation-delay: 0.1s; }
.property-card:nth-child(3) { animation-delay: 0.15s; }
.property-card:nth-child(4) { animation-delay: 0.2s; }
.property-card:nth-child(5) { animation-delay: 0.25s; }
.property-card:nth-child(6) { animation-delay: 0.3s; }

/* Progress Bar Pulse Animation */
@keyframes progressPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

.property-card.active .progress-fill {
    animation: progressPulse 2s infinite, shimmer 2s infinite;
}

/* Status Badge Glow */
@keyframes statusGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    }
}

.property-status.active {
    animation: statusGlow 2s infinite;
}

.property-status.paid_off {
    animation: statusGlow 2s infinite;
}

.property-status.paid_off {
    animation-name: statusGlowSuccess;
}

@keyframes statusGlowSuccess {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    }
}