/* ------------------- Sidebar ------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #fff;
    color: #000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid #ccc;
    z-index: 100;
    padding-bottom: 60px; /* space for logout */
}

.sidebar-logo {
    width: 100px;
    height: auto;
    display: block;
    margin: 15px auto 10px auto;
}

.school-name {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.sidebar-user {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 5px;
}

/* Sidebar Menu */
.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu ul li {
    border-bottom: 1px solid #ddd;
}

.sidebar-menu ul li a {
    display: block;
    color: #000;
    text-decoration: none;
    padding: 12px 20px;
    font-weight: 500;
}

.sidebar-menu ul li a:hover {
    background: #eaeaea;
}

/* Logout fixed at bottom */
.logout-fixed {
    margin-top: auto;
    display: block;
    text-align: center;
    background: #ff0000;
    color: #fff;
    padding: 10px 0;
    text-decoration: none;
    font-weight: bold;
    position: sticky;
    bottom: 0;
}

/* ------------------- Main wrapper ------------------- */
.main-wrapper {
    margin-left: 240px; /* width of sidebar */
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f9f9f9;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* content scrollable */
    padding: 20px;
    box-sizing: border-box;
}

/* Header */
.main-header {
    margin-bottom: 15px;
}

/* ------------------- Content Area ------------------- */
.content-area {
    flex: 1;
    overflow-x: auto; /* allow horizontal scroll for wide tables */
}

/* ------------------- Tables ------------------- */
.content-area table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.content-area table th,
.content-area table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-area table th {
    background-color: #007bff;
    color: #fff;
}

.content-area table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.content-area table tr:hover {
    background-color: #ddd;
}

/* ------------------- Dashboard Cards ------------------- */
.dashboard-card {
    display: inline-block;
    width: 180px;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    text-align: center;
    vertical-align: top;
}

.dashboard-cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Card colors */
.card-green { background: #28a745; }
.card-blue { background: #007bff; }
.card-red { background: #dc3545; }
.card-yellow { background: #ffc107; }
.card-purple { background: #6f42c1; }
.card-teal { background: #20c997; }

/* ------------------- Footer ------------------- */
.footer {
    position: fixed;
    bottom: 0;
    left: 240px; /* start after sidebar */
    width: calc(100% - 240px);
    background: #007bff;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    z-index: 50;
}

/* Scrollbar styling */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}
/* Reset */
* { margin:0; padding:0; box-sizing:border-box; font-family: Arial, sans-serif; }

/* Header */
header {
    background-color: #003366;
    color: #fff;
    padding: 10px 20px;
}

.logo-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-header .logo {
    height: 80px;
    width: auto;
}

.logo-header h1 {
    font-size: 28px;
    color: #fff;
}

.top-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin-top: 10px;
}

.top-nav ul li a {
    text-decoration: none;
    color: #fff;
    font-weight: bold;
}

.top-nav ul li a:hover {
    color: #ffcc00;
}

/* Slider */
.slider-container {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    margin-top: 10px;
}

.slider {
    display: flex;
    width: 500%;
    animation: slide 20s infinite;
}

.slider img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

@keyframes slide {
    0% { transform: translateX(0%); }
    20% { transform: translateX(-20%); }
    40% { transform: translateX(-40%); }
    60% { transform: translateX(-60%); }
    80% { transform: translateX(-80%); }
    100% { transform: translateX(0%); }
}

/* Staff Login Page */
.staff-login-container {
    max-width: 400px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid #003366;
    border-radius: 8px;
    background-color: #f1f1f1;
}

.staff-login-container h2 {
    text-align: center;
    margin-bottom: 15px;
}

.staff-login-container form {
    display: flex;
    flex-direction: column;
}

.staff-login-container form input,
.staff-login-container form select,
.staff-login-container form button {
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #003366;
}

.staff-login-container form button {
    background-color: #003366;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.staff-login-container form button:hover {
    background-color: #0055aa;
}

/* Footer */
footer {
    background-color: #003366;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    position: relative;
}
/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

/* Header */
header {
    background-color: #004d00;
    color: white;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-header {
    text-align: center;
}

.logo-header img.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.logo-header h1 {
    margin-top: 5px;
    font-size: 1.5em;
}

/* Navigation */
.top-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.top-nav ul li a {
    text-decoration: none;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    transition: 0.3s;
}

.top-nav ul li a:hover,
.top-nav ul li a.active {
    background-color: #006600;
}

/* Slider */
.slider-container {
    max-width: 1000px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
}

.slider {
    display: flex;
    width: 500%;
    animation: slide 15s infinite;
}

.slider img {
    width: 20%;
    object-fit: cover;
}

@keyframes slide {
    0% {transform: translateX(0%);}
    20% {transform: translateX(-20%);}
    40% {transform: translateX(-40%);}
    60% {transform: translateX(-60%);}
    80% {transform: translateX(-80%);}
    100% {transform: translateX(0%);}
}

/* Sections */
section {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
}

/* Staff Login Button */
.btn-login {
    display: inline-block;
    padding: 10px 20px;
    background-color: #004d00;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
}

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

/* Footer */
footer {
    background-color: #004d99;
    color: white;
    text-align: center;
    padding: 10px 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Login Card */
.login-card {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background-color: #e6ffe6;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.login-card form {
    display: flex;
    flex-direction: column;
}

.login-card form label {
    margin-top: 10px;
}

.login-card form input,
.login-card form select,
.login-card form button {
    margin-top: 5px;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.login-card form button {
    background-color: #004d00;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 15px;
}

.login-card form button:hover {
    background-color: #006600;
}
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    color: #fff;
}
.badge-green { background: #2ecc71; }
.badge-red { background: #e7973c; }
.login-logo img {
    width: 80px;
    margin-bottom: 10px;
}

.login-logo h2 {
    margin: 5px 0;
    font-size: 20px;
}

.login-logo p {
    margin-bottom: 15px;
}

/* ===============================
   GLOBAL MOBILE FIX – STAFF
   =============================== */
@media (max-width: 768px) {

    html, body {
        width: 100%;
        overflow-x: hidden;
    }

    /* Sidebar hidden on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: 0.3s ease;
        z-index: 9999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Main wrapper must be full width */
    .main-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }

    .main-content {
        padding: 15px;
        width: 100%;
    }

    /* Footer must not be pushed off screen */
    .footer {
        left: 0;
        width: 100%;
        position: relative;
    }

    /* Tables scroll instead of cutting columns */
    .content-area {
        overflow-x: auto;
    }

    .content-area table {
        min-width: 600px;
    }

    /* Dashboard cards stack */
    .dashboard-cards-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-card {
        width: 100%;
    }
}
/* ================= GLOBAL MOBILE FIX ================= */
@media (max-width: 768px) {

    /* RESET FIXED LAYOUTS */
    body {
        padding-top: 140px !important; /* space for fixed header */
    }

    /* SIDEBAR */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 240px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 9999;
    }

    .sidebar.active {
        left: 0;
    }

    /* MAIN CONTENT */
    .main-wrapper,
    .main-content,
    .content-area {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }

    /* FOOTER */
    .footer {
        left: 0;
        width: 100%;
        position: relative;
    }

    /* TABLES */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
/* ================= ENTER MARKS – MOBILE FIX ================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 700px; /* forces scroll instead of hiding */
}

@media (max-width: 768px) {

    /* STACK FILTERS */
    form select,
    form button {
        width: 100%;
        margin-bottom: 10px;
    }

    /* INPUTS INSIDE TABLE */
    table input[type="number"] {
        width: 70px;
        padding: 4px;
        font-size: 13px;
    }

    /* REDUCE HEADER TEXT */
    table th {
        font-size: 13px;
        padding: 6px;
        white-space: nowrap;
    }

    table td {
        white-space: nowrap;
    }

    /* PAGE TITLE */
    h2, h3 {
        font-size: 18px;
    }
}
@media (max-width: 768px) {
    .totals-form input,
    .totals-form button {
        width: 100%;
        margin-bottom: 8px;
    }
}

.student-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

