/* =========================================================
   phpVMS "Live Map" shell (Volanta-ish layout, NOT branding)
   - sidebar + topbar + map + panels
   - CLEANED: removed conflicting dropdown rules
   - Dropdown works with .is-open (your JS)
   ========================================================= */

:root{
  --bg: #0b0d12;
  --panel: rgba(20, 22, 30, .78);
  --panel-2: rgba(18, 20, 28, .66);
  --stroke: rgba(255,255,255,.08);
  --stroke-2: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);

  --accent: #2b8cff;
  --accent-2: #1e6fd4;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --r: 14px;
  --r2: 18px;

  --font: Arial, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, sans-serif;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body.vms-map{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 25% 15%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(900px 650px at 90% 30%, rgba(43,140,255,.10), transparent 60%),
    var(--bg);
  overflow:hidden;
}

/* kill underline / visited purple globally inside this theme shell */
body.vms-map a{
  color: inherit;
  text-decoration: none;
}
body.vms-map a:hover,
body.vms-map a:focus{
  text-decoration: none;
}

/* =========================================================
   SHELL GRID
   ========================================================= */
.vms-shell{
  position:fixed;
  inset:0;
  display:grid;
  grid-template-columns: 74px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 0;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.vms-sidebar{
  grid-column: 1;
  grid-row: 1 / -1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 14px;
  padding: 12px 10px;
  background: linear-gradient(to bottom, rgba(10,12,16,.92), rgba(10,12,16,.82));
  border-right: 1px solid rgba(255,255,255,.06);
  min-height: 0;
}

/* Sidebar logo: NO container look, consistent sizing */
.vms-sideLogo{
  width: 100%;
  height: 56px;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 10px 0;
}

.vms-sideLogo img{
  width: 38px !important;
  height: 38px !important;
  object-fit: contain !important;
  display: block;
}

.vms-sideLogo__fallback{
  width: 38px;
  height: 38px;
  display: none;
  place-items: center;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: rgba(255,255,255,.95);
  letter-spacing: -0.5px;
}

/* when image fails (your onerror adds .is-fallback) */
.vms-sideLogo.is-fallback .vms-sideLogo__fallback{ display: grid; }
.vms-sideLogo.is-fallback img{ display: none !important; }

.vms-nav{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 6px;
  width:100%;
  align-items:center;
}

.vms-ico{
  width:44px;
  height:44px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  text-decoration:none;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  cursor: pointer;
}
.vms-ico:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}
.vms-ico.is-active{
  background: rgba(43,140,255,.14);
  border-color: rgba(43,140,255,.28);
}

.vms-sidebarBottom{
  margin-top:auto;
  width:100%;
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:center;
  padding-bottom: 6px;
}

/* =========================================================
   TOPBAR (must be above map)
   ========================================================= */
.vms-topbar{
  grid-column: 2;
  grid-row: 1;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding: 10px 16px;

  height: 64px;              /* lock height */
  overflow: visible;

  position: relative;         /* for z-index */
  z-index: 2000;              /* above map */
}

/* site name */
.vms-siteName{
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1;
  display:flex;
  align-items:center;
  height: 44px;
  padding: 0 2px;
  user-select: none;
}

/* right side */
.vms-topRight{
  display:flex;
  align-items:center;
  gap: 14px;
}

/* clock */
.vms-clock{
  font-size: 13px;
  color: rgba(255,255,255,.70);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.vms-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  text-decoration:none;
  color: var(--text);
  font-size: 13px;
  background: rgba(255,255,255,.05);
}
.vms-btn--primary{
  background: linear-gradient(180deg, rgba(43,140,255,.95), rgba(30,111,212,.95));
  border-color: rgba(43,140,255,.35);
}
.vms-btn--ghost{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: rgba(255,255,255,.85);
}

/* =========================================================
   USER DROPDOWN (CUSTOM: .is-open)
   - NO bootstrap dropdown rules here
   ========================================================= */
.vms-userDropdownWrap{
  position: relative;
  display:flex;
  align-items:center;
}

.vms-userLink{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  display:grid;
  place-items:center;
  cursor:pointer;
  padding: 0;
  pointer-events: auto;
}

.vms-userLink img{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:block;
  object-fit: cover;
}

/* hidden by default */
.vms-userDropdownMenu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;

  min-width: 220px;
  padding: 10px;

  border-radius: 14px;
  background: rgba(20,22,30,.92);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  backdrop-filter: blur(10px);

  z-index: 99999;
  display: none;
}

