:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338ca;
    --secondary-color: #F3F4F6;
    --text-color: #1F2937;
    --text-muted: #6B7280;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --sidebar-width: 260px;
    --sidebar-bg: #111827;
    --sidebar-text: #E5E7EB;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* App Container */
.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFF;
    letter-spacing: -0.025em;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    padding-bottom: 80px;
    /* Space for FAB */
    background-color: var(--bg-color);
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
    font-size: 2rem;
    font-weight: 300;
    border: none;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(79, 70, 229, 0.4),
        0 3px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide FAB when parent view is not active */
.view:not(.active) .fab {
    display: none;
}


/* --- Existing Styles Adjusted --- */

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Investment Card */
.investment-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.investment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 10px;
}

.card-title-group {
    flex: 1;
    min-width: 0;
    /* Crucial for ellipsis */
    margin-right: 0.5rem;
}

.investment-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: #EEF2FF;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.dpe-badge {
    flex-shrink: 0;
    /* Prevent shrinking */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}

/* ... (Keep existing simple metric styles) ... */
.metrics-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
}

.metric {
    text-align: center;
}

.metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 800;
}

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

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

/* Details List */
.details-list {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.details-list p {
    margin-bottom: 0.35rem;
}

/* Card Actions */
.card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--secondary-color);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #F3F4F6;
    color: var(--primary-color);
}

.btn-icon.delete:hover {
    background: #FEF2F2;
    color: var(--danger);
}

/* ========================================
   MODAL - Modern Glassmorphism Design
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.6) 0%, rgba(79, 70, 229, 0.2) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
    opacity: 1;
}

/* Modal Content - Premium Card Style */
.modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    width: 95%;
    max-width: 900px;
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    height: 85vh;
    max-height: 90vh;
    position: relative;
    opacity: 1;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header - Gradient Accent */
.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 24px 24px 0 0;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #818cf8, #c084fc);
    border-radius: 24px 24px 0 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Close Button - Modern Style */
.close-modal,
.close-modal-prop,
.close-modal-manage,
.close-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.close-modal:hover,
.close-modal-prop:hover,
.close-modal-manage:hover,
.close-btn:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: var(--danger);
    transform: rotate(90deg);
}

/* 2-Column Form Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

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

/* Form Sections - Premium Cards */
.form-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.08);
    margin-bottom: 1.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.03),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s;
}

.form-section:hover {
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow:
        0 10px 15px -3px rgba(79, 70, 229, 0.05),
        0 4px 6px -2px rgba(79, 70, 229, 0.03);
}

.form-section h3 {
    grid-column: 1 / -1;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--primary-color), #818cf8) 1;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* Scrollable Form Body */
#investment-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.form-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Custom Scrollbar */
.form-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.form-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.form-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), #818cf8);
    border-radius: 4px;
}

.form-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Modal Footer - Frosted Glass */
.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(79, 70, 229, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    flex-shrink: 0;
    border-radius: 0 0 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Modal Actions (inline in form) */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 0 1.5rem 0;
    margin-top: 1rem;
    border-top: 1px solid rgba(79, 70, 229, 0.1);
}

/* Buttons - Premium Style */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow:
        0 4px 14px -3px rgba(79, 70, 229, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px -4px rgba(79, 70, 229, 0.6),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-color);
    padding: 0.875rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    /* Prevent text wrap */
    min-width: 100px;
    /* Ensure minimum size */
    text-align: center;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
}

/* ========================================
   FORM ELEMENTS - Premium Style
   ======================================== */

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

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.01em;
}

