body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #00095c;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 999;
}

.logo {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
}

.logo img {
    margin-right: 10px;
}

.top-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.top-nav ul li {
    margin-left: 20px;
}

.top-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2em;
    padding: 5px 10px;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    transition: all 0.3s ease;
}

.top-nav ul li a:hover {
    text-decoration: none;
    color: #00e1ff;
}

.header-main {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.header-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9);
}

.admin-office-menu {
    background-color: #00095c;
    color: #fff;
    padding: 15px 20px;
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.grid-item {
    background-color: #c0d9ee;
    border: 1px solid #c0d9ee;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
}

.grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(247, 122, 122, 0.846);
}

.grid-item a {
    text-decoration: none;
    color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.grid-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.grid-item a:hover img {
    transform: scale(1.1);
}

.grid-item span {
    font-size: 1.1em;
    font-weight: bold;
    color: #00095c;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.grid-item a:hover span {
    color: #00b7ffba;
}

footer {
    background-color: #00095c;
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #ffd900;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.footer-links li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.footer-links li a:hover {
    color: #ffd900;
    text-decoration: underline;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border-radius: 20px;
    padding: 2px 5px;
}

.search-container input[type="text"] {
    border: none;
    background: transparent;
    outline: none;
    padding: 5px;
    font-size: 14px;
    width: 50px;
}

.search-container button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #333;
}

.grid-item.hide {
    display: none;
}

/* --- Mobile Menu Styles --- */
.menu-toggle-btn,
.close-menu-btn {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.close-menu-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 36px;
}

/* --- Login Form & Overlay Styles --- */
#login-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 242, 245, 0.9);
    /* Semi-transparent background */
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: #ffffff;
    padding: 25px 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo img {
    width: 55px;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 22px;
    color: #00095c;
    margin: 0 0 20px 0;
}

#login-form input[type="text"],
#login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

#login-form button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #ff7700;
    /* Adapted to KPC color scheme */
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.remember-me-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}

.remember-me-container input {
    margin-right: 8px;
}

#login-error {
    color: #d93025;
    margin-top: 15px;
    height: 1em;
    font-weight: bold;
}

/* --- Authentication Display Logic --- */
body.logged-out #login-overlay {
    display: flex !important;
}

body.logged-out>header,
body.logged-out>main,
body.logged-out>footer {
    display: none !important;
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 768px) {
    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle-btn {
        display: block;
    }

    .close-menu-btn {
        display: block;
    }

    .top-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: #00095c;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
        transition: right 0.4s ease-in-out;
        z-index: 1001;
    }

    .top-nav.open {
        right: 0;
    }

    .top-nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 60px;
        width: 100%;
        margin-top: 0;
    }

    .top-nav ul li {
        margin: 15px 25px;
        width: calc(100% - 50px);
    }

    .top-nav ul li a {
        font-size: 1.3em;
    }

    .admin-office-menu {
        font-size: 1.4em;
        padding: 10px 15px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .admin-office-menu {
        font-size: 1.2em;
    }
}

#logoutButton i {
    margin-right: 8px;
}