/* ===============================
   GLOBAL UI (shared components)
   Safe to load on all pages
   (No .card / No .ring / No .bubble)
================================ */

/* helpers */
.hidden{ display:none !important; }

/* ===== Topbar ===== */
.topbar{
  position: sticky;
  top: 0;
  /* Keep header ABOVE global backdrops so search UI stays sharp.
     (Backdrops should blur the app behind them, not the search box.) */
  z-index: 10020;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.brand{
  display:flex;
  gap: 12px;
  align-items:center;
}
.brand-logo{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 1000;
  letter-spacing: .5px;
  background: rgba(0,0,0,.10);
}
.brand-name{
  font-weight: 1000;
  font-size: 26px;
  line-height: 1.1;
  position: relative;
  display: inline-block;
}

.brand-logo-img{
  /* Uploaded company logo (Settings -> Company branding) */
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  border-radius: 12px;
  vertical-align: middle;
  margin-right: 10px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.26));
}

/* Crown mark above the "E" in Empire OS */
.brand-crown{
  position: absolute;
  /* Centered above the "E" (slightly to the right), with tighter vertical spacing */
  left: 0.58em;
  top: -0.82em;
  font-size: 0.78em;
  line-height: 1;
  opacity: .95;
  pointer-events: none;
}
.brand-sub{
  font-size: 12px;
  opacity: .65;
  font-weight: 800;
  margin-top: 2px;
}

.top-search{
  display:flex;
  align-items:center;
  gap: 10px;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 10px 12px;
}
.top-search-input{
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-weight: 800;
}
.top-search-icon{
  opacity: .6;
  font-weight: 900;
}

.topbar-right{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  align-items:center;
  position: relative;
  z-index: 60;
}

/* icon buttons */
.icon-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.65);
  cursor:pointer;
  position: relative;
  font-weight: 900;
}
.icon-btn:hover{ filter: brightness(.98); }

/* Dark mode: icon buttons should match the left nav glass buttons */
body[data-mode="dark"] .icon-btn{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: inherit;
}

/* ===== Data source badges (DEMO / REAL / LOCAL) ===== */
.ts-ds-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .35px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.04);
  color: rgba(0,0,0,.72);
  user-select: none;
}
.ts-ds-badge.ts-ds-demo{
  background: rgba(255, 193, 7, .16);
  border-color: rgba(255, 193, 7, .30);
}
.ts-ds-badge.ts-ds-real{
  background: rgba(25, 135, 84, .14);
  border-color: rgba(25, 135, 84, .28);
}
.ts-ds-badge.ts-ds-local{
  background: rgba(13, 110, 253, .10);
  border-color: rgba(13, 110, 253, .22);
}

body[data-mode="dark"] .ts-ds-badge{
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
}
body[data-mode="dark"] .ts-ds-badge.ts-ds-demo{ background: rgba(255, 193, 7, .18); }
body[data-mode="dark"] .ts-ds-badge.ts-ds-real{ background: rgba(25, 135, 84, .18); }
body[data-mode="dark"] .ts-ds-badge.ts-ds-local{ background: rgba(13, 110, 253, .14); }
body[data-mode="dark"] .icon-btn:hover{
  background: rgba(255,255,255,.10);
}

/* When we inject provenance badges into titles, keep layout tidy */
.ts-title-with-ds{
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

.badge{
  position:absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 1000;
  background: rgba(255, 64, 129, .95);
  color: #fff;
  padding: 0 6px;
  pointer-events: none;
  z-index: 2;
}

/* user pill */
.user-pill{
  display:flex;
  gap: 10px;
  align-items:center;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.65);
  padding: 8px 10px;
  cursor:pointer;
}
.user-avatar{
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 1000;
  background: rgba(0,0,0,.10);
}
.user-meta{
  display:flex;
  flex-direction:column;
  line-height: 1.1;
}
.user-name{ font-weight: 1000; font-size: 13px; }
.user-role{ font-weight: 900; font-size: 12px; opacity: .65; }
.chev{ opacity:.7; font-weight: 1000; }

/* dropdown menu */
.dropdown{
  position:absolute;
  right: 0;
  top: 54px;
  width: 220px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(20,25,35,.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 55px rgba(0,0,0,.30);
  color: rgba(255,255,255,.92);
}
.drop-item{
  width: 100%;
  text-align:left;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 900;
  color: inherit;
}
.drop-item:hover{ background: rgba(255,255,255,.10); }
.drop-item.is-active{
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.12);
}
.drop-item.danger{ color: rgba(255,120,120,.95); }

