/* ====================================================================
   ALPHAVAULT AI — REAL ESTATE & TAX SIMULATOR
   Drive-Integrated Styles v2.0
   • Drive CSS variables (--avd-*)
   • Light mode default via body.avd-page.light-mode
   • Zero animations / Zero keyframes
   • Simple 0.2s ease transitions only
==================================================================== */

/* ════════════════════════════════════════════════════════════════════
   1. RE VARIABLES (mapped to Drive)
════════════════════════════════════════════════════════════════════ */
:root {
    --re-gradient:        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --re-gradient-soft:   linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.06) 100%);
    --re-success:         #10b981;
    --re-danger:          #ef4444;
    --re-warning:         #f59e0b;
    --re-transition:      all 0.2s ease;
    --re-radius:          var(--avd-radius, 10px);
    --re-radius-lg:       var(--avd-radius-lg, 16px);
}

/* ════════════════════════════════════════════════════════════════════
   2. CONTENT AREA OVERRIDES
════════════════════════════════════════════════════════════════════ */

/* Override overflow for RE page — content must scroll freely */
body.avd-page #avDriveContent {
    overflow-y: auto;
    overflow-x: hidden;
}

/* ════════════════════════════════════════════════════════════════════
   3. TITLES & HEADINGS
════════════════════════════════════════════════════════════════════ */
.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--avd-text);
    flex-wrap: wrap;
}

.section-title i {
    color: var(--avd-primary, #667eea);
    font-size: 1rem;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--avd-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subsection-title i {
    color: var(--avd-primary, #667eea);
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--avd-text);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title i {
    color: var(--avd-primary, #667eea);
}

/* ════════════════════════════════════════════════════════════════════
   4. SECTION CARD (matches Drive card style)
════════════════════════════════════════════════════════════════════ */
.section {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    box-shadow: var(--avd-shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.section:hover {
    border-color: var(--avd-border-hover);
}

.section-header {
    margin-bottom: 20px;
}

.section-body {
    /* container only */
}

/* ════════════════════════════════════════════════════════════════════
   5. KPIs SUMMARY GRID
════════════════════════════════════════════════════════════════════ */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--re-transition);
}

.kpi-card:hover {
    border-color: var(--avd-border-hover);
    box-shadow: var(--avd-shadow);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.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;
    min-width: 0;
}

.kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--avd-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════════════════
   6. FORM STYLES
════════════════════════════════════════════════════════════════════ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 800;
    color: var(--avd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.form-group label i {
    color: var(--avd-primary, #667eea);
    font-size: 11px;
}

.required {
    color: var(--re-danger);
    font-weight: 800;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--avd-text);
    background: var(--avd-input-bg);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius);
    outline: none;
    transition: var(--re-transition);
    box-sizing: border-box;
}

.form-control::placeholder {
    color: var(--avd-text-dim);
}

.form-control:focus {
    border-color: var(--avd-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-control:read-only {
    background: var(--avd-input-bg);
    opacity: 0.6;
    cursor: not-allowed;
}

.form-control option {
    background: #1e293b;
    color: #f0f4f8;
}

body.light-mode .form-control option {
    background: #ffffff;
    color: #1e293b;
}

.hint {
    font-size: 10px;
    color: var(--avd-text-dim);
    display: flex;
    align-items: center;
    gap: 5px;
}

.hint i {
    color: var(--avd-primary, #667eea);
}

.form-section {
    background: var(--re-gradient-soft);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius);
    padding: 20px;
    margin-top: 24px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════
   7. BUTTONS (RE-specific, for form actions)
════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--re-radius);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--re-transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--re-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    opacity: 0.93;
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #6c757d, #495057);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-secondary {
    background: var(--avd-input-bg);
    border-color: var(--avd-border);
    color: var(--avd-text-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--avd-text);
    border-color: var(--avd-border-hover);
}

body.light-mode .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    opacity: 0.93;
}

.btn-success:disabled {
    background: linear-gradient(135deg, #6c757d, #495057);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    opacity: 0.93;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    opacity: 0.93;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    opacity: 0.93;
}

.btn-cancel {
    background: var(--avd-input-bg);
    border: 1px solid var(--avd-border);
    color: var(--avd-text-muted);
}

.btn-cancel:hover {
    color: var(--avd-text);
    border-color: var(--avd-border-hover);
}

.btn-compare {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.btn-compare:hover { opacity: 0.93; }

.btn-add {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-add:hover { opacity: 0.93; }

/* Sizes */
.btn-lg { padding: 12px 28px; font-size: 13px; }
.btn-sm { padding: 6px 14px;  font-size: 11px; }

/* Icon button (inside property/simulation cards) */
.btn-icon {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--re-gradient);
    border: none;
    color: #fff;
    border-radius: var(--re-radius);
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--re-transition);
}

.btn-icon:hover { opacity: 0.88; }

.btn-icon.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Small icon button */
.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--avd-border);
    color: var(--avd-text-muted);
    border-radius: 7px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--re-transition);
}

.btn-icon-sm:hover {
    background: var(--re-gradient);
    color: #fff;
    border-color: transparent;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--avd-primary, #667eea);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--re-transition);
}

.btn-link:hover { opacity: 0.75; }

/* ════════════════════════════════════════════════════════════════════
   8. BORROWING CAPACITY
════════════════════════════════════════════════════════════════════ */
.capacity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.capacity-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--re-transition);
}

