

<?php $__env->startPush('style'); ?>
<style>
    .admin-dashboard-light {
        --ad-bg: #eef3fb;
        --ad-card: rgba(255, 255, 255, 0.92);
        --ad-card-solid: #ffffff;
        --ad-border: rgba(148, 163, 184, 0.22);
        --ad-text: #0f172a;
        --ad-muted: #64748b;
        --ad-blue: #2563eb;
        --ad-indigo: #4f46e5;
        --ad-purple: #7c3aed;
        --ad-green: #059669;
        --ad-orange: #d97706;
        --ad-red: #dc2626;
        --ad-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
        --ad-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);

        min-height: calc(100vh - 8rem);
        margin: -0.5rem -1rem 0;
        padding: 1.5rem 1.25rem 2rem;
        color: var(--ad-text);
        background:
            linear-gradient(120deg, rgba(37, 99, 235, .18) 0%, transparent 28%),
            linear-gradient(235deg, rgba(249, 115, 22, .16) 0%, transparent 30%),
            linear-gradient(0deg, rgba(16, 185, 129, .12) 0%, transparent 36%),
            linear-gradient(135deg, #f8fbff 0%, #eef4ff 46%, #fff7ed 100%);
        position: relative;
        overflow: hidden;
    }

    .admin-dashboard-light::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image:
            linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
            linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
        background-size: 42px 42px;
        mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 78%);
        pointer-events: none;
    }

    .admin-dashboard-light > * {
        position: relative;
        z-index: 2;
    }

    .ad-welcome {
        background:
            linear-gradient(125deg, rgba(250, 204, 21, .24) 0%, transparent 36%),
            linear-gradient(280deg, rgba(20, 184, 166, .26) 0%, transparent 34%),
            linear-gradient(135deg, #0f172a 0%, #1d4ed8 52%, #0f766e 100%);
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 24px;
        padding: 1.75rem;
        box-shadow: 0 26px 58px rgba(15, 23, 42, .20);
        color: #fff;
        overflow: hidden;
        position: relative;
    }

    .ad-welcome::before {
        content: "";
        position: absolute;
        width: 280px;
        height: 280px;
        border-radius: 50%;
        right: -90px;
        top: -110px;
        background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 68%);
    }

    .ad-welcome::after {
        content: "";
        position: absolute;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        left: 45%;
        bottom: -120px;
        background: linear-gradient(135deg, rgba(34, 197, 94, .18), transparent 68%);
    }

    .ad-welcome-content,
    .ad-welcome-actions {
        position: relative;
        z-index: 2;
    }

    .ad-badge {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        font-size: .72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: #bfdbfe;
        background: rgba(255,255,255,.12);
        border: 1px solid rgba(255,255,255,.18);
        border-radius: 999px;
        padding: .42rem .8rem;
        margin-bottom: .8rem;
        backdrop-filter: blur(10px);
    }

    .ad-welcome h2 {
        color: #fff;
        font-size: clamp(1.45rem, 2vw, 2rem);
        letter-spacing: 0;
        margin-bottom: .5rem;
    }

    .ad-welcome p {
        color: rgba(226, 232, 240, .92);
        max-width: 44rem;
        line-height: 1.65;
        margin-bottom: 0;
    }

    .ad-mini-status {
        display: flex;
        flex-wrap: wrap;
        gap: .7rem;
        margin-top: 1rem;
    }

    .ad-mini-pill {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        background: rgba(255,255,255,.11);
        border: 1px solid rgba(255,255,255,.14);
        color: rgba(255,255,255,.92);
        border-radius: 999px;
        padding: .45rem .75rem;
        font-size: .78rem;
        font-weight: 700;
    }

    .btn-ad-primary,
    .btn-ad-outline {
        border-radius: 14px;
        font-weight: 800;
        padding: .72rem 1.15rem;
        transition: all .18s ease;
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        white-space: nowrap;
    }

    .btn-ad-primary {
        background: linear-gradient(135deg, #facc15 0%, #f97316 100%);
        color: #111827 !important;
        border: none;
        box-shadow: 0 14px 28px rgba(249, 115, 22, .28);
    }

    .btn-ad-primary:hover {
        color: #111827 !important;
        transform: translateY(-2px);
        box-shadow: 0 18px 35px rgba(249, 115, 22, .34);
    }

    .btn-ad-outline {
        background: rgba(255,255,255,.12);
        color: #fff !important;
        border: 1px solid rgba(255,255,255,.22);
        backdrop-filter: blur(10px);
    }

    .btn-ad-outline:hover {
        background: rgba(255,255,255,.2);
        color: #fff !important;
        transform: translateY(-2px);
    }

    .ad-card {
        background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,250,252,.93));
        border: 1px solid var(--ad-border);
        border-radius: 22px;
        box-shadow: var(--ad-shadow-soft);
        color: var(--ad-text);
        overflow: hidden;
        position: relative;
        backdrop-filter: blur(14px);
        transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    }

    .ad-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        background: linear-gradient(90deg, #2563eb, #7c3aed, #f97316, #10b981);
        pointer-events: none;
    }

    .ad-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--ad-shadow);
        border-color: rgba(37, 99, 235, .22);
    }

    .ad-card .card-header {
        background: rgba(255,255,255,.68) !important;
        border-bottom: 1px solid rgba(148, 163, 184, .18) !important;
        padding: 1.05rem 1.25rem;
    }

    .ad-card .card-header h5 {
        color: var(--ad-text);
        font-weight: 800;
        letter-spacing: 0;
    }

    .ad-support-desk {
        background: rgba(255,255,255,.94);
        border: 1px solid var(--ad-border);
        border-radius: 22px;
        box-shadow: var(--ad-shadow-soft);
        overflow: hidden;
        margin-bottom: 1.5rem;
        backdrop-filter: blur(14px);
    }

    .ad-welcome .ad-support-desk {
        margin-bottom: 0;
        min-width: min(100%, 520px);
        background: rgba(255,255,255,.97);
        color: var(--ad-text);
        box-shadow: 0 18px 42px rgba(2, 6, 23, .22);
    }

    .ad-support-desk-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.05rem 1.25rem;
        border-bottom: 1px solid rgba(148, 163, 184, .18);
        background: rgba(255,255,255,.68);
    }

    .ad-support-desk-title {
        display: flex;
        align-items: center;
        gap: .75rem;
    }

    .ad-support-desk-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        background: linear-gradient(135deg, #2563eb, #0f766e);
        box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
        flex: 0 0 auto;
    }

    .ad-support-desk-title h5 {
        margin: 0;
        font-weight: 800;
        color: var(--ad-text);
    }

    .ad-support-desk-title p {
        margin: .15rem 0 0;
        color: var(--ad-muted);
        font-size: .82rem;
    }

    .ad-support-slider {
        padding: .8rem;
    }

    .ad-support-slider-shell {
        overflow: hidden;
        border-radius: 16px;
    }

    .ad-support-list {
        display: flex;
        gap: .8rem;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        padding: .15rem .05rem .55rem;
        scrollbar-width: none;
    }

    .ad-support-list::-webkit-scrollbar {
        display: none;
    }

    .ad-support-slider-controls {
        display: flex;
        justify-content: space-between;
        gap: .55rem;
        margin-top: .55rem;
    }

    .ad-support-slider-btn {
        width: 38px;
        height: 32px;
        border: 1px solid rgba(148, 163, 184, .28);
        border-radius: 11px;
        background: #fff;
        color: var(--ad-text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
    }

    .ad-support-slider-btn:hover {
        background: #eef6ff;
        color: var(--ad-blue);
    }

    .ad-support-ticket {
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 16px;
        background: #fff;
        padding: .95rem;
        min-height: 155px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
    }

    .ad-welcome .ad-support-ticket {
        min-height: 126px;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .75rem;
        align-items: center;
        padding: .78rem;
        flex: 0 0 100%;
        scroll-snap-align: start;
    }

    .ad-support-ticket small {
        color: var(--ad-muted);
        font-weight: 700;
    }

    .ad-support-ticket strong {
        color: var(--ad-text);
        display: block;
        margin-top: .2rem;
    }

    .ad-support-ticket p {
        color: #475569;
        font-size: .84rem;
        line-height: 1.5;
        margin: .65rem 0 .8rem;
    }

    .ad-welcome .ad-support-ticket p {
        margin: .35rem 0 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ad-support-empty {
        padding: 1.25rem;
        color: var(--ad-muted);
        text-align: center;
    }

    .ad-stat-card {
        position: relative;
        min-height: 135px;
        isolation: isolate;
    }

    .ad-stat-card .card-body {
        position: relative;
        z-index: 2;
    }

    .ad-stat-card::after {
        content: "";
        position: absolute;
        inset: auto -45px -65px auto;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        opacity: .16;
        background: var(--stat-glow, #2563eb);
    }

    .row.g-4.mb-4 > .col-md-4:nth-child(1) .ad-stat-card {
        background:
            linear-gradient(135deg, rgba(96, 165, 250, .18) 0%, transparent 34%),
            linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    }

    .row.g-4.mb-4 > .col-md-4:nth-child(2) .ad-stat-card {
        background:
            linear-gradient(135deg, rgba(52, 211, 153, .18) 0%, transparent 34%),
            linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
    }

    .row.g-4.mb-4 > .col-md-4:nth-child(3) .ad-stat-card {
        background:
            linear-gradient(135deg, rgba(251, 146, 60, .18) 0%, transparent 34%),
            linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    }

    .ad-stat-icon {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        flex-shrink: 0;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
    }

    .ad-stat-icon.ship {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        color: #1d4ed8;
    }

    .ad-stat-icon.active {
        background: linear-gradient(135deg, #dcfce7, #bbf7d0);
        color: #047857;
    }

    .ad-stat-icon.pending {
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        color: #b45309;
    }

    .ad-stat-label {
        font-size: .78rem;
        color: var(--ad-muted);
        font-weight: 800;
        margin-bottom: .25rem;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .ad-stat-value {
        font-size: 1.75rem;
        font-weight: 900;
        color: var(--ad-text);
        letter-spacing: 0;
        line-height: 1.1;
    }

    .ad-track-icon {
        box-shadow: 0 10px 22px rgba(37, 99, 235, .16);
    }

    .list-group-item-action {
        transition: background .18s ease, transform .18s ease;
    }

    .list-group-item-action:hover {
        background: linear-gradient(90deg, rgba(37, 99, 235, .08), rgba(249, 115, 22, .06));
        transform: translateX(3px);
    }

    .ad-stat-note {
        font-size: .78rem;
        color: var(--ad-muted);
        margin-top: .25rem;
    }

    .ad-chart-wrap {
        position: relative;
        min-height: 280px;
        height: 280px;
    }

    .ad-chart-top {
        display: flex;
        flex-wrap: wrap;
        gap: .65rem;
        align-items: center;
    }

    .ad-soft-pill {
        background: #eff6ff;
        color: #1d4ed8;
        border: 1px solid #dbeafe;
        border-radius: 999px;
        padding: .35rem .7rem;
        font-size: .75rem;
        font-weight: 800;
    }

    .list-group-item {
        background: transparent;
        color: var(--ad-text);
        border-color: rgba(148, 163, 184, .16) !important;
        transition: background .15s ease, padding-left .15s ease;
    }

    .list-group-item:hover {
        background: linear-gradient(90deg, rgba(37,99,235,.08), transparent);
        padding-left: 1.25rem !important;
    }

    .list-group-item small {
        color: var(--ad-muted) !important;
    }

    .ad-track-icon {
        width: 38px;
        height: 38px;
        border-radius: 14px;
        background: #eff6ff;
        color: #2563eb;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: .8rem;
        flex-shrink: 0;
    }

    .list-group-item .fa-arrow-right {
        color: #94a3b8;
        font-size: .85rem;
    }

    .text-muted {
        color: var(--ad-muted) !important;
    }

    @media (max-width: 991px) {
        .admin-dashboard-light {
            padding: 1rem .85rem 1.5rem;
            margin-left: -.75rem;
            margin-right: -.75rem;
        }

        .ad-welcome {
            padding: 1.35rem;
        }

        .ad-welcome-actions {
            width: 100%;
        }

        .ad-welcome-actions .btn {
            flex: 1;
            justify-content: center;
        }

        .ad-support-desk-head {
            display: block;
        }

        .ad-support-desk-head .btn {
            margin-top: .75rem;
            width: 100%;
        }

        .ad-support-list {
            gap: .65rem;
        }

        .ad-welcome .ad-support-ticket {
            flex-basis: 100%;
        }
    }

    @media (max-width: 575px) {
        .ad-stat-value {
            font-size: 1.45rem;
        }

        .ad-chart-wrap {
            height: 235px;
            min-height: 235px;
        }
    }
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
<style>
    html.admin-dark-mode body.admin-shell .admin-dashboard-light,
    body.admin-shell.dark-mode .admin-dashboard-light,
    body[data-admin-theme="dark"] .admin-dashboard-light {
        --ad-bg: #07111f;
        --ad-card: rgba(17, 28, 46, 0.96);
        --ad-card-solid: #111c2e;
        --ad-border: rgba(148, 163, 184, 0.18);
        --ad-text: #e5edf7;
        --ad-muted: #9fb0c4;
        --ad-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
        --ad-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
        color: #e5edf7 !important;
        background:
            radial-gradient(circle at 8% 6%, rgba(37, 99, 235, .18), transparent 26%),
            radial-gradient(circle at 92% 10%, rgba(249, 115, 22, .14), transparent 28%),
            linear-gradient(135deg, #050b14 0%, #07111f 46%, #0b1628 100%) !important;
    }

    html.admin-dark-mode body.admin-shell .admin-dashboard-light::before,
    body.admin-shell.dark-mode .admin-dashboard-light::before,
    body[data-admin-theme="dark"] .admin-dashboard-light::before {
        background-image:
            linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
            linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px) !important;
    }

    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-card,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-desk,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-ticket,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .list-group-item,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-card,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-desk,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-ticket,
    body.admin-shell.dark-mode .admin-dashboard-light .list-group-item,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-card,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-desk,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-ticket,
    body[data-admin-theme="dark"] .admin-dashboard-light .list-group-item {
        background: #111c2e !important;
        border-color: #26364c !important;
        color: #e5edf7 !important;
        box-shadow: var(--ad-shadow-soft) !important;
    }

    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-card .card-header,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-desk-head,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-card .card-header,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-desk-head,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-card .card-header,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-desk-head {
        background: #0b1628 !important;
        border-color: #26364c !important;
        color: #e5edf7 !important;
    }

    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-card .card-header h5,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-desk-title h5,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-ticket strong,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-stat-value,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .fw-bold,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-card .card-header h5,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-desk-title h5,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-ticket strong,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-stat-value,
    body.admin-shell.dark-mode .admin-dashboard-light .fw-bold,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-card .card-header h5,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-desk-title h5,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-ticket strong,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-stat-value,
    body[data-admin-theme="dark"] .admin-dashboard-light .fw-bold {
        color: #e5edf7 !important;
    }

    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-desk-title p,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-ticket small,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-support-ticket p,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-stat-label,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .ad-stat-note,
    html.admin-dark-mode body.admin-shell .admin-dashboard-light .text-muted,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-desk-title p,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-ticket small,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-support-ticket p,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-stat-label,
    body.admin-shell.dark-mode .admin-dashboard-light .ad-stat-note,
    body.admin-shell.dark-mode .admin-dashboard-light .text-muted,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-desk-title p,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-ticket small,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-support-ticket p,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-stat-label,
    body[data-admin-theme="dark"] .admin-dashboard-light .ad-stat-note,
    body[data-admin-theme="dark"] .admin-dashboard-light .text-muted {
        color: #9fb0c4 !important;
    }

</style>
<div class="admin-dashboard-light container-fluid">
    <?php
        try {
            $dashboardSupportTickets = \App\Models\SupportTicket::with('user')->where('needs_admin_attention', 1)->orderByDesc('id')->limit(12)->get();
        } catch (\Throwable $e) {
            $dashboardSupportTickets = collect();
        }
        $newShipmentUrl = \Illuminate\Support\Facades\Route::has('admin.shipments.create') ? route('admin.shipments.create') : url('admin/shipments/create');
        $shipmentsUrl = \Illuminate\Support\Facades\Route::has('admin.shipments') ? route('admin.shipments') : url('admin/shipments');
    ?>

    <div class="ad-welcome mb-4 d-flex flex-column flex-lg-row justify-content-between align-items-lg-center gap-4">
        <div class="ad-welcome-content">
            <span class="ad-badge">
                <i class="fas fa-chart-line"></i>
                Admin Control Center
            </span>

            <h2 class="fw-bold">
                Welcome back, <?php echo e(Auth('admin')->user()->firstName); ?>

            </h2>

            <?php if(Auth('admin')->user()->type == 'Super Admin' || Auth('admin')->user()->type == 'Admin'): ?>
            <div class="ad-welcome-actions d-flex flex-wrap gap-2 mt-3">
                <a href="<?php echo e($newShipmentUrl); ?>" class="btn btn-ad-primary">
                    <i class="fas fa-plus-circle"></i>
                    New shipment
                </a>
                <a href="<?php echo e($shipmentsUrl); ?>" class="btn btn-ad-outline">
                    <i class="fas fa-boxes"></i>
                    Manage shipments
                </a>
            </div>
            <?php endif; ?>
        </div>

        <div class="ad-support-desk">
            <div class="ad-support-desk-head">
                <div class="ad-support-desk-title">
                    <span class="ad-support-desk-icon"><i class="fas fa-comments"></i></span>
                    <div>
                        <h5>Live Support</h5>
                    </div>
                </div>
                <a href="<?php echo e(route('admin.support')); ?>" class="btn btn-sm btn-light">View All</a>
            </div>
            <?php if($dashboardSupportTickets->count()): ?>
                <div class="ad-support-slider" data-support-slider>
                    <div class="ad-support-slider-shell">
                        <div class="ad-support-list">
                            <?php $__currentLoopData = $dashboardSupportTickets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ticket): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $ticketUser = $ticket->user;
                                    $supportIdentity = $ticket->userid
                                        ? (optional($ticketUser)->email ?: (optional($ticketUser)->name ?: ('User #' . $ticket->userid)))
                                        : ($ticket->guest_email ?: ($ticket->guest_name ?: 'Website visitor'));
                                ?>
                                <div class="ad-support-ticket">
                                    <div>
                                        <small><?php echo e($supportIdentity); ?> - <?php echo e($ticket->department); ?></small>
                                        <strong><?php echo e($ticket->ticketid); ?></strong>
                                        <p><?php echo e(\Illuminate\Support\Str::limit($ticket->message, 95)); ?></p>
                                    </div>
                                    <button type="button" class="btn btn-sm btn-primary js-admin-chat-open" data-ticket="<?php echo e($ticket->ticketid); ?>">
                                        <i class="fas fa-reply"></i> Reply
                                    </button>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                    <div class="ad-support-slider-controls">
                        <button type="button" class="ad-support-slider-btn" data-support-slide="prev" aria-label="Previous support ticket">
                            <i class="fas fa-chevron-left"></i>
                        </button>
                        <button type="button" class="ad-support-slider-btn" data-support-slide="next" aria-label="Next support ticket">
                            <i class="fas fa-chevron-right"></i>
                        </button>
                    </div>
                </div>
            <?php else: ?>
                <div class="ad-support-empty">
                    No new support messages waiting for admin reply.
                </div>
            <?php endif; ?>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            document.querySelectorAll('[data-support-slider]').forEach(function (slider) {
                var track = slider.querySelector('.ad-support-list');
                if (!track) {
                    return;
                }

                slider.querySelectorAll('[data-support-slide]').forEach(function (button) {
                    button.addEventListener('click', function () {
                        var firstCard = track.querySelector('.ad-support-ticket');
                        var gap = 12;
                        var amount = firstCard ? firstCard.getBoundingClientRect().width + gap : track.clientWidth;
                        track.scrollBy({
                            left: button.getAttribute('data-support-slide') === 'next' ? amount : -amount,
                            behavior: 'smooth'
                        });
                    });
                });
            });
        });
    </script>

    <div class="row g-4 mb-4">
        <div class="col-md-4">
            <div class="card ad-card ad-stat-card border-0 h-100" style="--stat-glow:#2563eb;">
                <div class="card-body d-flex align-items-center p-4">
                    <div class="ad-stat-icon ship me-3">
                        <i class="fas fa-shipping-fast"></i>
                    </div>
                    <div>
                        <p class="ad-stat-label mb-0">Total shipments</p>
                        <p class="ad-stat-value mb-0"><?php echo e(number_format($numberOfUsers)); ?></p>
                        <div class="ad-stat-note">All shipment records</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card ad-card ad-stat-card border-0 h-100" style="--stat-glow:#059669;">
                <div class="card-body d-flex align-items-center p-4">
                    <div class="ad-stat-icon active me-3">
                        <i class="fas fa-route"></i>
                    </div>
                    <div>
                        <p class="ad-stat-label mb-0">Active today</p>
                        <p class="ad-stat-value mb-0"><?php echo e(number_format($activeShipments ?? 0)); ?></p>
                        <div class="ad-stat-note">Not yet delivered</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card ad-card ad-stat-card border-0 h-100" style="--stat-glow:#d97706;">
                <div class="card-body d-flex align-items-center p-4">
                    <div class="ad-stat-icon pending me-3">
                        <i class="fas fa-clock"></i>
                    </div>
                    <div>
                        <p class="ad-stat-label mb-0">Pending shipments</p>
                        <p class="ad-stat-value mb-0"><?php echo e(number_format($pendingShipments ?? 0)); ?></p>
                        <div class="ad-stat-note">Awaiting next update</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row g-4">
        <div class="col-lg-8">
            <div class="card ad-card border-0 h-100">
                <div class="card-header d-flex justify-content-between align-items-center">
                    <div>
                        <h5 class="mb-0">Shipment analytics</h5>
                        <small class="text-muted">Monthly shipment performance</small>
                    </div>
                    <div class="ad-chart-top">
                        <span class="ad-soft-pill"><?php echo e(now()->format('Y')); ?></span>
                    </div>
                </div>
                <div class="card-body pt-3">
                    <div class="ad-chart-wrap">
                        <canvas id="lineChart"></canvas>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-lg-4">
            <div class="card ad-card border-0 h-100">
                <div class="card-header d-flex justify-content-between align-items-center">
                    <div>
                        <h5 class="mb-0">Latest shipments</h5>
                        <small class="text-muted">Recently added records</small>
                    </div>
                    <i class="fas fa-truck-loading text-muted"></i>
                </div>

                <div class="card-body p-0">
                    <div class="list-group list-group-flush">
                        <?php $__empty_1 = true; $__currentLoopData = $latestUsers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <a href="<?php echo e(route('admin.shipments.view', ['id' => $user->id])); ?>"
                           class="list-group-item list-group-item-action d-flex justify-content-between align-items-center py-3 px-4">
                            <div class="d-flex align-items-center">
                                <div class="ad-track-icon">
                                    <i class="fas fa-box"></i>
                                </div>
                                <div>
                                    <div class="fw-bold"><?php echo e($user->trackingnumber); ?></div>
                                    <small class="text-muted"><?php echo e($user->email); ?></small>
                                </div>
                            </div>
                            <i class="fas fa-arrow-right"></i>
                        </a>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <div class="p-4 text-muted text-center small">
                            <i class="fas fa-inbox d-block mb-2" style="font-size: 1.4rem;"></i>
                            No recent shipments
                        </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<script>
const userStats = <?php echo json_encode($usersData, 15, 512) ?>;
const adTick = '#64748b';
const adGrid = 'rgba(15, 23, 42, 0.07)';

const ctx = document.getElementById('lineChart').getContext('2d');
const lineGradient = ctx.createLinearGradient(0, 0, 0, 300);
lineGradient.addColorStop(0, 'rgba(37, 99, 235, 0.28)');
lineGradient.addColorStop(0.45, 'rgba(79, 70, 229, 0.12)');
lineGradient.addColorStop(1, 'rgba(37, 99, 235, 0)');

new Chart(ctx, {
    type: 'line',
    data: {
        labels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
        datasets: [{
            label: 'Shipments',
            data: userStats,
            borderColor: '#2563eb',
            backgroundColor: lineGradient,
            fill: true,
            tension: 0.42,
            pointBackgroundColor: '#ffffff',
            pointBorderColor: '#2563eb',
            pointBorderWidth: 3,
            pointRadius: 4,
            pointHoverRadius: 7
        }]
    },
    options: {
        responsive: true,
        maintainAspectRatio: false,
        interaction: {
            mode: 'index',
            intersect: false
        },
        plugins: {
            legend: { display: false },
            tooltip: {
                backgroundColor: '#0f172a',
                titleColor: '#ffffff',
                bodyColor: '#e2e8f0',
                padding: 12,
                cornerRadius: 12,
                displayColors: false
            }
        },
        scales: {
            x: {
                ticks: { color: adTick, maxRotation: 0 },
                grid: { display: false }
            },
            y: {
                beginAtZero: true,
                ticks: { color: adTick },
                grid: { color: adGrid }
            }
        }
    }
});

</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app1', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/kdcwrbdi/public_html/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>