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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 40px;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.asset-input {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

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

input[type="text"],
input[type="number"] {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
}

button {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asset-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: center;
}

.asset-item button {
    background: #e74c3c;
    padding: 8px 16px;
}

.asset-item button:hover {
    background: #c0392b;
}

.correlation-matrix {
    overflow-x: auto;
}

.correlation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.correlation-table th,
.correlation-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.correlation-table th {
    background: #34495e;
    color: white;
}

.correlation-table input {
    width: 60px;
    text-align: center;
}

.target-settings {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.target-settings label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculate-btn {
    background: #27ae60;
    font-size: 18px;
    padding: 14px 32px;
}

.calculate-btn:hover {
    background: #229954;
}

.results-section {
    background: #f8f9fa;
}

#results {
    margin-bottom: 30px;
}

.result-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
}

.result-item strong {
    color: #2c3e50;
}

.portfolio-weights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.weight-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    text-align: center;
}

.weight-item .asset-name {
    font-weight: bold;
    color: #34495e;
    margin-bottom: 5px;
}

.weight-item .weight-value {
    font-size: 1.5rem;
    color: #3498db;
}

.chart-container {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}