/* --- General Resets & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* --- Main Layout Containers --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

#header {
    background-color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

#header img {
    max-width: 250px; /* Make logo responsive */
    height: auto;
}

#nav {
    background-color: #34495e;
    padding: 1rem 0;
}

#nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s;
}

#nav a:hover {
    color: #1abc9c;
}

#content {
    padding: 2rem 0;
}

#footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

#footer a {
    color: #1abc9c;
    text-decoration: none;
}

/* --- Responsive Content Layout (The Magic!) --- */
.main-layout {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to the next line on small screens */
    gap: 2rem;
}

.main-content {
    flex: 2; /* Takes up 2/3 of the space */
    min-width: 300px; /* Prevents it from getting too squished */
}

.sidebar {
    flex: 1; /* Takes up 1/3 of the space */
    min-width: 250px;
}

.sidebar img {
    width: 100%; /* Makes image fill the sidebar */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* On screens smaller than 768px (tablets/mobiles), stack the columns */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
}


/* --- Modern Component Styles --- */
h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #1abc9c;
    padding-bottom: 0.5rem;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Adds horizontal scroll on mobile if needed */
    border: 1px solid #ddd;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:last-child td {
    border-bottom: none;
}

tr.total-row td {
    font-weight: bold;
    background-color: #eafaf1;
}

/* Modern Form Styles */
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.button {
    background-color: #1abc9c;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #16a085;
}

.update-link img {
    width: 100px; /* Control size of edit button */
    height: auto;
}

/* Add this to the bottom of css/style.css */

/* Message for users who shouldn't be here */
.access-denied {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

/* Pagination Styles */
.pagination {
   margin-top: 2rem; 
   list-style: none;
   padding: 0;
   display: flex;
   justify-content: center;
   gap: 5px;
}

.pagination li a {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #34495e;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination li a:hover {
    background-color: #f2f2f2;
}

.pagination li a.active {
    font-weight: bold; 
    background-color: #34495e;
    color: #fff;
    border-color: #34495e;
}

/* Add this to the bottom of css/style.css */

/* --- Admin Menu Styles --- */
.admin-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-menu li {
    margin-bottom: 0.75rem;
}

.admin-menu .menu-button {
    display: block; /* Makes the entire area clickable */
    padding: 12px 15px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    border: none;
    width: 100%;
}

/* Primary buttons (for stats) */
.admin-menu .menu-button.primary {
    background-color: #1abc9c; /* Our main green */
}

.admin-menu .menu-button.primary:hover {
    background-color: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Secondary buttons (for management tasks) */
.admin-menu .menu-button.secondary {
    background-color: #34495e; /* Our dark blue/grey */
}

.admin-menu .menu-button.secondary:hover {
    background-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}


/* --- General Data Form Styles --- */
.data-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.data-form input[type="text"],
.data-form input[type="password"],
.data-form input[type="email"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

/* --- Message Box Styles (for success/error feedback) --- */
.message-box {
    padding: 15px;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    border: 1px solid transparent;
}

.message-box.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.message-box.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Add this to the bottom of css/style.css */

/* --- Action Buttons for Tables --- */
.action-button {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}
.action-button:hover {
    opacity: 0.8;
}

.action-button.edit {
    background-color: #3498db; /* Blue */
}

.action-button.delete {
    background-color: #e74c3c; /* Red */
}

/* Make delete forms in tables take up no extra space */
.delete-form {
    display: inline-block;
    margin: 0;
}

<!-- view -->

    .details-grid {
        display: grid;
        grid-template-columns: 180px 1fr;
        gap: 1rem;
        background-color: #f9f9f9;
        border: 1px solid #ddd;
        padding: 1.5rem;
        border-radius: 8px;
    }
    .details-grid div {
        padding: 5px 0;
    }
    .status-badge {
        padding: 5px 10px;
        border-radius: 15px;
        color: #fff;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 12px;
    }
    .status-badge.layon { background-color: #3498db; }
    .status-badge.paid { background-color: #2ecc71; }
    .status-badge.late { background-color: #e74c3c; }
    .status-badge.pending { background-color: #f1c40f; color: #333; 
    }
