/* ==========================================================================
   Halo theme
   Loaded last, after components.css. Remaps the design tokens from tokens.css
   and restyles the app shell, shared components, the Today screen and the
   customer portal. Three palettes are switched by html[data-palette]:
   cobalt (default), ignition and titanium. halo.js remembers the choice.
   Every selector is scoped under html[data-palette] so it outranks site.css.
   ========================================================================== */

/* ---------- Palettes ---------- */
html[data-palette],
html[data-palette="cobalt"] {
  --halo-a: #1f5fff;
  --halo-a-hi: #3b76ff;
  --halo-a-lo: #1247d6;
  --halo-a-rgb: 31, 95, 255;      /* solid accent, for tints */
  --halo-g-rgb: 31, 95, 255;      /* glow colour */
  --halo-a2: #00c2ff;
  --halo-a2-rgb: 0, 194, 255;
  --halo-tint: #e8efff;
  --halo-soft: #93b4ff;
  --halo-link: #1450e6;
  --halo-on-dark: #7fd9ff;        /* active icon in the dark sidebar */
}
html[data-palette="ignition"] {
  --halo-a: #f2541b;
  --halo-a-hi: #ff6d35;
  --halo-a-lo: #d2420c;
  --halo-a-rgb: 242, 84, 27;
  --halo-g-rgb: 242, 84, 27;
  --halo-a2: #ffb020;
  --halo-a2-rgb: 255, 176, 32;
  --halo-tint: #ffede4;
  --halo-soft: #ffb595;
  --halo-link: #c2410c;
  --halo-on-dark: #ffc061;
}
html[data-palette="titanium"] {
  --halo-a: #1e293b;
  --halo-a-hi: #334155;
  --halo-a-lo: #0f172a;
  --halo-a-rgb: 30, 41, 59;
  --halo-g-rgb: 56, 189, 248;
  --halo-a2: #38bdf8;
  --halo-a2-rgb: 56, 189, 248;
  --halo-tint: #e6ebf2;
  --halo-soft: #94a3b8;
  --halo-link: #0f172a;
  --halo-on-dark: #7dd3fc;
}

/* ---------- Token remap ---------- */
html[data-palette] {
  --halo-ink: #0f1222;
  --halo-ink-2: #3b4157;
  --halo-muted: #667089;
  --halo-bg: #f2f4f7;
  --halo-surface: #ffffff;
  --halo-sunk: #f0f2f6;
  --halo-line: #e3e6ec;
  --halo-line-2: #eef0f4;
  --halo-shell: #0f141c;
  --halo-shell-2: #1a212c;
  --halo-shell-line: #263040;
  --halo-glow: rgba(var(--halo-g-rgb), .38);
  --halo-shadow: 0 0 0 1px rgba(15, 18, 34, .06), 0 1px 2px rgba(15, 18, 34, .04), 0 8px 24px -12px rgba(15, 18, 34, .14);
  --halo-shadow-lift: 0 0 0 1px rgba(15, 18, 34, .07), 0 2px 4px rgba(15, 18, 34, .05), 0 18px 40px -18px rgba(15, 18, 34, .25);
  --halo-red: #e11d48;
  --halo-amber: #d97706;
  --halo-green: #059669;
  --halo-cyan: #0891b2;

  --font-sans: "Geist", Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --color-bg: var(--halo-bg);
  --color-bg-depth: #e9edf2;
  --color-surface: var(--halo-surface);
  --color-surface-muted: #f7f8fa;
  --color-line: var(--halo-line);
  --color-line-soft: var(--halo-line-2);
  --color-line-strong: #d3d8e1;
  --color-ink: var(--halo-ink);
  --color-muted: var(--halo-muted);

  --color-primary: var(--halo-a);
  --color-primary-strong: var(--halo-a-lo);
  --color-primary-soft: var(--halo-tint);
  --color-accent: var(--halo-a2);
  --color-accent-soft: rgba(var(--halo-a2-rgb), .12);
  --color-brand-ink: var(--halo-shell);

  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: var(--halo-shadow);
  --shadow-md: var(--halo-shadow);
  --shadow-lg: var(--halo-shadow-lift);
  --shadow-card: var(--halo-shadow);
  --shadow-overlay: var(--halo-shadow-lift);
  --focus-ring: 0 0 0 3px rgba(var(--halo-g-rgb), .28);

  --bs-body-font-family: var(--font-sans);
  --bs-primary: var(--halo-a);
  --bs-primary-rgb: var(--halo-a-rgb);
  --bs-link-color: var(--halo-link);
  --bs-link-color-rgb: var(--halo-a-rgb);
  --bs-link-hover-color: var(--halo-a-lo);
  --bs-border-radius: 10px;
  --bs-focus-ring-color: rgba(var(--halo-g-rgb), .28);
  --color-sidebar: var(--halo-shell);
}

