:root {
    --bg-dark: #0b1120;
    --card-bg: #151d2f;
    --card-border: #232f45;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --pertamina-blue: #003366;
    --pertamina-red: #d9262e;
    --pertamina-green: #22c55e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Scrollbar Modern */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.enterprise-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.85rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.stat-glow-blue {
    border-left: 4px solid #38bdf8;
}
.stat-glow-green {
    border-left: 4px solid #22c55e;
}
.stat-glow-amber {
    border-left: 4px solid #f59e0b;
}
.stat-glow-red {
    border-left: 4px solid #ef4444;
}

/* Badge Styling */
.badge-hadir {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}
.badge-terlambat {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-alfa {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.badge-shift {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.4);
}
.badge-nonshift {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Peta Leaflet Container */
#mapContainer, #liveTrackingMap, #locationsMap {
    z-index: 5;
    background: #e5e7eb;
}
.leaflet-popup-content-wrapper {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border: 1px solid #38bdf8 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip {
    background: #0f172a !important;
}

/* ==========================================================================
   LANDMARK PIN LOKASI KERJA RESMI (PERSIS SCREENSHOT 2)
   ========================================================================== */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.landmark-marker-container,
.tracking-phone-marker-container {
    background: transparent !important;
    border: none !important;
}

.office-landmark-pin {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.45));
    z-index: 500 !important;
    transition: transform 0.15s ease;
}

.office-landmark-pin:hover {
    transform: scale(1.1);
    z-index: 9999 !important;
}

.office-landmark-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    line-height: 1.2;
}

.office-landmark-badge.badge-office {
    background: #0f2942; /* Navy Elegan */
    border-color: #38bdf8;
    color: #e0f2fe;
}

.office-landmark-badge.badge-gate {
    background: #064e3b; /* Hijau Security Gate 1 */
    border-color: #10b981;
    color: #ecfdf5;
}

.office-landmark-badge.badge-fire {
    background: #7f1d1d; /* Merah Crimson Fire Station */
    border-color: #f87171;
    color: #fef2f2;
}

.office-landmark-badge.badge-warehouse {
    background: #4c1d95; /* Ungu Warehouse */
    border-color: #c084fc;
    color: #faf5ff;
}

.office-landmark-badge.badge-zone {
    background: #0c4a6e; /* Cyan Wilayah Operasional */
    border-color: #38bdf8;
    color: #f0f9ff;
}

.office-landmark-badge.badge-plant {
    background: #064e3b; /* Hijau Migas */
    border-color: #34d399;
    color: #ecfdf5;
}

.office-landmark-badge.badge-wellpad {
    background: #78350f; /* Cokelat Wellpad */
    border-color: #fbbf24;
    color: #fef3c7;
}

.office-landmark-badge.badge-proyek {
    background: #7c2d12; /* Oranye Proyek */
    border-color: #fb923c;
    color: #fff7ed;
}

.office-landmark-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 1px;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.office-landmark-dot.dot-office {
    background: #0284c7;
}
.office-landmark-dot.dot-gate {
    background: #10b981;
}
.office-landmark-dot.dot-fire {
    background: #ef4444;
}
.office-landmark-dot.dot-warehouse {
    background: #a855f7;
}
.office-landmark-dot.dot-zone {
    background: #0ea5e9;
}
.office-landmark-dot.dot-plant {
    background: #10b981;
}
.office-landmark-dot.dot-wellpad {
    background: #f59e0b;
}
.office-landmark-dot.dot-proyek {
    background: #ea580c;
}

/* ==========================================================================
   MARKER PERSONEL TRACKING (NOMOR HP / NIK) - PERSIS SCREENSHOT 2
   ========================================================================== */
.tracking-phone-marker {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.tracking-phone-marker:hover {
    transform: scale(1.15);
    z-index: 99999 !important;
}

/* KETIKA DICARI: PIN MUNCUL DI PALING DEPAN (Z-INDEX TERTINGGI), TIDAK TERTUTUP SIAPAPUN */
.pin-focused-front {
    z-index: 10000000 !important;
    transform: scale(1.28) !important;
    filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.95)) drop-shadow(0 8px 16px rgba(0,0,0,0.8)) !important;
}

.pin-focused-front .pin-personnel-badge {
    border: 3px solid #facc15 !important; /* Gold Border Menonjol */
    box-shadow: 0 0 25px 8px rgba(250, 204, 21, 0.85), inset 0 0 12px rgba(250, 204, 21, 0.4) !important;
    animation: beacon-pulse 1.6s infinite ease-in-out !important;
}

.pin-focused-front .pin-personnel-pointer {
    border-top-color: #facc15 !important;
    transform: scale(1.4);
}

@keyframes beacon-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.9), 0 0 20px 6px rgba(56, 189, 248, 0.8);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(250, 204, 21, 0), 0 0 25px 8px rgba(56, 189, 248, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0), 0 0 20px 6px rgba(56, 189, 248, 0.8);
    }
}

/* PIN LAIN YANG TIDAK SEDANG DICARI DIREDUKSI SEDIKIT AGAR TARGET MENCOLOK DI DEPAN */
.marker-muted {
    opacity: 0.35 !important;
    filter: grayscale(35%) drop-shadow(0 2px 4px rgba(0,0,0,0.3)) !important;
}

.pin-personnel-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 8px;
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.45);
    line-height: 1.25;
    white-space: nowrap;
    text-align: center;
    min-width: 140px;
}

.pin-personnel-badge .badge-emp-name {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pin-personnel-badge .badge-emp-phone {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.95;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
}

.pin-personnel-badge.pin-inside {
    background: linear-gradient(135deg, #15803d, #16a34a); /* Hijau Aman di Dalam Radius */
}

.pin-personnel-badge.pin-outside {
    background: linear-gradient(135deg, #b91c1c, #dc2626); /* Merah Alert Keluar Perimeter */
}

.pin-personnel-badge.pin-shift {
    background: linear-gradient(135deg, #0369a1, #0284c7); /* Biru Shift Lapangan */
}

.pin-personnel-pointer {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #16a34a;
    margin-top: -1px;
}

.pin-personnel-pointer.pin-outside {
    border-top-color: #dc2626;
}

.pin-personnel-pointer.pin-shift {
    border-top-color: #0284c7;
}

.pin-phone-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3.5px 9px;
    border-radius: 14px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.pin-phone-pill.pin-inside {
    background: #16a34a; /* Hijau Aman di Dalam Radius */
}

.pin-phone-pill.pin-outside {
    background: #dc2626; /* Merah Alert Keluar Perimeter */
}

.pin-phone-pill.pin-shift {
    background: #0284c7; /* Biru Shift Lapangan */
}

.pin-phone-pointer {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #16a34a;
    margin-top: -1px;
}

.pin-phone-pointer.pin-outside {
    border-top-color: #dc2626;
}

.pin-phone-pointer.pin-shift {
    border-top-color: #0284c7;
}

/* Print Invoice & Slip Styling */
@media print {
    body {
        background-color: #fff !important;
        color: #000 !important;
    }
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
    .enterprise-card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
}