/* ===== Data source badge (Demo/Local/Real) ===== */
.ds-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  opacity: .92;
  user-select: none;
  white-space: nowrap;
}
body[data-mode="light"] .ds-badge{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.04);
}
.ds-badge--demo{
  border-color: rgba(59,130,246,.38);
  background: rgba(59,130,246,.16);
}
.ds-badge--real{
  border-color: rgba(16,185,129,.38);
  background: rgba(16,185,129,.14);
}
.ds-badge--local{
  border-color: rgba(148,163,184,.38);
  background: rgba(148,163,184,.12);
}

/* Step 7 — Data source badges removed.
   If any layout still includes containers for badges, hide them when empty. */
.widget-badge:empty,
.meta-legend:empty,
.fb-badges:empty,
.kpi-badge:empty{
  display: none !important;
}
.drop-sep{
  height: 1px;
  background: rgba(255,255,255,.12);
  margin: 8px 0;
}

.drop-group{
  padding: 4px 8px 6px;
  font-weight: 1000;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
}

/* Light theme dropdown matches Notifications style */
body[data-mode="light"] .dropdown{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.85);
  color: rgba(20,25,35,.92);
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}
body[data-mode="light"] .drop-item:hover{ background: rgba(0,0,0,.06); }
body[data-mode="light"] .drop-sep{ background: rgba(0,0,0,.08); }
body[data-mode="light"] .drop-item.danger{ color: #7a0a0a; }

/* ===== Toasts ===== */
.toast-host{
  position: fixed;
  right: 18px;
  bottom: 15px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  /* Must sit above any right drawers / modals */
  z-index: 65000;
}
.toast{
  width: 320px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(20, 20, 20, 0.072);
  color: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  
}
.toast-title{ font-weight: 1000; margin: 0 0 3px; }
.toast-sub{ opacity:.75; font-weight: 700; font-size: 12px; }

@media (max-width: 980px){
  .topbar{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .topbar-center{ order: 3; }
  .topbar-right{ justify-content: space-between; }
}

/* Bootstrap Icons sizing */
.icon-btn .bi{ font-size: 18px; }
.top-search-icon .bi{ font-size: 16px; opacity: .85; }
.chev .bi{ font-size: 14px; opacity: .75; }
.dropdown .bi{ margin-right: 8px; }


/* Compact mode */
body.compact .card{ padding: 14px !important; }
body.compact .btn{ padding: 8px 12px !important; }
body.compact .input{ padding: 8px 10px !important; }


/* ===============================
   TEAM OVERVIEW (Supervisor widget)
   Fix layout: align header + rows into a responsive grid
   =============================== */

/* ===============================
   Team Overview – filters
   =============================== */
.team-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 14px;
}

.team-search{
  flex: 1 1 260px;
  min-width: 220px;
}

.team-select{
  flex: 0 0 220px;
  min-width: 180px;
}

#team-clear{
  flex: 0 0 auto;
}

/* On small screens stack with spacing */
@media (max-width: 520px){
  .team-filters{
    gap: 10px;
  }
  .team-select{
    flex: 1 1 220px;
  }
}

.team-table{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-head,

.team-item{
  display: block;
  margin-bottom: 10px;
}

.team-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 8px 10px 12px;
}

.team-actions .btn.tiny{
  min-height: 30px;
}

.team-row{
  display: grid;
  grid-template-columns: 1.6fr .9fr 1fr 1fr .7fr .9fr 1fr;
  gap: 12px;
  align-items: start;
}

.team-head{
  display: grid;
  grid-template-columns: 1.6fr .9fr 1fr 1fr .7fr .9fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  opacity: .75;
}

.team-row{
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

body[data-mode="light"] .team-row{
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0,0,0,.06);
}

.team-col{ min-width: 0; }
.team-col .hint{ font-size: 11px; opacity: .75; }

.team-col.status{ display:flex; justify-content:center; align-items:center; }
.team-col.name .n{ font-weight: 900; }
.team-col.name .s{ margin-top: 3px; }