html[data-palette] body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
html[data-palette] h1,
html[data-palette] .h1 { font-weight: 650; letter-spacing: -.03em; }
html[data-palette] h2,
html[data-palette] h3,
html[data-palette] .h2,
html[data-palette] .h3 { letter-spacing: -.015em; }
html[data-palette] a { color: var(--halo-link); }
html[data-palette] .btn,
html[data-palette] .sidebar-link,
html[data-palette] .app-topbar a,
html[data-palette] .app-sidebar a,
html[data-palette] .mobile-tabbar a { text-decoration: none; }

/* ---------- App shell ---------- */
html[data-palette] .app-shell,
html[data-palette] .app-content,
html[data-palette] .workspace-simple .app-content {
  background:
    radial-gradient(520px 260px at 12% 0%, rgba(var(--halo-a-rgb), .08), transparent 70%),
    radial-gradient(460px 240px at 78% 0%, rgba(var(--halo-a2-rgb), .08), transparent 70%),
    var(--halo-bg);
}

html[data-palette] .app-sidebar,
html[data-palette] .workspace-simple .app-sidebar {
  background: var(--halo-shell) !important;
  border-right: 1px solid #000 !important;
  color: #c9d0db;
  box-shadow: none;
}
html[data-palette] .sidebar-brand { color: #fff !important; }
html[data-palette] .sidebar-brand small,
html[data-palette] .nav-group-label,
html[data-palette] .app-sidebar .text-muted { color: #7b8597 !important; }
html[data-palette] .nav-group-label { letter-spacing: .08em; }
html[data-palette] .workspace-advanced .app-sidebar { gap: .65rem; }
html[data-palette] .workspace-advanced .sidebar-nav { gap: .65rem; }
html[data-palette] .workspace-advanced .nav-group { gap: .15rem; }
html[data-palette] .workspace-advanced .sidebar-link { min-height: 36px; padding: .42rem .65rem; }
html[data-palette] .nav-group-disclosure { display: block; }
html[data-palette] .nav-group-disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 32px;
  border-radius: 8px; padding: .35rem .65rem; list-style: none; cursor: pointer;
}
html[data-palette] .nav-group-disclosure > summary::-webkit-details-marker { display: none; }
html[data-palette] .nav-group-disclosure > summary::after { content: "+"; font-size: 1rem; font-weight: 500; }
html[data-palette] .nav-group-disclosure[open] > summary::after { content: "−"; }
html[data-palette] .nav-group-disclosure > summary:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
html[data-palette] .nav-group-disclosure > summary:focus-visible { outline: 2px solid var(--halo-on-dark); outline-offset: -2px; }
html[data-palette] .nav-group-disclosure .nav-group-links { display: grid; gap: .15rem; }
html[data-palette] .nav-group-disclosure:not([open]) .nav-group-links { display: none; }
html[data-palette] .sidebar-link,
html[data-palette] .workspace-simple .sidebar-link {
  color: #aab3c2 !important;
  border-radius: 10px;
  transition: background .15s, color .15s, box-shadow .15s;
}
html[data-palette] .sidebar-link .icon { color: #7d8899; }
html[data-palette] .sidebar-link:hover {
  background: rgba(255, 255, 255, .06) !important;
  color: #fff !important;
}
html[data-palette] .sidebar-link:hover .icon { color: #dfe4ec; }
html[data-palette] .sidebar-link.active,
html[data-palette] .workspace-simple .sidebar-link.active {
  background: rgba(255, 255, 255, .09) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 24px -6px rgba(var(--halo-g-rgb), .75);
}
html[data-palette] .sidebar-link.active .icon { color: var(--halo-on-dark); filter: drop-shadow(0 0 6px rgba(var(--halo-g-rgb), .7)); }

html[data-palette] .brand-mark,
html[data-palette] .brand-mark-premium,
html[data-palette] .sales-brand-mark {
  background: linear-gradient(135deg, var(--halo-a), var(--halo-a2)) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 4px 16px -2px var(--halo-glow), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
}

html[data-palette] .app-sidebar .form-select,
html[data-palette] .app-sidebar .form-control {
  background-color: var(--halo-shell-2);
  border-color: var(--halo-shell-line);
  color: #dfe4ec;
}
html[data-palette] .sidebar-account,
html[data-palette] .sidebar-admin-tools { border-color: var(--halo-shell-line) !important; }
html[data-palette] .sidebar-account .account-person,
html[data-palette] .sidebar-account .account-person strong { color: #fff; }
html[data-palette] .sidebar-account small,
html[data-palette] .sidebar-account .account-preferences { color: #8a94a6; }
html[data-palette] .sidebar-account .avatar {
  background: linear-gradient(135deg, #2a3342, #1a212c);
  color: #fff;
  box-shadow: 0 0 0 1px var(--halo-shell-line);
}
html[data-palette] .sidebar-account .btn-quiet {
  background: var(--halo-shell-2);
  border-color: var(--halo-shell-line);
  color: #dfe4ec;
}
html[data-palette] .sidebar-account .btn-quiet:hover,
html[data-palette] .sidebar-account .btn-quiet:focus-visible { background: #232b38; color: #fff; }

/* Keep daily navigation visible; personal controls expand only when requested. */
html[data-palette] .sidebar-account.profile-menu { display: block; position: relative; padding-top: .75rem; }
html[data-palette] .profile-menu > summary { cursor: pointer; list-style: none; border-radius: 8px; padding: .35rem; }
html[data-palette] .profile-menu > summary::-webkit-details-marker { display: none; }
html[data-palette] .profile-menu > summary::after { content: "⌃"; margin-left: auto; color: #c9d0db; }
html[data-palette] .profile-menu[open] > summary::after { content: "⌄"; }
html[data-palette] .profile-menu > summary:focus-visible { outline: 2px solid var(--halo-on-dark); outline-offset: 2px; }
html[data-palette] .profile-menu > summary:hover { background: rgba(255, 255, 255, .06); }
html[data-palette] .profile-menu .profile-menu-panel {
  position: absolute; bottom: calc(100% + .35rem); left: 0; right: 0; z-index: 40;
  display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--halo-shell-line);
  border-radius: 12px; background: var(--halo-shell-2); box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
  max-height: min(60vh, 420px); overflow-y: auto;
}
html[data-palette] .profile-menu:not([open]) .profile-menu-panel { display: none; }
html[data-palette] .profile-menu .profile-menu-panel .account-preferences { color: #dfe4ec; padding: .35rem 0; }
html[data-palette] .profile-menu .profile-menu-panel .account-preferences:hover { color: #fff; text-decoration: underline; }
html[data-palette] .profile-menu .profile-menu-panel label { color: #c9d0db; font-size: .75rem; margin-bottom: .35rem; }

html[data-palette] .app-topbar,
html[data-palette] .workspace-simple .app-topbar {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(15, 18, 34, .07);
  box-shadow: none;
}
html[data-palette] .topbar-title span { font-weight: 600; letter-spacing: -.01em; }

/* Palette switch: three swatches in the top bar and the mobile "More" menu */
.halo-palette {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(15, 18, 34, .05);
}
.halo-palette button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
}
.halo-palette button span.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.halo-palette button[data-palette-choice="cobalt"] .swatch { background: linear-gradient(135deg, #1f5fff, #00c2ff); }
.halo-palette button[data-palette-choice="ignition"] .swatch { background: linear-gradient(135deg, #f2541b, #ffb020); }
.halo-palette button[data-palette-choice="titanium"] .swatch { background: linear-gradient(135deg, #1e293b 55%, #38bdf8); }
.halo-palette button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 18, 34, .08), 0 2px 6px -2px rgba(15, 18, 34, .2);
}
.halo-palette button[aria-pressed="true"] .swatch { box-shadow: 0 0 10px rgba(var(--halo-g-rgb), .7); }
.halo-palette button:focus-visible { outline: 2px solid var(--halo-a); outline-offset: 2px; }
.workspace-palette-options { flex-wrap: wrap; gap: .5rem; padding: .5rem; }
.workspace-palette-options button { width: auto; height: auto; min-height: 44px; display: flex; gap: .5rem; padding: .6rem .8rem; color: var(--halo-ink); font-weight: 600; border: 1px solid transparent; }
.workspace-palette-options button[aria-pressed="true"] { border-color: var(--halo-link); box-shadow: 0 0 0 1px var(--halo-link); }
.halo-palette-mobile { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem; }
.halo-palette-mobile > span { color: var(--neutral-700); font-size: var(--fs-xs); }

/* ---------- Surfaces ---------- */
html[data-palette] .surface,
html[data-palette] .card,
html[data-palette] .settings-panel,
html[data-palette] .simple-command-queue,
html[data-palette] .simple-day-sections > section,
html[data-palette] .simple-request-card,
html[data-palette] .portal-next-actions,
html[data-palette] .portal-decision {
  background: var(--halo-surface);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--halo-shadow);
}
html[data-palette] .card-header,
html[data-palette] .card-footer { background: transparent; border-color: var(--halo-line-2); }
html[data-palette] .eyebrow {
  color: var(--halo-muted);
  letter-spacing: .08em;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
html[data-palette] .btn { border-radius: 10px; font-weight: 550; transition: box-shadow .15s, background .15s, transform .05s; }
html[data-palette] .btn:active { transform: translateY(1px); }
html[data-palette] .btn-primary {
  --bs-btn-active-bg: var(--halo-a-lo);
  --bs-btn-active-border-color: var(--halo-a-lo);
  --bs-btn-disabled-bg: var(--halo-a);
  --bs-btn-disabled-border-color: var(--halo-a);
  color: #fff;
  background: linear-gradient(180deg, var(--halo-a-hi), var(--halo-a-lo));
  border-color: var(--halo-a-lo);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 20px -8px var(--halo-glow);
}
html[data-palette] .btn-primary:hover,
html[data-palette] .btn-primary:focus-visible {
  color: #fff;
  background: linear-gradient(180deg, var(--halo-a-hi), var(--halo-a));
  border-color: var(--halo-a-lo);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 26px -8px rgba(var(--halo-g-rgb), .55);
}
html[data-palette] .btn-outline-primary {
  --bs-btn-active-bg: var(--halo-tint);
  --bs-btn-active-color: var(--halo-a-lo);
  background: var(--halo-tint);
  border-color: transparent;
  color: var(--halo-link);
}
html[data-palette] .btn-outline-primary:hover,
html[data-palette] .btn-outline-primary:focus-visible {
  background: rgba(var(--halo-a-rgb), .14);
  border-color: transparent;
  color: var(--halo-a-lo);
}
html[data-palette] .btn-outline-secondary,
html[data-palette] .btn-outline-dark,
html[data-palette] .btn-light {
  background: #fff;
  border-color: transparent;
  color: var(--halo-ink);
  box-shadow: var(--halo-shadow);
}
html[data-palette] .btn-outline-secondary:hover,
html[data-palette] .btn-outline-dark:hover,
html[data-palette] .btn-light:hover {
  background: #f8f9fb;
  color: var(--halo-ink);
  border-color: transparent;
}
html[data-palette] .btn:focus-visible { box-shadow: var(--focus-ring); }
html[data-palette] .btn-attention {
  background: var(--halo-shell);
  border-color: var(--halo-shell);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(15, 18, 34, .5);
}
html[data-palette] .btn-attention:hover,
html[data-palette] .btn-attention:focus-visible { background: #1a212c; color: #fff; }
html[data-palette] .btn-attention .attention-count,
html[data-palette] .workspace-simple .topbar-actions .btn-attention .attention-count {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--halo-a2);
  color: #0f141c;
  box-shadow: 0 0 10px rgba(var(--halo-a2-rgb), .7);
}

/* ---------- Forms ---------- */
html[data-palette] .form-control,
html[data-palette] .form-select {
  border-radius: 10px;
  border-color: #dde1e8;
}
html[data-palette] .form-control:focus,
html[data-palette] .form-select:focus,
html[data-palette] .form-check-input:focus {
  border-color: rgba(var(--halo-g-rgb), .7);
  box-shadow: var(--focus-ring);
}
html[data-palette] .form-check-input:checked {
  background-color: var(--halo-a);
  border-color: var(--halo-a);
}

/* ---------- Tables, tabs, badges ---------- */
html[data-palette] .table { --bs-table-border-color: var(--halo-line-2); }
html[data-palette] .table > thead th {
  background: #f7f8fa;
  color: var(--halo-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .02em;
}
html[data-palette] .nav-pills .nav-link.active,
html[data-palette] .nav-pills .show > .nav-link {
  background: var(--halo-a);
  box-shadow: 0 6px 16px -8px var(--halo-glow);
}
html[data-palette] .nav-tabs .nav-link.active { color: var(--halo-ink); border-bottom-color: var(--halo-a); }
html[data-palette] .text-bg-primary { background-color: var(--halo-a) !important; }
html[data-palette] .bg-primary { background-color: var(--halo-a) !important; }
html[data-palette] .text-primary { color: var(--halo-link) !important; }
html[data-palette] .page-link.active,
html[data-palette] .active > .page-link { background: var(--halo-a); border-color: var(--halo-a); }

/* ---------- Mobile tab bar ---------- */
html[data-palette] .mobile-tabbar {
  background: rgba(15, 20, 28, .94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid #000;
}
html[data-palette] .mobile-tabbar > a,
html[data-palette] .mobile-tabbar summary { color: #9aa3b2; }
html[data-palette] .mobile-tabbar > a.active { background: var(--halo-link); color: #fff; }
html[data-palette] .mobile-tabbar > a.active .icon { color: #fff; filter: none; }
html[data-palette] .settings-tabs .nav-link.active,
html[data-palette] .workspace-simple .settings-tabs .nav-link.active { background: var(--halo-link); border-color: var(--halo-link); color: #fff !important; }
@media (max-width: 767px) {
  /* Workspace tabs may stick at the top; the taller global header scrolls away. */
  html[data-palette] .app-topbar,
  html[data-palette] .workspace-simple .app-topbar { position: static; top: auto; }
}

/* ==========================================================================
   Today: the Halo home screen (Areas/App/Views/Today/_HaloIndex.cshtml)
   ========================================================================== */
.halo-today { display: grid; gap: 18px; }
.halo-today .tn { font-variant-numeric: tabular-nums; }
.halo-today .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.halo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.halo-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--halo-muted); font-size: 12.5px; font-weight: 500; }
.halo-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(5, 150, 105, .1); color: #047857; font-weight: 600; font-size: 11px;
}
.halo-live i { width: 6px; height: 6px; border-radius: 50%; background: #10b981; box-shadow: 0 0 8px #10b981; animation: halo-pulse 2s infinite; }
.halo-head h1 { margin: 4px 0 0; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.12; text-wrap: balance; }
.halo-head h1 span {
  background: linear-gradient(90deg, var(--halo-a), var(--halo-a2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-palette="titanium"] .halo-head h1 span { background-image: linear-gradient(90deg, #0f172a, #0284c7); }
.halo-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.halo-kbd {
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.4;
  padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--halo-line); background: var(--halo-sunk); color: var(--halo-muted);
}
.btn-primary .halo-kbd { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; }

.halo-alerts { display: grid; gap: 8px; }
.halo-alert {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px; background: #fff; box-shadow: var(--halo-shadow);
}
.halo-alert::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--halo-amber); box-shadow: 0 0 8px var(--halo-amber); }
.halo-alert span { color: var(--halo-muted); flex: 1; min-width: 200px; }

/* KPI tiles */
.halo-kpis { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 12px; }
.halo-kpi {
  position: relative; overflow: hidden; display: grid; gap: 4px;
  padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: var(--halo-shadow);
  color: var(--halo-ink); text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
html[data-palette] a.halo-kpi { color: var(--halo-ink); }
.halo-kpi:hover { box-shadow: var(--halo-shadow-lift); transform: translateY(-1px); }
.halo-kpi .lab { display: flex; justify-content: space-between; gap: 8px; color: var(--halo-muted); font-weight: 500; font-size: 12px; }
.halo-kpi strong { font-size: 34px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.halo-kpi small { color: var(--halo-muted); font-size: 12px; }
.halo-kpi small b { font-weight: 600; color: var(--halo-ink-2); }
.halo-kpi .ic {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: var(--halo-sunk); color: var(--halo-ink-2);
}
.halo-kpi .ic .icon { width: 15px; height: 15px; }
.halo-kpi .lab + div { padding-right: 36px; }
.halo-kpi.hot {
  box-shadow: 0 0 0 1px rgba(var(--halo-g-rgb), .38), 0 10px 30px -10px var(--halo-glow), 0 0 0 4px rgba(var(--halo-g-rgb), .06);
}
.halo-kpi.hot::after {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 200px; height: 150px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--halo-g-rgb), .16), transparent);
}
.halo-kpi.hot strong {
  background: linear-gradient(180deg, var(--halo-a), var(--halo-a-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.halo-kpi.hot .ic { background: var(--halo-tint); color: var(--halo-link); }
.halo-mix { display: flex; gap: 4px; margin-top: 6px; }
.halo-mix i { height: 4px; border-radius: 2px; min-width: 6px; }

/* Layout */
.halo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.halo-col { display: grid; gap: 18px; align-content: start; min-width: 0; }
.halo-panel { background: #fff; border-radius: 16px; box-shadow: var(--halo-shadow); min-width: 0; }
.halo-ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; flex-wrap: wrap; }
.halo-ph h2 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.halo-count { font-size: 11px; font-weight: 600; color: var(--halo-link); background: var(--halo-tint); padding: 1px 7px; border-radius: 999px; }
.halo-count.neutral { color: var(--halo-ink-2); background: var(--halo-sunk); }
.halo-count.good { color: #047857; background: rgba(5, 150, 105, .1); }
html[data-palette] .halo-link { color: var(--halo-link); font-weight: 500; font-size: 12.5px; text-decoration: none; }
.halo-link:hover { text-decoration: underline; }

/* Queue */
.halo-q {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 176px auto; gap: 14px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--halo-line-2); transition: background .15s;
}
.halo-q:hover { background: #fafbfc; }
.halo-av {
  --c: var(--halo-a);
  position: relative; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 600; font-size: 12px;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff);
}
.halo-av::after {
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid #fff; background: var(--c);
}
.halo-q .t1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-weight: 600; letter-spacing: -.01em; }
html[data-palette] .halo-q .t1 a { color: var(--halo-ink); }
.halo-q .t1 .sr { font-weight: 400; color: var(--halo-muted); font-size: 11.5px; }
.halo-q .t2 { color: var(--halo-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; font-size: 13px; }
.halo-q .t2 em { font-style: normal; color: var(--halo-muted); }
.halo-q .meta { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.halo-q .meta small { color: var(--halo-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.halo-reason {
  --c: var(--halo-a);
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: 999px;
  color: color-mix(in srgb, var(--c) 82%, #000);
  background: color-mix(in srgb, var(--c) 10%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent);
  white-space: nowrap;
}
.halo-reason i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); flex: none; }
.halo-q .acts { display: flex; gap: 6px; }
.halo-q .acts .btn { font-size: 12.5px; padding: 6px 12px; white-space: nowrap; }
.tone-accent { --c: var(--halo-a); }
html[data-palette="titanium"] .tone-accent { --c: #0284c7; }
.tone-success { --c: var(--halo-green); }
.tone-warning { --c: var(--halo-amber); }
.tone-danger { --c: var(--halo-red); }
.tone-neutral { --c: #475569; }
.halo-q.urgent { background: linear-gradient(90deg, rgba(var(--halo-g-rgb), .06), transparent 60%); }
.halo-q.urgent .halo-av { animation: halo-breathe 2.6s ease-in-out infinite; }
.halo-qfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--halo-line-2); color: var(--halo-muted); font-size: 12px; }
.halo-empty { display: grid; justify-items: center; gap: 4px; padding: 28px 18px 30px; text-align: center; color: var(--halo-muted); border-top: 1px solid var(--halo-line-2); }
.halo-empty strong { color: var(--halo-ink); font-size: 14px; }
.halo-empty .icon { width: 22px; height: 22px; color: var(--halo-green); }

/* Shop floor */
.halo-pipe { padding: 4px 18px 16px; display: grid; gap: 12px; }
.halo-pbar { display: flex; gap: 3px; height: 10px; }
.halo-pbar i { border-radius: 3px; min-width: 6px; }
.halo-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.halo-stage { background: var(--halo-sunk); border-radius: 12px; padding: 10px 10px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
.halo-stage .sh { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--halo-muted); font-weight: 500; }
.halo-stage .sh span { display: flex; align-items: center; gap: 5px; min-width: 0; }
.halo-stage .sh span em { min-width: 0; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.halo-stage .sh b { font-size: 16px; color: var(--halo-ink); font-weight: 600; letter-spacing: -.02em; }
.halo-sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.halo-car {
  display: block; background: #fff; border-radius: 8px; padding: 5px 7px;
  box-shadow: 0 0 0 1px rgba(15, 18, 34, .06); font-size: 11.5px; line-height: 1.25;
  text-decoration: none; transition: box-shadow .15s;
}
html[data-palette] a.halo-car { color: var(--halo-ink); }
.halo-car:hover { box-shadow: 0 0 0 1px rgba(var(--halo-g-rgb), .45), 0 0 14px rgba(var(--halo-g-rgb), .22); }
.halo-car b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.halo-car span { color: var(--halo-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.halo-more { font-size: 11px; color: var(--halo-muted); padding-left: 4px; }

/* Timeline */
.halo-tl { padding: 6px 18px 18px; overflow-x: auto; }
.halo-axis { position: relative; height: 104px; margin-top: 8px; min-width: 560px; }
.halo-axis .rail { position: absolute; left: 0; right: 0; top: 50px; height: 2px; background: var(--halo-line); border-radius: 1px; }
.halo-axis .past { position: absolute; left: 0; top: 50px; height: 2px; background: linear-gradient(90deg, rgba(var(--halo-g-rgb), .2), rgba(var(--halo-g-rgb), .95)); border-radius: 1px; }
.halo-axis .now { position: absolute; top: 10px; bottom: 6px; width: 2px; margin-left: -1px; background: rgba(var(--halo-g-rgb), 1); box-shadow: 0 0 12px 2px var(--halo-glow); border-radius: 1px; }
.halo-axis .now span {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 600; color: #fff; white-space: nowrap;
  background: rgba(var(--halo-g-rgb), 1); border-radius: 999px; padding: 1px 7px;
  box-shadow: 0 4px 12px -2px var(--halo-glow);
}
html[data-palette="titanium"] .halo-axis .now span { color: #0f172a; }
.halo-ev { position: absolute; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; font-size: 10.5px; white-space: nowrap; text-decoration: none; }
html[data-palette] a.halo-ev { color: var(--halo-ink); }
.halo-ev.up { bottom: 50px; }
.halo-ev.dn { top: 50px; }
.halo-ev .pin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c); background: var(--c); margin: -4px 0; }
.halo-ev.up .pin { order: 2; }
.halo-ev b { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.halo-ev small { color: var(--halo-muted); font-size: 10px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.halo-ev.done { opacity: .5; }
.halo-ev.drop { --c: var(--halo-cyan); }
.halo-ev.pickup { --c: var(--halo-green); }
.halo-ticks { position: relative; height: 16px; min-width: 560px; color: var(--halo-muted); font-size: 10.5px; font-family: var(--font-mono); }
.halo-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.halo-ticks span:first-child { transform: none; }
.halo-ticks span:last-child { transform: translateX(-100%); }
.halo-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--halo-muted); }
.halo-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* Right rail */
.halo-quick { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.halo-quick a {
  position: relative; display: grid; gap: 6px; padding: 12px; border-radius: 12px;
  background: var(--halo-sunk); font-weight: 500; font-size: 12.5px; text-decoration: none;
  transition: background .15s, box-shadow .15s;
}
html[data-palette] .halo-quick a { color: var(--halo-ink); }
.halo-quick a:hover { background: #e9ecf2; }
.halo-quick a .icon { width: 18px; height: 18px; color: var(--halo-link); }
.halo-quick a .halo-kbd { position: absolute; top: 10px; right: 10px; }
html[data-palette] .halo-quick a.big {
  grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; color: #fff;
  background: linear-gradient(135deg, var(--halo-a), var(--halo-a-lo) 55%, var(--halo-a2));
  box-shadow: 0 12px 28px -12px var(--halo-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
html[data-palette="titanium"] .halo-quick a.big { background: linear-gradient(135deg, #1e293b, #0f172a 60%, #075985); }
.halo-quick a.big .icon { color: #fff; width: 20px; height: 20px; }
.halo-quick a.big small { display: block; font-weight: 400; opacity: .82; font-size: 11.5px; }
.halo-quick a.big .halo-kbd { position: static; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: #fff; }
.halo-ready .r { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--halo-line-2); }
.halo-ready .r .tx { flex: 1; min-width: 0; }
.halo-ready .r .tx b { font-weight: 600; display: block; }
.halo-ready .r .tx small { display: block; color: var(--halo-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.halo-ready .ok { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(5, 150, 105, .1); color: var(--halo-green); flex: none; }
.halo-ready .ok .icon { width: 14px; height: 14px; }
.halo-ready .r-empty { padding: 4px 18px 16px; color: var(--halo-muted); font-size: 12.5px; }
.halo-promises .r .when { font-family: var(--font-mono); font-size: 12px; color: var(--halo-ink-2); }

@media (max-width: 1280px) {
  .halo-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .halo-q { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .halo-q .meta { grid-column: 2; grid-row: 2; }
  .halo-q .acts { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 1080px) {
  .halo-grid { grid-template-columns: minmax(0, 1fr); }
  .halo-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .halo-kpis { grid-template-columns: 1fr; }
  .halo-q { grid-template-columns: 36px minmax(0, 1fr); }
  .halo-q .acts { grid-column: 2; grid-row: 3; }
  .halo-q .t2 { white-space: normal; }
}

/* ==========================================================================
   Customer portal (Views/Portal/Index.cshtml) and check-in pages
   ========================================================================== */
html[data-palette] .customer-shell-body {
  background:
    radial-gradient(520px 280px at 15% 0%, rgba(var(--halo-a-rgb), .09), transparent 70%),
    radial-gradient(460px 260px at 85% 0%, rgba(var(--halo-a2-rgb), .1), transparent 70%),
    var(--halo-bg);
}
/* Selectors carry .customer-shell-body as well so they out-rank the
   several generations of portal rules in site.css and usability.css. */
html[data-palette] .customer-shell-body,
html[data-palette] .customer-shell-body :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .btn, .form-control, .form-select) {
  font-family: var(--font-sans);
}
html[data-palette] .customer-shell-body .portal-status-hero,
html[data-palette] .customer-shell-body .portal-status-hero.premium-portal-hero {
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(var(--halo-g-rgb), .10), transparent 70%),
    #fff;
  /* The shop's brand colour arrives as an inline border-color; keep it as a top accent. */
  border-style: solid !important;
  border-width: 3px 0 0 !important;
  border-radius: 20px;
  box-shadow: var(--halo-shadow-lift);
  position: relative;
  overflow: hidden;
}
html[data-palette] .customer-shell-body .portal-status-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 240px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--halo-g-rgb), .16), transparent);
}
html[data-palette] .customer-shell-body .portal-status-hero > * { position: relative; z-index: 1; }
html[data-palette] .customer-shell-body .portal-status-hero h1,
html[data-palette] .customer-shell-body .premium-portal-hero h1 {
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: -.035em;
  color: var(--halo-ink);
}
html[data-palette] .customer-shell-body .portal-status-hero .eyebrow { color: var(--halo-link); }
html[data-palette] .customer-shell-body .portal-request-number { font-family: var(--font-mono); color: var(--halo-muted); font-size: 12.5px; }
html[data-palette] .customer-shell-body .portal-trust-row span {
  background: var(--halo-sunk);
  border: 0;
  border-radius: 999px;
  color: var(--halo-ink-2);
}
html[data-palette] .customer-shell-body .portal-status-card {
  background: linear-gradient(160deg, #fff 10%, var(--halo-tint));
  border: 0;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(var(--halo-g-rgb), .25), 0 12px 30px -14px var(--halo-glow);
}
html[data-palette] .customer-shell-body .portal-status-card strong { font-family: var(--font-sans); color: var(--halo-ink); letter-spacing: -.02em; }
html[data-palette] .customer-shell-body .portal-status-card > span:not(.status-pill),
html[data-palette] .customer-shell-body .portal-status-card small { color: var(--halo-muted); }
/* Shops pick a colour per status; only the neutral and primary ones take the accent. */
html[data-palette] .customer-shell-body .portal-status-card .status-pill { border: 0; box-shadow: 0 6px 16px -8px rgba(15, 18, 34, .35); }
html[data-palette] .customer-shell-body .portal-status-card .status-pill:is(.text-bg-secondary, .text-bg-primary) {
  background: linear-gradient(180deg, var(--halo-a-hi), var(--halo-a-lo)) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px -8px var(--halo-glow);
}
html[data-palette] .customer-shell-body .portal-next-actions,
html[data-palette] .customer-shell-body .surface,
html[data-palette] .customer-shell-body .portal-decision {
  background: var(--halo-surface);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--halo-shadow);
}
html[data-palette] .customer-shell-body .portal-decision > summary { background: #f7f8fa; }
html[data-palette] .customer-shell-body .btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--halo-a-hi), var(--halo-a-lo));
  border-color: var(--halo-a-lo);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 20px -8px var(--halo-glow);
}
html[data-palette] .customer-shell-body .btn-primary:hover,
html[data-palette] .customer-shell-body .btn-primary:focus-visible {
  background: linear-gradient(180deg, var(--halo-a-hi), var(--halo-a));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 26px -8px rgba(var(--halo-g-rgb), .55);
}
html[data-palette] .media-tile {
  border-radius: 12px; overflow: hidden; border: 0;
  box-shadow: var(--halo-shadow);
}
html[data-palette] .message-bubble { border-radius: 14px; }
html[data-palette] .customer-powered-by { color: var(--halo-muted); }

/* ---------- Motion ---------- */
@keyframes halo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes halo-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--halo-g-rgb), .12), 0 0 14px rgba(var(--halo-g-rgb), .25); }
  50% { box-shadow: 0 0 0 3px rgba(var(--halo-g-rgb), .2), 0 0 24px rgba(var(--halo-g-rgb), .5); }
}
@media (prefers-reduced-motion: reduce) {
  .halo-live i,
  .halo-q.urgent .halo-av { animation: none; }
  .halo-kpi:hover { transform: none; }
}

/* The top-bar palette switch moves into the mobile "More" menu on small screens. */
@media (max-width: 760px) {
  .app-topbar .halo-palette { display: none; }
}