/* Hint text under inputs */
.form-group .hint,
.form-group small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Input & Select - Modern Style */
.form-control,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: var(--text-color);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control:hover,
.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow:
        0 0 0 3px rgba(79, 70, 229, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Placeholder styling */
.form-control::placeholder,
.form-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Select dropdown arrow */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* DPE Colors */
.bg-A {
    background-color: #10B981;
}

.bg-B {
    background-color: #34D399;
}

.bg-C {
    background-color: #A3E635;
}

.bg-D {
    background-color: #FACC15;
}

.bg-E {
    background-color: #F59E0B;
}

.bg-F {
    background-color: #FB923C;
}

.bg-G {
    background-color: #EF4444;
}


/* ========================================
   TYPE SELECTOR - Premium Toggle
   ======================================== */

.type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 0.375rem;
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.type-option {
    flex: 1;
    cursor: pointer;
}

.type-option input[type="radio"] {
    display: none;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border-radius: 10px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.type-icon {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
    transition: transform 0.3s;
}

.type-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

/* Active state */
.type-option input[type="radio"]:checked+.type-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow:
        0 4px 12px -2px rgba(79, 70, 229, 0.15),
        0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.type-option input[type="radio"]:checked+.type-card .type-icon {
    transform: scale(1.15);
}

.type-option input[type="radio"]:checked+.type-card .type-label {
    color: var(--primary-color);
}

/* Hover state */
.type-card:hover {
    background: rgba(255, 255, 255, 0.6);
}

.type-card:hover .type-icon {
    transform: scale(1.1);
}

/* ========================================
   UNIT MANAGEMENT - Premium Style
   ======================================== */

.unit-list,
.units-list {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.unit-row,
.unit-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.08);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

.unit-item:hover {
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.08);
}

.unit-info {
    flex: 1;
}

.unit-info input,
.unit-info select {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.unit-info input:focus,
.unit-info select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.units-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
}

.units-header label {
    font-weight: 600;
    color: var(--text-color);
}

.units-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 10px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.empty-units {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
}

/* Small Buttons */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-sm.btn-secondary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.btn-sm.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

/* Delete unit button */
.delete-unit {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-unit:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Select visibility fix */
select.form-control {
    min-width: 70px;
}

/* ========================================
   MY PROPERTIES MODULE - Premium Style
   ======================================== */

.properties-list {
    display: grid;
    gap: 1rem;
}

.property-row-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.property-row-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(79, 70, 229, 0.08),
        0 4px 6px -2px rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.1);
}

.property-row-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.property-row-card .card-actions .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
}

/* ========================================
   INVESTMENT CARDS (inv-card) - Modern Design
   ======================================== */

.inv-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07),
        0 2px 4px -1px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.inv-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #818cf8);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
    pointer-events: none;
}

.inv-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 25px -5px rgba(79, 70, 229, 0.1),
        0 10px 10px -5px rgba(79, 70, 229, 0.04),
        0 0 0 1px rgba(79, 70, 229, 0.1);
}

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

/* Card Header */
.inv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.inv-card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
}

.inv-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Metrics Section */
.inv-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.08);
}

.inv-metrics .metric {
    text-align: center;
    padding: 0.5rem;
}

.inv-metrics .metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.inv-metrics .metric-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
}

.inv-metrics .metric-value.good {
    color: var(--success);
}

.inv-metrics .metric-value.bad {
    color: var(--danger);
}

/* Card Actions */
.inv-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
}

