@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 56px;
    --primary-color: #0d6efd;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2a2d35;
    --sidebar-active: #0d6efd;
    --sidebar-text: #a0a4b0;
    --sidebar-text-active: #ffffff;
}

* {
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #f5f6fa;
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sidebar-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info small {
    font-size: 0.75rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: auto;
    scrollbar-color: #555a65 #1a1d23;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #1a1d23;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #555a65;
    border-radius: 4px;
    border: 1px solid #1a1d23;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #6a707d;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-radius: 0;
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active .nav-link {
    color: var(--sidebar-text-active);
    background: rgba(13, 110, 253, 0.15);
    border-right: 3px solid var(--primary-color);
}

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

/* Page content */
#page-content-wrapper {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-right 0.3s ease;
}

/* Top navbar */
.top-navbar {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 0.5rem 1rem;
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.search-box .form-control {
    border-radius: 20px;
    min-width: 250px;
}

.search-box .input-group {
    border-radius: 20px;
    overflow: hidden;
}

/* Stats Cards */
.stat-card {
    border-radius: 12px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 12px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Tables */
.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table > thead {
    background: #f8f9fa;
}

.table > thead th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

/* Status badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e5ea;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

/* Auth page */
.auth-page {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
}

.auth-card {
    border-radius: 16px;
    border: none;
}

.auth-card .card-body {
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--primary-color);
}

.auth-logo h3 {
    font-weight: 700;
    margin-top: 1rem;
}

/* Notification dropdown */
.notification-dropdown {
    max-height: 400px;
    overflow: hidden;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item:last-child {
    border-bottom: none;
}

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

.page-link {
    border-radius: 8px !important;
    border: none;
    color: #495057;
    padding: 0.4rem 0.8rem;
}

.page-item.active .page-link {
    background: var(--primary-color);
}

.page-item.disabled .page-link {
    background: transparent;
    color: #adb5bd;
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

/* Footer */
.footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

/* Upload area */
.upload-area {
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.upload-area i {
    font-size: 3rem;
    color: #98a2b3;
}

/* Filter section */
.filter-section {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Action buttons group */
.action-btns .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Responsive */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar {
        width: 0 !important;
        min-width: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    body.sidebar-collapsed .sidebar .sidebar-header,
    body.sidebar-collapsed .sidebar .sidebar-user,
    body.sidebar-collapsed .sidebar .sidebar-nav,
    body.sidebar-collapsed .sidebar .sidebar-footer {
        display: none;
    }

    #page-content-wrapper {
        transition: margin-right 0.3s ease;
    }

    body.sidebar-collapsed #page-content-wrapper {
        margin-right: 0;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
    }

    body.sidebar-collapsed .sidebar-overlay {
        display: block;
    }

    #page-content-wrapper {
        margin-right: 0;
    }

    .search-box {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .stat-card .stat-number {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .auth-card .card-body {
        padding: 1.5rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
}

/* Dark mode */
body.dark-mode {
    background-color: #1a1d23;
    color: #e0e0e0;
}

body.dark-mode .card,
body.dark-mode .top-navbar,
body.dark-mode .filter-section,
body.dark-mode .footer {
    background-color: #2a2d35;
    border-color: #3a3d45;
    color: #e0e0e0;
}

body.dark-mode .table {
    color: #e0e0e0;
}

body.dark-mode .table > :not(caption) > * > * {
    background-color: #2a2d35;
    border-color: #3a3d45;
}

body.dark-mode .table > thead {
    background: #1e2128;
}

body.dark-mode .table > thead th {
    color: #adb5bd;
    border-color: #3a3d45;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #1e2128;
    border-color: #3a3d45;
    color: #e0e0e0;
}

body.dark-mode .modal-content {
    background-color: #2a2d35;
    color: #e0e0e0;
}

body.dark-mode .text-muted {
    color: #8a8e9a !important;
}
