/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background-color: #b7c468; /* Gold background (183, 196, 104) */
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

header img {
    width: 50px;
    height: auto;
    margin-right: 10px;
}

header h2 {
    margin: 0;
    color: #333;
    font-size: 1.2em; /* Smaller on mobile */
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2eb087; /* Green background (46, 176, 135) */
    color: white;
    padding: 20px;
    box-sizing: border-box;
    transition: width 0.3s; /* Smooth transition for mobile toggle */
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.2em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sidebar a:hover {
    background-color: #259a73; /* Darker green hover (adjusted from original) */
}

/* Main Content */
main {
    flex: 1;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: auto; /* Allow horizontal scroll for tables */
}

main h1 {
    margin-top: 0;
    color: #333;
}

main h2 {
    color: #555;
    margin-top: 30px;
}

/* Forms */
form {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

form label {
    font-weight: bold;
}

form input, form select, form button {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

form button {
    background-color: #2eb087; /* Green button */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

form button:hover {
    background-color: #259a73; /* Darker green hover */
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #b7c468; /* Gold table header */
    color: white;
    font-weight: bold;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Messages */
.success {
    color: green;
    background-color: #d4edda;
    padding: 10px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error {
    color: red;
    background-color: #f8d7da;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
}

/* Responsive Design */

/* Tablet and below (768px and up) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }

    header h2 {
        font-size: 1em;
        margin-top: 10px;
    }

    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        display: none; /* Hidden by default, toggle with JS */
    }

    .sidebar.show {
        display: block;
    }

    main {
        padding: 10px;
    }

    form {
        gap: 8px;
    }

    form input, form select, form button {
        font-size: 0.9em;
        padding: 8px;
    }

    table {
        font-size: 0.8em;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    table th, table td {
        padding: 8px;
        min-width: 100px; /* Prevent squishing */
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    header img {
        width: 40px;
    }

    header h2 {
        font-size: 0.9em;
    }

    .sidebar {
        padding: 10px;
    }

    .sidebar ul {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .sidebar a {
        padding: 8px;
        font-size: 0.9em;
    }

    main h1 {
        font-size: 1.5em;
    }

    main h2 {
        font-size: 1.2em;
    }

    form {
        gap: 5px;
    }

    form input, form select, form button {
        font-size: 0.8em;
        padding: 6px;
    }

    table th, table td {
        padding: 6px;
        font-size: 0.7em;
    }

    .success, .error {
        font-size: 0.8em;
        padding: 8px;
    }
}

/* Large screens (1024px and up) */
@media (min-width: 1024px) {
    .sidebar {
        width: 300px;
    }

    main {
        padding: 30px;
    }

    table {
        font-size: 1.1em;
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

/* Mobile Menu Toggle (Add this JS to your pages for sidebar toggle) */
/* Example: Add a hamburger button in header for mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 1.5em;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}