/* --- Global Styles --- */
body {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 950px;
    margin: 20px auto;
    padding: 20px;
    background: #f0f2f5;
    color: #333;
}

h1 { text-align: center; color: #1e3a29; margin-bottom: 5px; }
h2 { margin-top: 0; color: #2c5e40; font-size: 1.2rem; border-bottom: 2px solid #e1e4e8; padding-bottom: 10px; }
.subtitle { text-align: center; color: #666; font-size: 0.9rem; margin-bottom: 25px; }

/* --- Panels --- */
.panel {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

/* --- Inputs --- */
label { display: block; margin-top: 15px; font-weight: 700; font-size: 0.85rem; color: #444; text-transform: uppercase; letter-spacing: 0.5px; }
input { width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 1rem; }
.input-group { display: flex; gap: 8px; align-items: flex-end; }
.note { margin-top: 8px; color: #888; font-style: italic; }

/* --- Buttons --- */
button { border: none; padding: 12px 20px; border-radius: 5px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.btn-primary { background: #28a745; color: white; margin-top: 5px; white-space: nowrap; }
.btn-primary:hover { background: #218838; }

.btn-full { background: #28a745; color: white; width: 100%; margin-top: 25px; font-size: 1.1rem; }
.btn-full:hover { background: #218838; transform: translateY(-1px); }

.btn-secondary { background: #6c757d; color: white; padding: 6px 12px; font-size: 0.85rem; }
.btn-secondary:hover { background: #5a6268; }

/* --- Results --- */
.results { background: #e8f5e9; border: 1px solid #c3e6cb; border-radius: 8px; padding: 20px; margin-top: 25px; }
.results p { margin: 8px 0; font-size: 1.05rem; display: flex; justify-content: space-between; border-bottom: 1px dashed #c3e6cb; padding-bottom: 5px; }
.results p:last-child { border-bottom: none; }

/* --- Status & Messages --- */
#status { margin-top: 10px; font-size: 0.85rem; font-weight: 600; min-height: 20px; }
.success-msg { color: #28a745; }
.error-msg { color: #dc3545; }

/* --- Chart & Table --- */
.chart-container { height: 220px; position: relative; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { border-bottom: 1px solid #eee; padding: 10px; text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { background: #f8f9fa; font-weight: 700; color: #555; }
tr:hover { background-color: #f9f9f9; }