.capacity-card:hover {
    border-color: var(--avd-border-hover);
    box-shadow: var(--avd-shadow);
}

.capacity-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--re-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.capacity-content { flex: 1; min-width: 0; }

.capacity-content h4 {
    font-size: 10px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin: 0 0 6px 0;
}

.capacity-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--avd-text);
    line-height: 1.2;
    margin-bottom: 4px;
}

.capacity-content small {
    font-size: 10px;
    color: var(--avd-text-dim);
}

.capacity-bar-section { margin-top: 20px; }

.capacity-bar-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--avd-text-muted);
    margin-bottom: 12px;
}

.debt-ratio-bar {
    width: 100%;
    height: 12px;
    background: var(--avd-input-bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--avd-border);
}

.debt-ratio-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--re-gradient);
    transition: width 0.4s ease;
}

.debt-ratio-markers {
    position: absolute;
    top: -24px;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--avd-text-dim);
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════
   9. TAX & FEES
════════════════════════════════════════════════════════════════════ */
.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--re-gradient);
    color: #fff;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}

.tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.tax-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--re-transition);
}

.tax-card:hover {
    border-color: var(--avd-border-hover);
    box-shadow: var(--avd-shadow);
}

.tax-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--re-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.tax-content { flex: 1; min-width: 0; }

.tax-content h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--avd-text-muted);
    margin: 0 0 6px 0;
}

.tax-amount {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--avd-text);
    line-height: 1.2;
    margin-bottom: 3px;
}

.tax-frequency {
    font-size: 10px;
    color: var(--avd-text-dim);
    font-weight: 600;
}

.tax-summary {
    background: var(--re-gradient-soft);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius);
    padding: 18px;
    margin-top: 16px;
}

.tax-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--avd-border);
    font-size: 12px;
}

.tax-summary-item:last-child { border-bottom: none; }

.tax-summary-item span {
    color: var(--avd-text-muted);
    font-weight: 600;
}

.tax-summary-item strong {
    color: var(--avd-text);
    font-weight: 800;
}

.tax-summary-item.total {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid var(--avd-border);
    font-size: 13px;
}

.tax-summary-item.total strong {
    font-size: 1.1rem;
    background: var(--re-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ════════════════════════════════════════════════════════════════════
   10. FINANCIAL RESULTS
════════════════════════════════════════════════════════════════════ */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.result-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    padding: 18px;
    transition: var(--re-transition);
}

.result-card:hover {
    border-color: var(--avd-border-hover);
    box-shadow: var(--avd-shadow);
}

.result-card h4 {
    font-size: 12px;
    font-weight: 800;
    color: var(--avd-text);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-card h4 i { color: var(--avd-primary, #667eea); }

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--avd-border);
}

.breakdown-item:last-child { border-bottom: none; }

.breakdown-item span {
    font-size: 11px;
    font-weight: 600;
    color: var(--avd-text-muted);
}

.breakdown-item strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--avd-text);
}

.breakdown-item.total {
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid var(--avd-border);
}

.breakdown-item.total strong {
    font-size: 1rem;
    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; }

