/* --- General Body & Container --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: 70px; /* Space for fixed navbar */
    margin: 0;
    background-color: #f4f7f6; /* Lighter page background */
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.page-content {
    margin-top: 20px; /* Space below navbar */
    padding-bottom: 40px; /* Space above footer */
}

/* ======================= Navbar Styles Start ======================= */
.navbar {
    background-color: #2c3e50; /* Darker, elegant blue-grey */
    padding: 0.75rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for toggler on small screens */
}

.navbar-brand {
    color: #ecf0f1; /* Light grey/white */
    font-size: 1.6rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
}
.navbar-brand:hover {
    color: #ffffff;
}

/* --- Toggler Button Styles --- */
.navbar-toggler {
    padding: 0.4rem 0.8rem;
    font-size: 1.25rem;
    background-color: transparent;
    border: 1px solid rgba(236, 240, 241, 0.3); /* Lighter border */
    border-radius: 0.25rem;
    cursor: pointer;
    display: none; /* Hidden on larger screens */
    transition: background-color 0.2s ease-in-out;
}
.navbar-toggler:hover {
    background-color: rgba(236, 240, 241, 0.1);
}
.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(236, 240, 241, 0.25);
}

.navbar-toggler .toggler-icon {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #ecf0f1; /* Icon color */
    border-radius: 1px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
.navbar-toggler .toggler-icon + .toggler-icon {
    margin-top: 4px;
}

.navbar-toggler.active .top-bar {
    transform: rotate(45deg) translate(4px, 4px);
}
.navbar-toggler.active .middle-bar {
    opacity: 0;
}
.navbar-toggler.active .bottom-bar {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* --- Collapsible Content & Links --- */
.navbar-collapse {
    /* On larger screens, it's part of the flex layout */
    display: flex; /* Default for larger screens */
    flex-basis: auto; /* Allow content to determine width */
    flex-grow: 1; /* Allow it to grow */
    align-items: center;
}

.navbar-links {
    display: flex;
    flex-direction: row; /* Horizontal on large screens */
    align-items: center;
    margin-left: auto; /* Push to the right */
    list-style: none; /* Remove if using ul/li */
    padding-left: 0; /* Remove if using ul/li */
}

.nav-link {
    color: #bdc3c7; /* Lighter grey for links */
    text-decoration: none;
    padding: 0.6rem 0.9rem;
    margin: 0 0.2rem;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active { /* Add .active class for current page if needed */
    color: #ffffff;
    background-color: rgba(236, 240, 241, 0.15); /* Subtle highlight */
}

/* --- Logout Section --- */
.navbar-logout {
    display: flex;
    align-items: center;
    margin-left: 1rem; /* Space from other links */
}

.user-greeting {
    color: #95a5a6; /* Dimmer grey */
    margin-right: 0.8rem;
    font-size: 0.85em;
    white-space: nowrap;
}

.logout-form {
    display: inline; /* Keep form inline */
}

.btn-logout {
    background-color: #EB6A5C !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 4px !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

.btn-logout:hover,
.btn-logout:focus {
    background-color: #c0392b !important; /* Darker red on hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important; /* Subtle shadow on hover */
}

/* --- Responsive Styles for Navbar (Small Screens) --- */
@media (max-width: 991.98px) {

    .navbar-toggler {
        display: block;
    }

    .navbar-collapse {
        display: none; /* Hide the links container by default */
        flex-basis: 100%; /* Take full width when shown */
        width: 100%;
        margin-top: 0.5rem; /* Space below brand/toggler */
        background-color: #34495e; /* Slightly different background for dropdown */
        border-radius: 0 0 4px 4px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .navbar-collapse.show {
        display: block; /* Show when .show class is added by JS */
    }

    .navbar-links {
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        padding: 0.5rem 0;
    }

    /* Target both direct .nav-link and .nav-link inside spans */
    .navbar-links > .nav-link,
    .navbar-links > span > .nav-link { /* ADDED THIS SELECTOR */
        padding: 0.8rem 1rem;
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(236, 240, 241, 0.1);
        margin: 0; /* Reset any horizontal margins */
        border-radius: 0;
        display: block; /* Ensure it behaves as a block element */
        text-align: left; /* Align text to the left */
    }

    /* Remove bottom border from the very last link element visible */
    .navbar-links > .nav-link:last-child,
    .navbar-links > span:last-of-type > .nav-link:last-of-type {
        border-bottom: none;
    }

    /* Ensure spans also behave like blocks to stack correctly */
    .navbar-links > span { /* ADDED THIS */
        display: flex; /* Use flex to make inner links stretch */
        flex-direction: column;
        width: 100%;
    }


    .navbar-links > .nav-link:hover,
    .navbar-links > span > .nav-link:hover,
    .navbar-links > .nav-link:focus,
    .navbar-links > span > .nav-link:focus {
        background-color: rgba(236, 240, 241, 0.2);
    }


    .navbar-logout {
       flex-direction: column;
       align-items: stretch; /* Stretch to full width */
       padding: 0.8rem 1rem; /* Match nav-link padding */
       border-top: 1px solid rgba(236, 240, 241, 0.1); /* Separator if it's the last item */
    }
    .navbar-logout .user-greeting {
        margin-bottom: 0.5rem;
        text-align: center;
    }
     .navbar-logout .logout-form {
        width: 100%;
     }
     .navbar-logout .btn-logout {
        width: 100%; /* Make logout button full width in dropdown */
        text-align: center;
     }
}

/* ======================= Navbar Styles End ========================= */

.card {
    margin-bottom: 20px;
    border: 1px solid #dee2e6; /* Slightly lighter border */
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    background-color: #ffffff; /* White card background */
}

.card-header {
    background-color: #e9ecef; /* Light grey header */
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    color: #495057; /* Darker text for header */
}

.card-body {
    padding: 1.25rem;
}

.card-body .btn { /* Or a more specific class if needed */
    display: block; /* Make each button take its own line */
    width: 100%;    /* Optional: Make buttons full width */
    margin-bottom: 0.5rem; /* Add space below each button */
    box-sizing: border-box; /* Ensure padding/border are included in width */
}

/* Remove margin from the last button in the group */
.card-body .btn:last-child {
    margin-bottom: 0;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #e9ecef;
    text-align: left; /* Ensure headers align left */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.03); /* Lighter stripe */
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-decoration: none; /* Ensure buttons don't look like links */
}
.btn:hover {
    text-decoration: none;
}


.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #004085;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-secondary:hover {
    color: #fff;
    background-color: #5a6268;
    border-color: #545b62;
}


.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}
.btn-success:hover{
    color: #fff;
    background-color: #1e7e34;
    border-color: #1c7430;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}
.btn-danger:hover{
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-warning {
    color: #212529;
    background-color: #ffc107;
    border-color: #ffc107;
}
.btn-warning:hover {
    color: #212529;
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-info {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}
.btn-info:hover {
    color: #fff;
    background-color: #138496;
    border-color: #117a8b;
}


.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}


.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}
.form-control:disabled, .form-control[readonly] {
    background-color: #e9ecef; /* Style disabled inputs */
    opacity: 1;
}


label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500; /* Slightly bolder labels */
}

.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Login Form Specific */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff; /* White background for login box */
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Footer Styles */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6; /* Separator line */
}

/* Utility classes */
.mt-3 { margin-top: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.badge {
    display: inline-block;
    padding: .35em .65em; /* Adjust padding as needed */
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    color: #fff; /* Default text color */
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
}

.bg-success { background-color: #28a745 !important; }
.bg-danger { background-color: #dc3545 !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-info { background-color: #17a2b8 !important; }
.bg-secondary { background-color: #6c757d !important; }
.text-dark { color: #212529 !important; } /* For light backgrounds like yellow */

.disabled {
    cursor: not-allowed;
    opacity: 0.65;
    pointer-events: none; /* Prevent clicks */
}