/* shown when your JS toggles */
.vms-userDropdownMenu.is-open{ display:block; }

.vms-userSep{
  height:1px;
  background: rgba(255,255,255,.10);
  margin: 8px 0;
}

.vms-userItem{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius: 12px;
  text-decoration:none;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
}
.vms-userItem:hover{
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.96);
  text-decoration:none;
}

.vms-userItem--danger{ color: rgba(255,120,120,.95); }
.vms-userItem--danger:hover{
  background: rgba(255,120,120,.10);
  color: rgba(255,160,160,.98);
}

/* =========================================================
   CARD / PANELS
   ========================================================= */
.vms-card{
  position: fixed;
  left: 92px;
  top: 92px;
  width: 300px;
  border-radius: var(--r2);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  z-index: 25;
  backdrop-filter: blur(10px);
}

.vms-card__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.vms-card__title{
  font-weight: 700;
  font-size: 13px;
}

.vms-card__close{
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  cursor:pointer;
}

.vms-card__body{
  padding: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.76);
  line-height: 1.35;
}

.vms-card__actions{
  display:flex;
  gap: 10px;
  margin-top: 10px;
}

/* =========================================================
   MAP CANVAS
   ========================================================= */
.vms-canvas{
  grid-column: 2;
  grid-row: 2;
  position:relative;
  overflow:hidden;
  min-height: 0;
  z-index: 0; /* must stay under topbar */
}

/* Leaflet tile safety */
.leaflet-container img,
.leaflet-container .leaflet-tile {
  max-width: none !important;
  max-height: none !important;
}

/* Map stage fill */
.va-mapwrap,
.va-mapstage{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.va-mapstage #map,
.va-mapstage #va_map,
.va-mapstage .leaflet-container{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* HOME: hide flights list only */
body.home .livemap-flights,
body.home #live_flights,
body.home .livemap-table,
body.home .livemap-list,
body.home .flight-list,
body.home .table-responsive:has(#live_flights_table){
  display: none !important;
}

/* LIVE MAP: optional floating list */
body.vms-livemap .livemap-flights{
  position: absolute;
  left: 92px;
  right: 16px;
  bottom: 16px;
  max-height: 32vh;
  overflow-y: auto;
  z-index: 50;
  background: rgba(20,22,30,.78);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}
/* =========================================================
   SIDEBAR: optional expand-on-hover (user setting)
   - does NOT push page content
   - only shifts the site name in topbar to avoid overlap
   ========================================================= */

:root{
  --sidebar-collapsed: 74px;
  --sidebar-expanded: 220px;
  --sidebar-overlap: calc(var(--sidebar-expanded) - var(--sidebar-collapsed));
}

/* sidebar can overflow into the main area when expanded */
.vms-sidebar{
  width: var(--sidebar-collapsed);
  overflow: visible;
  z-index: 60;
  transition: width .16s ease;
}

/* enable expansion only when user enabled it */
body.vms-sidebarHoverEnabled .vms-sidebar.is-expandable:hover{
  width: var(--sidebar-expanded);
}

/* icon buttons become "rows" when expanded */
.vms-ico{
  display:flex;                 /* safe for both states */
  align-items:center;
  justify-content:center;       /* collapsed */
  gap: 10px;
}

/* labels hidden by default */
.vms-ico__label{
  display:none;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.86);
  white-space: nowrap;
}

/* expanded: show labels and make items full-width */
body.vms-sidebarHoverEnabled .vms-sidebar.is-expandable:hover .vms-ico{
  width: calc(100% - 8px);
  justify-content:flex-start;
  padding: 0 12px;
}

/* expanded: show text */
body.vms-sidebarHoverEnabled .vms-sidebar.is-expandable:hover .vms-ico__label{
  display:inline;
}

/* stop the logo jumping: keep its area fixed */
.vms-sideLogo{
  width: 100%;
}

/* =========================================================
   TOPBAR: only push the site name while sidebar is hovered
   ========================================================= */

.vms-siteName{
  transition: transform .16s ease;
  will-change: transform;
}

/* only shift the brand, not the entire topbar */
body.vms-sidebarHoverEnabled.vms-sidebarHovering .vms-siteName{
  transform: translateX(var(--sidebar-overlap));
}

/* =========================================================
   Dropdown toggle checkmark styling
   ========================================================= */
.vms-userCheck{
  width: 18px;
  display:inline-flex;
  justify-content:center;
  opacity: 0;                   /* JS toggles this */
  font-weight: 900;
}
