/*
 * ═══════════════════════════════════════════════════════════════
 *  ADMIN PANEL STYLES
 * ═══════════════════════════════════════════════════════════════
 */

/* ─── Login Screen ──────────────────────────────────────────── */
.admin-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    background-image: radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 50%, rgba(247, 147, 30, 0.05) 0%, transparent 50%);
}

.admin-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.admin-login-header {
    text-align: center;
    margin-bottom: 32px;
}

/* ─── Dashboard Layout ──────────────────────────────────────── */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: var(--transition);
}

/* Sidebar Backdrop (mobile) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Admin Page Header */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Tabs Container */
.tabs-container {
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

/* Admin Search */
.admin-search {
    max-width: 300px;
    flex: 1;
}

.admin-sidebar.collapsed {
    width: 70px;
}

.admin-sidebar.collapsed .sidebar-logo-text,
.admin-sidebar.collapsed .sidebar-link span,
.admin-sidebar.collapsed .sidebar-badge {
    display: none;
}

.admin-sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 14px;
}

.admin-sidebar.collapsed .sidebar-link i {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    min-height: 70px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.08);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
}

/* ─── Main Content ──────────────────────────────────────────── */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-sidebar.collapsed ~ .admin-main {
    margin-left: 70px;
}

/* ─── Top Bar ───────────────────────────────────────────────── */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 70px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: var(--bg-card-hover);
}

.admin-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.admin-avatar:hover {
    background: var(--bg-card);
}

.admin-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ─── Notifications Panel ───────────────────────────────────── */
.notifications-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.notifications-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    background: rgba(255, 107, 53, 0.05);
}

.notif-item .notif-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notif-item .notif-text {
    flex: 1;
}

.notif-item .notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.notif-item .notif-message {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notif-item .notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Content Area ──────────────────────────────────────────── */
.admin-content {
    padding: 24px;
    flex: 1;
}

.admin-page {
    animation: fadeIn 0.3s ease;
}

/* ─── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card .stat-icon.revenue { background: rgba(255, 107, 53, 0.15); }
.stat-card .stat-icon.orders { background: rgba(55, 66, 250, 0.15); }
.stat-card .stat-icon.pending { background: rgba(255, 165, 2, 0.15); }
.stat-card .stat-icon.customers { background: rgba(46, 213, 115, 0.15); }

/* ─── Live Orders Grid ──────────────────────────────────────── */
.live-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.live-order-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
    animation: slideUp 0.4s ease;
}

.live-order-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.live-order-card.new-order {
    border-color: var(--warning);
    animation: pulseGlow 2s infinite, slideUp 0.4s ease;
}

.live-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.live-order-id {
    font-weight: 700;
    font-size: 0.95rem;
}

.live-order-items {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    max-height: 40px;
    overflow: hidden;
}

.live-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.live-order-total {
    font-weight: 700;
    color: var(--primary);
}

.live-order-actions {
    display: flex;
    gap: 6px;
}

/* ─── Admin Orders List ─────────────────────────────────────── */
.admin-order-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.admin-order-card:hover {
    border-color: var(--border-light);
}

.admin-order-card.new-order {
    border-left: 4px solid var(--warning);
    animation: slideUp 0.4s ease;
}

.order-detail-section {
    margin-bottom: 20px;
}

.order-detail-section h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.order-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ─── Table Container ───────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* ─── Delivery Boy Card ─────────────────────────────────────── */
.delivery-boy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.delivery-boy-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.db-avatar {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.db-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.db-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.db-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.db-stat {
    text-align: center;
}

.db-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.db-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Category Admin Card ───────────────────────────────────── */
.admin-cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.admin-cat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
}

.admin-cat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.admin-cat-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-cat-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Coupon Card ───────────────────────────────────────────── */
.admin-coupon-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.admin-coupon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.coupon-discount {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.coupon-code-display {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 107, 53, 0.1);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ─── New Order Popup ───────────────────────────────────────── */
.new-order-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}

.new-order-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.new-order-popup-content {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.3);
    animation: pulse 1s infinite;
}

.new-order-icon {
    font-size: 3rem;
    animation: bounceIn 0.5s ease;
}

/* ─── Settings ──────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: start;
}

/* ─── Report Cards ──────────────────────────────────────────── */
.report-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.report-stat:last-child {
    border-bottom: none;
}

.report-stat .report-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.report-stat .report-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.top-item .top-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.top-item .top-name {
    flex: 1;
    font-weight: 500;
}

.top-item .top-orders {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Media Upload ──────────────────────────────────────────── */
.thumb-gallery-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.thumb-upload-area {
    width: 110px;
    height: 110px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.thumb-upload-area:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.03);
}

.thumb-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.08);
}

.thumb-upload-area.has-thumb {
    border-style: solid;
    border-color: var(--primary);
}

