/* admin.css - Admin Panel Styles */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --darker-color: #111827;
    --light-color: #f3f4f6;
    --lighter-color: #f9fafb;
    --white-color: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--lighter-color);
    overflow-x: hidden;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-container {
    background: var(--white-color);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-with-icon input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}

.remember-me input {
    width: auto;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-login {
    width: 100%;
    margin-top: 1rem;
}

.login-help {
    text-align: center;
    margin-top: 1.5rem;
}

.login-help a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Admin Dashboard Layout */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--darker-color);
    color: var(--white-color);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white-color);
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--white-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: var(--white-color);
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item .badge {
    position: absolute;
    left: 1rem;
    background: var(--danger-color);
    color: var(--white-color);
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.2);
    color: var(--white-color);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--danger-color);
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* Admin Header */
.admin-header {
    background: var(--white-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    padding: 0.625rem 3rem 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    width: 250px;
    font-family: 'Cairo', sans-serif;
}

.notifications {
    position: relative;
}

.notification-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger-color);
    color: var(--white-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.notifications-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--white-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.notifications-dropdown.show {
    display: block;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notifications-header h3 {
    font-size: 1.125rem;
}

.notifications-header a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.notification-item:hover {
    background: var(--lighter-color);
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
}

.notification-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.notification-item p {
    margin: 0;
    font-size: 0.875rem;
}

.notification-item span {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: var(--lighter-color);
}

.user-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-btn span {
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--white-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-dropdown a:hover {
    background: var(--lighter-color);
}

/* Page Content */
.page {
    display: none;
    padding: 2rem;
}

.page.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white-color);
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-color); }
.stat-icon.green { background: var(--success-color); }
.stat-icon.orange { background: var(--warning-color); }
.stat-icon.purple { background: #8b5cf6; }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Table */
.recent-activity {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white-color);
}

.data-table thead {
    background: var(--lighter-color);
}

.data-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background: var(--lighter-color);
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.btn-edit {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    background: var(--white-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-page {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-page:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.report-card {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.report-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.report-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.report-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Settings */
.settings-container {
    display: grid;
    gap: 2rem;
}

.settings-section {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.settings-form input,
.settings-form select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white-color);
    margin: 3% auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 1000px;
}

.close {
    color: var(--text-secondary);
    float: left;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--danger-color);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-right-color: var(--white-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--white-color);
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-right {
        gap: 0.75rem;
    }
    
    .search-box input {
        width: 150px;
    }
}