/* css */

:root {
    --tracker-blue: #3b709e;
    --tracker-blue-hover: #447aa9;
    --tracker-blue-active: #29577f;
    --tracker-blue-light: #9bc7ef;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #0f1419;
}

/* First-visit demonstration notice, matching the other gallery maps. */
.disclaimer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
}

.disclaimer-overlay[hidden] { display: none; }

.disclaimer-modal {
    width: min(100%, 860px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 32px;
    border: 1px solid #456685;
    border-radius: 18px;
    background: #1c2029;
    color: #f5f2f7;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.disc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.disc-icon {
    display: grid;
    place-items: center;
    flex: 0 0 72px;
    height: 72px;
    border: 1px solid rgba(107, 169, 222, 0.55);
    border-radius: 12px;
    background: rgba(59, 112, 158, 0.22);
    color: var(--tracker-blue-light);
    font-size: 2.175rem;
    font-weight: 700;
}

.disc-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.77rem;
    line-height: 1.3;
}

.disc-tag {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(59, 112, 158, 0.22);
    color: var(--tracker-blue-light);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.disclaimer-modal p {
    margin: 0 0 14px;
    color: #d4d3db;
    font-size: 1.35rem;
    line-height: 1.6;
}

.disclaimer-modal strong { color: #fff; }

.disclaimer-modal .disc-source-note {
    margin-bottom: 22px;
    padding: 11px 14px;
    border: 1px solid #3b414c;
    border-radius: 8px;
    background: #252b35;
    color: #c2c6cf;
    font-size: 1.185rem;
}

.disc-btn {
    display: block;
    width: 100%;
    padding: 13px 20px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--tracker-blue-active), var(--tracker-blue-hover));
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.disc-btn:hover { filter: brightness(1.12); }
.disc-btn:focus-visible { outline: 3px solid var(--tracker-blue-light); outline-offset: 3px; }

@media (max-width: 600px) {
    .disclaimer-overlay { padding: 12px; }
    .disclaimer-modal {
        max-height: calc(100dvh - 24px);
        padding: 24px;
    }

    .disc-icon {
        flex-basis: 60px;
        height: 60px;
    }
}

.banner-body { padding: 2px 16px; }

.map_title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    column-gap: 24px;
}

.demo-feed-label {
    color: #7ee0ac;
    font-size: 1.2rem;
    white-space: nowrap;
}

img {
    max-width: 100%;
    max-height:100%;
}

.text {
    font-size: 70px;
}

.info {
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    background: white;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}

.info h4 {
    margin: 0 0 5px;
    color: #777;
}

::placeholder {
    /* Chrome, Firefox, Opera, Safari 10.1+ */
    color: grey;
    font-style: italic;
    opacity: 0.5;
    /* Firefox */
}

:-ms-input-placeholder {
    /* Internet Explorer 10-11 */
    color: grey;
}

::-ms-input-placeholder {
    /* Microsoft Edge */
    color: grey;
}

#contPage {
    height: 100vh;
    background-color: #000;
}

/* Top Section */
#top-row {
    height: 10%;
}

#title-banner {
    text-align: left;
    font-size: clamp(1.875rem, 3.75vw, 3.45rem);
}

/* Responsive layout container for help and search bar */
#top-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 21px;
}

/* Custom button colors for top-controls buttons */
#top-controls .btn {
    background-color: var(--tracker-blue);
    border-color: var(--tracker-blue);
    color: white;
    font-size: 12px;
}

#top-controls .btn:hover {
    background-color: var(--tracker-blue-hover);
    border-color: var(--tracker-blue-hover);
    color: white;
}

#top-controls .btn:active,
#top-controls .btn:focus {
    background-color: var(--tracker-blue-active) !important;
    border-color: var(--tracker-blue-active) !important;
    color: white;
    box-shadow: none;
}

#help-buttons,
#search-bar {
    padding: 5px;
}

/* Let search-bar float right on larger screens */
@media (min-width: 768px) {
    #help-buttons {
        order: 1;
        flex: 1 1 auto;
        width: auto;
    }
    #search-bar {
        order: 2;
        flex: 0 1 auto;
        width: auto;
        text-align: right;
    }
}

/* Stack help-buttons above search-bar on smaller screens, icons only */
@media (max-width: 767px) {
    #help-buttons,
    #search-bar {
        flex: 100%;
        width: 100%;
        text-align: left;
    }

    .btn-text {
        display: none;
    }
}

