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

body {
    background: #eef2f7;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 20px;
    color: #1e293b;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Header */
.header {
    background: linear-gradient(135deg, #0f2b3d 0%, #1a5d7a 100%);
    color: white;
    padding: 20px 28px;
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}
.header p {
    opacity: 0.85;
    margin-top: 6px;
    font-size: 0.85rem;
}

.config-selector {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.config-selector select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.9);
    font-size: 13px;
    min-width: 200px;
}
.btn-save-config, .btn-delete-config {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.btn-save-config {
    background: #4CAF50;
    color: white;
}
.btn-delete-config {
    background: #f44336;
    color: white;
}

/* TWO COLUMN LAYOUT */
.two-columns {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.left-panel {
    flex: 1.2;
    min-width: 380px;
}
.right-panel {
    flex: 2;
    min-width: 550px;
}

/* Cards */
.card {
    background: white;
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    border-left: 3px solid #2563eb;
    padding-left: 12px;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Asset Tabs */
.asset-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.asset-tab {
    background: #f1f5f9;
    border: none;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}
.asset-tab.active {
    background: #1e3a8a;
    color: white;
}
.asset-panel {
    display: none;
}
.asset-panel.active {
    display: block;
}

/* Form Elements */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.form-group {
    flex: 1;
    min-width: 110px;
}
.form-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}
.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.form-group input[readonly] {
    background: #f1f5f9;
    cursor: not-allowed;
}

/* Investment Table */
.investment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
}
.investment-table th, .investment-table td {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}
.investment-table th {
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 700;
}
.count-input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
}

.btn-calculate {
    background: linear-gradient(95deg, #0f2b3d, #1e4a76);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 40px;
    width: 100%;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}
.btn-calculate:hover {
    background: linear-gradient(95deg, #1a3a50, #2563eb);
    transform: translateY(-1px);
}

/* IRR Results Cards */
.irr-results {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.irr-card {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    border-radius: 20px;
    padding: 18px;
    flex: 1;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.irr-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 1px;
}
.irr-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 8px;
}
.irr-card .note {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.asset-irr-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.asset-irr-item {
    background: white;
    border-radius: 16px;
    padding: 12px;
    flex: 1;
    text-align: center;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}
.asset-irr-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.asset-irr-item .name {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}
.asset-irr-item .irr {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-top: 6px;
}
.asset-irr-item .inv {
    font-size: 0.7rem;
    color: #475569;
}
.asset-irr-item .weight {
    font-size: 0.65rem;
    color: #10b981;
    margin-top: 4px;
}

/* Cashflow Tables */
.scrollable {
    overflow-x: auto;
    border-radius: 16px;
}
.cashflow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    background: white;
}
.cashflow-table th, .cashflow-table td {
    padding: 8px 6px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}
.cashflow-table th {
    background: #f1f5f9;
    text-align: center;
    font-weight: 700;
    color: #1e293b;
    position: sticky;
    top: 0;
}
.cashflow-table td:first-child {
    text-align: left;
    font-weight: 600;
    background: #fafcff;
}
.investment-row {
    background: #fffbeb;
}
.positive {
    color: #10b981;
    font-weight: 700;
}
.negative {
    color: #ef4444;
}

/* Residual Box */
.residual-box {
    background: #eef2ff;
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
}
.residual-box h4 {
    font-size: 0.85rem;
    margin-bottom: 12px;
    color: #1e3a8a;
}
.residual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}
.residual-table th, .residual-table td {
    padding: 6px 5px;
    text-align: right;
    border-bottom: 1px solid #cbd5e1;
}
.residual-table th {
    background: #e0e7ff;
    text-align: center;
}

.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.stat-box {
    background: white;
    border-radius: 16px;
    padding: 12px;
    flex: 1;
    text-align: center;
    border: 1px solid #e2e8f0;
}
.stat-box .stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748b;
}
.stat-box .stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-top: 4px;
}

.note {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 12px;
    padding: 8px;
    background: #f1f5f9;
    border-radius: 12px;
}

footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.65rem;
    color: #64748b;
    padding: 16px;
}