/* =========================================================
   site.css — project-wide base styles loaded first by _Layout.cshtml.

   Consumed app-wide. Reads tokens from sares-tokens.css.
   Mixes layout primitives, Radzen overrides, map-pin chrome,
   drawers, legacy tile/table styles, and pagination — kept in
   one file because _Layout loads it before component sheets so
   later rules can override these baselines.
   ========================================================= */

/* ── Page shell / Entry-page container ── */
.entry-page-container {
    --page-bg: #f5f7fb;
    --card-bg: #ffffff;
    --card-border: #e3e8ef;
    --soft-border: #e5e7eb;
    --input-border: #d1d5db;
    --text-main: #1f2937;
    --text-body: #374151;
    --text-muted: #6b7280;
    --soft-bg: #f9fafb;
    --soft-bg-2: #f3f4f6;
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 2px 12px rgba(15, 23, 42, 0.05);
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --sticky-top: 12px;
    --toolbar-height-offset: 88px;
    padding: 1.5rem;
    background-color: var(--page-bg);
    min-height: 100vh;
    box-sizing: border-box;
}

#components-reconnect-modal {
    display: none;
}

    #components-reconnect-modal.components-reconnect-show,
    #components-reconnect-modal.components-reconnect-failed,
    #components-reconnect-modal.components-reconnect-rejected {
        display: block;
        position: fixed;
        inset: auto 1rem 1rem 1rem;
        z-index: 20000;
    }

.excel-preview-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
}

