:root {
  --ink: #07152f;
  --muted: #4b5b78;
  --soft: #eef7f6;
  --line: #dfe7f1;
  --panel: #ffffff;
  --canvas: #ffffff;
  --teal: #05a9a3;
  --teal-dark: #008b86;
  --mint: #28c79a;
  --blue: #4b7df7;
  --violet: #9b5cf6;
  --amber: #f7b731;
  --orange: #ff8a3d;
  --red: #ff4757;
  --gray: #c9d1dc;
  --sidebar: 176px;
  --topbar: 68px;
  --radius: 10px;
  --shadow: 0 14px 44px rgba(18, 34, 64, 0.07);
  --shadow-soft: 0 6px 20px rgba(18, 34, 64, 0.045);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  overflow-x: hidden;
}

button, input {
  font: inherit;
}

button { cursor: pointer; }
.hidden { display: none !important; }
a { color: var(--teal-dark); text-decoration: none; font-weight: 700; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #cbd8e7; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #dff9f5, #edf6ff);
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(180deg, #12c8b7, #017d7a);
}

.brand-mark::before {
  width: 13px;
  height: 24px;
  left: 10px;
  top: 7px;
  transform: rotate(-28deg);
}

.brand-mark::after {
  width: 13px;
  height: 24px;
  right: 8px;
  top: 7px;
  transform: rotate(28deg);
  opacity: 0.92;
}

.brand-mark span {
  width: 8px;
  height: 18px;
  top: 11px;
  left: 14px;
  background: #e9fffd;
  opacity: 0.86;
}

.brand-mark.large {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
}

.brand-mark.large::before,
.brand-mark.large::after {
  width: 23px;
  height: 42px;
  top: 10px;
}

.brand-mark.large::before { left: 17px; }
.brand-mark.large::after { right: 16px; }
.brand-mark.large span { width: 14px; height: 34px; top: 15px; left: 25px; }

.login-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  background:
    radial-gradient(circle at 78% 14%, rgba(5, 169, 163, 0.14), transparent 28%),
    linear-gradient(90deg, #fff 0%, #fff 52%, #edf7f5 52%, #edf7f5 100%);
}

.auth-rail {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(22px);
}

.auth-rail-logo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 80px;
  border-bottom: 1px solid var(--line);
}

.auth-rail-icons {
  display: grid;
  gap: 22px;
  padding: 28px 0;
}

.auth-rail-icons i,
.auth-rail-action {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink);
  font-size: 20px;
}

.auth-rail-icons i:last-child {
  background: #e9f8f6;
  color: var(--teal-dark);
}

.auth-rail-action {
  margin-bottom: 20px;
}

.auth-rail-action:hover {
  background: #e9f8f6;
  color: var(--teal-dark);
}

.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(500px, 50%) minmax(0, 50%);
}

.auth-panel {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(104px, 12vh, 132px) clamp(28px, 5vw, 70px) 32px;
  background: rgba(255, 255, 255, 0.94);
}

.auth-brand {
  position: absolute;
  top: clamp(34px, 5vw, 56px);
  left: clamp(34px, 5vw, 64px);
}

.auth-brand strong {
  display: block;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
}

.auth-brand span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.auth-brand span::after {
  content: "";
  width: 58px;
  height: 2px;
  border-radius: 99px;
  background: var(--teal);
}

.auth-card {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  min-width: 0;
}

.auth-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.auth-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 4.7vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.auth-copy p {
  margin: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.auth-eyebrow {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dcf1ee;
  border-radius: 999px;
  background: #f4fbfa;
  padding: 8px 12px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-eyebrow i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(5, 169, 163, 0.12);
}

.auth-form {
  min-width: 0;
  border: 1px solid rgba(223, 232, 241, 0.96);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  padding: 18px 20px 20px;
  box-shadow: 0 28px 80px rgba(9, 22, 48, 0.08);
  backdrop-filter: blur(22px);
}

.auth-form h2 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -0.04em;
}

.login-form { display: grid; gap: 16px; text-align: left; }
.login-form label span { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.login-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  outline: 0;
  background: #fff;
}

.login-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(5, 169, 163, 0.12);
}

