:root {
    --bg-color: #f4f7f6;
    --window-bg: #2c3e50;
    --primary-color: #157527;
    --secondary-color: #00a86b;
    --tertiary-color: #ff9f43;
    --text-color: #000000;
    --border-color: #ddd;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0px;
}

/* Main Grid Layout */
.main-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Make tablets/mobiles stack */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Window styling */
.window {
    background: var(--window-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 0px solid var(--border-color);
}

h2 {
    margin-top: 0;
    border-bottom: 0px solid var(--bg-color);
    padding-bottom: 10px;
    font-size: 1.2rem;
    color: var(--bg-color);
}

/* Window 1: Configuration */
.config-window {
    grid-row: span 2; /* Takes up full height on left in desktop view */
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box; /* Important for padding not to affect width */
    background-color: #ffffff;
}

#calculateBtn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: rgb(255, 255, 255);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#calculateBtn:hover {
    background-color: #0fa20a;
}

/* Window 2: Key Results */
/* --- Media Queries for Smaller Screens --- */

@media (max-width: 600px) {
    /* Main container already handles stacking the three windows via the existing @media (max-width: 900px) query */

    /* Target the container for the three small result boxes (Key Results) */
    .key-results {
        /* Change the flex direction from horizontal (default row) to vertical (column) */
        flex-direction: column; 
        gap: 10px; /* Adjust gap for better vertical spacing */
    }

    /* Ensure the graph container takes up its space */
    .graph-container {
        /* You might want to decrease the minimum height on mobile */
        min-height: 250px; 
    }
}
.results-window {
    display: flex;
    flex-direction: column;
}

.key-results {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.result-box {
    flex: 1;
    background: var(--bg-color);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.result-box h3 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: #666;
}

.result-box span {
    font-size: 1.2rem;
    font-weight: bold;
}

.result-box.primary span {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.graph-container {
    color:#ffffff;
    flex-grow: 1;
    min-height: 300px;
    position: relative; /* Needed for Chart.js responsiveness */
    color:#ffffff
}

/* Window 3: Table */
.table-window {
    overflow: hidden; /* Ensures table container scroll works */
    display: flex;
    flex-direction: column;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
}
.table-header h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.toggle-btns button {
    padding: 8px 12px;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    margin-left: -1px; /* overlap borders */
}
.toggle-btns button:first-child {border-radius: 4px 0 0 4px;}
.toggle-btns button:last-child {border-radius: 0 4px 4px 0;}

.toggle-btns button.active {
    background: var(--secondary-color);
    color: rgb(255, 255, 255);
}

.table-container {
    overflow-y: auto;
    max-height: 300px;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 0.9rem;
}

th, td {
    text-align: right;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

th:first-child, td:first-child {
    text-align: left;
}

th {
    background-color: #00a86b;
    position: sticky;
    top: 0;
}
.bg-dark-indigo {
    background-color: #2c3e50; /* Deep Slate Blue/Dark Indigo */
}