@media (max-width: 860px){
  .team-head{ display:none; 
  .team-actions{ justify-content: flex-start; padding: 0 8px 12px; }
}
  .team-row{
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .team-col.name{ grid-column: 1 / -1; }
  }

/* ===============================
   STEP 1 — Widget Foundation
   Structure only (no behavior)
================================ */
.ts-widget{
  position: relative;
}

/* Hidden by default; enabled via role selectors below */
.ts-widget-edit{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: default;
  z-index: 5;
}

/* Dark mode: make widget edit icon match the nav/icon glass style */
body[data-mode="dark"] .ts-widget-edit{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}

/* Dark mode: widget edit icon should blend with nav buttons */
body[data-mode="dark"] .ts-widget-edit{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}

.ts-widget-edit i{
  font-size: 14px;
  line-height: 1;
}

/* Visible only for Admin, ACM, HR */
body[data-role="admin"] .ts-widget-edit,
body[data-role="acm"] .ts-widget-edit,
body[data-role="hr"] .ts-widget-edit{
  display: flex;
}

/* =============================
   Left Sidebar (icons-only, text on hover)
   ============================= */
.app-shell{
  display: flex;
  min-height: calc(100vh - var(--header-h, 72px));
}
.app-page{
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.side-nav{
  /* Keep sidebar always clickable above page overlays/modals */
  z-index: 8000;

  width: 64px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center; /* center the nav dock vertically */

  /* Keep nav visible while scrolling */
  position: sticky;
  top: var(--header-h, 72px);
  height: calc(100vh - var(--header-h, 72px));
  align-self: flex-start;
}

/* Group wrappers (top / bottom / overflow) */
.side-nav-group{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Bootstrap-like collapse (minimal) */
.collapse{ display: none; }
.collapse.show{ display: flex; }

.side-nav-overflow{
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.side-nav-overflow.show::before{
  content: "";
  width: 34px;
  height: 1px;
  background: rgba(255,255,255,.14);
  margin-bottom: 6px;
}

.side-link{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  color: inherit;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  transition: background .14s ease, border-color .14s ease;
}

.side-link i,
.side-link img{
  font-size: 18px;
  transition: transform .14s ease;
  transform-origin: center;
}

/* Custom app logos */
.gads-icon{
  width: 26px;
  height: 26px;
  display: block;
}

/* Evri SVG (sidebar) */
.evri-nav-icon{
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}


/* Brand badge wrapper (for FontAwesome brand icons) */
.brand-badge{
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.brand-badge i{ font-size: 18px; line-height: 1; }

.brand-badge.brand-lg{
  width: 36px;
  height: 36px;
  border-radius: 14px;
}
.brand-badge.brand-lg i{ font-size: 22px; }

/* Wix: make it feel premium (no black tile images) */
.brand-wix{
  /* Keep Wix logo outside any boxed background (no filled tile).
     We keep the wrapper sizing for alignment, but remove the box feel.
  */
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--accent-cyan);
}
body[data-mode="light"] .brand-wix{
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--accent);
}

/* Add a premium glow without a filled background box */
.brand-wix i{
  filter: drop-shadow(0 10px 22px rgba(46,230,255,.22));
}
body[data-mode="light"] .brand-wix i{
  filter: drop-shadow(0 10px 22px rgba(14,165,233,.18));
}

/* Make brand badges grow on nav hover like icons */
.side-link:hover .brand-badge{ transform: scale(1.18); }

/* Monochrome app icons (match Royal Mail style: black in light, white in dark) */
img.mono-app-icon{ filter: invert(0); }
body[data-mode="dark"] img.mono-app-icon{ filter: invert(1) brightness(1.2); }
body[data-mode="light"] img.mono-app-icon{ filter: invert(0); }

i.mono-app-icon, svg.mono-app-icon{ filter: none; color: currentColor; }
body[data-mode="dark"] i.mono-app-icon,
body[data-mode="dark"] svg.mono-app-icon{ filter: none; color: currentColor; }


/* Meta icon (Font Awesome) — keep identical everywhere */
.meta-fa-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height: 1;
  font-size: 22px;
}
.meta-fa-sm{ font-size: 16px; }
.meta-fa-lg{ font-size: 24px; }


.gmail-icon{ width: 26px; height: 26px; display:block; }
.gm-icon{ width: 34px; height: 34px; display:block; }
/* Mac-dock-ish hover grow (keeps the button in the same place) */
.side-link:hover i,
.side-link:hover img{
  transform: scale(1.22);
}

/* Overflow toggle behaviour (More drawer) */
.side-more:hover i{ transform: scale(1.12); }
.side-more.is-open i{ transform: scale(1.12); }
.side-more.is-open:hover i{ transform: scale(1.12); }

/* ===== Nav edit mode (drag & drop) ===== */
#side-nav.nav-editing .side-link{
  cursor: grab;
  /* subtle wiggle */
  animation: navWiggle .55s ease-in-out infinite;
}
#side-nav.nav-editing .side-link:active{ cursor: grabbing; }

/* Don't wiggle the edit toggle, overflow arrow, or logout */
#side-nav.nav-editing #nav-edit-toggle,
#side-nav.nav-editing #nav-widget-add,
#side-nav.nav-editing #side-nav-more-toggle,
#side-nav.nav-editing #logout-btn{
  animation: none;
  cursor: pointer;
}