#draw-export {
    padding: 2px;
}

#findAddNum {
    width: 80px;
}

#findAddSt {
    width: 150px;
}

#shapeNote {
    width: 200px;
}

/* Search input — explicit dark text on light background for readability */
#findWorkOrder {
    color: #212529;
    background-color: #f8f9fa;
    border: 1px solid #adb5bd;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 20px;
    width: 10ch;
}

a:link, a:visited  {color:#8b92a0;text-decoration:none;}
a:hover {color:blue;text-decoration:underline;}
a:active {color:green;text-decoration:none}

/* Map Section */
#map-row {
    height: 80%;
    margin: 2px;
}

#mapid {
    height: 100%;
    border: 1px solid black;
    z-index: 1;
}

/* Sidebar Panel */
#sidebar {
    padding: 0px;
    margin: 0px;
    font-size: medium;
}

#sidebar h3 {
    margin: 2px;
}

#sidebar h2 {
    padding: 0px;
    margin-top: 2px;
    margin-bottom: 1px;
}

#guide {
    color: black;
}

#guide-bar {
    padding: 3px;
}

#guide-bar h3 {
    margin: 2px;
}

#guide-bar h2 {
    padding: 0px;
    margin-top: 2px;
    margin-bottom: 1px;
}

/* Map Legend Items */
#legend {
    font-weight: bold;
    padding: 10px;
    font-size: small;
    font-family: Arial, Helvetica, sans-serif;
}

.dot {
    height: 10px;
    width: 10px;
    fill-opacity: 0.5;
    border-radius: 50%;
    display: inline-block;
}

.dot2 {
    height: 20px;
    width: 20px;
    border: 3px solid blue;
    fill-opacity: 0.3;
    border-radius:50%;
    display: inline-block;
}

.rectangle-key {
    height: 10px;
    width: 20px;
    border-style: solid;
    border-width: 2px;
    display: inline-block;
}

/* Legend styles for different marker types */
.square-marker-legend {
    height: 16px;
    width: 16px;
    border: 2px solid blue;
    background-color: green;
    border-radius: 2px;
    display: inline-block;
    margin-right: 5px;
}

.legend-color {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
}

#mylocation {
    border-color: #ff02ff;
    background-color: #f53bfc;
}

#circle-security {
    border-color: blue;
    background-color: green;
}

#circle-strmmh {
    border-color: #73cd07;
    background-color: #73cd07;
}

#circle-sanmh {
    border-color: #568a05;
    background-color: #568a05;
}

#circle-water {
    border-color: blue;
    border-width: 5px;
    background-color: blue;
}

#rect-lots {
    border-color: black;
    background-color: #e6bc7c2e;
    fill-opacity: 0.2;
}

#circle-hydrants {
    border-color: #ff0000;
    background-color: #ff0000;
}

#rect-citybnd {
    border-color: #ff0000;
    background-color: #ff000020;
    fill-opacity: 0.0;
}

#warning {
    border-color: orange;
    background-color: orange;
}

#rect-area-lake {
    border-color: blue;
    background-color: blue;
}

/* Contact Tab */
#sci {
    color: black;
    font-size: small;
}

#logo {
    float: left;
}

/* Style tab links — 2 tabs, each 50% */
.tablink {
    background-color: #555;
    color: white;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 16px;
    font-size: 12px;
    width: 50%;
}

.tablink:hover {
    background-color: #777;
}

/* Style the tab content */
.tabcontent {
    color: black;
    display: none;
    padding: 45px 10px 10px;
    height: 100%;
    font-size: 14px;
}

/* Both tabs dark — unified with the overall dark aesthetic */
#Info {
    background-color: #1a2332;
    color: #e0e6ed;
}

#Dashboard {
    background-color: #0f1419;
    color: #e0e6ed;
    padding: 45px 0 10px;
}

/* =========================================================
   Dashboard-in-sidebar styles  (dash- prefix)
   ========================================================= */

.dash-tab-content {
    padding: 10px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* "Open Full Dashboard" button */
.dash-focus-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, var(--tracker-blue-active) 0%, var(--tracker-blue-hover) 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 0.88em;
    font-weight: 600;
    margin-bottom: 14px;
    transition: opacity 0.2s ease;
}
.dash-focus-btn:hover { opacity: 0.85; color: white !important; }

