/* LaLo-BMS – map viewing UX (full screen, collapsible sidebar & map panel, dashboard map-first layout) */

/* ---------- map control stack: icons + fullscreen / fit / rotate */
.rm-ctrl button { display: flex; align-items: center; justify-content: center; }
.rm-ctrl button svg { display: block; }
.rm-ctrl button.on { background: var(--teal-50, #E7F4F5); color: var(--teal, #0E7C86); }
.rm-compass { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center; z-index: 4; pointer-events: none; }

.histpage .rm-compass { bottom: 74px; }
.poolpage .rm-compass { right: auto; left: 12px; }
.mfs-hbtn { gap: 6px; }
.mfs-hbtn svg { width: 15px; height: 15px; }

/* ---------- full screen (Fullscreen API or fixed overlay fallback) */
.mfs-on { background: #10343B !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: hidden !important; }
.mfs-on:fullscreen { width: 100vw; height: 100vh; }
.mfs-on.mfs-fixed { position: fixed !important; inset: 0 !important; z-index: 9000 !important; width: auto !important; height: auto !important; margin: 0 !important; max-width: none !important; grid-area: auto !important; }
html.mfs-lock, html.mfs-lock body { overflow: hidden !important; }
.mfs-on > .card-h, .mfs-on > .maphead { display: none !important; }
.mfs-on > div:not(.mfs-bar):not(.mfs-drawer):not(.mfs-panel):not(.mlayers):not(.mlegend):not(.map-overlay):not(#popup):not(.mapside):not(.playbar) { position: absolute !important; inset: 0 !important; }
.mfs-on .map, .mfs-on #dmap { position: absolute !important; inset: 0 !important; border-radius: 0 !important; flex: none !important; height: auto !important; }
.mfs-on .rm-ctrl { top: 66px; right: 12px; }
.mfs-on .rm-focus { top: auto; bottom: 64px; right: 12px; }
.mfs-on .rm-compass { bottom: 14px; right: 14px; }
.mfs-bar { position: absolute; left: 12px; right: 12px; top: 10px; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; border-radius: 12px; background: rgba(11, 42, 49, .84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; z-index: 40; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-size: 12.5px; white-space: nowrap; }
.mfs-t { display: flex; flex-direction: column; line-height: 1.15; margin-right: 6px; min-width: 0; }
.mfs-t b { font-size: 14px; }
.mfs-t small { font-size: 11px; color: #9FD3D8; }
.mfs-sp { flex: 1; }
.mfs-b { height: 32px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #E3F3F4; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-weight: 700; font-size: 12px; cursor: pointer; }
.mfs-b.ic { width: 32px; padding: 0; justify-content: center; }
.mfs-b:hover { background: rgba(255, 255, 255, .14); }
.mfs-b.on { background: #fff; color: #0B3B45; border-color: #fff; }
.mfs-chips { display: flex; gap: 6px; margin-left: 4px; }
.mfs-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: rgba(255, 255, 255, .1); font-weight: 600; font-size: 12px; }
.mfs-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.mfs-chip b { font-weight: 800; }
.mfs-live { display: inline-flex; align-items: center; gap: 6px; color: #86EFAC; font-weight: 700; }
.mfs-live i { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.mfs-shift { color: #B9DDE0; font-weight: 600; }
.mfs-clock { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.mfs-exit { height: 32px; border-radius: 9px; border: 0; background: #F26B4F; color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.mfs-exit kbd { font: 700 10.5px ui-monospace, Menlo, monospace; background: rgba(255, 255, 255, .25); border-radius: 4px; padding: 1px 5px; }
.mfs-drawer { position: absolute !important; left: 12px; top: 66px; bottom: 12px; width: 330px; z-index: 30; background: rgba(255, 255, 255, .97) !important; border-radius: 12px !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .3) !important; display: flex !important; flex-direction: column; overflow: hidden; height: auto !important; min-height: 0; }
.mfs-panel { position: absolute !important; right: 60px; top: 66px; width: 340px; max-height: calc(100% - 80px); z-index: 30; overflow: auto !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .3) !important; background: rgba(255, 255, 255, .97) !important; height: auto !important; }
.mfs-hide { display: none !important; }
.mfs-drawer .mp-handle { display: none; }
.mfs-on.mfs-nolegend .mlegend, .mfs-on.mfs-nolegend .map-overlay { display: none !important; }
.mfs-on.mfs-nolayers .mlayers { display: none !important; }
.mfs-on .mlayers { left: auto; right: 60px; top: 66px; }
.mfs-on.mfs-popen .mlayers { display: none; }
.mfs-on .mlegend, .mfs-on .map-overlay { left: 12px; bottom: 12px; }
.mfs-on.mfs-dopen .mlegend, .mfs-on.mfs-dopen .map-overlay { left: 354px; }
.mfs-on .mapside { right: 60px; bottom: 12px; }
.mfs-on .playbar { left: 12px; right: 60px; bottom: 12px; }
@media (max-width: 1400px) { .mfs-shift { display: none; } .mfs-t small { display: none; } }
@media (max-width: 1300px) { .mfs-chip { padding: 0 8px; font-size: 11.5px; } .mfs-b span { display: none; } .mfs-b { padding: 0 8px; } }

/* ---------- collapsible sidebar → icon rail */
.side-tg { margin: 4px 10px 0; height: 32px; border-radius: 8px; border: 1px dashed rgba(255, 255, 255, .18); background: transparent; color: #8FB9BF; display: flex; align-items: center; gap: 8px; padding: 0 10px; font-weight: 600; font-size: 12px; cursor: pointer; flex: none; }
.side-tg:hover { background: rgba(255, 255, 255, .06); color: #fff; }
body.side-mini .app { grid-template-columns: 72px 1fr; }
body.side-mini .side .brand { justify-content: center; padding-left: 0 !important; padding-right: 0 !important; }
body.side-mini .side .brand-name, body.side-mini .side .poweredby { display: none; }
body.side-mini .side nav { padding: 8px 8px; }
body.side-mini .side .grp { font-size: 0; padding: 8px 0 4px; height: 1px; margin: 6px 6px; border-top: 1px solid rgba(255, 255, 255, .1); }
body.side-mini .side nav a { justify-content: center; padding: 0; position: relative; height: 40px; }
body.side-mini .side nav a > span:not(.badge):not(.lk) { display: none; }
body.side-mini .side nav a .badge { position: absolute; top: 2px; right: 6px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
body.side-mini .side nav a .lk { position: absolute; top: 4px; right: 6px; margin: 0; }
body.side-mini .side .me { justify-content: center; padding: 8px 0; margin: 8px; }
body.side-mini .side .me > :not(.av) { display: none; }
body.side-mini .side .tsw, body.side-mini .side .resort { justify-content: center; padding: 8px 0; margin: 10px 8px 4px; }
body.side-mini .side .tsw > div, body.side-mini .side .tsw .chev, body.side-mini .side .resort > div { display: none; }
body.side-mini .side .tsw-menu { min-width: 260px; }
body.side-mini .side-tg { justify-content: center; padding: 0; margin: 4px 14px 0; }

/* ---------- #map: collapsible side panel */
.mp-panel { position: relative; }
.mp-panel > .card-h:first-child { padding-right: 46px; }
.mp-handle { position: absolute; top: 9px; right: 9px; z-index: 6; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line, #E2E8EB); background: #fff; color: var(--text-2, #46595F); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.mp-handle:hover { background: var(--teal-50, #E7F4F5); color: var(--teal, #0E7C86); }
.mappage.mp-collapsed { grid-template-columns: 40px 1fr !important; }
.mp-collapsed .mp-panel > :not(.mp-handle) { display: none !important; }
.mp-collapsed .mp-handle { right: 5px; top: 10px; }
.mp-collapsed .mp-panel::after { content: "DANH SÁCH XE"; position: absolute; left: 50%; top: 52px; transform: translateX(-50%); writing-mode: vertical-rl; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--muted, #7B8C92); }

/* ---------- dashboard: map-first layout */
.dash.dash2 { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.dash2 > .kpis { flex: none; }
.dash2-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(380px, 1fr); gap: 12px; }
.dash2-map { display: flex; flex-direction: column; min-height: 0; height: 100%; position: relative; }
.dash2-map #dmap { flex: 1; min-height: 0; position: relative; }
.dash2-side { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 2px; }
.dash2-side > .card { flex: none; }
.dash2-side .card-h > .sub { display: none; }
.dash2-main > .card, .dash2-side > .card { grid-column: auto !important; grid-row: auto !important; }
.dash2-side .alerts, .dash2-side > .card { overflow: visible !important; }
@media (min-width: 1760px) {
  .dash2-side { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .dash2-side > .card:first-child { grid-column: 1 / -1 !important; }
}
