/* --- General Styles --- */
:root {
    --primary-color: #125297; /* Dark Blue */
    --secondary-color: #3975b7; /* Lighter Blue */
    --accent-color: #ffc107; /* Amber/Gold */
    --text-color: #333;
    --text-color-light: #f8f9fa;
    --bg-color-light: #f8f9fa;
    --bg-color-white: #ffffff;
    --border-color: #dee2e6;
    --sidebar-width: 250px;
    --header-height: 60px;
    --footer-height: 50px;
}

body {
    font-family: 'Poppins', sans-serif, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color-light);
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.6;
    display: flex; /* Needed for flex layout */
    min-height: 100vh;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 0.8em;
    margin-top: 0;
    font-weight: 600;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; color: var(--secondary-color); }
h3 { font-size: 1.3rem; }


/* --- Layout Structure --- */
.page-wrapper {
    display: flex;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--text-color-light);
    position: fixed; /* Fixed sidebar */
    left: 0;
    top: 0;
    height: 100vh; /* Full height */
    overflow-y: auto; /* Scroll if content overflows */
    transition: transform 0.3s ease; /* Animation for mobile */
    z-index: 1000;
}

.sidebar-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header a {
    color: var(--text-color-light);
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
}
.sidebar-header a:hover {
    text-decoration: none;
    opacity: 0.9;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color-light);
    text-decoration: none;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
    border-left: 4px solid transparent; /* For active indicator */
}

.sidebar-nav li a:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
    padding-left: 25px;
}

.sidebar-nav li.active a {
    background-color: var(--secondary-color);
    font-weight: 600;
    border-left-color: var(--accent-color); /* Active indicator */
}

/* --- Main Content Area --- */
.main-content {
    margin-left: var(--sidebar-width); /* Space for the fixed sidebar */
    flex-grow: 1; /* Take remaining width */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure it stretches */
}

.top-header {
    background-color: var(--bg-color-white);
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky; /* Optional: make header sticky */
    top: 0;
    z-index: 900;
}

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.page-title-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.user-info {
    font-size: 0.9rem;
    color: #555;
}


.content-area {
    padding: 25px;
    flex-grow: 1; /* Takes up remaining vertical space */
}

.main-footer {
    background-color: #e9ecef; /* Lighter footer */
    color: #6c757d;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    /* Removed position:fixed, now it's part of the main content flow */
}
.main-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Hide sidebar off-screen */
        /* Consider adding a backdrop overlay when sidebar is open */
    }

    .sidebar.active {
        transform: translateX(0); /* Show sidebar */
    }

    .main-content {
        margin-left: 0; /* Full width content */
        width: 100%;
    }

    .mobile-menu-toggle {
        display: block; /* Show hamburger icon */
    }

    .page-title-header {
        flex-grow: 1;
        text-align: center;
        margin: 0 10px;
    }

    .user-info {
       display: none; /* Optionally hide user info on small screens */
    }
}


/* --- Utility Classes --- */
.text-danger { color: #dc3545; }
.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-info { color: #17a2b8; }
.text-muted { color: #6c757d; }

.bg-light { background-color: var(--bg-color-light) !important; }
.p-3 { padding: 1rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }

/* Basic Table Styling (can be overridden by specific CSS files) */
.table-basic {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: var(--bg-color-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden; /* For border-radius */
}

.table-basic th,
.table-basic td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

.table-basic thead th {
    background-color: #e9ecef;
    font-weight: 600;
    color: var(--text-color);
    border-bottom-width: 2px;
}

.table-basic tbody tr:nth-child(even) {
    background-color: var(--bg-color-light);
}

.table-basic tbody tr:hover {
    background-color: #ddeeff; /* Light blue hover */
}

/* Basic Form Styling */
.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    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: 4px;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    margin-bottom: 10px; /* Add some space below form elements */
}
.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
label {
    display: inline-block;
    margin-bottom: 5px;
    font-weight: 500;
}
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}
.form-section {
    background-color: #fdfdff;
    padding: 20px;
    border: 1px solid #e8e8ff;
    border-radius: 6px;
    margin-bottom: 20px;
}
.form-section h2 {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.3rem;
}

/* Buttons */
.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: 8px 15px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    margin: 2px;
}
.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
}
.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: #bd2130;
    border-color: #b21f2d;
}
.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: #117a8b;
    border-color: #10707f;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 3px;
}

/* Alerts / Messages */
.alert {
  position: relative;
  padding: 12px 20px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
}
.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;
}