/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6f9;
    color: #333;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #343a40;
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    background-color: #212529;
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: #c2c7d0;
    border-bottom: 1px solid #4b545c;
    transition: background-color 0.2s;
    text-decoration: none;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: #495057;
    color: white;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    background-color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-wrapper {
    padding: 2rem;
    overflow-y: auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #444;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background-color: #007bff;
}

.btn-success {
    background-color: #28a745;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-info {
    background-color: #17a2b8;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin: 0.5rem 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Utilities */
.text-right {
    text-align: right;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: absolute;
        top: 60px;
        /* Adjust based on header height */
        left: -100%;
        height: calc(100vh - 60px);
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    .top-navbar {
        padding: 1rem;
    }

    .toggle-menu {
        display: block !important;
        /* Show toggle button */
        cursor: pointer;
        font-size: 1.5rem;
        margin-right: 1rem;
    }

    width: 100%;
    text-align: center;
}

/* Responsive Forms */
form.d-flex,
.d-flex.gap-2 {
    flex-direction: column;
    align-items: stretch !important;
}

.form-control {
    width: 100% !important;
    margin-bottom: 0.5rem;
}

.btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Adjust table actions */
td .btn {
    font-weight: 600;
    color: #555;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background-color: #007bff;
}

.btn-success {
    background-color: #28a745;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-info {
    background-color: #17a2b8;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin: 0.5rem 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Utilities */
.text-right {
    text-align: right;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: absolute;
        top: 60px;
        /* Adjust based on header height */
        left: -100%;
        height: calc(100vh - 60px);
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    .top-navbar {
        padding: 1rem;
    }

    .toggle-menu {
        display: block !important;
        /* Show toggle button */
        cursor: pointer;
        font-size: 1.5rem;
        margin-right: 1rem;
    }

    width: 100%;
    text-align: center;
}

/* Responsive Forms */
form.d-flex,
.d-flex.gap-2 {
    flex-direction: column;
    align-items: stretch !important;
}

.form-control {
    width: 100% !important;
    margin-bottom: 0.5rem;
}

.btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Adjust table actions */
td .btn {
    width: auto;
    margin-bottom: 0;
}
}

.toggle-menu {
    display: none;
    /* Hide by default on desktop */
}

/* Responsive Modal */
.modal-content-responsive {
    background: white;
    width: 500px;
    margin: 50px auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 90%;
    /* Responsive width */
}

@media (max-width: 768px) {
    .modal-content-responsive {
        margin: 20px auto;
        padding: 1.5rem;
        width: 95%;
    }
}