* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-header i {
    font-size: 1.75rem;
    color: #3498db;
}

.sidebar-title {
    color: white;
}

.sidebar-user {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #3498db;
}

.sidebar-nav .nav-item.active {
    background: rgba(52, 152, 219, 0.2);
    color: white;
    border-left-color: #3498db;
    font-weight: 600;
}

.sidebar-nav .nav-item i {
    font-size: 1.25rem;
    width: 24px;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-footer .nav-item:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.sidebar-footer .nav-item i {
    font-size: 1.25rem;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
    overflow-x: hidden;
}

.content-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.header-user-details {
    display: flex;
    flex-direction: column;
}

.header-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
}

.header-user-role {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-body {
    padding: 2rem;
    width: 100%;
    overflow-x: hidden;
}

.dashboard-welcome {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 400px;
}

/* Scrollable content area */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.fixed-filters {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

/* Flash Messages */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    width: 100%;
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
    overflow-x: hidden;
}

/* Table Container */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Tables */
.table-sm th,
.table-sm td {
    padding: 0.75rem;
    font-size: 0.875rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

/* Summary Cards */
.summary-card {
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.summary-card.primary {
    border-left-color: #0d6efd;
}

.summary-card.success {
    border-left-color: #198754;
}

.summary-card.info {
    border-left-color: #0dcaf0;
}

.summary-card.warning {
    border-left-color: #ffc107;
}

.summary-card h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.summary-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Row and Column Constraints */
.row {
    margin-left: 0;
    margin-right: 0;
}

.row > * {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
}

@media (max-width: 768px) {
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Pagination */
.pagination {
    gap: 0.25rem;
    flex-wrap: wrap;
}

.page-link {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #667eea;
    margin: 0 2px;
    padding: 0.375rem 0.75rem;
}

.page-link:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

@media (max-width: 576px) {
    .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Dashboard Cards */
.dashboard-card {
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: white;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.dashboard-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dashboard-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-title,
    .sidebar-user,
    .nav-item span {
        display: none;
    }
    
    .sidebar-header {
        justify-content: center;
    }
    
    .sidebar-nav .nav-item {
        justify-content: center;
        padding: 1rem;
    }
    
    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
    }
    
    .content-header {
        padding: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
    }
    
    .header-user-info {
        display: none;
    }
    
    .content-body {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-sm th,
    .table-sm td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .fixed-filters .form-control,
    .fixed-filters .form-select {
        font-size: 0.875rem;
    }
    
    .summary-card h3 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content-header h1 {
        font-size: 1.1rem;
    }
    
    .content-body {
        padding: 0.75rem;
    }
    
    .summary-card {
        margin-bottom: 1rem;
    }
    
    .table-sm th,
    .table-sm td {
        white-space: nowrap;
    }
}

.min-vh-100 {
    min-height: 100vh;
}


/* Filter Indicator Styles */
.filter-indicator {
    margin: 0;
    padding: 0;
}

.filter-indicator .alert {
    margin: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    background-color: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.3);
    color: #0dcaf0;
}

.filter-indicator .alert i {
    margin-right: 0.25rem;
}

.filter-indicator .btn-close {
    font-size: 0.7rem;
    padding: 0.25rem;
    opacity: 0.7;
}

.filter-indicator .btn-close:hover {
    opacity: 1;
}

/* Alert small variant */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-close-sm {
    width: 0.75rem;
    height: 0.75rem;
}
