body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;      /* Centers vertically */
    justify-content: center;  /* Centers horizontally */
    min-height: 100vh;        /* Makes the body fill the full screen height */
}

/* Main Wrapper */
.login-wrapper {
    /* KuyKuy Bridge brand colours, scoped to the login page (it loads no shared token sheet). */
    --login-brand-primary: #12648A;   /* Deep Blue: white text on it is 6.53:1 */
    --login-brand-accent: #6BC6DC;    /* Light Cyan: decorative only, never text */
    --login-brand-white: #FFFFFF;
    display: flex;
    width: 100%;
    max-width: 1280px; /* Set the maximum width of the viewport */
    min-height: 700px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px; /* Adds some space on smaller screens */
}

/* Left Branding Panel */
.branding-panel {
    background: var(--login-brand-primary);
    border-top: 4px solid var(--login-brand-accent);
    color: var(--login-brand-white);
    padding: 60px;
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* White plate keeps the official light-background logo legible on Deep Blue. */
.branding-panel .brand-plate {
    display: inline-flex;
    align-self: flex-start;
    background: var(--login-brand-white);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 40px;
}

.branding-panel .logo {
    display: block;
    width: 200px;
    height: auto;
}

.branding-panel h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.branding-panel p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Right Form Panel */
.form-panel {
    width: 55%;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container {
    width: 100%;
    max-width: 400px;
}

.form-container h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.form-container .subtitle {
    color: #666;
    margin-bottom: 30px;
}

/* KD-122 — failed-login flash. #B3261E on #FCEEED is 6.0:1. */
.login-error {
    background-color: #FCEEED;
    border: 1px solid #B3261E;
    border-radius: 8px;
    color: #B3261E;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.login-error p {
    margin: 0;
}

.login-error p + p {
    margin-top: 6px;
}

.form-container .subtitle a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

/* Form Styles */
form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

form input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--lighter);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: menulist; /* <-- Add this line */
}

/* Button Styles */
.btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background-color: #212121;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #424242;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-google:hover {
    background-color: #f5f5f5;
}

.btn-google img {
    width: 20px;
    margin-right: 10px;
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.forgot-password a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2000;
        backdrop-filter: blur(5px);
    }
    .modal-content {
        background-color: white;
        padding: 2rem 2.5rem;
        border-radius: 8px;
        text-align: center;
        display: flex;
        align-items: center;
        gap: 1.5rem;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        color: var(--primary);
        font-size: 1.1rem;
        font-weight: 500;
    }
    .spinner {
        border: 4px solid #f3f3f3;
        border-top: 4px solid var(--secondary);
        border-radius: 50%;
        width: 30px;
        height: 30px;
        animation: spin 1s linear infinite;
    }
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .chart-pie, .chart-bar {
    /* A fixed or min-height makes Chart.js compute non-zero size */
    min-height: 260px;
    }
    /* Let the canvas fill the container */
    .chart-pie canvas, .chart-bar canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    }
/* Responsive Design */
@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
        min-height: auto;
        width: 90%;
        margin: 20px auto; /* KD-121: centre the card (was 20px 0 -> flush-left) */
    }

    .branding-panel, .form-panel {
        width: 100%;
        box-sizing: border-box;
    }

    /* KD-121: width:100% + padding overflowed the panel without border-box. */
    .form-panel form input,
    .form-panel .btn-login,
    .form-panel .btn-google {
        box-sizing: border-box;
    }

    .branding-panel {
        text-align: center;
        padding: 40px 20px;
    }

    .branding-panel .brand-plate {
        align-self: center;
    }
    
    .form-panel {
        padding: 40px 20px;
    }
}