.preview-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}

    .preview-table th {
        background: #f5f5f5;
        font-weight: 600;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .preview-table th,
    .preview-table td {
        border: 1px solid #ddd;
        padding: 8px 12px;
        white-space: nowrap;
        text-align: left;
        font-size: 13px;
    }

.components-reconnect-dialog {
    max-width: 420px;
    margin-left: auto;
    background: rgba(24, 34, 45, 0.96);
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

    .components-reconnect-dialog p {
        margin: 0.35rem 0 0;
    }

    .components-reconnect-dialog .reload {
        appearance: none;
        border: none;
        border-radius: 999px;
        padding: 0.45rem 0.85rem;
        cursor: pointer;
        text-decoration: none;
        background: var(--sares-sun, #f4c84c);
        color: #1f2937;
        font-weight: 700;
    }
/* ── Fix: Radzen applies transform:translateZ(0) to .rz-body which creates
   a containing block and breaks position:fixed for modals inside @Body.
   This global override neutralizes it so fixed overlays cover the full viewport. ── */
.rz-layout .rz-body {
    transform: none !important;
}

    /* Map page should fit the available layout area without vertical page scroll. */
    .rz-layout .rz-body:has(.map-page) {
        overflow-y: hidden;
    }

/* ── Map pins, marker chrome, focus animations ── */
.bigmap-custom-pin {
    pointer-events: auto;
    background: transparent !important;
    border: none !important;
}

.leaflet-container .leaflet-marker-icon.bigmap-custom-pin,
.leaflet-container .leaflet-div-icon.bigmap-custom-pin {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.bigmap-custom-pin svg {
    filter: none;
    opacity: 0.92;
    transition: transform 220ms cubic-bezier(.22,1,.36,1), filter 180ms ease, opacity 180ms ease;
    transform-origin: 50% 100%;
}

.bigmap-custom-pin:hover svg {
    filter: drop-shadow(0 4px 10px rgba(61, 75, 68, 0.18));
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
}

.bigmap-pin-focused svg {
    filter: drop-shadow(0 14px 28px rgba(122, 140, 46, 0.42));
    animation: saresMapPinFocusPulse 1.45s ease-in-out infinite;
}

.bigmap-pin-displaced svg {
    opacity: 0.82;
    filter: drop-shadow(0 7px 14px rgba(61, 75, 68, 0.16));
}

.sares-marker-focus-link {
    animation: saresMapLinkFadeIn 180ms ease-out;
}

.sares-marker-focus-halo {
    background: transparent !important;
    border: none !important;
}

    .sares-marker-focus-halo span {
        display: block;
        width: 92px;
        height: 92px;
        margin-left: -46px;
        margin-top: -46px;
        border-radius: 999px;
        border: 2px solid rgba(122, 140, 46, 0.42);
        background: radial-gradient(circle, rgba(122, 140, 46, 0.18) 0%, rgba(122, 140, 46, 0.06) 44%, rgba(122, 140, 46, 0) 72%);
        animation: saresMapFocusHalo 1.4s ease-out infinite;
        pointer-events: none;
    }

@keyframes saresMapPinFocusPulse {
    0% {
        transform: translateY(-6px) scale(1.04);
    }

    50% {
        transform: translateY(-11px) scale(1.2);
    }

    100% {
        transform: translateY(-6px) scale(1.04);
    }
}

@keyframes saresMapLinkFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes saresMapFocusHalo {
    0% {
        transform: scale(0.72);
        opacity: 0.78;
    }

    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

/* ── SARES dialog shell (Radzen dialog overrides) ── */
body .sares-dialog-wrapper {
    background: rgba(61, 75, 68, 0.22);
    backdrop-filter: blur(6px) saturate(1.05);
    -webkit-backdrop-filter: blur(6px) saturate(1.05);
}

body .sares-dialog-shell {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

    body .sares-dialog-shell .rz-dialog-titlebar {
        display: none !important;
    }

    body .sares-dialog-shell .rz-dialog-content {
        background: transparent !important;
        padding: 0 !important;
        border: none !important;
        overflow: visible !important;
    }
/* ── Indicator drawer + tiles + legacy tables ── */
.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* Full-screen overlay behind the drawer */
.indicator-drawer-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(0,0,0,0.45);
    z-index: 1000; /* must sit above page content */
}

/* Drawer container (right side panel) */
.indicator-drawer {
    position: fixed;
    top: 0;
    right: -420px; /* hidden offscreen by default */
    width: 420px; /* adjust as needed */
    height: 100vh;
    background: #ffffff;
    box-shadow: -6px 0 18px rgba(0,0,0,0.15);
    z-index: 1001; /* above overlay */
    transition: right 0.25s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Visible state */
.indicator-drawer-open {
    right: 0;
}

/* Unified icon style for table header filter glyphs across indicator pages */
.table-filter-icon {
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
}

/* Keep configuration-page loading overlays local to the table/header shell. */
.config-page-shell {
    position: relative;
    min-height: 180px;
}

/* Header */
.indicator-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.indicator-close-arrow {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

/* Content area */
.indicator-drawer-content {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}

/* Optional: prevent body scroll when drawer open (requires JS to toggle class on <body>) */
body.no-scroll {
    overflow: hidden;
}

/* Minor visuals retained from your tiles (tweak as you like) */
.dashboard-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px 14px;
}

.tile, .tile2 {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
}

.tile-title {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.tile-number {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

.tablet_02, .tablet_03, .tablet_04, .tablet_05 {
    padding: 12px 14px;
}

.fixed-table {
    width: 100%;
    border-collapse: collapse;
}

    .fixed-table th, .fixed-table td {
        border: 1px solid #e5e5e5;
        padding: 6px 8px;
        font-size: 12px;
    }

.indicator-styled-table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
}

    .indicator-styled-table th, .indicator-styled-table td {
        border: 1px solid #e5e5e5;
        padding: 8px 10px;
        font-size: 13px;
    }

.indicator-selected-row {
    background: #fff9e6;
}




/* ── Settings dropdown menu ── */
/* ===== Dropdown wrapper ===== */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* ===== Dropdown panel ===== */
.settings-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: #1e1e2f;
    color: white;
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    padding: 8px 0;
    animation: dropdownFade 0.2s ease-in-out;
}

/* ===== Header info ===== */
.dropdown-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 14px;
}

    .dropdown-header i {
        margin-right: 10px;
        color: #ffcc00;
    }

/* ===== Dropdown items ===== */
.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    text-align: left;
    font-size: 14px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

    .dropdown-item i {
        margin-right: 10px;
        width: 18px;
        text-align: center;
    }

    .dropdown-item:hover {
        background: rgba(255,255,255,0.1);
    }

    .dropdown-item.logout {
        color: #ff5555;
    }

        .dropdown-item.logout:hover {
            background: rgba(255, 85, 85, 0.2);
        }

/* ===== Divider ===== */
.settings-dropdown hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 6px 0;
}

/* ===== Animation ===== */
@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ── Pagination controls ── */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    gap: 20px;
}

    .pagination-controls button {
        background-color: #2b9948;
        color: white;
        border: none;
        padding: 10px 18px;
        font-size: 14px;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

        .pagination-controls button:hover {
            background-color: #237a3a;
        }

        .pagination-controls button:disabled {
            background-color: #ccc;
            color: #666;
            cursor: not-allowed;
        }

    .pagination-controls span {
        font-size: 14px;
        color: #333;
    }