.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-field button {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.login-error {
  color: #b42332;
  background: #fff1f3;
  border: 1px solid #ffd0d7;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.auth-actions .primary-action,
.auth-actions .ghost-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 800;
  white-space: nowrap;
}

.auth-actions .ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.login-note { font-size: 11px; color: #8a99ad !important; margin: 0 !important; }

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: #66748b;
  font-size: 12px;
  font-weight: 800;
}

.auth-points span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-points span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.auth-visual {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #edf7f5;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(237, 247, 245, 0.32), rgba(237, 247, 245, 0) 22%),
    radial-gradient(circle at 72% 82%, rgba(237, 247, 245, 0.28), transparent 24%);
  pointer-events: none;
}

.auth-visual img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.auth-visual-badge {
  position: absolute;
  z-index: 4;
  right: clamp(24px, 5vw, 70px);
  bottom: clamp(54px, 6vw, 86px);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(223, 231, 241, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  box-shadow: 0 20px 50px rgba(18, 34, 64, 0.1);
  backdrop-filter: blur(20px);
}

.auth-visual-badge i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e9f8f6;
  color: var(--teal-dark);
}

.auth-visual-badge strong,
.auth-visual-badge span {
  display: block;
  white-space: nowrap;
}

.auth-visual-badge strong {
  color: var(--ink);
  font-size: 13px;
}

.auth-visual-badge span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  background: var(--canvas);
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup strong { font-size: 22px; letter-spacing: -0.055em; font-weight: 800; }
.sidebar-close { display: none !important; }

.sidebar-nav,
.sidebar-bottom {
  display: grid;
  gap: 10px;
  padding: 36px 8px 8px;
}

.sidebar-nav { flex: 1; align-content: start; }
.sidebar-bottom { padding-bottom: 14px; }

.side-link {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.side-link span {
  white-space: nowrap;
}

.side-link i {
  width: 20px;
  font-size: 18px;
  color: #061633;
  text-align: center;
}

.side-link:hover,
.side-link.active {
  background: linear-gradient(90deg, rgba(5, 169, 163, 0.15), rgba(5, 169, 163, 0.06));
  color: var(--teal-dark);
  box-shadow: inset 3px 0 0 var(--teal);
}

.side-link:hover i,
.side-link.active i { color: var(--teal-dark); }
.collapse-link i { border: 1px solid var(--line); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-size: 11px; }
.collapse-link {
  justify-content: center !important;
  gap: 0 !important;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 0 !important;
}
.collapse-link span {
  display: none !important;
}
.collapse-link:hover,
.collapse-link.active {
  background: transparent;
  box-shadow: none;
}
.collapse-link:hover i {
  background: #e5fbf8;
  color: var(--teal-dark);
  border-color: rgba(5, 169, 163, 0.22);
}

.app-main {
  margin-left: var(--sidebar);
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 22px 0 31px;
}

.mobile-menu { display: none !important; }

.top-tabs {
  display: flex;
  height: 100%;
  gap: 33px;
  flex: 1;
  align-items: stretch;
  min-width: 0;
}

.top-tab {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  min-width: max-content;
  position: relative;
}

.top-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

.top-tab:hover,
.top-tab.active { color: var(--teal-dark); }
.top-tab.active::after { background: var(--teal); }

.app-shell:not([data-view="agent"]):not([data-view="settings"]) .top-tab[data-view="agent"] {
  display: none;
}

.event-status {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #334464;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.venue i { color: var(--teal); margin-right: 8px; }
.live-pill {
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  background: #dff8ec;
  color: #008345;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.heartbeat { display: inline-flex; align-items: center; gap: 8px; }
.heartbeat i, .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  display: inline-block;
}

.icon-button,
.profile-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  position: relative;
}

.icon-button:hover { background: #eef7fb; }
.badge-button em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  font-size: 9px;
  font-style: normal;
  line-height: 15px;
}

.profile-button {
  background: linear-gradient(145deg, #d7e8ff, #ffffff);
  color: var(--ink);
  font-weight: 800;
  border: 1px solid #d8e3ef;
}

.app-content {
  padding: 24px 22px 32px 30px;
}

@supports (zoom: 0.9) {
  @media (min-width: 981px) {
    .app-shell:not([data-view="agent"]) .app-content {
      zoom: 0.9;
    }
  }
}

.view { display: none; }
.view.active { display: block; animation: fade-in 0.18s ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 0 0 12px;
}

.compact-heading { margin-bottom: 12px; }
.page-heading h1 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.05em;
  font-weight: 750;
}
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.heading-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.primary-action,
.ghost-button,
.select-button {
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(18, 34, 64, 0.025);
}

.primary-action {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 24px;
}

.primary-action.teal {
  background: linear-gradient(135deg, #06b5ae, #00958f);
  border-color: transparent;
  border-radius: 8px;
}

.ghost-button:hover,
.select-button:hover { border-color: #c8d7e6; background: #fbfdff; }
.ghost-button.compact,
.select-button.tiny { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 7px; }
.ghost-button.full { width: 100%; }
.ghost-button.centered { margin: 10px auto 0; min-width: 150px; display: flex; }

.select-button {
  min-width: 126px;
  justify-content: space-between;
  color: #24344f;
}

.select-button strong { margin-left: 4px; font-size: 14px; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.panel-head.slim {
  padding: 18px 18px 0;
  align-items: center;
}

.panel-head h2,
.settings-panel h2,
.side-card h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.02em;
  font-weight: 750;
}
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}
.status-chip.success { background: #dff8ec; color: #008345; }

.metric-grid {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}
.metric-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 98px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 14px;
  padding: 18px 20px;
  align-items: center;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.analytics-grid .panel,
.overview-layout .panel,
.map-layout .panel {
  position: relative;
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.metric-card::before,
.analytics-grid .panel::before,
.overview-layout .panel::before,
.map-layout .panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 15% 0%, rgba(5, 169, 163, 0.12), transparent 42%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.metric-card:hover,
.analytics-grid .panel:hover,
.overview-layout .panel:hover,
.map-layout .panel:hover {
  border-color: rgba(5, 169, 163, 0.24);
  box-shadow: 0 14px 30px rgba(18, 34, 64, 0.075);
  transform: translateY(-2px);
}

.metric-card:hover::before,
.analytics-grid .panel:hover::before,
.overview-layout .panel:hover::before,
.map-layout .panel:hover::before {
  opacity: 1;
}

.metric-card > *,
.analytics-grid .panel > *,
.overview-layout .panel > *,
.map-layout .panel > * {
  position: relative;
  z-index: 1;
}

.metric-card .soft-icon { grid-row: 1 / 4; }
.metric-card span {
  color: #536481;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 700;
}
.metric-card strong {
  font-size: 22px;
  letter-spacing: -0.04em;
  margin-top: 5px;
}
.metric-card strong i { color: var(--muted); font-size: 16px; font-style: normal; }
.metric-card small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.metric-card small b { color: #09995c; background: #ddf7ea; border-radius: 999px; padding: 3px 8px; }

.soft-icon,
.soft-icon-inline {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  font-size: 18px;
}

.soft-icon.blue, .soft-icon-inline.blue { background: #eef3ff; color: var(--blue); }
.soft-icon.teal, .soft-icon-inline.teal { background: #e5fbf8; color: var(--teal); }
.soft-icon.mint, .soft-icon-inline.mint { background: #e7faee; color: var(--mint); }
.soft-icon.violet, .soft-icon-inline.violet { background: #f3ebff; color: var(--violet); }
.soft-icon.amber, .soft-icon-inline.amber { background: #fff6db; color: var(--amber); }
.soft-icon.orange, .soft-icon-inline.orange { background: #fff0e5; color: var(--orange); }

.overview-layout,
.content-with-rail,
.reports-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  min-width: 0;
}

.overview-layout { margin-top: 12px; }
.hero-panel { min-height: 430px; position: relative; overflow: hidden; }

@media (min-width: 981px) {
  #view-overview.view.active {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
  }

  #view-overview .metric-grid {
    margin: 0;
  }

  #view-overview .three-col {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }

  #view-overview .three-col .panel {
    display: flex;
    flex-direction: column;
  }

  #view-overview .activity-list,
  #view-overview .task-list,
  #view-overview .readiness-bars {
    flex: 1;
    align-content: space-evenly;
  }
}

.mini-floor,
.floor-map {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(120, 140, 170, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 140, 170, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #f8fbff, #eef7ff);
  background-size: 32px 32px, 32px 32px, auto;
}

.mini-floor {
  height: 280px;
  margin: 22px;
  border-radius: 18px;
  border: 1px solid #dfe8f1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.floor-room,
.map-room,
.map-table {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid #d1dceb;
  background: rgba(255, 255, 255, 0.72);
  color: #315076;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  border-radius: 8px;
}

.mini-floor .stage { left: 34%; top: 10%; width: 35%; height: 24%; }
.mini-floor .sponsor { left: 8%; top: 32%; width: 22%; height: 38%; color: #1966ff; background: #ecf4ff; }
.mini-floor .lounge { left: 11%; bottom: 10%; width: 24%; height: 18%; }
.mini-floor .booth { right: 12%; top: 37%; width: 18%; height: 18%; }

.map-bubble,
.avatar-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(7, 21, 47, 0.15);
  z-index: 3;
}
.map-bubble {
  width: 54px;
  height: 54px;
  background: rgba(5, 169, 163, 0.72);
  border: 12px solid rgba(5, 169, 163, 0.18);
}
.map-bubble.purple { background: rgba(151, 85, 236, 0.78); border-color: rgba(151, 85, 236, 0.20); }
.map-bubble.orange { background: rgba(255, 128, 55, 0.84); border-color: rgba(255, 128, 55, 0.22); }
.map-bubble.yellow { background: rgba(246, 189, 56, 0.86); border-color: rgba(246, 189, 56, 0.22); }
.map-bubble.blue { background: rgba(75, 125, 247, 0.86); border-color: rgba(75, 125, 247, 0.22); }

.avatar-pin {
  width: 46px;
  height: 46px;
  border: 3px solid var(--teal);
  background: linear-gradient(145deg, #15264c, #4b7df7);
  font-size: 12px;
}
.avatar-pin.green { border-color: var(--mint); background: linear-gradient(145deg, #0f534b, #28c79a); }
.avatar-pin.orange { border-color: var(--orange); background: linear-gradient(145deg, #69401c, #ff8a3d); }

.floor-callout,
.map-toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  min-width: min(520px, calc(100% - 44px));
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  z-index: 4;
}
.floor-callout > i,
.map-toast > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f0f5fb;
  color: var(--ink);
}
.floor-callout b,
.map-toast b { display: block; font-size: 15px; }
.floor-callout span,
.map-toast span { color: var(--muted); font-size: 13px; }
.map-toast span i { width: 7px; height: 7px; background: var(--mint); border-radius: 50%; display: inline-block; margin-right: 6px; }
.map-toast button { border: 0; background: #e9fbf8; color: var(--teal-dark); font-weight: 800; border-radius: 9px; padding: 11px 22px; }

.uwb-sim-map {
  display: grid;
  gap: 12px;
  margin: 16px 18px 18px;
}

.uwb-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.uwb-map-toolbar > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.uwb-map-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.uwb-map-toolbar span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(40, 199, 154, 0.13);
}

.uwb-map-toolbar strong {
  color: var(--ink);
  font-size: 14px;
}

.uwb-view-toggle {
  display: flex;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6fbff;
}

.uwb-view-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.uwb-view-toggle button.is-active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 6px 16px rgba(18, 34, 64, 0.08);
}

.uwb-map-canvas {
  position: relative;
  height: 318px;
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background:
    radial-gradient(circle at 54% 48%, rgba(20, 184, 166, 0.12), transparent 22%),
    linear-gradient(150deg, #f6faff 0%, #e8eff7 56%, #dce7f2 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 18px 42px rgba(100, 116, 139, 0.12);
}

.uwb-map-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.5)),
    radial-gradient(circle at 80% 12%, rgba(148, 163, 184, 0.2), transparent 22%);
  pointer-events: none;
}

.uwb-map-state {
  position: absolute;
  z-index: 6;
  right: 18px;
  top: 16px;
  padding: 9px 12px;
  border: 1px solid #dbe4ee;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.uwb-map-tools {
  position: absolute;
  z-index: 6;
  left: 16px;
  top: 16px;
  display: grid;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
}

.uwb-map-tools button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 38px;
  border: 0;
  border-bottom: 1px solid #e5edf5;
  background: transparent;
  color: #334155;
}

.uwb-map-tools button:last-child { border-bottom: 0; }

.uwb-floor {
  position: absolute;
  inset: 7% 5% 6%;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 250, 255, 0.94)),
    #f7fbff;
  box-shadow:
    0 34px 70px rgba(100, 116, 139, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78);
  transform: perspective(980px) rotateX(58deg) rotateZ(-8deg) scale(1.08);
  transform-origin: 50% 54%;
  transition: inset 0.32s ease, transform 0.32s ease, border-radius 0.32s ease;
}

.uwb-floor-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(190, 203, 219, 0.52) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 203, 219, 0.52) 1px, transparent 1px);
  background-size: 34px 34px;
}

.uwb-wall,
.uwb-column {
  position: absolute;
  display: block;
  background: rgba(225, 234, 244, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 18px rgba(100, 116, 139, 0.16);
}

.uwb-wall { border: 1px solid rgba(203, 213, 225, 0.72); }
.uwb-wall.wall-top { left: 3%; right: 3%; top: 3%; height: 20px; }
.uwb-wall.wall-left { left: 3%; top: 3%; bottom: 4%; width: 20px; }
.uwb-wall.wall-right { right: 3%; top: 12%; bottom: 3%; width: 20px; }
.uwb-wall.wall-back-a { left: 9%; top: 86%; width: 42%; height: 18px; }
.uwb-wall.wall-back-b { right: 10%; top: 86%; width: 26%; height: 18px; }

.uwb-column {
  width: 18px;
  height: 18px;
  border-radius: 2px;
}

.uwb-column.column-1 { left: 11%; top: 17%; }
.uwb-column.column-2 { left: 24%; top: 15%; }
.uwb-column.column-3 { left: 39%; top: 15%; }
.uwb-column.column-4 { left: 57%; top: 16%; }
.uwb-column.column-5 { left: 78%; top: 19%; }
.uwb-column.column-6 { left: 88%; top: 42%; }
.uwb-column.column-7 { left: 88%; top: 66%; }
.uwb-column.column-8 { left: 11%; top: 42%; }
.uwb-column.column-9 { left: 11%; top: 66%; }
.uwb-column.column-10 { left: 38%; top: 87%; }
.uwb-column.column-11 { left: 70%; top: 83%; }

.uwb-links {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.uwb-links line {
  stroke: #13b8aa;
  stroke-width: 0.16;
  stroke-dasharray: 1.1 0.8;
  stroke-linecap: round;
  opacity: 0.55;
  filter: drop-shadow(0 2px 3px rgba(20, 184, 166, 0.18));
}

.uwb-marker {
  position: absolute;
  left: var(--marker-x);
  top: var(--marker-y);
  z-index: 4;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
}

.uwb-marker::before,
.uwb-marker::after,
.uwb-marker i,
.uwb-marker b {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.uwb-marker::before,
.uwb-marker::after {
  content: "";
  bottom: 7px;
  border: 1px solid var(--marker-color);
  border-radius: 50%;
  opacity: 0.22;
}

.uwb-marker::before {
  width: 52px;
  height: 21px;
}

.uwb-marker::after {
  bottom: -1px;
  width: 86px;
  height: 36px;
  opacity: 0.1;
}

.uwb-marker i {
  bottom: 21px;
  width: 27px;
  height: 27px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95), transparent 20%),
    var(--marker-color);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.18),
    0 0 0 9px rgba(19, 184, 170, 0.14);
}

.uwb-marker b {
  bottom: 57px;
  min-width: 58px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.uwb-marker.is-source i {
  width: 33px;
  height: 33px;
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.2),
    0 0 0 12px rgba(19, 184, 170, 0.15);
}

.uwb-nearby-card,
.uwb-layer-card {
  position: absolute;
  z-index: 7;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
}

.uwb-nearby-card {
  left: 118px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: min(284px, calc(100% - 236px));
  padding: 14px;
}

.uwb-nearby-card > div {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e3f8f3;
  color: #0f8d90;
  flex: 0 0 auto;
}

.uwb-nearby-card strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
}

.uwb-nearby-card span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
}

.uwb-layer-card {
  right: 20px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  min-width: 154px;
  padding: 14px 16px;
}

.uwb-layer-card span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.uwb-layer-card i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.uwb-sim-map[data-map-mode="2d"] .uwb-floor {
  inset: 15% 8% 13%;
  border-radius: 14px;
  transform: none;
}

.uwb-sim-map[data-map-mode="2d"] .uwb-links line { stroke-width: 0.22; }

.stack-panel { display: grid; align-content: start; gap: 18px; padding-bottom: 18px; }
.health-list { padding: 18px; display: grid; gap: 12px; }
.health-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.health-list div span { display: flex; gap: 9px; align-items: center; }
.health-list div b { color: var(--ink); }
.health-list div em {
  grid-column: 1 / -1;
  height: 6px;
  background: linear-gradient(90deg, var(--teal), #dce9f1);
  border-radius: 999px;
}

.privacy-card {
  margin: 0 18px 0;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #c6eee6;
  background: linear-gradient(135deg, #e9fbf5, #f6fffd);
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.privacy-card i { color: var(--teal); font-size: 20px; }
.privacy-card strong { display: block; color: var(--teal-dark); margin-bottom: 6px; }
.privacy-card span { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.privacy-card a { display: inline-block; margin-top: 8px; font-size: 12px; }
.privacy-card.tall { margin: 0; }

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.activity-list,
.task-list,
.readiness-bars,
.insight-list,
.quick-list,
.alert-summary,
.template-list,
.schedule-list,
.settings-mini,
.engagement-list,
.source-list {
  padding: 18px;
}

.activity-list { display: grid; gap: 14px; }
.activity-list div { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; border-bottom: 1px solid #edf2f7; padding-bottom: 12px; }
.activity-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-list b { font-size: 13px; }
.activity-list span { color: var(--muted); font-size: 12px; }
.activity-list em { grid-row: 1 / 3; align-self: center; color: #008345; background: #dcf7e9; border-radius: 999px; padding: 5px 9px; font-style: normal; font-weight: 800; }

.task-list { display: grid; gap: 14px; }
.task-list label { font-size: 13px; color: #253752; display: flex; gap: 10px; align-items: center; }
.task-list input { accent-color: var(--teal); }

.readiness-bars { display: grid; gap: 17px; }
.readiness-bars div,
.source-list div,
.h-bars div {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.readiness-bars b,
.source-list b,
.h-bars b {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #96dcd8);
  display: block;
}
.readiness-bars em,
.source-list em,
.h-bars em { color: var(--ink); font-style: normal; font-weight: 800; text-align: right; }

.map-heading .heading-actions { align-items: stretch; }
#view-map .page-heading {
  margin-top: 12px;
  margin-bottom: 30px;
}

@media (min-width: 981px) {
  #view-map.view.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    min-height: 0;
  }

  #view-map .map-panel {
    flex: 1 1 0;
    min-height: 0;
  }

  #view-map .floor-map {
    height: 100%;
  }

  #view-map .map-stat-strip {
    flex: 0 0 auto;
  }
}

.map-panel { padding: 0; overflow: hidden; }
.floor-map {
  height: 650px;
  margin: 0;
  border-radius: 10px;
}
#view-map .floor-map {
  height: 648px;
  background: url("../images/appflow/map-floor-reference.png") center / cover no-repeat;
}

@media (min-width: 981px) {
  #view-map .floor-map {
    height: 100%;
  }
}

#view-map .floor-map::before,
#view-map .floor-map > :not(.map-toast) {
  display: none !important;
}
#view-map .map-toast {
  display: none;
}
.floor-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 6%, rgba(71, 91, 125, 0.08) 6% 9%, transparent 9% 100%),
    linear-gradient(180deg, transparent 0 8%, rgba(71, 91, 125, 0.08) 8% 12%, transparent 12% 100%);
  pointer-events: none;
}