.inv-actions .btn-icon {
    flex: 1;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.625rem;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.inv-actions .btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.inv-actions .btn-icon[title="Supprimer"]:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* DPE Badges */
.dpe-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.dpe-badge.dpe-A {
    background: linear-gradient(135deg, #059669, #10B981);
}

.dpe-badge.dpe-B {
    background: linear-gradient(135deg, #10B981, #34D399);
}

.dpe-badge.dpe-C {
    background: linear-gradient(135deg, #65A30D, #84CC16);
}

.dpe-badge.dpe-D {
    background: linear-gradient(135deg, #CA8A04, #EAB308);
}

.dpe-badge.dpe-E {
    background: linear-gradient(135deg, #D97706, #F59E0B);
}

.dpe-badge.dpe-F {
    background: linear-gradient(135deg, #EA580C, #F97316);
}

.dpe-badge.dpe-G {
    background: linear-gradient(135deg, #DC2626, #EF4444);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 2px dashed rgba(79, 70, 229, 0.2);
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.empty-state .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    transition: all 0.3s;
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.4);
}

/* ========================================
   FINANCIAL DASHBOARD - Premium Style
   ======================================== */

/* Finance Header */
.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.finance-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-back {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.625rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.btn-back:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateX(-2px);
}

.finance-property-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.finance-property-info p {
    margin: 0;
    font-size: 0.9rem;
}

.tourism-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Month Navigator */
.month-navigator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 0.5rem;
    border-radius: 14px;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.month-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.month-display {
    display: flex;
    gap: 0.5rem;
}

.month-display select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    background: white;
    color: var(--text-color);
    cursor: pointer;
}

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

/* Summary Grid */
.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .finance-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.25rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.summary-card.negative {
    border-left: 4px solid var(--danger);
}

.summary-card.neutral {
    border-left: 4px solid var(--primary-color);
}

.summary-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
}

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

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

/* Finance Columns Layout */
.finance-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .finance-columns {
        grid-template-columns: 1fr;
    }
}

/* Finance Sections */
.finance-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.finance-section.full-width {
    grid-column: 1 / -1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--primary-color), #818cf8) 1;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Source Buttons */
.source-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.source-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.source-btn.airbnb {
    background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
    color: #FF5A5F;
    border-color: rgba(255, 90, 95, 0.2);
}

.source-btn.airbnb:hover {
    background: #FF5A5F;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 90, 95, 0.3);
}

.source-btn.booking {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #003580;
    border-color: rgba(0, 53, 128, 0.2);
}

.source-btn.booking:hover {
    background: #003580;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 53, 128, 0.3);
}

.source-btn.direct {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.2);
}

.source-btn.direct:hover {
    background: #059669;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.source-btn.other {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.2);
}

.source-btn.other:hover {
    background: #7c3aed;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.3);
}

.source-icon {
    font-size: 1.1rem;
}

/* Entries List */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.empty-entries {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
}

.entry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.entry-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.entry-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.entry-source-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.entry-source-badge.airbnb {
    background: #FF5A5F;
    color: white;
}

.entry-source-badge.booking {
    background: #003580;
    color: white;
}

.entry-source-badge.direct {
    background: #059669;
    color: white;
}

.entry-source-badge.other {
    background: #7c3aed;
    color: white;
}

.entry-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.entry-amount.positive {
    color: var(--success);
}

.entry-amount.negative {
    color: var(--danger);
}

.entry-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color 0.2s;
}

.entry-delete:hover {
    color: var(--danger);
}

/* Source Distribution */
.source-distribution {
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: 10px;
}

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

.distribution-bars {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
}

.distribution-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    transition: width 0.3s ease;
}

.distribution-bar.airbnb {
    background: #FF5A5F;
}

.distribution-bar.booking {
    background: #003580;
}

.distribution-bar.direct {
    background: #059669;
}

.distribution-bar.other {
    background: #7c3aed;
}

.distribution-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.airbnb {
    background: #FF5A5F;
}

.legend-dot.booking {
    background: #003580;
}

.legend-dot.direct {
    background: #059669;
}

.legend-dot.other {
    background: #7c3aed;
}

/* Add Expense Row */
.add-expense-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.add-expense-row select,
.add-expense-row input {
    flex: 1;
}

.add-expense-row input[type="number"] {
    max-width: 120px;
}

/* Expense Library */
.add-library-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.add-library-item input,
.add-library-item select {
    flex: 1;
}

.library-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.library-item-info {
    display: flex;
    flex-direction: column;
}

.library-item-name {
    font-weight: 600;
    color: var(--text-color);
}

.library-item-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.library-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
}

.library-item-delete:hover {
    color: var(--danger);
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: #f8fafc;
}

.comparison-table tbody tr {
    transition: background 0.2s;
}

