* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f3f4f6;
    --sidebar-bg: #1f2937;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    direction: rtl;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-header i {
    margin-left: 10px;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.2);
    border-right-color: var(--primary-color);
    color: var(--white);
}

.nav-item i {
    margin-left: 12px;
    width: 20px;
}

/* Main Content */
.main-content {
    margin-right: 260px;
    flex: 1;
    padding: 0;
}

.header {
    background-color: var(--white);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background-color: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #dc2626;
}

/* Pages */
.page {
    display: none;
    padding: 30px;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-icon.blue {
    background-color: var(--primary-color);
}

.stat-icon.green {
    background-color: var(--success-color);
}

.stat-icon.red {
    background-color: var(--danger-color);
}

.stat-icon.orange {
    background-color: var(--warning-color);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Chart Section */
.chart-section {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-section h2 {
    margin-bottom: 20px;
    font-size: 18px;
}

.branch-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.branch-stat-item {
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 6px;
    border-right: 3px solid var(--primary-color);
}

.branch-stat-item h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.branch-stat-item .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
}

/* Table */
.table-container {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--bg-color);
}

.data-table th {
    padding: 12px 15px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background-color: var(--bg-color);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.accepted {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-action {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.btn-action:hover {
    background-color: var(--secondary-color);
}

.btn-retry {
    background-color: var(--warning-color);
}

.btn-retry:hover {
    background-color: #d97706;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-pagination {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-pagination:hover:not(:disabled) {
    background-color: var(--bg-color);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    background-color: transparent;
    border: none;
    padding: 0;
}

.close:hover {
    color: var(--text-primary);
    background-color: var(--bg-color);
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--bg-color);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-weight: 600;
    width: 150px;
    color: var(--text-secondary);
}

.detail-value {
    flex: 1;
}

.items-table {
    width: 100%;
    margin-top: 20px;
}

.items-table th {
    background-color: var(--bg-color);
    padding: 10px;
    text-align: right;
    font-size: 13px;
}

.items-table td {
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

/* Onboarding Modal */
.onboarding-steps {
    position: relative;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-success i {
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-header h2,
    .nav-item span {
        display: none;
    }

    .main-content {
        margin-right: 80px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select,
    .filter-input {
        width: 100%;
    }
}