.map-controls {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 10px;
}
.map-controls.left { left: 18px; top: 18px; }
.map-controls.bottom { right: 24px; bottom: 26px; grid-auto-flow: column; }
.map-controls button,
.floor-picker button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: white;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-weight: 800;
}
.floor-picker {
  position: absolute;
  right: 10px;
  top: 155px;
  z-index: 5;
  display: grid;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.floor-picker button { box-shadow: none; border-radius: 0; color: #315076; }
.floor-picker .active { border: 2px solid var(--teal); border-radius: 999px; margin: 4px; width: 32px; height: 32px; color: var(--teal-dark); }

.map-room.stage { left: 34%; top: 0; width: 33%; height: 90px; }
.map-room.sponsor-a { left: 12%; top: 16%; width: 10%; height: 140px; color: #1966ff; background: #ecf4ff; }
.map-room.lounge-room { left: 11%; bottom: 17%; width: 11%; height: 150px; }
.map-room.sponsor-b { right: 11%; top: 16%; width: 10%; height: 140px; color: #1966ff; background: #ecf4ff; }
.map-room.catering { right: 3%; top: 18%; width: 8%; height: 112px; }
.map-room.help { right: 7%; bottom: 12%; width: 8%; height: 82px; }
.map-table { width: 60px; height: 56px; color: #45607f; }
.map-table.t1 { left: 30%; top: 25%; } .map-table.t2 { left: 35%; top: 28%; } .map-table.t3 { left: 50%; top: 25%; } .map-table.t4 { left: 66%; top: 25%; }
.map-table.t5 { left: 43%; top: 42%; } .map-table.t6 { left: 51%; top: 43%; } .map-table.t7 { left: 58%; top: 52%; } .map-table.t8 { left: 68%; top: 43%; }

.map-stat-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.map-stat-strip div {
  min-height: 112px;
  display: grid;
  grid-template-columns: 46px 1fr;
  column-gap: 12px;
  align-content: center;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}
.map-stat-strip div:last-child { border-right: 0; }
.map-stat-strip i { grid-row: 1 / 4; align-self: center; }
.map-stat-strip strong { font-size: 22px; letter-spacing: -0.04em; }
.map-stat-strip span { color: var(--muted); font-size: 13px; }
.map-stat-strip em { color: #008345; background: #dcf7e9; font-style: normal; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 4px 8px; width: max-content; margin-top: 6px; }

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 22px;
}
.filter-row.compact { margin-bottom: 12px; }
.search-input {
  min-width: 235px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #fff;
}
.search-input i { color: #8b99ad; }
.search-input input {
  border: 0;
  outline: 0;
  width: 100%;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.content-with-rail { align-items: start; }
#view-people .content-with-rail { grid-template-columns: minmax(0, 1fr) 250px; }
#view-alerts .content-with-rail { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.main-stack, .rail-stack { display: grid; gap: 16px; align-content: start; min-height: auto; min-width: 0; }
#view-people .main-stack {
  gap: 0;
  grid-template-rows: none;
  min-height: auto;
}
#view-people .rail-stack { margin-top: 18px; }
#view-people .table-footer { margin-top: 16px; }
#view-people .table-panel {
  display: block;
  min-height: 0;
}
#view-people .app-table { height: auto; }
#view-people .rail-stack {
  grid-template-rows: none;
}

@media (min-width: 981px) {
  #view-people.view.active {
    display: block;
    height: auto;
    min-height: auto;
  }

  #view-people .filter-row {
    margin-top: 0;
  }

  #view-people .content-with-rail {
    min-height: 0;
  }

  #view-people .main-stack,
  #view-people .rail-stack {
    align-content: start;
    min-height: auto;
  }

  #view-people .table-panel {
    min-height: 0;
  }
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  contain: paint;
}
.section-tabs button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  min-height: 42px;
  color: #40516b;
  font-weight: 600;
  position: relative;
}
.section-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}
.section-tabs button.active { color: var(--teal-dark); }
.section-tabs button.active::after { background: var(--teal); }
.section-tabs em {
  margin-left: 6px;
  color: var(--teal-dark);
  background: #e2f7f3;
  border-radius: 999px;
  padding: 2px 7px;
  font-style: normal;
  font-size: 11px;
}

