* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #4895ef;
    --dark-color: #1e1e2e;
    --light-color: #f8f9fa;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.admin-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--dark-color) 0%, #2d2d44 100%);
    color: white;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-right: 4px solid var(--success-color);
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    background: var(--danger-color);
    color: white;
    border-radius: 20px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    white-space: nowrap;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
}

.header {
    height: var(--header-height);
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--dark-color);
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: #f1f5f9;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    width: 300px;
    flex-shrink: 0;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition);
    background: white;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    color: var(--dark-color);
    flex-shrink: 0;
}

.icon-btn:hover {
    background: #f1f5f9;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Section Styles */
.section {
    display: none;
    padding: 2rem;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--dark-color);
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--info-color);
    color: white;
}

.btn-secondary:hover {
    background: #3a7bd5;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Stats Grid */
.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: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon { background: var(--primary-color); }
.stat-card:nth-child(2) .stat-icon { background: var(--info-color); }
.stat-card:nth-child(3) .stat-icon { background: var(--danger-color); }
.stat-card:nth-child(4) .stat-icon { background: var(--success-color); }

.stat-info {
    min-width: 0;
    flex: 1;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-info p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

.data-table td {
    white-space: normal;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.user-info-sm {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-info-sm strong {
    color: var(--dark-color);
    font-size: 0.875rem;
}

.user-info-sm small {
    color: #64748b;
    font-size: 0.75rem;
}

/* Filters */
.filters-bar {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    white-space: nowrap;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    transition: var(--transition);
    min-width: 120px;
    background: white;
}

.filter-group select:focus {
    border-color: var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.close-modal:hover {
    background: #f1f5f9;
    color: var(--dark-color);
}

.modal-body {
    padding: 1.5rem;
}

/* Application Details */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    margin-bottom: 1rem;
    break-inside: avoid;
}

.detail-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
}

.detail-value {
    color: #1e293b;
    word-break: break-word;
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 0;
}

.analytics-card h3 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.125rem;
}

.chart-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    min-width: 0;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.activity-item:hover {
    background: #f8fafc;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    color: #64748b;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.action-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-view {
    background: var(--info-color);
    color: white;
}

.action-view:hover {
    background: #3a7bd5;
    transform: translateY(-1px);
}

.action-edit {
    background: var(--warning-color);
    color: white;
}

.action-edit:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

.action-delete {
    background: var(--danger-color);
    color: white;
}

.action-delete:hover {
    background: #e91e63;
    transform: translateY(-1px);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 4000;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary-color);
    max-width: 400px;
    width: calc(100% - 40px);
}

.notification-success { border-left-color: var(--success-color); }
.notification-error { border-left-color: var(--danger-color); }
.notification-warning { border-left-color: var(--warning-color); }
.notification-info { border-left-color: var(--info-color); }

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: var(--transition);
}