#side-nav.nav-editing #nav-edit-toggle{
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.14);
}

#side-nav.nav-editing .side-link.dragging{
  opacity: .45;
}

/* Pointer-DnD helpers */
#side-nav.nav-editing .nav-placeholder{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}

.nav-ghost{
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: .94;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}

#side-nav.nav-editing .side-link.nav-drop-target{
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.16);
}

@keyframes navWiggle{
  0%{ transform: rotate(-0.45deg) translateY(0); }
  50%{ transform: rotate(0.45deg) translateY(-1px); }
  100%{ transform: rotate(-0.45deg) translateY(0); }
}

/* Remove (X) control for nav items — only in edit mode */
.nav-remove-btn{
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.nav-remove-btn i{ font-size: 10px; line-height: 1; }
#side-nav.nav-editing .nav-remove-btn{ display: inline-flex; }

/* Active page dot indicator (left) */
.side-link::before{
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.side-link.is-active::before{
  background: currentColor;
  opacity: .9;
  box-shadow: 0 0 0 3px rgba(255,255,255,.10);
}

.side-link:hover{
  background: rgba(255,255,255,.10);
}

.side-link.is-active{
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
}

/* Hover label (no layout expand) */
.side-link::after{
  content: attr(data-label);
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(30,30,35,.55);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,.92);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}


.side-link:hover::after{ opacity: 1; }

.side-badge{
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,0,120,.85);
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
}

/* Same badge styling, but positioned correctly for header tool buttons */
.tool-badge{
  right: 6px;
  top: 6px;
  border: 2px solid rgba(255,255,255,.70);
}
body[data-mode="light"] .tool-badge{
  border: 2px solid rgba(0,0,0,.10);
}

/* spacer removed (logout is part of the centered dock) */
.side-spacer{ display:none; }

/* Light mode compatibility */
body[data-mode="light"] .side-link{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.55);
}
body[data-mode="light"] .side-link::after{
  background: rgba(255,255,255,.85);
  color: rgba(0,0,0,.85);
  border: 1px solid rgba(0,0,0,.10);
}

/* ===== Home: pinned widget slot (inside left column) ===== */
.home-top-fixed{
  display:block;
  margin: 0 0 18px;
}

.home-top-fixed .ts-widget-fixed{
  width: 100%;
  max-width: none;
}



/* ===============================
   Header hover tools (Search / Messages / Notifications / Profile)
   - matches circular iOS-like controls
   - hover reveals popovers; only one open is enforced by JS
================================ */
.sr-only{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.header-tools{
  display:flex;
  align-items:center;
  gap:14px;
}

.tool{
  position:relative;
  display:flex;
  align-items:center;
}

/* Route loading indicator (small spinner in header) */
.nav-loading-btn{
  cursor: default;
}
.nav-spinner{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: rgba(77,163,255,1);
  animation: tsSpin .9s linear infinite;
  box-shadow: 0 0 14px rgba(77,163,255,.18);
}

/* Full-page route loading overlay (more visible than header spinner) */
.route-loading-overlay{
  position: fixed;
  /* Cover only the content area (keep header + sidebar visible) */
  top: var(--appHeaderH, var(--header-h, 72px));
  left: 64px; /* .side-nav width */
  right: 0;
  bottom: 0;
  /* Keep below the sidebar (z-index 8000) so nav stays clickable */
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,23,.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* While loading, hide only the page content (not the shell) so users see an empty page area */
html.route-loading .app-page{
  opacity: 0;
  pointer-events: none;
}
html .app-page{
  transition: opacity .12s ease;
}
.route-loading-card{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  color: var(--text, #fff);
}
.route-loading-text{
  font-size: 14px;
  opacity: .9;
}
body[data-mode="light"] .route-loading-overlay{
  background: rgba(248,250,252,.55);
}
body[data-mode="light"] .route-loading-card{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.65);
  color: rgba(0,0,0,.80);
  box-shadow: 0 24px 80px rgba(0,0,0,.12);
}
body[data-mode="light"] .nav-spinner{
  border-color: rgba(15,23,42,.14);
  border-top-color: rgba(37,99,235,1);
  box-shadow: 0 0 14px rgba(37,99,235,.12);
}

.tool-btn{
  width:46px;
  height:46px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--text, #fff);
  cursor:pointer;
  position:relative;
}

/* Keep header tool icons visually closer to the left-nav icon size */
.tool-btn i{
  font-size:20px;
}

body[data-mode="light"] .tool-btn{
  border:1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.55);
  color: rgba(0,0,0,.75);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
}

.tool-btn .badge{
  position:absolute;
  top:6px;
  right:6px;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  background: #ff4d6d;
  color:#fff;
  border:2px solid rgba(255,255,255,.75);
}

.tool-btn .user-avatar{
  width:32px;
  height:32px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  background: rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.22);
}

