/* =============================================
   Global Styles
============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --gray-dark: #1f2937;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-light);
    color: var(--gray-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary);
}

/* =============================================
   Login Styles
============================================= */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-box h2 {
    text-align: center;
    font-size: 18px;
    color: var(--gray);
    font-weight: normal;
    margin-bottom: 24px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--gray);
}

/* =============================================
   Form Styles
============================================= */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray);
}

/* =============================================
   Button Styles
============================================= */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: var(--info);
    color: var(--white);
}

.btn-info:hover {
    background: #2563eb;
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* =============================================
   Alert Styles
============================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* =============================================
   Table Styles
============================================= */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--gray-light);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* =============================================
   Badge Styles
============================================= */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-administrator {
    background: #e5e7eb;
    color: #374151;
}

.badge-lecturer {
    background: #dbeafe;
    color: #1e40af;
}

.badge-student {
    background: #dcfce7;
    color: #166534;
}

/* =============================================
   Card Styles
============================================= */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* =============================================
   Modal Styles
============================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.modal-content .close:hover {
    color: var(--gray-dark);
}

/* =============================================
   Dashboard Styles
============================================= */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--gray-dark);
    color: var(--white);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .logo {
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: #9ca3af;
    transition: all 0.2s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
}

.main-content {
    margin-left: 250px;
    padding: 24px;
    flex: 1;
}

/* =============================================
   Stats Grid
============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
}

.stat-icon {
    font-size: 32px;
    margin-right: 16px;
}

.stat-info h3 {
    font-size: 24px;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--gray);
    font-size: 14px;
}

/* =============================================
   Activity List
============================================= */
.activity-list {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-user {
    font-weight: 500;
}

.activity-action {
    color: var(--gray);
}

.activity-time {
    color: var(--gray);
    font-size: 12px;
}

/* =============================================
   Page Header
============================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
}

/* =============================================
   Pagination
============================================= */
.pagination-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    color: var(--gray-dark);
}

.pagination li a:hover {
    background: var(--gray-light);
}

.pagination li.active span {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* =============================================
   Responsive
============================================= */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .logo {
        font-size: 12px;
        padding: 0 10px;
    }
    
    .sidebar ul li a {
        padding: 12px 10px;
        font-size: 12px;
    }
    
    .sidebar ul li a i {
        margin-right: 4px;
    }
    
    .sidebar ul li a span {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        font-size: 24px;
    }
    
    .stat-info h3 {
        font-size: 18px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 12px;
    }
}
/* =============================================
   Menu Toggle Button
============================================= */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #1f2937;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* Top Header with Menu Toggle */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .app-title {
    font-weight: 600;
    font-size: 18px;
    color: #1f2937;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown .user-name {
    font-weight: 500;
    font-size: 14px;
    color: #1f2937;
}

.user-dropdown .user-role {
    font-size: 12px;
    color: #6b7280;
}

.logout-btn {
    padding: 6px 14px;
    background: #ef4444;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

@media (max-width: 768px) {
    .top-header {
        padding: 10px 16px;
    }
    .header-left .app-title {
        font-size: 16px;
    }
    .user-dropdown .user-name {
        font-size: 13px;
    }
    .user-dropdown .user-role {
        display: none;
    }
}