.notification-close:hover {
    color: var(--dark-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ========================================================================== */
/* RESPONSIVE DESIGN */
/* ========================================================================== */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (1024px to 1199px) */
@media (max-width: 1199px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar-header h2 span,
    .nav-item span,
    .user-details,
    .logout-btn span {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }
    
    .nav-item {
        justify-content: center;
        padding: 1rem;
    }
    
    .nav-item i {
        margin-right: 0;
        font-size: 1.25rem;
    }
    
    .nav-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    .search-box {
        width: 250px;
    }
}

/* Tablet Landscape (768px to 1023px) */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .search-box {
        width: 200px;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .filter-group {
        justify-content: space-between;
        width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .section-actions {
        justify-content: stretch;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
}

/* Tablet Portrait (600px to 767px) */
@media (max-width: 767px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--header-height);
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .header-left {
        order: 1;
        flex: 1 1 100%;
    }
    
    .header-right {
        order: 2;
        flex: 1 1 100%;
        justify-content: space-between;
    }
    
    .search-box {
        flex: 1;
        min-width: 200px;
    }
    
    .section {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: 1.75rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analytics-card {
        padding: 1.25rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body {
        padding: 1.25rem;
    }
}

/* Mobile Landscape (480px to 599px) */
@media (max-width: 599px) {
    .search-box {
        display: none;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    .filters-bar {
        padding: 1rem;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .filter-group label {
        font-size: 0.8125rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pagination-btn {
        width: 100%;
        justify-content: center;
    }
    
    .activity-item {
        padding: 0.875rem 1rem;
    }
    
    .activity-icon {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

/* Mobile Portrait (320px to 479px) */
@media (max-width: 479px) {
    .header {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .section {
        padding: 0.75rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem 0.75rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .section-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.8125rem;
    }
    
    .action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .detail-grid {
        gap: 0.75rem;
    }
    
    .detail-item {
        margin-bottom: 0.75rem;
    }
}

/* Extra Small Mobile (under 320px) */
@media (max-width: 319px) {
    .admin-container {
        min-width: 320px;
    }
    
    .header {
        min-width: 320px;
    }
    
    .main-content {
        min-width: 320px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .section-actions,
    .filters-bar,
    .action-btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .section {
        display: block !important;
        padding: 0;
    }
    
    .table-container {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .data-table {
        min-width: auto;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .stat-icon,
    .activity-icon,
    .user-avatar {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .stat-card:hover,
    .action-btn:hover,
    .btn:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #1e293b;
        color: white;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .stat-card:hover,
    .action-btn:hover,
    .btn:hover {
        transform: none;
    }
    
    .nav-item {
        padding: 1rem 1.5rem;
    }
    
    .action-btn,
    .btn {
        min-height: 44px;
    }
    
    .icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
}
/* ========================================================================== */
/* AUTHENTICATION STYLES */
/* ========================================================================== */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.login-logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.login-logo h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0;
}

.login-header p {
    color: #64748b;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    z-index: 1;
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition);
    background: white;
}

.input-with-icon input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary-color);
    background: #f3f4f6;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: var(--transition);
}

.btn-spinner {
    display: none;
}

.btn-spinner .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-spinner {
    display: block;
}

.auth-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--info-color);
}

.auth-info p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-info p:first-child {
    margin-top: 0;
}

.auth-info p:last-child {
    margin-bottom: 0;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.user-info-item {
    cursor: default;
}

.dropdown-item.user-info-item:hover {
    background: none;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.logout-dropdown {
    color: #ef4444;
}

.logout-dropdown:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.welcome-banner h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
}

.welcome-banner p {
    margin: 0;
    opacity: 0.9;
}

/* User Management */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-avatar.large {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

.user-card .user-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-color);
}

.user-role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-role-badge.admin {
    background: #dbeafe;
    color: #1e40af;
}

.user-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.user-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

/* Auth Error States */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Session Timer */
.session-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Responsive Auth Styles */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .login-logo {
        flex-direction: column;
        text-align: center;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .welcome-banner {
        padding: 1.5rem;
    }
    
    .welcome-banner h2 {
        font-size: 1.5rem;
    }
    
    .user-card {
        padding: 1.25rem;
    }
    
    .user-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .user-card-stats {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support for auth */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: #1f2937;
        color: white;
    }
    
    .login-card .form-group label {
        color: #e5e7eb;
    }
    
    .login-card .input-with-icon input {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .login-card .input-with-icon input:focus {
        border-color: var(--primary-color);
    }
    
    .auth-info {
        background: #374151;
        color: #e5e7eb;
    }
}
/* Mobile Menu Improvements */
.sidebar {
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar.active {
    transform: translateX(0);
}

/* Mobile Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-backdrop.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Close button for mobile sidebar */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1001;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile header adjustments */
.header {
    transition: var(--transition);
}

/* Ensure main content is properly positioned */
.main-content {
    transition: var(--transition);
}

/* Mobile-specific sidebar styles */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar-close {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* When sidebar is open, prevent body scroll */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Adjust header for mobile */
    .header {
        padding: 0 1rem;
    }
    
    /* Ensure content is visible when sidebar is open */
    .sidebar.active ~ .main-content {
        transform: translateX(280px);
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .sidebar.active ~ .main-content {
        transform: translateX(100%);
    }
    
    .sidebar-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar-header h2 span,
    .nav-item span,
    .user-details,
    .logout-btn span {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }
    
    .nav-item {
        justify-content: center;
        padding: 1rem;
    }
    
    .nav-item i {
        margin-right: 0;
        font-size: 1.25rem;
    }
    
    .nav-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
}
/* Ensure content is properly visible on mobile */
@media (max-width: 768px) {
    .section {
        padding: 1rem;
        min-height: calc(100vh - var(--header-height));
        overflow-x: hidden;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .table-container {
        margin: 0 -1rem;
        width: calc(100% + 2rem);
    }
    
    .data-table {
        min-width: 800px;
    }
    
    /* Welcome banner adjustments */
    .welcome-banner {
        margin: 0 -1rem 1rem -1rem;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }
    
    .welcome-banner h2 {
        font-size: 1.25rem;
    }
    
    /* Section header adjustments */
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .section-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .section {
        padding: 0.75rem;
    }
    
    .header {
        padding: 0 0.75rem;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}