/* ════════════════════════════════════════════════════════════════════
   11. CHARTS
════════════════════════════════════════════════════════════════════ */
.chart-container {
    margin-bottom: 28px;
}

.chart {
    min-height: 360px;
    border-radius: var(--re-radius);
    overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════
   12. COMPARISON TABLE
════════════════════════════════════════════════════════════════════ */
.comparison-table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: var(--re-radius);
    border: 1px solid var(--avd-border);
}

.comparison-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    background: var(--avd-card);
}

.comparison-table thead {
    background: var(--re-gradient);
}

.comparison-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 800;
    font-size: 11px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.comparison-table tbody tr {
    border-bottom: 1px solid var(--avd-border);
    transition: background 0.15s ease;
}

.comparison-table tbody tr:last-child { border-bottom: none; }

.comparison-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.04);
}

body.light-mode .comparison-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.comparison-table td {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--avd-text-muted);
    white-space: nowrap;
}

.comparison-table td:first-child {
    font-weight: 700;
    color: var(--avd-text);
}

.comparison-chart-container { margin-top: 24px; }

/* ════════════════════════════════════════════════════════════════════
   13. SAVED SIMULATIONS
════════════════════════════════════════════════════════════════════ */
.simulations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simulations-empty {
    text-align: center;
    padding: 48px 20px;
    background: var(--re-gradient-soft);
    border: 1px dashed var(--avd-border);
    border-radius: var(--re-radius-lg);
}

.simulations-empty i {
    font-size: 3rem;
    color: var(--avd-text-dim);
    margin-bottom: 14px;
    display: block;
}

.simulations-empty p {
    font-size: 13px;
    font-weight: 700;
    color: var(--avd-text-muted);
    margin-bottom: 6px;
}

.simulations-empty small {
    font-size: 11px;
    color: var(--avd-text-dim);
    display: block;
    margin-bottom: 16px;
}

/* Simulation card */
.simulation-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    overflow: hidden;
    transition: var(--re-transition);
}

.simulation-card:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: var(--avd-shadow);
}

.sim-header {
    background: var(--re-gradient);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sim-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    word-break: break-word;
}

.sim-country {
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
    padding: 3px 10px;
    border-radius: 7px;
    white-space: nowrap;
}

.sim-body { padding: 16px 18px; }

.sim-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.sim-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--avd-text-muted);
}

.sim-info i {
    color: var(--avd-primary, #667eea);
    width: 16px;
    flex-shrink: 0;
}

.sim-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--avd-border);
}

.sim-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sim-metric small {
    font-size: 9px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sim-metric strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--avd-text);
}

.sim-footer {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--avd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

body.light-mode .sim-footer {
    background: rgba(0, 0, 0, 0.02);
}

.sim-footer small {
    font-size: 10px;
    color: var(--avd-text-dim);
    display: flex;
    align-items: center;
    gap: 5px;
}

.sim-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════
   14. PORTFOLIO MANAGEMENT
════════════════════════════════════════════════════════════════════ */
.portfolio-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.portfolio-kpi-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--re-transition);
}

.portfolio-kpi-card:hover {
    border-color: var(--avd-border-hover);
    box-shadow: var(--avd-shadow);
}

.portfolio-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.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; min-width: 0; }

.portfolio-kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 6px;
}

.portfolio-kpi-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--avd-text);
    line-height: 1.2;
}

/* Portfolio charts grid */
.portfolio-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Portfolio properties grid */
.portfolio-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.portfolio-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    background: var(--re-gradient-soft);
    border: 1px dashed var(--avd-border);
    border-radius: var(--re-radius-lg);
}

.portfolio-empty i {
    font-size: 3rem;
    color: var(--avd-text-dim);
    margin-bottom: 12px;
    display: block;
}

.portfolio-empty p {
    font-size: 13px;
    font-weight: 700;
    color: var(--avd-text-muted);
    margin-bottom: 6px;
}

.portfolio-empty small {
    font-size: 11px;
    color: var(--avd-text-dim);
}

/* Portfolio filters */
.portfolio-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px;
    background: var(--re-gradient-soft);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--avd-text-muted);
}

