body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar {
    height: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 2px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Leaflet Popups */
.leaflet-popup-content-wrapper {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.dark .leaflet-popup-content-wrapper {
    background: #0f172a;
    color: #f8fafc;
    border-color: #1e293b;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

.leaflet-popup-tip {
    background: #ffffff;
}

.dark .leaflet-popup-tip {
    background: #0f172a;
}

/* Live dot pulse */
@keyframes livePulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.35;
        transform: scale(0.9);
    }
}

.pulse-live {
    animation: livePulseDot 1.8s infinite ease-in-out;
}

/* Collapsible map sidebar with zero ghosting/peeking */
#mapSidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, box-shadow 0.25s ease;
}

#mapSidebar.sidebar-collapsed {
    transform: translateX(calc(-100% - 2.5rem)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

/* Leaflet tooltip auto-behavior */
.leaflet-tooltip {
    pointer-events: none !important;
}

/* Tom Select: samakan dengan form input aplikasi */
.ts-wrapper {
    width: 100%;
}

.ts-wrapper .ts-control {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 8px;
    gap: 4px;
}

.ts-wrapper.focus .ts-control {
    background: #fff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
    outline: none;
}

.ts-wrapper .ts-control > input {
    font-size: 12px;
    color: #0f172a;
    min-width: 80px;
}

.ts-wrapper .ts-control > input::placeholder {
    color: #94a3b8;
}

.ts-wrapper .ts-control .item {
    background: #0284c7;
    border: 1px solid #0284c7;
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    padding: 1px 6px;
}

.ts-wrapper.plugin-remove_button .item .remove {
    border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.ts-dropdown {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(2, 32, 71, 0.12);
    font-size: 12px;
    font-weight: 500;
    color: #0f172a;
    margin-top: 4px;
    z-index: 60;
}

.ts-dropdown .option {
    padding: 7px 10px;
}

.ts-dropdown .option input[type="checkbox"] {
    margin-right: 6px;
    accent-color: #0284c7;
}

.ts-dropdown .option:hover,
.ts-dropdown .active {
    background: #f1f5f9;
    color: #0f172a;
}

.ts-dropdown .selected {
    background: #e0f2fe;
    color: #075985;
}

.grid-page-size .ts-wrapper.dropdown-up.focus .ts-control {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.grid-page-size .ts-wrapper.dropdown-up .ts-dropdown {
    border-radius: 8px 8px 0 0;
    border-bottom: 0;
    box-shadow: 0 -8px 24px rgba(2, 32, 71, 0.12);
    margin-top: 0;
    margin-bottom: -1px;
}

#gridViewContainer .camera-filter-bar .ts-wrapper {
    flex: 3 3 0%;
    min-width: 150px;
}

#gridViewContainer .ts-wrapper .ts-control {
    min-height: 34px;
}

.grid-page-size .ts-wrapper {
    flex: none !important;
    min-width: 0 !important;
}

#gridPaginationContainer {
    position: relative;
    overflow: visible;
}

.grid-page-size {
    position: relative;
}

.dark .ts-wrapper .ts-control {
    background: #1e293b;
    border-color: #334155;
}

.dark .ts-wrapper.focus .ts-control {
    background: #1e293b;
    border-color: #0ea5e9;
}

.dark .ts-wrapper .ts-control > input {
    color: #e2e8f0;
}

.dark .ts-dropdown {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .ts-dropdown .option:hover,
.dark .ts-dropdown .active {
    background: #1e293b;
    color: #fff;
}

.dark .ts-dropdown .selected {
    background: #0c4a6e;
    color: #fff;
}

.dark .grid-page-size .ts-wrapper.dropdown-up .ts-dropdown {
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}