/* KPI Cards — 2×2 grid */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.dash-kpi-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 8px;
    position: relative;
    transition: all 0.2s ease;
}

.dash-kpi-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
}

.dash-kpi-card.dash-kpi-fault {
    border-color: #ef4444;
    background: rgba(239,68,68,0.1);
}

.dash-kpi-value {
    font-size: 1.9em;
    font-weight: 700;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 4px;
}

.dash-kpi-label {
    font-size: 0.72em;
    font-weight: 600;
    color: #8b92a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-kpi-sub {
    font-size: 0.65em;
    color: #4a5568;
    margin-top: 2px;
}

.dash-alert-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ef4444;
    color: white;
    font-size: 0.6em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    animation: dashShake 2s ease-in-out infinite;
}

@keyframes dashShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80%      { transform: translateX(2px); }
}

/* Section titles */
.dash-section-title {
    font-size: 0.8em;
    font-weight: 600;
    color: #8b92a0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 14px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Generator Status Overview grid */
.dash-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 4px;
}

.dash-status-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    transition: all 0.2s ease;
}

.dash-status-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
}

.dash-status-val {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 2px;
}

.dash-status-val.running { color: #10b981; }
.dash-status-val.stopped { color: #6366f1; }
.dash-status-val.fault   { color: #ef4444; }
.dash-status-val.unknown { color: #8b92a0; }

.dash-status-lbl {
    font-size: 0.62em;
    color: #8b92a0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Device list */
.dash-device-list {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.dash-device-list::-webkit-scrollbar { width: 4px; }
.dash-device-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 3px; }
.dash-device-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.dash-device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 8px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.dash-device-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.dash-device-label {
    font-size: 0.85em;
    font-weight: 500;
    color: #e0e6ed;
}

.dash-device-state {
    font-size: 0.72em;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #8b92a0;
}

.dash-device-state-running { color: #10b981; }
.dash-device-state-stopped { color: #6366f1; }
.dash-device-state-fault   { color: #ef4444; }
.dash-device-state-unknown { color: #8b92a0; }

/* =========================================================
   Modal overlay (Legend and Help)
   ========================================================= */

.vp-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 20000;
    align-items: center;
    justify-content: center;
}

.vp-modal-content {
    background: #1a2332;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    color: #e0e6ed;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.vp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    border-radius: 12px 12px 0 0;
}

.vp-modal-header h3 { color: #e0e6ed; font-size: 1.1em; }

.vp-modal-close {
    background: none;
    border: none;
    color: #8b92a0;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s ease;
}
.vp-modal-close:hover { color: #e0e6ed; }

.vp-modal-body {
    padding: 20px;
    font-size: 0.92em;
    line-height: 1.6;
    color: #c0c8d4;
}

.vp-modal-body ul {
    margin: 6px 0 10px 16px;
}

.vp-modal-body li {
    margin-bottom: 4px;
}

.vp-modal-body strong { color: #e0e6ed; }

/* Legend items in modal */
#legend { color: #c0c8d4; font-size: 0.9em; line-height: 2; }

/* =========================================================
   Sidebar close button override
   ========================================================= */

/* The plugin renders a white circle × button — restyle it for dark theme */
.leaflet-sidebar .close {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.leaflet-sidebar .close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* =========================================================
   Info tab — dark theme overrides
   ========================================================= */

#Info h3, #Info h4, #Info h5 { color: #e0e6ed; }
#Info b                       { color: #c0c8d4; }
#Info p                       { color: #a0aab8; }
#Info a:link, #Info a:visited { color: #00d2ff; }
#Info a:hover                 { color: #3a7bd5; }

/* Disclaimer box in Info tab */
#Info .banner-body {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    margin-top: 10px;
}

/* Trail status block */
.trail-status {
    margin-top: 12px;
    padding: 8px 10px;
    background: rgba(0, 210, 255, 0.06);
    border-left: 3px solid #00d2ff;
    border-radius: 0 6px 6px 0;
    font-size: 0.85em;
    line-height: 1.5;
}

/* =========================================================
   Fault pulse ring — animates on map markers in Fault state
   ========================================================= */

@keyframes faultPulse {
    0%   { transform: scale(0.3); opacity: 0.85; }
    100% { transform: scale(2.6); opacity: 0; }
}

.fault-pulse-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #f97316;
    background: transparent;
    animation: faultPulse 2s ease-out infinite;
    pointer-events: none;
}

/* =========================================================
   Fault KPI card — clickable state
   ========================================================= */

.dash-kpi-fault-clickable {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease !important;
}

.dash-kpi-fault-clickable:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    transform: translateY(-2px);
}

/* =========================================================
   Fault drawer — expands below the KPI grid
   ========================================================= */

#dash-fault-drawer {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    animation: drawerSlideIn 0.2s ease-out;
}

@keyframes drawerSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dash-fault-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    background: rgba(239, 68, 68, 0.15);
    font-size: 0.78em;
    font-weight: 600;
    color: #ef4444;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.dash-fault-device-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-fault-device-row:last-child {
    border-bottom: none;
}

.dash-fault-device-uid {
    font-size: 0.85em;
    font-weight: 600;
    color: #e0e6ed;
}

.dash-fault-device-customer {
    font-size: 0.72em;
    color: #6b7280;
    margin-top: 1px;
}

.dash-fault-locate-btn {
    background: rgba(249, 115, 22, 0.2);
    border: 1px solid rgba(249, 115, 22, 0.5);
    color: #f97316;
    font-size: 0.72em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.dash-fault-locate-btn:hover {
    background: rgba(249, 115, 22, 0.4);
}

.dash-fault-zoom-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    font-size: 0.68em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.dash-fault-zoom-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.dash-fault-close-btn {
    background: none;
    border: none;
    color: #8b92a0;
    font-size: 0.9em;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s ease;
}

.dash-fault-close-btn:hover {
    color: #e0e6ed;
}

/* =========================================================
   Refresh animation
   ========================================================= */

#dash-chart {
    transition: opacity 0.3s ease;
}

#dash-chart.refreshing {
    opacity: 0.55;
}

/* =========================================================
   Timestamp in Dashboard tab
   ========================================================= */

.dash-timestamp {
    font-size: 0.7em;
    color: #4a5568;
    line-height: 1.4;
    text-align: right;
    white-space: nowrap;
}

/* =========================================================
   Device list — customer name + No GPS badge
   ========================================================= */

.dash-device-customer {
    font-size: 0.72em;
    color: #6b7280;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.dash-no-gps {
    display: inline-block;
    font-size: 0.65em;
    color: #6b7280;
    background: rgba(107, 114, 128, 0.15);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 8px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
}

/* =========================================================
   Marker cluster icon
   ========================================================= */

.cluster-icon-wrapper {
    background: transparent !important;
    border: none !important;
}

.cluster-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tracker-blue) 0%, var(--tracker-blue-hover) 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 112, 158, 0.5);
    transition: transform 0.15s ease;
}

.cluster-bubble:hover {
    transform: scale(1.1);
}

/* Centered coordinate + zoom display at bottom of map */
.showxy-center {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(15, 20, 25, 0.75);
    color: #c0c8d4;
    font-size: 0.78em;
    font-family: 'Courier New', Courier, monospace;
    padding: 4px 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* Bottom Section */
#bottom-row {
    height: 5%;
}

#mymouse {
    font-weight: lighter;
    font-size: medium;
}

/* HTML/CSS Chart Styles */
.html-chart-container {
    width: 90%;
    max-width: 315px; /* 90% of 350px */
    margin: 9px auto; /* 90% of 10px */
    background-color: #2a2d3a;
    border: 1px solid #404654;
    border-radius: 11px; /* 90% of 12px */
    padding: 18px; /* 90% of 20px */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.html-chart {
    width: 100%;
}

.chart-title {
    text-align: center;
    font-size: 16px; /* 90% of 18px */
    font-weight: bold;
    margin-bottom: 18px; /* 90% of 20px */
    color: #ffffff;
}

/* Pie Chart Styles */
.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px; /* 90% of 20px */
}

.pie-chart {
    margin-bottom: 14px; /* 90% of 15px */
    width: 180px; /* 90% of 200px */
    height: 180px; /* 90% of 200px */
}

.pie-slice {
    cursor: pointer;
    transition: all 0.3s ease;
}

.pie-slice:hover {
    filter: brightness(1.2);
}

.pie-center-number {
    font-size: 25px; /* 90% of 28px */
    font-weight: bold;
    fill: #4A9EFF;
}

.pie-center-label {
    font-size: 11px; /* 90% of 12px */
    fill: #9ca3af;
}

/* Pie Chart Legend */
.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 7px; /* 90% of 8px */
    margin-bottom: 18px; /* 90% of 20px */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px; /* 90% of 8px */
    color: #e5e7eb;
    font-size: 13px; /* 90% of 14px */
}

.legend-dot {
    width: 11px; /* 90% of 12px */
    height: 11px; /* 90% of 12px */
    border-radius: 50%;
}

.legend-dot.running {
    background-color: rgba(10, 210, 90, 0.8);
}

.legend-dot.stopped {
    background-color: rgba(255, 99, 132, 0.8);
}

.legend-dot.unknown {
    background-color: rgba(255, 206, 86, 0.8);
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* 90% of 100px */
    gap: 11px; /* 90% of 12px */
    margin-top: 14px; /* 90% of 15px */
}

.dashboard-card {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 7px; /* 90% of 8px */
    padding: 11px 7px; /* 90% of 12px 8px */
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dashboard-card.alert {
    border-color: #ef4444;
    background-color: #3f1f1f;
}

.dashboard-card.alert:hover {
    background-color: #4f2626;
}

.card-value {
    font-size: 22px; /* 90% of 24px */
    font-weight: bold;
    color: #4A9EFF;
    margin-bottom: 4px;
}

.dashboard-card.alert .card-value {
    color: #ef4444;
}

.card-label {
    font-size: 10px; /* 90% of 11px */
    color: #e5e7eb;
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-sublabel {
    font-size: 8px; /* 90% of 9px */
    color: #9ca3af;
    line-height: 1.2;
}

.alert-badge {
    position: absolute;
    top: -5px; /* 90% of -6px */
    right: -5px; /* 90% of -6px */
    background-color: #ef4444;
    color: white;
    font-size: 7px; /* 90% of 8px */
    font-weight: bold;
    padding: 2px 5px; /* 90% of 2px 6px */
    border-radius: 9px; /* 90% of 10px */
    text-transform: uppercase;
}

/* Fuel Level Circle */
.fuel-level {
    display: flex;
    justify-content: center;
    margin-bottom: 7px; /* 90% of 8px */
}

.fuel-circle {
    position: relative;
}

.fuel-progress {
    transition: stroke-dasharray 0.5s ease;
}

.fuel-text {
    font-size: 13px; /* 90% of 14px */
    font-weight: bold;
    fill: #4A9EFF;
}

/* Pie Chart Tooltip */
.pie-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 9px; /* 90% of 6px 10px */
    border-radius: 4px;
    font-size: 11px; /* 90% of 12px */
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 1px solid #404654;
}

/* Remove old bar chart styles and replace with updated ones */
.chart-bars {
    display: none; /* Hide old bar chart */
}

.bar {
    display: none; /* Hide old bars */
}

.bar-value {
    display: none; /* Hide old bar values */
}

.bar-label {
    display: none; /* Hide old bar labels */
}

.chart-stats {
    display: none; /* Hide old stats */
}

.stat-label {
    font-size: 10px;
    color: #666;
    display: block;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

/* Custom Leaflet Marker Styles — all shapes use inline SVG divIcons; no wrapper styling needed */

/* Responsive Chart Design */
@media (max-width: 768px) {
    .html-chart-container {
        max-width: 90%; /* 90% of 100% */
        margin: 5px 0;
        padding: 14px; /* 90% of 15px */
    }

    .pie-chart {
        width: 162px; /* 90% of 180px */
        height: 162px; /* 90% of 180px */
    }

    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); /* 90% of 80px */
        gap: 7px; /* 90% of 8px */
    }

    .dashboard-card {
        padding: 9px 5px; /* 90% of 10px 6px */
    }

    .card-value {
        font-size: 18px; /* 90% of 20px */
    }

    .card-label {
        font-size: 9px; /* 90% of 10px */
    }

    .card-sublabel {
        font-size: 7px; /* 90% of 8px */
    }

    .fuel-circle svg {
        width: 45px; /* 90% of 50px */
        height: 45px; /* 90% of 50px */
    }

    .fuel-text {
        font-size: 11px; /* 90% of 12px */
    }

    .pie-center-number {
        font-size: 22px; /* 90% of 24px */
    }

    .pie-center-label {
        font-size: 9px; /* 90% of 10px */
    }

    .legend-item {
        font-size: 12px; /* 90% of 13px */
        gap: 5px; /* 90% of 6px */
    }

    .legend-dot {
        width: 9px; /* 90% of 10px */
        height: 9px; /* 90% of 10px */
    }
}
