/* Basic Reset / Normalization */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #1a1a1d; /* Dark background */
    color: #c5c6c7; /* Light grey text */
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #4b5d67; /* Darker border */
    padding-bottom: 20px;
}

#logo {
    height: 75px; /* Increased logo size */
    margin-right: 20px;
}

h1 {
    color: #F37021; /* Logo orange */
    font-weight: 600;
    font-size: 2.5em; /* Decreased heading size */
}

main {
    max-width: 1400px; /* Limit width for better readability on large screens */
    margin: 0 auto;
}

section {
    margin-bottom: 40px;
    background-color: #2a2a2e; /* Slightly lighter dark background for sections */
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Darker shadow */
    overflow-x: auto; /* Allow horizontal scrolling for tables on small screens */
}

h2 {
    color: #F37021; /* Logo orange */
    margin-bottom: 20px;
    border-bottom: 1px solid #4b5d67; /* Darker border */
    padding-bottom: 10px;
    font-weight: 500;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em; /* Slightly smaller font for tables */
}

th, td {
    border: 1px solid #4f4f51; /* Lighter grey border for dark mode */
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap; /* Prevent text wrapping in cells */
}

th {
    background-color: #333336; /* Dark header background */
    color: #f1f1f1; /* Light header text */
    font-weight: 600;
    position: sticky; /* Keep headers visible when scrolling */
    top: 0;
    z-index: 1; /* Ensure headers are above content */
}

tbody tr:nth-child(even) {
    background-color: #303033; /* Slightly darker background for even rows */
}

tbody tr:hover {
    background-color: #d8631c; /* Darker orange for hover */
    color: #f1f1f1; /* Light text on hover */
}

/* Align currency values to the right */
td:not(:first-child),
th:not(:first-child) {
    text-align: right;
}

/* Style specific rows */
.total-row td {
    font-weight: bold;
    background-color: #b85418; /* Darker orange for total row */
    color: #f1f1f1; /* Light text for total row */
}

.notes-row td {
    font-style: italic;
    color: #a5a6a7; /* Lighter grey for notes */
    font-size: 0.85em;
}

/* Removed CSS targeting empty columns as they have been removed from HTML */
/*
#actual-outflows th:nth-child(n+6):nth-child(-n+14),
#actual-outflows td:nth-child(n+6):nth-child(-n+14) {
     min-width: 10px;
     padding: 10px 2px;
     border-left: 1px solid #2a2a2e;
     border-right: 1px solid #2a2a2e;
}

#summary th:nth-child(n+7):nth-child(-n+14),
#summary td:nth-child(n+7):nth-child(-n+14) {
     min-width: 10px;
     padding: 10px 2px;
     border-left: 1px solid #2a2a2e;
     border-right: 1px solid #2a2a2e;
}
*/

/* Style positive/negative values in summary */
#summary td:last-child:not(:contains('-')) { /* Select last cell if not negative */
    color: #86c232; /* Positive green */
    font-weight: bold;
}

#summary td:contains('-') { /* Basic check for negative */
    color: #e84a5f; /* Negative red */
    font-weight: bold;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #4b5d67; /* Darker border */
    font-size: 0.85em;
    color: #999;
}

/* Responsive adjustments (optional) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    #logo {
        margin-bottom: 10px;
    }

    h1 {
        font-size: 1.8em;
    }
}

.chart-container {
    position: relative; /* Needed for Chart.js responsiveness */
    height: 350px; /* Set a fixed height */
    max-width: 90%; /* Limit width */
    margin: 20px auto; /* Add some space above/below and center */
    padding: 15px;
    border: 1px solid #4f4f51; /* Optional: border around chart area */
    border-radius: 5px;
    background-color: #333336; /* Slightly different background for chart area */
}

.charts-row {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 20px; /* Space between charts */
    justify-content: space-around; /* Distribute space */
    margin-bottom: 20px; /* Space below the row */
}

.charts-row .chart-container {
    flex: 1 1 45%; /* Allow charts to grow/shrink, aiming for ~45% width */
    min-width: 300px; /* Minimum width before wrapping */
    max-width: 48%; /* Ensure they don't exceed half width */
    margin: 0; /* Remove the auto margin used previously */
}

.table-scroll-wrapper {
    overflow-x: auto; /* Enable horizontal scrolling */
    margin-top: 20px; /* Add some space above the scrollable table */
    padding-bottom: 10px; /* Add space below for scrollbar */
}

.notes-row td {
    font-style: italic;
    color: #a5a6a7; /* Lighter grey for notes */
    font-size: 0.85em;
}

/* --- Login Box Styles --- */
#login-box {
    position: fixed; /* Or absolute, depending on desired behavior */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    padding: 40px;
    background-color: #2a2a2e; /* Match section background */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000; /* Ensure it's above other content if needed */
}

#login-box .login-logo {
    height: 80px;
    margin-bottom: 25px;
    display: block; /* Make it a block element */
    margin-left: auto;
    margin-right: auto;
}

#login-box h2 {
    color: #F37021; /* Orange title */
    margin-bottom: 30px;
    border-bottom: none; /* Remove border inherited from section h2 */
    padding-bottom: 0;
}

#login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #4f4f51;
    border-radius: 5px;
    background-color: #333336;
    color: #c5c6c7;
    font-size: 1em;
}

#login-form button {
    width: 100%;
    padding: 12px 15px;
    background-color: #F37021; /* Orange button */
    color: #1a1a1d; /* Dark text */
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#login-form button:hover {
    background-color: #d8631c; /* Darker orange on hover */
}

.error-message {
    color: #e84a5f; /* Red for errors */
    margin-top: 15px;
    min-height: 1.2em; /* Prevent layout shift */
    font-size: 0.9em;
}

/* Hide regular header logo when login box is shown */
#report-content header #logo {
    /* You might adjust this depending on final layout */
} 