{{-- Premium Top Bar Component --}}
<div class="premium-topbar">
    <div class="topbar-container">
        {{-- Left Section: Welcome & Date --}}
        <div class="topbar-left">
            <div class="welcome-section">
                <div class="welcome-text">
                    <span class="greeting">{{ $greeting }}</span>
                    <span class="user-name">{{ auth()->user()->name }}</span>
                </div>
                <div class="current-date">
                    <svg xmlns="http://www.w3.org/2000/svg" class="date-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
                    </svg>
                    <span>{{ now()->locale('id')->isoFormat('dddd, D MMMM Y') }}</span>
                </div>
            </div>
        </div>

        {{-- Center Section: Quick Stats --}}
        <div class="topbar-center">
            <div class="quick-stats">
                <div class="quick-stat">
                    <div class="stat-icon blue">
                        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" />
                        </svg>
                    </div>
                    <div class="stat-content">
                        <span class="stat-value">{{ $todayAttendance }}</span>
                        <span class="stat-label">Hadir Hari Ini</span>
                    </div>
                </div>
                <div class="quick-stat">
                    <div class="stat-icon orange">
                        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
                        </svg>
                    </div>
                    <div class="stat-content">
                        <span class="stat-value">{{ $pendingApprovals }}</span>
                        <span class="stat-label">Pending</span>
                    </div>
                </div>
                <div class="quick-stat">
                    <div class="stat-icon green">
                        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
                        </svg>
                    </div>
                    <div class="stat-content">
                        <span class="stat-value">{{ $ongoingTrips }}</span>
                        <span class="stat-label">Dinas Aktif</span>
                    </div>
                </div>
            </div>
        </div>

        {{-- Right Section: Actions --}}
        <div class="topbar-right">
            <div class="topbar-actions">
                {{-- Live Clock --}}
                <div class="live-clock" x-data="{ time: '' }" x-init="
                    setInterval(() => {
                        const now = new Date();
                        time = now.toLocaleTimeString('id-ID', { hour: '2-digit', minute: '2-digit', second: '2-digit' });
                    }, 1000)
                ">
                    <svg xmlns="http://www.w3.org/2000/svg" class="clock-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
                    </svg>
                    <span x-text="time" class="time-text"></span>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
.premium-topbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
    margin: -1rem -1rem 1.5rem -1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.dark .premium-topbar {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Left Section */
.topbar-left {
    flex: 1;
}

.welcome-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.welcome-text {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.greeting {
    font-size: 0.875rem;
    color: #64748b;
}

.user-name {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .user-name {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.current-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #64748b;
}

.date-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* Center Section - Quick Stats */
.topbar-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.quick-stats {
    display: flex;
    gap: 1.5rem;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.dark .quick-stat {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.dark .stat-value {
    color: #f1f5f9;
}

.stat-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
}

/* Right Section */
.topbar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-clock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 1rem;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.clock-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.time-text {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 1280px) {
    .quick-stats {
        gap: 1rem;
    }

    .quick-stat {
        padding: 0.5rem 0.75rem;
    }

    .stat-icon {
        width: 2rem;
        height: 2rem;
    }

    .stat-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .stat-value {
        font-size: 1rem;
    }
}

@media (max-width: 1024px) {
    .topbar-center {
        display: none;
    }
}
</style>