.filter-group label i { color: var(--avd-primary, #667eea); }

/* ════════════════════════════════════════════════════════════════════
   15. PROPERTY CARDS
════════════════════════════════════════════════════════════════════ */
.property-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    overflow: hidden;
    transition: var(--re-transition);
    position: relative;
}

.property-card:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: var(--avd-shadow-lg);
}

.property-header {
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid var(--avd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

body.light-mode .property-header {
    background: rgba(102, 126, 234, 0.04);
}

.property-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.property-title h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--avd-text);
}

.property-country {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--re-gradient);
    color: #fff;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
}

.property-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-status.active  { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.property-status.paid_off { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }

.property-body { padding: 20px; }

.property-main-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--avd-border);
}

.property-main-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.property-main-stats .stat label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-main-stats .stat label i { color: var(--avd-primary, #667eea); }

.property-main-stats .stat strong {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--avd-text);
}

.property-main-stats .stat small.appreciation {
    font-size: 11px;
    font-weight: 700;
    color: var(--re-success);
}

/* Property Timeline */
.property-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--re-gradient-soft);
    border-radius: var(--re-radius);
    border: 1px solid var(--avd-border);
    transition: var(--re-transition);
}

.timeline-item:hover {
    border-color: var(--avd-border-hover);
}

.timeline-item i {
    font-size: 1.2rem;
    color: var(--avd-primary, #667eea);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 7px;
    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: 3px;
}

.timeline-item label {
    font-size: 10px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-item span {
    font-size: 12px;
    font-weight: 700;
    color: var(--avd-text);
}

.timeline-item strong {
    font-size: 13px;
    font-weight: 900;
    color: var(--avd-text);
}

.timeline-item small {
    font-size: 10px;
    color: var(--avd-text-dim);
    font-weight: 600;
}

/* Property Progress Bar */
.property-progress {
    margin-top: 16px;
    padding: 16px;
    background: var(--re-gradient-soft);
    border-radius: var(--re-radius);
    border: 1px solid var(--avd-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-header span {
    font-size: 11px;
    font-weight: 700;
    color: var(--avd-text-muted);
}

.progress-header span:last-child {
    font-size: 13px;
    font-weight: 900;
    color: var(--avd-text);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--avd-input-bg);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--avd-border);
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--re-gradient);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-footer small {
    font-size: 10px;
    font-weight: 600;
    color: var(--avd-text-dim);
}

/* Property Actions */
.property-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--avd-border);
}

body.light-mode .property-actions {
    background: rgba(0, 0, 0, 0.02);
}