.table-panel { max-width: 100%; min-width: 0; overflow: hidden; }
.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.app-table th,
.app-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
}
#view-people .app-table th,
#view-people .app-table td {
  padding: 9px 16px;
}
#view-people .app-table th:nth-child(1) { width: 18%; }
#view-people .app-table th:nth-child(2) { width: 13%; }
#view-people .app-table th:nth-child(3) { width: 14%; }
#view-people .app-table th:nth-child(4) { width: 21%; }
#view-people .app-table th:nth-child(5) { width: 10%; }
#view-people .app-table th:nth-child(6) { width: 8%; }
#view-people .app-table th:nth-child(7) { width: 14%; }
#view-people .person-avatar {
  width: 28px;
  height: 28px;
}
#view-people .tag {
  padding: 3px 8px;
  font-size: 10px;
}
.app-table th {
  color: #536481;
  font-size: 11px;
  font-weight: 600;
  background: #fff;
}
.app-table tr:last-child td { border-bottom: 0; }
.app-table td { color: #172640; }
.person-cell { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.person-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 11px;
  font-weight: 800;
  background:
    radial-gradient(circle at 52% 34%, #ffd6ba 0 17%, transparent 18%),
    radial-gradient(circle at 50% 92%, #183f6f 0 34%, transparent 35%),
    linear-gradient(145deg, #d9f5f1, #2d6db4);
  position: relative;
}
.person-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid white;
}
.person-avatar.avatar-2 { background: radial-gradient(circle at 50% 34%, #f3c19b 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #0d6a9c 0 34%, transparent 35%), linear-gradient(145deg, #cdebf9, #005b89); }
.person-avatar.avatar-3 { background: radial-gradient(circle at 52% 34%, #e7a979 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #243049 0 34%, transparent 35%), linear-gradient(145deg, #f8d7b7, #0c2342); }
.person-avatar.avatar-4 { background: radial-gradient(circle at 52% 34%, #ffcba8 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #2b7c6d 0 34%, transparent 35%), linear-gradient(145deg, #d7fff7, #21a994); }
.person-avatar.avatar-5 { background: radial-gradient(circle at 52% 34%, #f2be98 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #083463 0 34%, transparent 35%), linear-gradient(145deg, #c7f1ff, #0e4d9d); }
.person-avatar.avatar-6 { background: radial-gradient(circle at 52% 34%, #f9c99d 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #462e22 0 34%, transparent 35%), linear-gradient(145deg, #ffe2c5, #775244); }
.person-avatar.avatar-7 { background: radial-gradient(circle at 52% 34%, #d9956d 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #104f82 0 34%, transparent 35%), linear-gradient(145deg, #c8edff, #064a7a); }
.person-avatar.avatar-8 { background: radial-gradient(circle at 52% 34%, #efb184 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #632b2a 0 34%, transparent 35%), linear-gradient(145deg, #ffd4cc, #9d453e); }
.person-avatar.avatar-9 { background: radial-gradient(circle at 52% 34%, #f1bb93 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #0b4b88 0 34%, transparent 35%), linear-gradient(145deg, #d8f0ff, #2f75ca); }
.person-avatar.avatar-10 { background: radial-gradient(circle at 52% 34%, #f7c2a0 0 17%, transparent 18%), radial-gradient(circle at 50% 92%, #273d51 0 34%, transparent 35%), linear-gradient(145deg, #e9f1f7, #647d99); }
.company-mark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  font-weight: 800;
  margin-right: 10px;
  color: white;
}
.company-mark.red { background: #f04438; } .company-mark.purple { background: #7a5cff; } .company-mark.black { background: #121826; } .company-mark.green { background: #42c585; } .company-mark.blue { background: #2b7be7; }
.location-cell small { display: block; color: #7b8aa2; margin-top: 3px; }
.score-pill {
  background: #d8f7e7;
  color: #008b53;
  border-radius: 999px;
  padding: 5px 11px;
  font-weight: 800;
}
.intent-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.tag.purple, .tag.violet { background: #f2eaff; color: #7d42e8; }
.tag.blue { background: #e9f2ff; color: #1b63c8; }
.tag.green { background: #e7f9ec; color: #0b8d4c; }
.tag.yellow { background: #fff4d8; color: #b26b00; }
.tag.pink { background: #ffe9f6; color: #d73991; }
.tag.teal { background: #e5fbf8; color: var(--teal-dark); }
.tag.orange { background: #fff0e6; color: #c45d12; }
.tag.gray { background: #eff3f8; color: #607089; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #52627c;
  font-size: 13px;
}
.pagination { display: flex; gap: 6px; }
.pagination button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: #40516b;
  font-weight: 800;
}
.pagination .active { background: #eefbf9; color: var(--teal-dark); border-color: #ceeee9; }

.side-card { padding-bottom: 18px; }
.quick-list { display: grid; gap: 10px; }
.quick-list button {
  height: 36px;
  border: 1px solid #edf2f7;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #24344f;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.quick-list span { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.quick-list em {
  background: #f2f5f8;
  border-radius: 999px;
  padding: 2px 8px;
  font-style: normal;
  font-size: 11px;
}
.insight-list { display: grid; gap: 18px; }
.insight-list div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}
.insight-list span { font-size: 13px; color: var(--ink); }
.insight-list b { font-size: 18px; }
.insight-list em { font-style: normal; color: #008345; background: #dcf7e9; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800; }

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
#view-analytics .page-heading {
  margin-top: -8px;
  margin-bottom: 9px;
}
#view-analytics .filter-row {
  margin-top: 8px;
  margin-bottom: 12px;
}

@media (min-width: 981px) {
  #view-analytics.view.active {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
  }

  #view-analytics .analytics-grid {
    flex: 1;
    grid-template-rows: auto auto minmax(250px, 1fr);
  }

  #view-analytics .heatmap-card,
  #view-analytics .engagement-card,
  #view-analytics .insights-card {
    display: flex;
    flex-direction: column;
  }

  #view-analytics .heatmap {
    flex: 1;
    min-height: 160px;
    height: auto;
  }

  #view-analytics .engagement-list,
  #view-analytics .insight-bullets {
    flex: 1;
  }

  #view-analytics .insights-card .ghost-button {
    width: auto;
    align-self: flex-start;
    margin: 0 22px 18px;
  }
}

.chart-panel.wide { grid-column: span 6; min-height: 198px; }
.donut-panel { grid-column: span 4; min-height: 194px; display: grid; grid-template-columns: 145px 1fr; align-items: center; padding-bottom: 12px; }
.bar-panel { grid-column: span 4; min-height: 194px; }
.heatmap-card { grid-column: span 6; min-height: 218px; }
.engagement-card, .insights-card { grid-column: span 3; min-height: 218px; }

.line-chart { width: calc(100% - 36px); height: 140px; margin: 4px 18px 8px; overflow: visible; }
.gridline { stroke: #e6edf5; stroke-width: 1; }
.line { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line.last { stroke: var(--blue); stroke-dasharray: 8 6; stroke-width: 2; }
.line.danger { stroke: var(--red); } .line.warn { stroke: var(--amber); } .line.ok { stroke: var(--teal); }
.legend { display: inline-flex; align-items: center; gap: 10px; color: #53637c; font-size: 12px; }
.legend i { width: 16px; height: 2px; background: var(--teal); display: inline-block; }
.legend i.blue { background: var(--blue); border-top: 2px dashed var(--blue); height: 0; }
.donut-panel .panel-head {
  grid-column: 1 / -1;
}
.donut {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin: 10px 0 0 28px;
  background: conic-gradient(var(--teal) 0 43%, #8fb3ff 43% 62%, var(--violet) 62% 81%, var(--amber) 81% 90%, #d0d7e2 90% 100%);
  position: relative;
}
.donut.blue { background: conic-gradient(var(--teal) 0 45%, #76a6ff 45% 80%, var(--amber) 80% 95%, #d0d7e2 95% 100%); }
.donut::after { content: ""; position: absolute; inset: 28px; background: #fff; border-radius: 50%; }
.legend-list { display: grid; gap: 9px; margin-top: 10px; padding-right: 18px; }
.legend-list span { display: grid; grid-template-columns: 14px 1fr auto; gap: 9px; align-items: center; font-size: 12px; color: #53637c; }
.legend-list i { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.legend-list i.violet { background: var(--violet); } .legend-list i.blue { background: #76a6ff; } .legend-list i.yellow { background: var(--amber); } .legend-list i.gray { background: #d0d7e2; }
.h-bars { padding: 18px 24px 14px; display: grid; gap: 12px; }
.h-bars div { grid-template-columns: 110px 1fr 42px; }
.h-bars div:nth-child(2) b { background: #7dd6cc; } .h-bars div:nth-child(3) b { background: #7fa6f8; } .h-bars div:nth-child(4) b { background: #a982ee; } .h-bars div:nth-child(5) b { background: #f4c65a; }
.heatmap {
  margin: 16px 20px 18px;
  height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(7,21,47,0.06) 0 8%, transparent 8% 100%),
    linear-gradient(rgba(7,21,47,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7,21,47,0.04) 1px, transparent 1px),
    #f8fbff;
  background-size: auto, 28px 28px, 28px 28px, auto;
}
#view-analytics .heatmap {
  height: 160px;
  background: url("../images/appflow/analytics-heatmap-reference.png") center / cover no-repeat;
}
#view-analytics .heatmap span,
#view-analytics .heatmap em {
  display: none;
}
.heatmap span {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 121, 58, 0.85), rgba(246, 189, 56, 0.55) 34%, rgba(40, 199, 154, 0.42) 62%, transparent 75%);
  filter: blur(3px);
}
.heatmap em { position: absolute; right: 14px; top: 14px; color: var(--ink); font-size: 12px; font-style: normal; line-height: 1.9; }
.engagement-list { display: grid; gap: 14px; }
.engagement-list div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.engagement-list span { display: inline-flex; align-items: center; gap: 12px; color: #53637c; font-size: 13px; }
.engagement-list i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--teal); background: #e5fbf8; }
.insight-bullets { padding: 18px 22px; display: grid; gap: 14px; color: #53637c; font-size: 13px; line-height: 1.5; }
.insight-bullets p { margin: 0; display: flex; gap: 12px; }
.insight-bullets i { color: var(--mint); }

.alert-list { padding: 0 18px 18px; }

@media (min-width: 981px) {
  #view-alerts.view.active {
    display: block;
    min-height: auto;
  }

  #view-alerts .content-with-rail {
    min-height: 0;
  }

  #view-alerts .main-stack,
  #view-alerts .rail-stack {
    align-content: start;
  }

  #view-alerts .rail-stack .side-card:last-child {
    display: flex;
    flex-direction: column;
  }

  #view-alerts .source-list {
    flex: 1;
    align-content: space-evenly;
  }
}

#view-alerts .main-stack { grid-template-rows: none; }
#view-alerts .rail-stack { grid-template-rows: none; }
#view-alerts .alert-list {
  display: block;
  min-height: 0;
}
#view-alerts .alert-list .ghost-button.centered { margin-top: 10px; }
.alert-item {
  display: grid;
  grid-template-columns: 58px 1fr auto 20px;
  gap: 14px;
  align-items: center;
  min-height: 106px;
  border-bottom: 1px solid #edf2f7;
}
.alert-item > i:first-child {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.alert-item.high > i:first-child { background: #fff0f2; color: var(--red); }
.alert-item.medium > i:first-child { background: #fff5e6; color: #ff9800; }
.alert-item.low > i:first-child { background: #e9fbf8; color: var(--teal); }
.alert-item.violet > i:first-child { background: #f5ecff; color: var(--violet); }
.alert-item.blue > i:first-child { background: #edf4ff; color: var(--blue); }
.alert-item b { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.alert-item b em { font-style: normal; border-radius: 999px; padding: 4px 8px; font-size: 11px; background: #fff0f2; color: var(--red); }
.alert-item.medium b em { background: #fff5e6; color: #d97800; }
.alert-item.low b em { background: #e9fbf8; color: var(--teal-dark); }
.alert-item span { color: #53637c; font-size: 13px; display: block; margin: 9px 0; }
.alert-item small { color: #6e7d95; font-size: 12px; }
.alert-item time { color: #40516b; font-size: 12px; }
.alert-summary strong { display: block; font-size: 34px; letter-spacing: -0.06em; }
.alert-summary > span { color: var(--muted); display: block; margin-bottom: 18px; }
.alert-summary div { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; min-height: 38px; border-bottom: 1px solid #edf2f7; font-size: 13px; }
.alert-summary div i { width: 13px; height: 13px; border: 2px solid var(--red); border-radius: 50%; }
.alert-summary .warning { border-color: var(--orange); } .alert-summary .success { border-color: var(--teal); } .alert-summary .info { border-color: var(--blue); }
.small-chart { width: calc(100% - 34px); margin: 15px 17px; height: 130px; }
.source-list { display: grid; gap: 13px; }
.source-list div { grid-template-columns: 118px 1fr 24px; }
.source-list div:nth-child(1) b { background: var(--red); } .source-list div:nth-child(2) b { background: var(--orange); } .source-list div:nth-child(3) b { background: var(--teal); } .source-list div:nth-child(4) b { background: var(--blue); } .source-list div:nth-child(5) b { background: #c7d0dc; }

.reports-layout { grid-template-columns: minmax(0, 1fr) 326px; align-items: stretch; margin-top: 12px; }
.library-panel { padding-bottom: 18px; }

@media (min-width: 981px) {
  #view-reports.view.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 60px);
  }

  #view-reports .reports-layout {
    flex: 1 1 0;
    min-height: 0;
  }

  #view-reports .metric-grid {
    margin-top: 0;
  }

  #view-reports .main-stack,
  #view-reports .rail-stack {
    align-content: stretch;
  }

  #view-reports .main-stack {
    grid-template-rows: minmax(346px, 1fr) minmax(250px, 1fr);
  }

  #view-reports .library-panel,
  #view-reports .recent-reports,
  #view-reports .rail-stack .side-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #view-reports .report-grid {
    flex: 1;
    grid-auto-rows: minmax(122px, 1fr);
  }

  #view-reports .report-card {
    height: auto;
    min-height: 122px;
  }

  #view-reports .recent-reports .app-table,
  #view-reports .template-list,
  #view-reports .schedule-list {
    flex: 1;
  }

  #view-reports .schedule-list {
    align-content: space-evenly;
  }
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.report-card {
  height: 122px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px 9px;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 12px;
}
.report-card > i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  background: #edf4ff;
}
.report-card i.blue { color: var(--blue); } .report-card i.mint { color: var(--mint); background: #e9fbf5; } .report-card i.violet { color: var(--violet); background: #f3ebff; } .report-card i.orange { color: var(--orange); background: #fff0e5; } .report-card i.yellow { color: var(--amber); background: #fff6db; } .report-card i.red { color: var(--red); background: #fff0f2; } .report-card i.teal { color: var(--teal); background: #e5fbf8; } .report-card i.gray { color: #607089; background: #eff3f8; }
.report-card b { font-size: 13px; }
.report-card span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.report-card small { grid-column: 1 / -1; color: #53637c; margin-top: 6px; border-top: 1px solid #edf2f7; padding-top: 7px; }
.template-list { display: grid; gap: 5px; }
.template-list button {
  min-height: 50px;
  border: 0;
  background: transparent;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
}
.schedule-list { display: grid; gap: 18px; }
.schedule-list label { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.schedule-list span { font-size: 13px; font-weight: 800; }
.schedule-list em { display: block; color: var(--muted); font-style: normal; font-weight: 500; margin-top: 4px; }
.schedule-list input { width: 38px; height: 22px; accent-color: var(--teal); }
.recent-reports { margin-top: 0; overflow: hidden; }
.reports-layout .main-stack { grid-template-rows: auto minmax(206px, 1fr); }
.reports-layout .rail-stack { grid-template-rows: auto minmax(235px, 1fr); }

.chainlit-page {
  height: 100vh;
  min-height: 0;
  margin: -28px -22px -32px -30px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.app-shell[data-view="agent"] .app-content {
  padding: 0;
  overflow: hidden;
  background: #f8fcfb;
}

.app-shell[data-view="agent"] #view-agent,
.app-shell[data-view="agent"] .chainlit-page {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #f8fcfb;
}

.app-shell[data-view="agent"] .chainlit-frame-shell,
.app-shell[data-view="agent"] .chainlit-frame {
  height: 100%;
  min-height: 100%;
  background: #f8fcfb;
}

.app-shell[data-view="agent"] .view.active {
  animation: none;
}
.beta-chip {
  vertical-align: middle;
  font-size: 11px;
  color: var(--violet);
  background: #f3ebff;
  border-radius: 999px;
  padding: 4px 9px;
  letter-spacing: 0;
}
.chainlit-frame-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}
.chainlit-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
.demo-agent-panel {
  height: 100%;
  background:
    radial-gradient(circle at 12% 12%, rgba(19, 184, 170, 0.12), transparent 24%),
    linear-gradient(135deg, #f7fbfc 0%, #ffffff 44%, #f4fbfa 100%);
  overflow: auto;
}
.demo-agent-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 18px;
  padding: 38px 44px 28px;
}
.demo-agent-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.demo-agent-header h1 {
  margin: 8px 0 6px;
  font-size: 34px;
  letter-spacing: 0;
}
.demo-agent-header p {
  margin: 0;
  max-width: 690px;
  color: var(--muted);
  line-height: 1.5;
}
.demo-agent-kicker,
.demo-agent-status span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.demo-agent-kicker i,
.demo-agent-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(19, 184, 170, 0.13);
}
.demo-agent-status {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.demo-agent-status b {
  display: block;
  margin-top: 8px;
  color: var(--ink);
}
.demo-agent-thread {
  display: grid;
  align-content: center;
  gap: 14px;
}
.demo-chat-row {
  max-width: 920px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
}
.demo-chat-row.user {
  justify-self: end;
  width: min(700px, 82%);
  background: #071733;
  color: #fff;
}
.demo-chat-row.agent {
  justify-self: start;
  width: min(920px, 94%);
}
.demo-chat-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.demo-chat-row.user span { color: rgba(255, 255, 255, 0.66); }
.demo-chat-row p,
.demo-chat-row h2 {
  margin: 0;
}
.demo-chat-row h2 {
  font-size: 20px;
  letter-spacing: 0;
}
.demo-chat-row ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #40516b;
  line-height: 1.55;
}
.demo-agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.demo-agent-chips b {
  border-radius: 999px;
  background: #e9fbf8;
  color: var(--teal-dark);
  padding: 7px 10px;
  font-size: 12px;
}
.demo-agent-artifact {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.demo-agent-artifact.is-active { display: block; }
.demo-agent-prompts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.demo-agent-prompts button {
  border: 1px solid var(--line);
  background: #fff;
  color: #17243a;
  border-radius: 8px;
  padding: 12px 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(10, 26, 47, 0.07);
}
.demo-agent-prompts button:hover {
  border-color: rgba(19, 184, 170, 0.38);
  color: var(--teal-dark);
}
.chainlit-frame-status {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(223, 231, 241, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #40516b;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.chainlit-frame-status.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
}
.chainlit-frame-status i { color: var(--teal-dark); }
.chainlit-config-copy {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}
.chainlit-config-code {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfc;
  color: #40516b;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.compact-table { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: table; }
.compact-table th, .compact-table td { padding: 11px 12px; font-size: 12px; }
.compact-table tbody tr { cursor: pointer; transition: background 0.16s ease; }
.compact-table tbody tr:hover { background: #f6fbfb; }

.settings-tabs {
  display: flex;
  gap: 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding: 0 8px;
  overflow-x: auto;
}
.settings-tabs button {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #40516b;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
}
.settings-tabs button i { margin-right: 9px; }
.settings-tabs .active { color: var(--teal-dark); }
.settings-tabs .active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--teal); }
.settings-panel { padding: 20px; }
.settings-layout { align-items: start; }
.settings-panel h2 {
  letter-spacing: -0.04em;
}

@media (min-width: 981px) {
  #view-settings.view.active {
    display: block;
    height: auto;
    min-height: auto;
  }

  #view-settings .settings-layout {
    min-height: 0;
  }

  #view-settings .main-stack,
  #view-settings .rail-stack {
    align-content: start;
    min-height: auto;
  }

  #view-settings .main-stack {
    grid-template-rows: none;
  }

  #view-settings .settings-panel,
  #view-settings .rail-stack .side-card {
    min-height: auto;
  }
}

.settings-panel > p,
.side-card > p { margin: 6px 0 18px; color: var(--muted); font-size: 13px; }
.setting-row {
  display: grid;
  grid-template-columns: 42px 1fr auto 16px;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  border-top: 1px solid #edf2f7;
}
.setting-row > i:first-child {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--teal);
  background: #e5fbf8;
}
.setting-row b { display: block; font-size: 13px; }
.setting-row span { color: var(--muted); font-size: 12px; }
.setting-row em { color: #40516b; font-style: normal; font-size: 12px; }
.account-card { padding: 18px; }
.account-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 14px; margin: 18px 0; }
.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,0.72), transparent 32%),
    linear-gradient(145deg, #83e1d5, #10213f);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.02em;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), 0 10px 24px rgba(15, 31, 61, 0.16);
}
.account-row > div { min-width: 0; }
.account-row span:not(.profile-avatar) { overflow-wrap: anywhere; }
.account-row b, .account-row span, .account-row em { display: block; }
.account-row span { color: var(--muted); font-size: 12px; margin: 4px 0; }
.account-row em { color: var(--teal-dark); background: #e2f7f3; width: max-content; border-radius: 999px; padding: 3px 8px; font-style: normal; font-size: 11px; font-weight: 800; }
.account-row .profile-avatar {
  display: grid;
  place-items: center;
  color: white;
  margin: 0;
}
.settings-mini { display: grid; gap: 0; }
.settings-mini div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf2f7; font-size: 13px; }
.settings-mini div:last-child { border-bottom: 0; }
.settings-mini span { color: var(--ink); font-weight: 700; }
.settings-mini b { color: #40516b; font-weight: 600; }
.success-text { color: #008345 !important; }
.danger-zone h2 { color: #d6293e; }
.danger-zone div { display: flex; justify-content: space-between; align-items: center; padding: 0 18px 18px; }
.danger-zone span { color: #d6293e; font-weight: 800; font-size: 13px; }
.danger-zone button { border: 1px solid var(--red); color: var(--red); background: white; border-radius: 7px; padding: 8px 16px; font-weight: 800; }
.switch input { display: none; }
.switch span { width: 38px; height: 22px; background: #b9c0ca; border-radius: 999px; display: block; position: relative; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; left: 2px; top: 2px; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.16); }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(16px); }

.app-shell,
.app-sidebar,
.app-main,
.side-link span,
.brand-lockup strong,
.sidebar-status {
  transition: width 0.2s ease, margin-left 0.2s ease, opacity 0.18s ease, transform 0.18s ease, max-width 0.2s ease;
}

.app-shell.sidebar-collapsed {
  --sidebar: 74px;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded {
  --sidebar: 74px;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .app-sidebar {
  width: 176px;
  box-shadow: 18px 0 38px rgba(18, 34, 64, 0.08);
}

.app-shell.sidebar-collapsed .sidebar-brand {
  padding: 0 12px;
  justify-content: center;
}

.app-shell.sidebar-collapsed .brand-lockup {
  gap: 0;
}

.app-shell.sidebar-collapsed .brand-lockup strong,
.app-shell.sidebar-collapsed .side-link span,
.app-shell.sidebar-collapsed .sidebar-status {
  opacity: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-shell.sidebar-collapsed .sidebar-status {
  height: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
}

.app-shell.sidebar-collapsed .sidebar-nav,
.app-shell.sidebar-collapsed .sidebar-bottom {
  padding-left: 10px;
  padding-right: 10px;
}

.app-shell.sidebar-collapsed .side-link {
  justify-content: center;
  gap: 0;
  padding: 0;
}

.app-shell.sidebar-collapsed .collapse-link i { transform: none; }
.app-shell.sidebar-collapsed.sidebar-hover-expanded .collapse-link {
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 !important;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-brand {
  padding: 0 16px 0 20px;
  justify-content: space-between;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .brand-lockup {
  gap: 10px;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .brand-lockup strong,
.app-shell.sidebar-collapsed.sidebar-hover-expanded .side-link span {
  opacity: 1;
  width: auto;
  height: auto;
  max-width: 180px;
  overflow: visible;
  pointer-events: auto;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .collapse-link span {
  display: none !important;
  opacity: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-status {
  opacity: 0;
  width: 0;
  max-width: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-nav,
.app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-bottom {
  padding-left: 8px;
  padding-right: 8px;
}

.app-shell.sidebar-collapsed.sidebar-hover-expanded .side-link {
  justify-content: flex-start;
  gap: 18px;
  padding: 0 17px;
}

.sidebar-status {
  display: grid;
  gap: 7px;
  padding: 14px;
  margin: 0 0 8px;
  border: 1px solid #dce8f1;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7fcff, #effbf8);
  box-shadow: var(--shadow-soft);
}

.sidebar-status .live-pill {
  width: max-content;
  height: 24px;
  padding: 0 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-status strong {
  font-size: 19px;
  letter-spacing: -0.04em;
}

.sidebar-status small {
  color: var(--muted);
  line-height: 1.35;
}

.floating-menu {
  display: none !important;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 34;
  background: #fff;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

.app-content {
  min-height: 100vh;
  padding-top: 28px;
}

.section-tabs button.is-active,
.section-tabs button.active { color: var(--teal-dark); }
.section-tabs button.is-active::after,
.section-tabs button.active::after { background: var(--teal); }

.quick-list button.is-active,
.report-card.is-selected,
.template-list button.is-active {
  border-color: rgba(5, 169, 163, 0.32);
  background: #effbf9;
  box-shadow: inset 3px 0 0 var(--teal);
}

.app-table tbody tr.is-hidden,
.alert-item.is-hidden {
  display: none;
}

.alert-item.is-read {
  opacity: 0.58;
}

.alert-item.is-read b::after {
  content: "Read";
  color: #607089;
  background: #eff3f8;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  margin-left: 8px;
}

.compact-mode .panel,
.compact-mode .metric-card {
  border-radius: 7px;
}

.compact-mode .app-content {
  padding: 18px 18px 24px;
}

.compact-mode .metric-card,
.compact-mode .panel-head,
.compact-mode .activity-list,
.compact-mode .task-list,
.compact-mode .readiness-bars,
.compact-mode .insight-list,
.compact-mode .quick-list,
.compact-mode .alert-summary,
.compact-mode .template-list,
.compact-mode .schedule-list,
.compact-mode .settings-mini,
.compact-mode .engagement-list,
.compact-mode .source-list {
  padding: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .metric-card,
  .analytics-grid .panel,
  .overview-layout .panel,
  .map-layout .panel {
    transition: none;
  }

  .metric-card:hover,
  .analytics-grid .panel:hover,
  .overview-layout .panel:hover,
  .map-layout .panel:hover {
    transform: none;
  }
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 21, 47, 0.36);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(223, 232, 241, 0.95);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(7, 21, 47, 0.24);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px 10px;
  border-bottom: 1px solid #edf2f7;
}

.modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.045em;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.modal-close {
  border: 0;
  background: #f2f6fb;
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
}

.modal-body {
  padding: 20px 24px 24px;
  display: grid;
  gap: 16px;
}

.modal-body label {
  display: grid;
  gap: 8px;
  color: #40516b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.modal-body textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.option-grid,
.check-grid {
  display: grid;
  gap: 10px;
}

.option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-grid button,
.check-row {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 13px;
  color: var(--ink);
  font-weight: 800;
}

.option-grid button:hover,
.check-row:hover {
  border-color: rgba(5, 169, 163, 0.32);
  background: #f3fcfb;
}

.check-row {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 700;
}

.modal-body label.check-row,
.modal-body .check-row {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 1px solid #b8c6d8;
  border-radius: 5px;
  background: #fff;
  flex: 0 0 18px;
  cursor: pointer;
}

.check-row input[type="checkbox"]:checked {
  border-color: var(--teal);
  background-color: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7.3L5.7 10L11 4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 13px 13px;
}

.preview-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 44px));
}

.toast {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #dce8f1;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow);
}

.toast i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--teal-dark);
  background: #e5fbf8;
}

.toast b {
  display: block;
  font-size: 13px;
}

.toast span {
  color: var(--muted);
  font-size: 12px;
}

.demo-final-card {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(circle at 15% 18%, rgba(19, 184, 170, 0.34), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(244, 181, 61, 0.34), transparent 30%),
    linear-gradient(135deg, #061827 0%, #0b7679 46%, #d79b3f 100%);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.demo-final-card.is-visible {
  opacity: 1;
  transform: scale(1);
}
.demo-final-card > div {
  text-align: center;
  max-width: 900px;
}
.demo-final-card span {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.demo-final-card h2 {
  margin: 24px 0 12px;
  font-size: clamp(34px, 6vw, 72px);
  letter-spacing: 0;
}
.demo-final-card p {
  margin: 0;
  font-size: clamp(17px, 2.2vw, 26px);
  color: rgba(255, 255, 255, 0.84);
}

.action-cell {
  display: inline-flex;
  gap: 6px;
}

.mini-action {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  min-height: 28px;
  padding: 0 9px;
  color: #40516b;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .metric-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  :root { --sidebar: 0px; }
  .login-page {
    display: block;
    background: #fff;
  }
  .auth-rail {
    position: sticky;
    height: 64px;
    flex-direction: row;
    padding: 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-rail-logo {
    width: auto;
    height: 64px;
    border: 0;
  }
  .auth-rail-icons {
    display: flex;
    gap: 4px;
    padding: 0;
    overflow-x: auto;
  }
  .auth-rail-icons i {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .auth-rail-action {
    display: none;
  }
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 420px;
    order: -1;
  }
  .auth-visual img {
    object-position: center top;
  }
  .auth-panel {
    min-height: auto;
    align-items: start;
    justify-items: center;
    padding: 30px 18px 84px;
  }
  .auth-brand {
    position: static;
    justify-self: start;
    margin-bottom: 30px;
  }
  .auth-card {
    width: min(100%, 680px);
  }
  .auth-copy h1 {
    max-width: 12ch;
  }
  .auth-copy p {
    font-size: 16px;
    line-height: 1.5;
  }
  .auth-visual-badge {
    left: 18px;
    right: 18px;
    bottom: 16px;
  }
  .app-sidebar {
    width: 230px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app-sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-close, .floating-menu { display: inline-grid !important; }
  .app-main { margin-left: 0; }
  .top-tabs { overflow-x: auto; gap: 18px; }
  .main-stack,
  .rail-stack,
  .section-tabs,
  .table-panel,
  .recent-reports,
  .compact-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .event-status .venue, .event-status #clock, .event-status .heartbeat { display: none; }
  .overview-layout,
  .content-with-rail,
  .reports-layout,
  .settings-layout { grid-template-columns: 1fr; }
  #view-people .content-with-rail,
  #view-alerts .content-with-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  #view-people .main-stack,
  #view-people .rail-stack,
  #view-alerts .main-stack,
  #view-alerts .rail-stack,
  .reports-layout .main-stack,
  .reports-layout .rail-stack,
  .settings-layout .main-stack,
  .settings-layout .rail-stack {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    min-height: auto;
  }
  #view-people .app-table { height: auto; }
  .metric-grid.five,
  .metric-grid.four,
  .three-col,
  .map-stat-strip { grid-template-columns: 1fr 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-panel.wide,
  .donut-panel,
  .bar-panel,
  .heatmap-card,
  .engagement-card,
  .insights-card { grid-column: span 1; }
  .chainlit-page {
    margin: -28px -22px -32px -30px;
    padding: 0;
  }
  .demo-agent-shell {
    padding: 28px 22px 24px;
  }
  .demo-agent-header {
    display: block;
  }
  .demo-agent-status {
    margin-top: 14px;
    min-width: 0;
  }
  .demo-chat-row.user,
  .demo-chat-row.agent {
    width: 100%;
  }
  .uwb-map-canvas { height: 360px; }
  .chainlit-frame-shell { min-height: 100vh; }
  .app-shell:not([data-view="agent"]) .app-content { padding-top: 60px; }
}

@media (max-width: 640px) {
  .app-content { padding: 18px 14px 28px; }
  .app-shell:not([data-view="agent"]) .app-content { padding-top: 60px; }
  .page-heading { flex-direction: column; }
  .metric-grid.five,
  .metric-grid.four,
  .three-col,
  .map-stat-strip { grid-template-columns: 1fr; }
  .floor-map { height: 540px; }
  .map-stat-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .filter-row { align-items: stretch; }
  .filter-row > * { width: 100%; }
  .section-tabs { overflow-x: auto; gap: 20px; }
  .app-table { min-width: 860px; }
  .table-panel, .recent-reports, .compact-table { overflow-x: auto; }
  .uwb-sim-map { margin: 14px; }
  .uwb-map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .uwb-view-toggle { width: max-content; max-width: 100%; }
  .uwb-map-canvas { height: 410px; }
  .uwb-map-state {
    left: 68px;
    right: 12px;
    top: 14px;
    font-size: 10px;
  }
  .uwb-marker { transform: translate(-50%, -50%) scale(0.84); }
  .uwb-nearby-card {
    left: 14px;
    right: 14px;
    bottom: 14px;
    min-width: 0;
  }
  .uwb-layer-card { display: none; }
  .uwb-sim-map[data-map-mode="2d"] .uwb-floor { inset: 17% 5% 22%; }
  .chainlit-page { margin: -18px -14px -28px; }
  .demo-agent-header h1 { font-size: 28px; }
  .demo-chat-row { padding: 15px; }
  .demo-agent-prompts { justify-content: stretch; }
  .demo-agent-prompts button { width: 100%; }
  .auth-visual { min-height: 340px; }
  .auth-copy p {
    max-width: 34ch;
  }
  .auth-actions {
    grid-template-columns: 1fr;
  }
  .auth-actions .ghost-button {
    width: 100%;
  }
  .auth-points {
    gap: 12px;
  }
  .option-grid { grid-template-columns: 1fr; }
}