body[data-mode="light"] .tool-btn .user-avatar{
  background: rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.08);
}

/* Global search backdrop (used when search is opened) */
.global-search-backdrop{
  position: fixed;
  inset: 0;
  /* Must sit above all app modals (ts-modal is 30000) so search works everywhere */
  z-index: 40010;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
  background: rgba(10,12,18,.20);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body[data-mode="light"] .global-search-backdrop{
  background: rgba(255,255,255,.24);
}
.global-search-backdrop.show{
  display:block;
  opacity:1;
  pointer-events: auto;
}

/* Global search modal */
.global-search-modal{
  position: fixed;
  /* Above backdrop + any other overlays */
  z-index: 40040;
  top: 86px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  border-radius: 16px;
  padding: 12px;
  display: none;
  box-shadow: 0 18px 60px rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(18, 22, 34, 0.081);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body[data-mode="light"] .global-search-modal{
  background: rgba(255, 255, 255, 0.048);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}
.global-search-modal.show{ display:block; }

.global-search-modal .gsm-top{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
body[data-mode="light"] .global-search-modal .gsm-top{
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.08);
}

.global-search-modal .gsm-filters{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 0 2px;
}
.global-search-modal .gsm-chip{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
body[data-mode="light"] .global-search-modal .gsm-chip{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.04);
}
.global-search-modal .gsm-chip:hover{
  background: rgba(255,255,255,.12);
}
body[data-mode="light"] .global-search-modal .gsm-chip:hover{
  background: rgba(0,0,0,.06);
}
.global-search-modal .gsm-chip.is-active{
  border-color: rgba(120,180,255,.40);
  background: rgba(120,180,255,.18);
}
body[data-mode="light"] .global-search-modal .gsm-chip.is-active{
  background: rgba(80,140,255,.14);
}

.global-search-modal .gsm-input{
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
}
.global-search-modal .gsm-close{
  border: 0;
  background: rgba(255,255,255,.08);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
body[data-mode="light"] .global-search-modal .gsm-close{
  background: rgba(0,0,0,.06);
}
.global-search-modal .gsm-results{
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
}
.gsm-item{
  display:flex;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  border: #fff;
  margin: 5px;
}
.gsm-item:hover{ background: rgba(255,255,255,.06); }
body[data-mode="light"] .gsm-item:hover{ background: rgba(0,0,0,.04); }
.gsm-item.is-active{ background: rgba(255, 255, 255, 0.641); }
body[data-mode="light"] .gsm-item.is-active{ background: rgba(0,0,0,.06); }
.gsm-item:focus-visible{ outline: 2px solid rgba(120,180,255,.35); outline-offset: 2px; }
.gsm-hl{ background: rgba(120,180,255,.25); color: inherit; padding: 0 2px; border-radius: 6px; }
body[data-mode="light"] .gsm-hl{ background: rgba(80,140,255,.20); }
.gsm-item .gsm-meta{ opacity: .72; font-size: 12px; }
.gsm-empty{
  padding: 14px 10px;
  opacity: .72;
  font-size: 13px;
}
.global-search-modal .gsm-footer{
  margin-top: 8px;
  padding: 0 4px;
  font-size: 12px;
  opacity: .6;
}

/* Legacy popover shouldn't show (modal is the working UI) */
.tool-search.open .tool-pop-search{ display:none !important; }

/* Search popover */
.tool-pop{
  position:absolute;
  right:0;
  top:50%;
  transform: translateY(-50%);
  display:none;
  z-index:80;
}

.tool-pop-search{
  right:0;
}

/* When search is open, render as centered modal above all pages */
.tool-search.open .tool-pop{
  position: fixed;
  top: 86px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: block;
  /* Must be above the backdrop. */
  z-index: 10030;
}


.tool-search-input{
  width: min(560px, calc(100vw - 56px));
  height:56px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  color: var(--text, #fff);
  padding: 0 16px 0 16px;
  outline:none;
}

body[data-mode="light"] .tool-search-input{
  border:1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.75);
  color: rgba(0,0,0,.75);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
}

.tool-search-input::placeholder{
  opacity:.75;
}

/* Dropdown aligned under profile
   NOTE: user dropdown is re-homed to <body> in JS so backdrop-filter works reliably on Safari.
   Keep selector for both states (inside #tool-user for legacy, and #user-dropdown once moved).
*/
#tool-user .dropdown,
#user-dropdown{
  /* Position is set by JS (fixed + anchored under the pill).
     Fallback keeps it working even if JS doesn't run. */
  position: fixed;
  z-index: 10040;
  /* Fallback anchor (JS will compute exact left/top). */
  right: 18px;
  top: calc(var(--header-h, 72px) + 6px);
  min-width: 260px;

  /* match Notifications glass */
  background: rgba(20, 20, 28, .34);
  border-color: rgba(255,255,255,.14);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);

  /* Safari sometimes drops backdrop-filter unless this element is composited */
  transform: translateZ(0);
  will-change: transform, backdrop-filter;
}

/* Invisible hover bridge so you can move from icon to menu without it hiding */
#tool-user .dropdown::before,
#user-dropdown::before{
  content:"";
  position:absolute;
  top:-12px;
  left:0;
  right:0;
  height:12px;
  background: transparent;
}

