:root {
    /* Color Palette - Premium Fintech */
    --primary: #0f172a;
    /* Slate 900 */
    --primary-light: #1e293b;
    /* Slate 800 */
    --accent: #d4af37;
    /* Metallic Gold */
    --accent-hover: #b5952f;
    --success: #10b981;
    --text-main: #334155;
    --text-light: #64748b;
    --bg-body: #f1f5f9;
    /* Slate 100 */
    --surface: #ffffff;
    --border: #e2e8f0;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.15);

    /* Radius */
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Header */
.main-header {
    background: var(--surface);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.header-content {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--accent);
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-tab:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-tab.active {
    background: var(--primary-light);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Contract View */
.contract-container {
    max-width: 800px;
    margin: 2rem auto;
    width: 100%;
    padding: 0 1.5rem;
}

.form-card {
    padding: 2rem;
}

.centered-header {
    text-align: center;
    justify-content: center;
    color: #60a5fa;
    /* Light Blue Title as per image */
    background: transparent;
    border-bottom: none;
    font-size: 1.4rem;
}

.centered-header h2 {
    color: #55a2ea;
    font-weight: 700;
}

.btn-success {
    background: #4ade80;
    /* Green */
    color: white;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.btn-success:hover {
    background: #22c55e;
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
    display: none;
}

.status-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards & Panels */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-effect {
    /* If we want a glassmorphism sidebar later, currently plain surface looks cleaner for inputs */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to right, #f8fafc, #ffffff);
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms */
.input-panel {
    height: fit-content;
}

#investment-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.three-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.sm label {
    font-size: 0.8rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

input,
select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--primary);
    font-size: 0.95rem;
    transition: all 0.2s;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.divider {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.form-actions {
    margin-top: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* btn secondary */
.btn-secondary {
    padding: 0.75rem 2rem;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.logo-image {
    height: 60px;
    /* Adjust as needed based on aspect ratio */
    width: auto;
    object-fit: contain;
}

/* 
.logo-icon { ... } Removed
.logo-area h1 { ... } Removed/Hidden if only image
*/
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--accent);
}

.summary-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.icon-blue {
    color: #3b82f6;
    background: #eff6ff;
}

.icon-gold {
    color: #d4af37;
    background: #fefce8;
}

.summary-data {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.sub-value {
    font-size: 0.7rem;

    /* Animations */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* PDF Print Optimizations */
@media print {

    .card,
    .summary-cards,
    .result-table,
    .summary-card {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Dossier Styling (The Tables) */
    .dossier-card {
        padding: 2rem;
        background: white;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
}

.dossier-header {
    background: #60a5fa;
    /* Blue header from image approximation */
    background: linear-gradient(135deg, #4287f5, #60a5fa);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.dossier-title {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dossier-subtitle {
    text-align: right;
    font-weight: 600;
    font-size: 1.1rem;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.result-table th,
.result-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.result-table th {
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    background: #f1f5f9;
}

.result-table tr:last-child td {
    border-bottom: none;
}

/* Specific Table Styles mapping the user's image */
.summary-table {
    background: #93c5fd;
    /* Soft blue */
    background: linear-gradient(to bottom, #93c5fd, #bfdbfe);
    border: none;
}

.summary-table .row-main {
    background: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.summary-table td {
    border-color: rgba(255, 255, 255, 0.5);
    color: #1e3a8a;
}

/* Cost Table */
.cost-table-header {
    margin-top: 2rem;
    border-top: 2px dotted #fbbf24;
    padding-top: 0.5rem;
    text-align: center;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.cost-table {
    background: #ffffff;
}

.cost-table tr:last-child {
    font-weight: 700;
    background: #fff7ed;
    /* Orange tint like image */
}

.cost-table td:first-child {
    text-align: left;
    color: var(--text-light);
}

/* Analysis Table */
.analysis-title {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    color: var(--primary);
    text-transform: uppercase;
}

.analysis-table td {
    padding: 0.6rem 1rem;
}

.analysis-table th {
    background: transparent;
    text-align: right;
    font-style: italic;
    color: var(--text-main);
}

.analysis-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-main);
}

.row-highlight {
    background: #f0f9ff;
    font-weight: 600;
}

.row-total {
    background: #fff7ed;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid var(--accent);
}

.utility-text {
    font-size: 0.75rem;
    color: var(--text-main);
    /* Darker for better visibility */
    margin-top: 1rem;
    font-weight: 700;
    /* Bold as requested */
    padding-bottom: 0.5rem;
    /* Ensure space at bottom */
}