.comparison-table tbody tr:hover {
    background: #f8fafc;
}

.comparison-table tbody tr.current-month {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    font-weight: 600;
}

.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.trend-indicator.up {
    color: var(--success);
}

.trend-indicator.down {
    color: var(--danger);
}

.trend-indicator.neutral {
    color: var(--text-muted);
}

/* Highlights Row */
.highlights-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.highlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.highlight-badge.best {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.highlight-badge.worst {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

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

/* ========================================
   ANNUAL TABLE VIEW
   ======================================== */

.year-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 80px;
    text-align: center;
}

.filter-controls {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.filter-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.filter-controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.annual-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.annual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 1000px;
}

.annual-table th,
.annual-table td {
    padding: 0.75rem 0.5rem;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.annual-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

.annual-table th.sticky-col,
.annual-table td.sticky-col {
    position: sticky;
    left: 0;
    background: white;
    text-align: left;
    font-weight: 600;
    z-index: 2;
    min-width: 150px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.annual-table th.sticky-col {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    z-index: 3;
}

.annual-table tbody tr:hover {
    background: #f8fafc;
}

.annual-table tbody tr.revenue-row {
    background: linear-gradient(90deg, #ecfdf5 0%, transparent 20%);
}

.annual-table tbody tr.expense-row {
    background: linear-gradient(90deg, #fef2f2 0%, transparent 20%);
}

.annual-table tbody tr.total-row {
    font-weight: 700;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.annual-table tfoot tr {
    font-weight: 700;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
}

.annual-table tfoot td {
    border-top: 2px solid var(--primary-color);
}

.annual-table td.positive {
    color: var(--success);
}

.annual-table td.negative {
    color: var(--danger);
}

.annual-table td.total-col {
    background: #f8fafc;
    font-weight: 700;
}

/* Row type indicators */
.row-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.row-type-badge.revenue {
    background: #ecfdf5;
    color: #059669;
}

.row-type-badge.expense {
    background: #fef2f2;
    color: #dc2626;
}

/* Recurring indicator */
.recurring-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--primary-color);
    font-size: 0.6rem;
    margin-left: 0.25rem;
    cursor: help;
}

/* ========================================
   REVENUE INPUT MODAL
   ======================================== */

.source-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
}

.source-badge-large.airbnb {
    background: linear-gradient(135deg, #FF5A5F 0%, #FF385C 100%);
    color: white;
}

.source-badge-large.booking {
    background: linear-gradient(135deg, #003580 0%, #00224F 100%);
    color: white;
}

.source-badge-large.direct {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.source-badge-large.other {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
}

/* ========================================
   RECURRING EXPENSES
   ======================================== */

.recurring-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: 10px;
    margin-top: 0.5rem;
}

.recurring-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.recurring-toggle label {
    font-weight: 500;
    color: var(--text-color);
}

.recurring-toggle small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.expense-recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef2ff;
    color: var(--primary-color);
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Button for annual view access */
.btn-annual-view {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 10px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-annual-view:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   SPREADSHEET-STYLE TABLE
   ======================================== */

/* Expense Configuration Panel */
.expense-config-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

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

.expense-types-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expense-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.expense-type-chip:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.expense-type-chip .recurring-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
}

.expense-type-chip .chip-actions {
    display: flex;
    gap: 0.25rem;
}

.expense-type-chip .chip-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.expense-type-chip .chip-btn:hover {
    opacity: 1;
}

/* Spreadsheet Container */
.spreadsheet-container {
    overflow-x: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.spreadsheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 1100px;
}

.spreadsheet-table th,
.spreadsheet-table td {
    padding: 0;
    text-align: center;
    border: 1px solid #e2e8f0;
    height: 40px;
}

/* Header Styles */
.spreadsheet-header th {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0.75rem 0.5rem;
}

.spreadsheet-table th.sticky-col {
    position: sticky;
    left: 0;
    z-index: 20;
    min-width: 180px;
    text-align: left;
    padding-left: 1rem;
}

.spreadsheet-table td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
    background: white;
    min-width: 180px;
    text-align: left;
    padding-left: 1rem;
    font-weight: 600;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.spreadsheet-table th.total-col,
.spreadsheet-table td.total-col {
    background: #f8fafc;
    font-weight: 700;
    min-width: 100px;
}

/* Row Types */
.spreadsheet-table tr.section-header-row td {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem;
}

.spreadsheet-table tr.ca-row td {
    background: #f0fdf4;
}

.spreadsheet-table tr.ca-row td.sticky-col {
    background: #ecfdf5;
    color: #059669;
}

.spreadsheet-table tr.expense-row td {
    background: #fff1f2;
    /* Rose léger */
}

.spreadsheet-table tr.expense-row td.sticky-col {
    background: #ffe4e6;
    /* Rose un peu plus foncé pour sticky */
    color: #881337;
}

.spreadsheet-table tr.expense-row.recurring td {
    background: #fdf2f8;
    /* Rose/Violet très pâle pour récurrent */
}

.spreadsheet-table tr.expense-row.recurring td.sticky-col {
    background: #fce7f3;
}

.spreadsheet-table tr.total-row td {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    font-weight: 700;
    font-size: 0.9rem;
}

.spreadsheet-table tr.total-row td.sticky-col {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary-color);
}

.spreadsheet-table tr.net-row td {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    font-weight: 700;
    font-size: 1rem;
}

.spreadsheet-table tr.net-row td.positive {
    color: #059669;
}

.spreadsheet-table tr.net-row td.negative {
    color: #dc2626;
}

/* Editable Cells */
.spreadsheet-cell {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.85rem;
    font-family: inherit;
    padding: 0.5rem;
    transition: all 0.15s;
}

.spreadsheet-cell:focus {
    outline: none;
    background: white;
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.spreadsheet-cell.recurring-cell {
    background: rgba(251, 191, 36, 0.1);
    font-style: italic;
}

.spreadsheet-cell.override-cell {
    background: rgba(79, 70, 229, 0.1);
    font-weight: 600;
}

.spreadsheet-cell::-webkit-inner-spin-button,
.spreadsheet-cell::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.spreadsheet-cell[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Calculated Cells */
.calc-cell {
    font-weight: 600;
    color: var(--text-color);
}

.calc-cell.positive {
    color: #059669;
}

.calc-cell.negative {
    color: #dc2626;
}

/* Type Column Icons */
.type-icon {
    margin-right: 0.5rem;
}

.recurring-indicator-small {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    opacity: 0.7;
}

/* Recurring Toggle Box in Modal */
.recurring-toggle-box {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.recurring-toggle-box .toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.recurring-toggle-box .toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.recurring-toggle-box small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Empty State for Expense Config */
.expense-config-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Hover effects on rows */
.spreadsheet-table tbody tr:hover td:not(.sticky-col) {
    background: rgba(79, 70, 229, 0.05);
}

/* ========================================
   EXPENSE GROUPING - Collapsible UI
   ======================================== */

.expense-group {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.expense-group:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.expense-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.expense-group-header:hover {
    background: rgba(79, 70, 229, 0.03);
}

.expense-group-header .group-name {
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expense-group-header .group-toggle {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.expense-group.expanded .group-toggle {
    transform: rotate(180deg);
}

.expense-group-header .group-total {
    font-weight: 600;
    color: var(--danger);
}

.expense-group-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.02);
}

.expense-group.expanded .expense-group-details {
    max-height: 500px;
}

.expense-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.9rem;
}

.expense-detail-item .detail-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 80px;
}

.expense-detail-item .detail-amount {
    font-weight: 500;
    color: var(--danger);
}

/* ========================================
   RECEIPT INDICATORS - Modern Badge Style
   ======================================== */

.receipt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.receipt-badge:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.receipt-badge.present {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.receipt-badge.missing {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
}

.receipt-badge.exempt {
    background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
    color: white;
}

/* Single expense item (no grouping) */
.expense-single-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 0.5rem;
}

.expense-single-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.expense-single-item .expense-name {
    font-weight: 500;
    color: var(--text-color);
}

.expense-single-item .expense-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.expense-single-item .expense-amount {
    font-weight: 600;
    color: var(--danger);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
    transition: all 0.2s;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger-outline:hover {
    background: #FEF2F2;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.15);
}

/* Modal Actions - Danger Button Context */
.modal-actions .btn-danger {
    min-width: 120px;
}

/* ========================================
   CONTACTS MODULE (Répertoire)
   ======================================== */

/* Contacts List Grid */
.contacts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* Contact Card */
.contact-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07),
        0 2px 4px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #818cf8, #c084fc);
    opacity: 0;
    transition: opacity 0.3s;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 25px -5px rgba(124, 58, 237, 0.1),
        0 10px 10px -5px rgba(124, 58, 237, 0.04);
    border-color: rgba(124, 58, 237, 0.15);
}

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

.contact-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-avatar.individual {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.contact-avatar.professional {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.contact-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.contact-company-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

/* Contact Type Badge */
.contact-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.contact-type-badge.individual {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.contact-type-badge.professional {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Contact Coordinates Display */
.contact-coords {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
}

.contact-coord {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-coord span:first-child {
    opacity: 0.7;
}

.contact-coord a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-coord a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Contact Card Actions */
.contact-card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.contact-card-actions .btn-sm {
    flex: 1;
}

/* Contact Type Selector (Form) */
.contact-type-selector {
    display: flex;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 0.375rem;
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.contact-type-option {
    flex: 1;
    cursor: pointer;
}

.contact-type-option input[type="radio"] {
    display: none;
}

.contact-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border-radius: 10px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.contact-type-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: transform 0.3s;
}

.contact-type-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.contact-type-option input[type="radio"]:checked+.contact-type-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow:
        0 4px 12px -2px rgba(124, 58, 237, 0.15),
        0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.contact-type-option input[type="radio"]:checked+.contact-type-card .contact-type-icon {
    transform: scale(1.15);
}

.contact-type-option input[type="radio"]:checked+.contact-type-card .contact-type-label {
    color: #7c3aed;
}

.contact-type-card:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Contact Detail Modal */
.contact-detail-info {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(124, 58, 237, 0.08);
}

.contact-detail-header {
    margin-bottom: 1rem;
}

.contact-detail-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0.5rem 0 0.25rem 0;
}

.contact-detail-coords {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.coord-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

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

/* Exchanges Section */
.exchanges-section {
    margin-top: 1.5rem;
}

.add-exchange-form {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.add-exchange-form textarea {
    resize: vertical;
    min-height: 60px;
}

/* Exchanges Timeline */
.exchanges-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.empty-exchanges {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.exchange-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.2s;
}

.exchange-item:hover {
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.1);
}

.exchange-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.exchange-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
    margin: 0;
}

.exchange-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.exchange-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0 0 0;
    white-space: pre-wrap;
}

.exchange-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    opacity: 0;
    transition: all 0.2s;
}

.exchange-item:hover .exchange-delete {
    opacity: 1;
}

.exchange-delete:hover {
    color: var(--danger);
}

/* Empty contacts state */
.contacts-list .empty-state {
    grid-column: 1 / -1;
}

/* Linked Contact Badge (on Investment Cards) */
.linked-contact-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.15);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.linked-contact-badge:hover {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: rgba(124, 58, 237, 0.25);
    transform: translateX(4px);
}

.linked-contact-icon {
    font-size: 1.25rem;
}

.linked-contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.linked-contact-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.linked-contact-company {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.linked-contact-arrow {
    color: #7c3aed;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s;
}

.linked-contact-badge:hover .linked-contact-arrow {
    transform: translateX(4px);
}