body[data-mode="light"] #tool-user .dropdown,
body[data-mode="light"] #user-dropdown{
  background: rgba(255,255,255,.64);
  border-color: rgba(0,0,0,.10);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

/* When JS sets open state */
.tool.open .tool-pop{ display:block; }


/* ===== Shopify-like Sale toast (global) ===== */
.ts-toast-host{
  position: fixed;
  top: 72px;
  right: 18px;
  /* Must sit above any app drawers / modals (ts-modal ~30000, global search ~40040) */
  z-index: 65000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.ts-toast{
  min-width: 280px;
  max-width: 360px;
  background: rgba(18, 18, 20, 0.207);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.22);
  transform: translateY(-6px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
 backdrop-filter: blur(6px);
}

.ts-toast.show{ opacity: 1; transform: translateY(0); }
.ts-toast.hide{ opacity: 0; transform: translateY(-6px); }

.ts-toast-row{
  display: grid;
  grid-template-columns: 34px 1fr 22px;
  gap: 10px;
  align-items: center;
}

.ts-toast-icon{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(38, 36, 36, 0.1);
  font-size: 18px;
  backdrop-filter: blur(6px);
}

.ts-toast-title{
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 2px;
}

.ts-toast-sub{
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.25;
}

.ts-toast-actions{
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.ts-toast-action{
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ts-toast-action:hover{
  background: rgba(255,255,255,0.18);
}

.ts-toast-x{
  opacity: 0.65;
  cursor: pointer;
  user-select: none;
  text-align: center;
  font-size: 14px;
}
.ts-toast-x:hover{ opacity: 1; }

/* =========================
   Multi-store switcher
   (used on Shopify pages + Home owner overview)
========================= */
.store-switch{ width:100%; margin-bottom: 10px; }
.store-switch-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.store-switch-label{ display:flex; align-items:center; gap:8px; font-weight:700; opacity:.9; }

/* Static (when only 1 store) */
.store-switch-static{ justify-content:flex-start; gap:14px; }
.store-switch-chip{
  padding: 6px 12px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  font-weight: 800;
}

/* Custom dropdown (native <select> menu can't be styled cross-browser) */
.store-dropdown{ position:relative; }
.store-dropdown-btn{
  min-width: 240px;
  height: 34px;
  padding: 0 14px;
  border-radius: 30px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
}
.store-dropdown-btn:hover{
  border-color: rgba(255,255,255,.22);
  background: color-mix(in srgb, var(--input-bg) 70%, white 6%);
}
.store-dropdown-btn:focus{ outline:none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 70%, transparent 30%); }
.store-dropdown-text{ font-weight: 800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.store-dropdown-menu{
  position:absolute;
  right:0;
  top: calc(100% + 8px);
  min-width: 260px;
  max-width: 360px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10, 14, 22, .86);
  backdrop-filter: blur(10px);
  box-shadow: var(--card-shadow-soft);
  display:none;
  z-index: 60;
}

/* =====================================================
   Cursor policy (FINAL)
   Goal: never show "pointer everywhere".
   - Default cursor for all layout/content
   - Pointer ONLY on interactive controls
   Notes:
   - This file is loaded AFTER core.css, so these rules win.
   - We use !important to override page-specific styles.
===================================================== */

/* Default everywhere */
.app-wrapper *,
.ts-modal *{
  cursor: default !important;
}

/* Text caret where appropriate */
.app-wrapper input:not([type="button"]):not([type="submit"]):not([type="reset"]),
.app-wrapper textarea,
.ts-modal input:not([type="button"]):not([type="submit"]):not([type="reset"]),
.ts-modal textarea{
  cursor: text !important;
}

/* Pointer only on true interactive controls */
.app-wrapper button,
.app-wrapper a[href],
.app-wrapper [role="button"],
.app-wrapper input[type="button"],
.app-wrapper input[type="submit"],
.app-wrapper input[type="reset"],
.ts-modal button,
.ts-modal a[href],
.ts-modal [role="button"],
.ts-modal input[type="button"],
.ts-modal input[type="submit"],
.ts-modal input[type="reset"]{
  cursor: pointer !important;
}

/* Disabled */
.app-wrapper button:disabled,
.app-wrapper input[type="button"]:disabled,
.app-wrapper input[type="submit"]:disabled,
.app-wrapper input[type="reset"]:disabled,
.app-wrapper [aria-disabled="true"],
.ts-modal button:disabled,
.ts-modal input[type="button"]:disabled,
.ts-modal input[type="submit"]:disabled,
.ts-modal input[type="reset"]:disabled,
.ts-modal [aria-disabled="true"]{
  cursor: not-allowed !important;
}
body[data-mode="light"] .store-dropdown-menu{
  background: rgba(255,255,255,.82);
  border-color: rgba(15,23,42,0.12);
}
.store-dropdown.open .store-dropdown-menu{ display:block; }

.store-dd-item{
  width:100%;
  border:none;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight: 700;
}
.store-dd-item:hover{ background: rgba(255,255,255,.08); }
body[data-mode="light"] .store-dd-item:hover{ background: rgba(15,23,42,0.06); }
.store-dd-item.active{
  background: rgba(37,99,235,.22);
  border: 1px solid rgba(37,99,235,.35);
}
.store-dd-item.active i{ opacity:.95; }

@media (max-width: 520px){
  .store-switch-inner{ flex-direction:column; align-items:stretch; }
  .store-dropdown-btn{ min-width: 0; width:100%; }
  .store-dropdown-menu{ left:0; right:0; min-width: 0; }
}


/* ===== Step 32: Live Visitors Map (2D) ===== */
.livevis-map{
  position: relative;
  width: 100%;
  height: 260px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,.22);
}
.livevis-map .bg{
  position:absolute;
  inset:0;
  /* Fallback-friendly: keep the map nice even if the optional globe image is missing */
  background-image:
    radial-gradient(900px 260px at 50% 20%, rgba(46,230,255,.12), transparent 60%),
    radial-gradient(700px 250px at 75% 65%, rgba(124,77,255,.10), transparent 62%),
    url("../images/black_globe.jpg");
  background-size: cover;
  background-position: center;
  filter: saturate(1.05) contrast(1.1);
  opacity: .92;
}
.livevis-map .overlay{
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 260px at 50% 20%, rgba(46,230,255,.10), transparent 60%),
    radial-gradient(700px 250px at 75% 65%, rgba(124,77,255,.08), transparent 62%);
  pointer-events:none;
}
.livevis-map .dots{ position:absolute; inset:0; }
.livevis-dot{
  position:absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translate(-50%,-50%);
  background: rgba(46,230,255,.85);
  box-shadow:
    0 0 12px rgba(46,230,255,.45),
    0 0 22px rgba(46,230,255,.20);
  border: 1px solid rgba(255,255,255,.18);
}
.livevis-dot[data-scale="2"]{ width: 14px; height: 14px; }
.livevis-dot[data-scale="3"]{ width: 18px; height: 18px; }
.livevis-dot[data-scale="4"]{ width: 22px; height: 22px; }
.livevis-dot::after{
  content:"";
  position:absolute;
  inset:-16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(46,230,255,.20), transparent 60%);
  opacity: .9;
}
body.lowgfx .livevis-dot::after{ display:none; }