/* ════════════════════════════════════════════════════════════════════
   16. RE-SPECIFIC MODALS (separate from Drive modals)
════════════════════════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    box-shadow: var(--avd-shadow-lg);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-content.modal-large { max-width: 880px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--avd-border);
    background: rgba(102, 126, 234, 0.04);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 14px;
    font-weight: 800;
    color: var(--avd-text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-header h2 i { color: var(--avd-primary, #667eea); }

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--avd-border);
    background: var(--avd-input-bg);
    color: var(--avd-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--re-transition);
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--re-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.modal-body {
    padding: 22px;
    overflow-x: hidden;
}

.modal-body p {
    line-height: 1.7;
    margin-bottom: 14px;
    color: var(--avd-text-muted);
    font-size: 13px;
}

.modal-body ul,
.modal-body ol {
    padding-left: 22px;
    margin-bottom: 14px;
}

.modal-body li {
    margin-bottom: 6px;
    line-height: 1.7;
    color: var(--avd-text-muted);
    font-size: 12px;
}

.modal-body h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--avd-text);
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.modal-body h4 i { color: var(--avd-primary, #667eea); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.warning-box {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--re-warning);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 12px;
    color: var(--avd-text-muted);
    line-height: 1.6;
}

.warning-box i { color: var(--re-warning); margin-right: 6px; }

/* ════════════════════════════════════════════════════════════════════
   17. SIMULATION INFO CARD
════════════════════════════════════════════════════════════════════ */
.simulation-info-card {
    background: var(--avd-card);
    border: 1px solid var(--avd-border);
    border-radius: var(--re-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-item label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--avd-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.info-item label i { color: var(--avd-primary, #667eea); }

.info-item span {
    font-size: 13px;
    font-weight: 800;
    color: var(--avd-text);
}

/* ════════════════════════════════════════════════════════════════════
   18. SCROLLBAR (RE modals)
════════════════════════════════════════════════════════════════════ */
.modal-content::-webkit-scrollbar { width: 5px; }
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}
.comparison-table-wrapper::-webkit-scrollbar { height: 5px; }
.comparison-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════════
   19. ACCESSIBILITY
════════════════════════════════════════════════════════════════════ */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--avd-primary, #667eea);
    outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════
   20. RESPONSIVE — TABLET (≤ 1200px)
════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .portfolio-charts-grid {
        grid-template-columns: 1fr;
    }
    .kpis-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .portfolio-kpis-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ════════════════════════════════════════════════════════════════════
   21. RESPONSIVE — MOBILE (≤ 768px)
════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .section { padding: 16px; }

    /* KPIs — 2 per row */
    .kpis-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .kpi-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .kpi-icon { margin: 0 auto; }

    /* Portfolio KPIs — 2 per row */
    .portfolio-kpis-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .portfolio-kpi-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .portfolio-kpi-icon { margin: 0 auto; }
    .portfolio-charts-grid { grid-template-columns: 1fr; }
    .portfolio-properties-grid { grid-template-columns: 1fr; }

    /* Form */
    .form-row { grid-template-columns: 1fr; gap: 14px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }

    /* Results */
    .results-grid { grid-template-columns: 1fr; }
    .capacity-grid { grid-template-columns: 1fr; }
    .tax-grid { grid-template-columns: 1fr; }

    /* Simulations */
    .sim-metrics { grid-template-columns: 1fr; }
    .sim-footer { flex-direction: column; align-items: flex-start; }
    .sim-actions { width: 100%; flex-direction: column; }
    .sim-actions .btn-icon { width: 100%; }
    .sim-header {
        flex-direction: row;
        justify-content: space-between;
    }
    .sim-header h4 {
        font-size: 12px;
        max-width: 62%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Section header actions */
    .section .section-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .section .header-actions {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .section .header-actions .avd-btn {
        width: 100%;
        justify-content: center;
    }

    /* Property cards */
    .property-main-stats { grid-template-columns: 1fr; }
    .property-actions { flex-direction: column; }
    .property-actions .btn-icon { width: 100%; }
    .property-header { flex-direction: column; align-items: flex-start; }

    /* Modals */
    .modal.active {
        padding: 0;
        align-items: flex-start;
    }
    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    .modal-body .form-row { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column; }
    .modal-actions .btn { width: 100%; justify-content: center; }

    /* Charts */
    .chart { min-height: 280px; }
}

/* ════════════════════════════════════════════════════════════════════
   22. RESPONSIVE — SMALL MOBILE (≤ 480px)
════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .kpis-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .kpi-card { padding: 10px; }
    .kpi-value { font-size: 1.1rem; }

    .portfolio-kpis-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .portfolio-kpi-card { padding: 10px; }
    .portfolio-kpi-value { font-size: 1.1rem; }

    .section { padding: 14px; }

    .section .header-actions {
        grid-template-columns: 1fr !important;
    }

    .sim-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .sim-header h4 { max-width: 100%; white-space: normal; }

    .capacity-card { flex-direction: column; text-align: center; }
    .tax-card      { flex-direction: column; text-align: center; }

    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .timeline-item { flex-direction: column; gap: 10px; }
    .timeline-item i { align-self: flex-start; }

    .progress-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .progress-footer { flex-direction: column; align-items: flex-start; gap: 4px; }

    .chart { min-height: 240px; }
}

/* ════════════════════════════════════════════════════════════════════
   23. PRINT
════════════════════════════════════════════════════════════════════ */
@media print {
    #avdSidebar,
    #avDriveHeader,
    .avd-sidebar-toggle,
    .sim-actions,
    .property-actions,
    .form-actions,
    .modal { display: none !important; }

    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 16px;
    }

    .simulation-card,
    .property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 14px;
    }
}

/* ════════════════════════════════════════════════════════════════════
   NOTE: ZERO ANIMATIONS
   All @keyframes, animation: properties and transform-on-hover
   scale effects have been intentionally removed.
   Only border-color / box-shadow / opacity transitions remain
   at 0.2s ease (matching Drive's --avd-transition).
════════════════════════════════════════════════════════════════════ */