.media-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.media-remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: 2px solid var(--bg-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.media-remove-btn:hover {
    transform: scale(1.15);
    background: #ff2020;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
    min-height: 0;
}

.gallery-grid:empty {
    display: none;
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .gallery-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-remove {
    opacity: 1;
}

.gallery-item .gallery-remove:hover {
    background: var(--danger);
}

.gallery-item .gallery-type-badge {
    position: absolute;
    bottom: 3px;
    left: 3px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.55rem;
    font-weight: 600;
}

.gallery-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Sidebar - slides from left */
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 100;
        width: 260px;
    }

    .admin-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0,0,0,0.5);
    }

    /* Show backdrop on mobile */
    .sidebar-backdrop {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-sidebar.collapsed ~ .admin-main {
        margin-left: 0;
    }

    /* Page header - stack vertically on mobile */
    .admin-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-page-header h4 {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .btn-create-action {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .admin-search {
        max-width: 100%;
    }

    /* Tabs scroll */
    .tabs-container {
        margin-bottom: 12px;
    }

    .tabs-container .tabs {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .tabs-container .tabs::-webkit-scrollbar {
        display: none;
    }

    /* Topbar adjustments */
    .admin-topbar {
        padding: 0 14px;
        height: 60px;
    }

    .topbar-right .search-bar {
        display: none;
    }

    .admin-name {
        display: none;
    }

    .admin-avatar {
        padding: 4px 6px;
    }

    .notification-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    /* Content area */
    .admin-content {
        padding: 14px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    /* Grids */
    .grid-2 {
        grid-template-columns: 1fr;
    }

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

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

    .live-orders-grid {
        grid-template-columns: 1fr;
    }

    /* Order tabs - horizontal scroll */
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
        flex-shrink: 0;
    }

    /* Order cards */
    .admin-order-card {
        padding: 14px;
        margin-bottom: 10px;
    }

    .order-action-buttons {
        gap: 6px;
    }

    .order-action-buttons .btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Flex layout fixes */
    .flex.justify-between.items-center.mb-20.flex-wrap {
        gap: 10px;
    }

    .flex.justify-between.items-center.mb-20 {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .flex.justify-between.items-center.mb-20 .btn {
        width: 100%;
        justify-content: center;
    }

    /* Notifications Panel */
    .notifications-panel {
        right: 8px;
        width: calc(100vw - 16px);
        top: 60px;
    }

    /* Modals - full width on mobile */
    .modal-overlay .modal {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 90vh;
        margin: auto;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    /* Delivery boy cards */
    .delivery-boy-card {
        padding: 14px;
    }

    .db-avatar {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .db-name {
        font-size: 0.95rem;
    }

    /* Category cards */
    .admin-cat-card {
        padding: 16px;
    }

    .admin-cat-icon {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    /* Coupon cards */
    .coupon-discount {
        font-size: 1.4rem;
    }

    .admin-coupon-card {
        padding: 16px;
    }

    /* Table responsive */
    .table-container {
        overflow-x: auto;
    }

    /* Menu table on admin */
    .admin-menu-table th,
    .admin-menu-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    /* Report cards */
    .report-stat .report-value {
        font-size: 0.95rem;
    }

    /* Media upload in modal */
    .thumb-gallery-row {
        flex-direction: column;
        gap: 10px;
    }

    .thumb-upload-area {
        width: 100%;
        height: 100px;
    }

    /* Gallery grid */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-add-row {
        flex-direction: column;
    }

    /* New order popup */
    .new-order-popup {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .new-order-popup-content {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .stat-card .stat-change {
        font-size: 0.7rem;
    }

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

    .admin-content {
        padding: 10px;
    }

    .admin-topbar {
        padding: 0 10px;
    }

    .tab-btn {
        font-size: 0.7rem;
        padding: 5px 8px;
    }

    .btn-sm {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* Compact cards */
    .card {
        padding: 16px;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    /* Compact order cards */
    .admin-order-card {
        padding: 12px;
    }

    /* Compact delivery/category cards */
    .delivery-boy-card,
    .admin-cat-card,
    .admin-coupon-card {
        padding: 12px;
    }

    .db-avatar {
        font-size: 1.8rem;
    }

    .admin-cat-icon {
        font-size: 1.8rem;
    }
}

/* ─── Toggle Switch ──────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    left: 2px;
    top: 2px;
    transition: var(--transition);
}

.toggle-switch input:checked + .slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* ─── Admin Support Layout ──────────────────────────────── */
.support-admin-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
    min-height: 400px;
}

.admin-chat-panel {
    display: flex;
    flex-direction: column;
    max-height: 550px;
}

.admin-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.admin-chat-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
}

.admin-chat-input {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
}

.active-ticket {
    border-color: var(--primary) !important;
    background: rgba(255, 107, 53, 0.05) !important;
}

/* Reuse support-msg from user.css so define here too for admin */
.support-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    line-height: 1.5;
}

.support-msg.sent {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.support-msg.received {
    align-self: flex-start;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.support-msg .msg-time {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.support-msg .msg-sender {
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.8;
}

.support-ticket-status {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.support-ticket-status.open { background: rgba(255,165,2,0.15); color: var(--warning); }
.support-ticket-status.replied { background: rgba(46,213,115,0.15); color: var(--success); }
.support-ticket-status.waiting { background: rgba(55,66,250,0.15); color: var(--info); }
.support-ticket-status.closed { background: rgba(139,139,163,0.15); color: var(--text-muted); }

@media (max-width: 768px) {
    .support-admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-chat-panel {
        max-height: 400px;
    }
}
