/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f4f5f7;
    color: #1a1a2e;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Muli', sans-serif;
    font-weight: 600;
}

/* === Layout === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* === Header === */
header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 30px;
    border-bottom: 1px solid #dde0e4;
    padding-bottom: 15px;
}

header h1 {
    font-size: 1.6rem;
    color: #0f1923;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.data-date {
    color: #4a5568;
    font-size: 0.85rem;
}

.logout-link {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.logout-link:hover {
    color: #C9A84C;
}

/* === Error Banner === */
.error-banner {
    background: rgba(231, 76, 60, 0.08);
    border-left: 3px solid #e74c3c;
    color: #c0392b;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* === KPI Cards (3 columns) === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    border-left: 3px solid #C9A84C;
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.kpi-label {
    color: #4a5568;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-family: 'Muli', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: #0f1923;
}

.kpi-value.positive {
    color: #27ae60;
}

.kpi-value.negative {
    color: #c0392b;
}

.kpi-value.neutral {
    color: #4a5568;
}

.kpi-value.warning {
    color: #d4a017;
}

/* === Data Table === */
.table-card {
    background: #ffffff;
    border-left: 3px solid #C9A84C;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.table-card h2 {
    color: #4a5568;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.data-table-container {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c8cdd3 #f4f5f7;
}

.data-table-container::-webkit-scrollbar {
    width: 6px;
}

.data-table-container::-webkit-scrollbar-track {
    background: #f4f5f7;
}

.data-table-container::-webkit-scrollbar-thumb {
    background: #c8cdd3;
    border-radius: 3px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.data-table td:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.025);
}

.data-table .today-row td:nth-child(odd) {
    background-color: rgba(201, 168, 76, 0.22);
}

.data-table .today-row td:nth-child(even) {
    background-color: rgba(201, 168, 76, 0.15);
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    background: #0f1923;
    color: #C9A84C;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
}

.data-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #ebedf0;
    color: #1a1a2e;
}

.data-table .today-row {
    background: rgba(201, 168, 76, 0.15);
    font-weight: 600;
}

.data-table .today-row td {
    color: #0f1923;
}

.data-table .forecast-row {
    font-style: italic;
}

.data-table .forecast-row td {
    color: #6b7685;
}

.data-table tbody tr:hover {
    background: #f0f1f4;
}

.data-table .today-row:hover {
    background: rgba(201, 168, 76, 0.22);
}

/* === Comparison Panels === */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.comparison-panel {
    background: #ffffff;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.comparison-panel:first-child {
    border-left: 3px solid #C9A84C;
    border-right: 1px solid #ebedf0;
}

.comparison-panel:last-child {
    border-right: 3px solid #C9A84C;
}

.comparison-panel h3 {
    color: #4a5568;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.comparison-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.comparison-label {
    color: #4a5568;
    font-size: 0.85rem;
}

.comparison-value {
    font-family: 'Muli', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #0f1923;
}

/* === Login === */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-left: 3px solid #C9A84C;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
    color: #C9A84C;
    font-size: 1.4rem;
    margin-bottom: 24px;
}

.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: #f4f5f7;
    border: 1px solid #dde0e4;
    color: #1a1a2e;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-card input[type="password"]:focus {
    border-color: #C9A84C;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: #C9A84C;
    color: #ffffff;
    border: none;
    font-family: 'Muli', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.login-card button:hover {
    background: #b8953f;
}

.error-msg {
    background: rgba(231, 76, 60, 0.08);
    border-left: 3px solid #e74c3c;
    color: #c0392b;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    .comparison-panel:first-child {
        border-right: none;
        border-bottom: 1px solid #ebedf0;
    }
    header {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}
