/* ===== ADMIN DASHBOARD STYLES ===== */

.admin-section {
    padding: 120px 0 80px;
    background: var(--bg-light);
    min-height: 100vh;
}

.admin-header {
    text-align: center;
}

.admin-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header i {
    color: var(--primary-color);
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.revenue {
    grid-column: span 1;
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== ADMIN CONTROLS ===== */
.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.control-left {
    display: flex;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.control-right {
    display: flex;
    gap: 12px;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(45, 134, 89, 0.1);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-primary);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    background: white;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(45, 134, 89, 0.1);
}

/* ===== TABLE ===== */
.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-bottom: 24px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table thead {
    background: var(--gradient-primary);
    color: white;
}

.orders-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.orders-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.orders-table tbody tr {
    transition: var(--transition);
}

.orders-table tbody tr:hover {
    background: var(--bg-light);
}

.loading-cell {
    text-align: center;
    padding: 60px !important;
    color: var(--text-light);
}

.loading-cell i {
    font-size: 24px;
    margin-right: 12px;
}

.no-orders-cell {
    text-align: center;
    padding: 60px !important;
    color: var(--text-light);
}

.no-orders-cell i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.confirmed {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.processing {
    background: #e0e7ff;
    color: #6366f1;
}

.status-badge.shipped {
    background: #ddd6fe;
    color: #7c3aed;
}

.status-badge.delivered {
    background: #d1fae5;
    color: #059669;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #dc2626;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.action-btn.view {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.action-btn.view:hover {
    background: #2563eb;
    color: white;
}

.action-btn.edit {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.action-btn.edit:hover {
    background: #d97706;
    color: white;
}

.action-btn.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.action-btn.whatsapp:hover {
    background: #25D366;
    color: white;
}

.action-btn.delete {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.action-btn.delete:hover {
    background: #dc2626;
    color: white;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#pageInfo {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-small {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header i {
    color: var(--primary-color);
}

.close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--primary-color);
    color: white;
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 24px 32px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== ORDER DETAILS IN MODAL ===== */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-item {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 12px;
}

.detail-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.detail-item.full-width {
    grid-column: span 2;
}

.status-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-primary);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(45, 134, 89, 0.1);
}

/* ===== ANIMATIONS ===== */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-left,
    .control-right {
        width: 100%;
    }

    .control-right {
        justify-content: stretch;
    }

    .control-right .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.revenue {
        grid-column: span 1;
    }

    .orders-table {
        font-size: 13px;
    }

    .orders-table th,
    .orders-table td {
        padding: 12px 8px;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-item.full-width {
        grid-column: span 1;
    }

    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .admin-section {
        padding: 100px 0 60px;
    }

    .admin-header h2 {
        font-size: 20px;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .stat-info h3 {
        font-size: 28px;
    }

    .search-box {
        min-width: 100%;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .pagination {
        flex-direction: column;
    }
}