.livevis-map .legend{
  position:absolute;
  left:12px;
  top:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.30);
  backdrop-filter: blur(var(--blur-card));
}
body.lowgfx .livevis-map .legend{ backdrop-filter:none; }
.livevis-map .legend .t{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
}
.livevis-map .legend .s{
  font-size: 11px;
  opacity: .8;
}

/* ===== Step 32: Ads breakdown cards ===== */
.ads-mini-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px){
  .ads-mini-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .ads-mini-grid{ grid-template-columns: 1fr; }
}
.ads-mini{
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,.05);
  padding: 12px;
  position:relative;
  overflow:hidden;
}
.ads-mini::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:.35;
  background: radial-gradient(500px 120px at 20% 0%, var(--a1), transparent 60%);
  pointer-events:none;
}
.ads-mini .head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.ads-mini .brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
}
.ads-mini .mark{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
}
.ads-mini .mark img{ width: 18px; height: 18px; object-fit: contain; display:block; }
.ads-mini .kpi{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.ads-mini .kpi .k{ font-size: 11px; opacity:.75; }
.ads-mini .kpi .v{ font-size: 15px; font-weight: 900; }
.ads-mini canvas{
  width: 100%;
  height: 46px;
  display:block;
  margin-top: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.08);
}

/* ===== Theme safety overrides (Step 8) ===== */
body[data-mode="dark"] .topbar{
  background: rgba(20,25,35,.55);
  border-bottom: 1px solid rgba(255,255,255,.10);
  color: var(--text);
}
body[data-mode="dark"] .top-search{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}
body[data-mode="dark"] .top-search-input{ color: var(--text); }
body[data-mode="dark"] .brand-logo{ background: rgba(255,255,255,.10); }
body[data-mode="dark"] .user-pill{
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
body[data-mode="dark"] .user-avatar{ background: rgba(255,255,255,.10); }

/* Light mode dropdown selector fix (legacy .light -> data-mode) already handled above */


/* ===== Post Step 8 small fixes ===== */
body[data-mode="light"] .topbar{
  /* Make light-mode header properly glassy/blurry (match dark-mode feel) */
  background: rgba(255,255,255,.52);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

/* Remove visible borders on primary gradient buttons (demo polish) */
.btn.primary{ border: 0px !important; }

/* ===== AI Agents hard gating =====
   If the AI Agents app is not installed+activated, hide all AI-only UI elements. */
body.aiagents-disabled .aiagents-only{ display: none !important; }

/* =========================
   Step 22: Location picker (header)
========================= */
.tool-location-btn{
  width:auto;
  padding:0 14px;
  gap:10px;
}
.tool-location-btn .loc-label{
  font-size:13px;
  font-weight:800;
  max-width: 180px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-location-btn .loc-chevron{
  font-size:14px;
  opacity:.85;
}
@media (max-width: 980px){
  .tool-location-btn .loc-label{ max-width: 120px; }
}

/* Drawer content styles for Manage Locations */
.ts-loc-list{ display:flex; flex-direction:column; gap:10px; }
.ts-loc-row{ padding:10px 12px; border-radius:14px; border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); }
body[data-mode="light"] .ts-loc-row{ border:1px solid rgba(0,0,0,.08); background: rgba(255,255,255,.65); }
.ts-loc-row.is-arch{ opacity:.6; }
.ts-loc-top{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ts-loc-name{ font-weight:900; }
.ts-loc-meta{ font-size:12px; opacity:.75; margin-top:2px; }
.ts-loc-actions{ display:flex; align-items:center; gap:8px; }
.ts-section-title{ font-weight:900; margin: 8px 0; }
.ts-form-row{ margin: 10px 0; }
.ts-hint{ font-size:12px; opacity:.75; margin-top: 8px; }


/* HOTFIX4_TOAST: enforce readable toast text in all themes */
body .ts-toast-title, body .ts-toast-sub{ color:#fff !important; }
body .ts-toast, body .ts-toast *{ color:#fff !important; -webkit-text-fill-color: #fff !important; }

/* When we inject provenance badges into KPI labels, keep layout tidy */
.ts-metric-with-ds{
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

/* REAL mode warning near page head when integration isn't connected */
.ts-real-warning{
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255, 193, 7, .20);
  color: rgba(0,0,0,.75);
}
body[data-mode="dark"] .ts-real-warning{
  border-color: rgba(255,255,255,.14);
  background: rgba(255, 193, 7, .18);
  color: rgba(255,255,255,.82);
}

/* REAL-mode data guard overlay (prevents DEMO/LOCAL metrics looking like REAL) */
.ts-real-guard-overlay{
  position:absolute;
  inset:0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px;
  border-radius: inherit;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(6px);
}
body[data-mode="dark"] .ts-real-guard-overlay{
  background: rgba(0,0,0,.55);
}
.ts-real-guard-overlay__inner{
  max-width: 520px;
  width: 100%;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.70);
}
body[data-mode="dark"] .ts-real-guard-overlay__inner{
  border-color: rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
}
.ts-real-guard-overlay__title{
  font-weight: 1000;
  letter-spacing: -.2px;
}
.ts-real-guard-overlay__sub{
  margin-top: 4px;
  font-size: 12px;
  opacity: .85;
  line-height: 1.35;
}
.ts-real-guard-overlay__link{
  display:inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.06);
  color: rgba(0,0,0,.80);
}
body[data-mode="dark"] .ts-real-guard-overlay__link{
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.88);
}

/* Step 6: reusable CTA link */
.ts-cta-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: inherit;
}
.ts-cta-link:hover{
  background: rgba(255,255,255,0.16);
}

.ts-real-warning--local{
  opacity: 0.75;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
}
