/* ============================================================
   KAMO Ops Command Center — Style
   ============================================================ */

:root {
  --rail-width: 76px;
  --topbar-height: 60px;

  --bg: #0c0e13;
  --bg-primary: #0c0e13;
  --bg-surface: #1a1f2e;
  /* App chrome: left rail + top bar */
  --chrome-rail: rgba(13, 23, 34, 1);
  --chrome-topbar: rgba(13, 23, 34, 1);
  --bg-panel: rgba(19, 22, 29, 0.88);
  --bg-panel-hover: rgba(26, 30, 40, 0.96);
  --bg-hover: #242c3d;
  --bg-elevated: #1c2029;
  --border: #252a36;
  --border-soft: #2e3544;
  --border-light: #2e3444;
  --border-accent: #3b82f6;

  --text-primary: #e8eaf0;
  --text-secondary: #8b90a0;
  --text-muted: #5c6178;

  --accent: #3b82f6;
  --accent-light: #8bb6ff;
  --accent-dim: rgba(59, 130, 246, 0.12);

  --success: #22c55e;
  --success-dim: rgba(34, 197, 94, 0.12);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.12);
  --critical: #ef4444;
  --critical-dim: rgba(239, 68, 68, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.12);
  --teal: #14b8a6;
  --teal-dim: rgba(20, 184, 166, 0.12);
  --pink: #ec4899;
  --pink-dim: rgba(236, 72, 153, 0.12);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.12);
  --lime: #84cc16;
  --lime-dim: rgba(132, 204, 22, 0.12);
  --orange: #fb923c;
  --orange-dim: rgba(251, 146, 60, 0.12);
  --slate: #94a3b8;
  --slate-dim: rgba(148, 163, 184, 0.12);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow-soft: 0 24px 60px rgba(88, 58, 33, 0.1);
  --shadow-panel: 0 16px 34px rgba(89, 62, 35, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.2);
  --glow-soft: 0 0 24px rgba(59, 130, 246, 0.1);
  --glow-accent: inset 0 0 1px rgba(59, 130, 246, 0.2);

  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-display: 'Instrument Serif', Georgia, serif;

  /* Left-anchored × on inventory fullscreen UIs (transport, lookup, expand modal) */
  --inventory-fullscreen-x-inset: 0.38rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Native selects: Chromium/Windows may use light list UI unless color-scheme is dark */
html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
  --mobile-rail-extra-bottom: 0px;
  --vv-bottom-offset: 0px;
}

/* Pull-to-refresh indicator (standalone web app only; see app.js) */
.ptr-indicator {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 12000;
  height: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top, 0px) 0 0;
  overflow: hidden;
}

.ptr-indicator-inner {
  width: min(520px, calc(100vw - 1.25rem));
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transform: translateY(-18px);
  opacity: 0;
  transition: opacity 160ms ease;
}

.ptr-indicator.is-visible .ptr-indicator-inner {
  opacity: 1;
}

.ptr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 13, 20, 0.65);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.ptr-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.86);
}

.ptr-arrow {
  width: 16px;
  height: 16px;
  transform-origin: 50% 50%;
  transition: transform 160ms ease;
}

.ptr-indicator.is-armed .ptr-arrow {
  transform: rotate(180deg);
}

.ptr-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.82);
  display: none;
}

.ptr-indicator.is-loading .ptr-spinner {
  display: block;
  animation: ptrSpin 0.78s linear infinite;
}

.ptr-indicator.is-loading .ptr-arrow {
  display: none;
}

@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}

.ptr-label {
  font: 700 0.74rem/1 var(--font-body);
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  user-select: none;
}

/* ============================================================
   Splash screen (mobile / web app)
   ============================================================ */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 780px at 70% 18%, rgba(59, 130, 246, 0.22), transparent 62%),
    radial-gradient(900px 520px at 18% 28%, rgba(99, 102, 241, 0.10), transparent 58%),
    radial-gradient(1100px 760px at 50% 70%, rgba(2, 6, 23, 0.80), rgba(2, 6, 23, 1) 72%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.98), rgba(8, 12, 20, 0.98));
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

html.splash-enabled .splash-screen {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

html.splash-enabled .splash-screen.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.splash-card {
  display: none;
}

.splash-head {
  display: none;
}

.splash-head-text {
  display: none;
}

.splash-center {
  position: relative;
  width: min(560px, calc(100vw - 2.6rem));
  min-height: min(640px, calc(100vh - 4.5rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  text-align: center;
  padding: 1.2rem 1rem;
  animation:
    splashPop 520ms cubic-bezier(0.16, 1, 0.3, 1) both,
    splashFloat 3.6s ease-in-out 520ms infinite;
}

.splash-logo {
  display: block;
  height: 92px;
  width: auto;
  margin: 0;
  filter: drop-shadow(0 22px 60px rgba(0, 0, 0, 0.55));
  opacity: 0.96;
  flex-shrink: 0;
  animation: splashLogoPulse 2.4s ease-in-out 520ms infinite;
}

@keyframes splashLogoPulse {
  0%, 100% { transform: scale(1); opacity: 0.96; }
  50% { transform: scale(1.02); opacity: 1; }
}

.splash-orbit {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.06), transparent 55%),
    conic-gradient(from 190deg, rgba(59, 130, 246, 0.0), rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.0));
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 56%, rgba(0,0,0,1) 58% 100%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 0 56%, rgba(0,0,0,1) 58% 100%);
  opacity: 0.55;
  filter: blur(0.3px);
  pointer-events: none;
  animation: splashOrbit 3.2s linear infinite;
}

@keyframes splashOrbit {
  to { transform: rotate(360deg); }
}

@keyframes splashPop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.008); }
}

.splash-title {
  font-family: 'Russo One', 'Bebas Neue', var(--font-body);
  font-weight: 400;
  font-size: 2.1rem;
  letter-spacing: 0.10em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.splash-subtitle {
  margin-top: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.34em;
  color: rgba(148, 163, 184, 0.72);
  margin-top: -0.28rem;
  line-height: 1.05;
}

.splash-loader {
  position: relative;
  height: 10px;
  margin-top: 0.95rem;
  width: min(320px, 78%);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.splash-loader-bar {
  display: none;
}

@keyframes splashShimmer {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}

.splash-loader-track {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.06));
}

.splash-loader-fill {
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.00),
    rgba(59, 130, 246, 0.78),
    rgba(147, 197, 253, 0.92),
    rgba(59, 130, 246, 0.78),
    rgba(37, 99, 235, 0.00)
  );
  opacity: 0.95;
  will-change: transform, opacity;
  animation: splashSweep 1.25s cubic-bezier(0.25, 1, 0.35, 1) infinite;
}

.splash-loader-glow {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(147, 197, 253, 0.92);
  box-shadow:
    0 0 12px rgba(59, 130, 246, 0.85),
    0 0 38px rgba(59, 130, 246, 0.55);
  will-change: left, opacity, transform;
  animation: splashDot 1.25s cubic-bezier(0.25, 1, 0.35, 1) infinite;
}

@keyframes splashSweep {
  0% { transform: translateX(-110%); opacity: 0; }
  10% { opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translateX(110%); opacity: 0; }
}

@keyframes splashDot {
  0% { left: -6%; opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  12% { opacity: 0.95; }
  88% { opacity: 0.95; }
  100% { left: 106%; opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

.splash-loading-text {
  margin-top: 0.35rem;
  font: 800 0.62rem/1 var(--font-body);
  letter-spacing: 0.36em;
  color: rgba(59, 130, 246, 0.55);
}

@media (max-width: 420px) {
  .splash-orbit { width: 440px; height: 440px; }
  .splash-logo { height: 84px; }
  .splash-title { font-size: 1.9rem; }
}
body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.1), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(167,139,250,0.1), transparent 24%),
    radial-gradient(circle at bottom right, rgba(6,182,212,0.08), transparent 22%),
    linear-gradient(180deg, #0b0d12 0%, #0c0e13 55%, #0f1219 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding: var(--topbar-height) 0 0 var(--rail-width);
}

select {
  color-scheme: dark;
}
select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.ambient-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 75% 55% at 20% 12%, rgba(59,130,246,0.08) 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 78% 82%, rgba(139,92,246,0.07) 0%, transparent 62%);
  pointer-events: none;
}

/* ---- COMMAND RAIL (LEFT NAVIGATION) ---- */
.command-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail-width);
  background: var(--chrome-rail);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  z-index: 99;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Hide the Overview entry on the desktop left rail (it stays on the mobile
   bottom nav, which is the same .command-rail restyled under 768px). */
@media (min-width: 768px) {
  .rail-menu-item--overview { display: none; }
}

.rail-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

.rail-brand {
  display: none;
}

.rail-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.rail-toggle svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.rail-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(59, 130, 246, 0.28);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.rail-toggle:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 4px;
}

.rail-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.5rem;
  flex: 1;
  min-height: 0;
}

.rail-menu > li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.25rem;
  margin-top: 0.25rem;
}

.rail-link,
.rail-group-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
  background: transparent;
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  font-family: var(--font-body);
  font-weight: 500;
  width: 100%;
  flex-shrink: 0;
}
.rail-link--button {
  font: inherit;
}
.rail-notif-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rail-link:hover,
.rail-group-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.rail-link:focus-visible,
.rail-group-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}

.rail-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-light);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.rail-link.active::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.rail-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.rail-label {
  display: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.rail-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}


.rail-group-btn[aria-expanded="true"] .rail-chevron {
  transform: rotate(180deg);
}

/* Hide the chevron when the label is hidden (mobile collapsed-icon-only state) */
@media (max-width: 767px) {
  .rail-menu:not(.open) .rail-chevron {
    display: none;
  }
}

.rail-divider {
  list-style: none;
  height: 1px;
  margin: 0.6rem 0.4rem;
  background: var(--border-soft);
  opacity: 0.6;
  flex-shrink: 0;
}

.rail-submenu {
  list-style: none;
  display: grid;
  gap: 0.1rem;
  padding: 0.25rem 0 0.15rem;
}

.rail-submenu[hidden] {
  display: none;
}

.rail-submenu .rail-link {
  min-height: 32px;
  padding: 0.35rem 0.5rem 0.35rem 2.1rem;
  font-size: 0.75rem;
  justify-content: flex-start;
}

.rail-submenu .rail-link::after {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted, rgba(255, 255, 255, 0.25));
  transform: translateY(-50%);
}

.rail-submenu .rail-link.active::after {
  background: var(--accent);
}

/* ---- TOPBAR (REDESIGNED) ---- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--rail-width);
  right: 0;
  height: var(--topbar-height);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  background: var(--chrome-topbar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-soft);
  gap: 1rem;
}

/* Extend the topbar's bottom rule across the rail so it spans the full screen */
.topbar::before {
  content: '';
  position: absolute;
  bottom: -1px;
  right: 100%;
  width: var(--rail-width);
  height: 1px;
  background: var(--border-soft);
  pointer-events: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 0 0 auto;
  min-width: 0;
}

.topbar-title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.topbar-brand {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.topbar-brand:hover {
  color: var(--accent);
}

.topbar-mobile-logo {
  display: none;
}
.topbar-brand:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

.topbar-subtitle {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topbar-context-period {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-transform: none;
}

.topbar-context-period[hidden] {
  display: none !important;
}

.topbar-market-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.topbar-market-trigger::after {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.75;
  transition: transform 0.2s ease;
}
.topbar-market-trigger[aria-expanded="true"]::after {
  transform: rotate(-135deg) translateY(-1px);
}
.topbar-market-trigger:hover,
.topbar-market-trigger:focus-visible {
  color: #8bb6ff;
}
.topbar-market-trigger:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
}
.topbar-market-menu {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  min-width: 220px;
  padding: 0.35rem;
  display: grid;
  gap: 0.2rem;
  background: rgba(19, 22, 29, 0.96);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  z-index: 1000;
}
.topbar-market-menu[hidden] { display: none; }
.topbar-market-option {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.topbar-market-option:hover,
.topbar-market-option:focus-visible {
  background: var(--bg-panel-hover);
  color: var(--text-primary);
  outline: none;
}
.topbar-market-option.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Top-bar tabs removed — navigation moved to command rail */

.topbar-market-section {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

/* Calendar trigger sits flush against the store chip (parent `.topbar-right` gap does not apply between them) */
.topbar-store-calendar-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-width: 0;
  /* Single source of truth for calendar + store chip glyphs */
  --topbar-chip-icon-size: 14px;
}

/* Current selection summary (date · market · district · store) — left of reset. */
.topbar-selection-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.1rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 18rem;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #ffffff;
  white-space: nowrap;
}
.topbar-selection-summary:empty {
  display: none;
}
/* Mobile-only strip under the top bar (shown via the mobile media query). */
.topbar-selection-bar {
  display: none;
}
.topbar-selection-line {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.topbar-selection-label {
  flex: 0 0 auto;
  color: #ffffff;
  opacity: 0.85;
}
.topbar-selection-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 767px) {
  .topbar-selection-summary { display: none; }
}

/* Reset period + store — matches chip size; no dropdown chevron */
.topbar-reset-defaults-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  flex-shrink: 0;
}
.topbar-reset-defaults-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}
.topbar-reset-defaults-btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}
.topbar-reset-defaults-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.topbar-reset-defaults-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  pointer-events: none;
}
.topbar-reset-defaults-btn-icon svg {
  display: block;
  width: var(--topbar-chip-icon-size, 14px);
  height: var(--topbar-chip-icon-size, 14px);
}
/* Immunize top bar from page-wide `.inventory-toolbar { width: 100% }` mobile rules */
.topbar-store-calendar-cluster .inventory-toolbar.topbar-period-toolbar {
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

/* Reporting period (UTC) — matches `.topbar-store-select` chrome */
.topbar-period-toolbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.topbar-period-toolbar .inventory-period-dropdown {
  position: relative;
}
.topbar-period-toolbar .inventory-period-dropdown-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  flex-shrink: 0;
}
.topbar-period-toolbar .inventory-period-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}
.topbar-period-toolbar .inventory-period-dropdown-trigger:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}
/* Small chevron under calendar / store chips (matches dropdown affordance) */
.topbar-period-toolbar .inventory-period-dropdown-trigger::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  pointer-events: none;
}
.topbar-period-toolbar .inventory-period-dropdown-trigger[aria-expanded='true'] {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(28, 33, 48, 0.95);
  color: var(--text-primary);
}
.topbar-period-toolbar .inventory-period-dropdown-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  transform: translateY(-2px);
  pointer-events: none;
}
.topbar-period-toolbar .inventory-period-dropdown-trigger--icon-only .inventory-period-dropdown-trigger-icon svg {
  display: block;
  width: var(--topbar-chip-icon-size, 14px);
  height: var(--topbar-chip-icon-size, 14px);
}

.topbar-store-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  flex-shrink: 0;
  padding: 0;
}
.topbar-store-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}
.topbar-store-select::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  pointer-events: none;
}
/* Lift icon slightly so the chevron has clearance — box matches calendar glyph */
.topbar-store-select .topbar-store-icon {
  display: block;
  width: var(--topbar-chip-icon-size, 14px);
  height: var(--topbar-chip-icon-size, 14px);
  flex-shrink: 0;
  transform: translateY(-2px);
}
.topbar-store-select:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}
.topbar-store-icon { color: currentColor; pointer-events: none; }
.topbar-store-select.is-open {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(28, 33, 48, 0.95);
  color: var(--text-primary);
}

/* Popover anchored under the store button (JS moves node to `body` so fixed coords match viewport) */
.topbar-store-popover {
  position: fixed;
  z-index: 9500;
  box-sizing: border-box;
  min-width: 300px;
  max-width: calc(100vw - 16px);
  padding: 0.95rem 1rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(20, 25, 38, 0.98);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 0.8rem;
  transform-origin: top center;
  animation: topbarStorePopIn 0.16s ease-out;
}
.topbar-store-popover[hidden] { display: none; }
@keyframes topbarStorePopIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}
.topbar-store-popover-arrow {
  position: absolute;
  top: -7px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid rgba(20, 25, 38, 0.98);
  filter: drop-shadow(0 -1px 0 rgba(148, 163, 184, 0.22));
}
.topbar-store-popover-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}
.topbar-store-popover-row label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.topbar-store-popover-row select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(13, 17, 27, 0.85)
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none"><path d="M2 4l3 3 3-3" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>')
    no-repeat right 0.55rem center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.4rem 1.6rem 0.4rem 0.55rem;
  font: inherit;
  outline: none;
  cursor: pointer;
}
.topbar-store-popover-row select:focus-visible {
  border-color: rgba(99, 102, 241, 0.55);
}
.topbar-store-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.topbar-store-popover-clear,
.topbar-store-popover-done {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(13, 17, 27, 0.7);
  color: var(--text-secondary);
}
.topbar-store-popover-clear:hover { color: var(--text-primary); border-color: rgba(148, 163, 184, 0.4); }
.topbar-store-popover-done {
  background: rgba(99, 102, 241, 0.32);
  border-color: rgba(99, 102, 241, 0.6);
  color: #fff;
}
.topbar-store-popover-done:hover { background: rgba(99, 102, 241, 0.45); }

/* Search box (store name OR employee name) at the top of the store popover. */
.topbar-store-search-row {
  margin-bottom: 0.6rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.topbar-store-search {
  position: relative;
}
.topbar-store-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(13, 17, 27, 0.85);
  color: var(--text-primary);
  padding: 0.42rem 0.6rem;
  font: inherit;
  outline: none;
}
.topbar-store-search-input::placeholder { color: var(--text-muted); }
.topbar-store-search-input:focus-visible { border-color: rgba(99, 102, 241, 0.55); }
.topbar-store-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 10;
  max-height: 248px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(16, 21, 33, 0.99);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);
  padding: 0.25rem;
}
.topbar-store-search-results[hidden] { display: none; }
.topbar-store-search-empty {
  padding: 0.55rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.topbar-store-search-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
}
.topbar-store-search-item:hover,
.topbar-store-search-item.is-active {
  background: rgba(99, 102, 241, 0.22);
}
.topbar-store-search-item-badge {
  flex: 0 0 auto;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.34rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-secondary);
}
.topbar-store-search-item-badge.is-emp {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.topbar-store-search-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.topbar-store-search-item-primary {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-store-search-item-secondary {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-notif-btn {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.topbar-notif-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar-notif-btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

.topbar-notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #f04438;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--chrome-rail);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.live-dot {
  width: 0.4rem;
  height: 0.4rem;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.topbar-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.todo-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(24,28,38,0.98), rgba(18,21,29,0.94));
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
}
.todo-launcher--drop-ready {
  border-color: rgba(59, 130, 246, 0.3);
}
.todo-launcher--drop-target {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(59, 130, 246, 0.7);
  background: linear-gradient(180deg, rgba(32, 40, 58, 0.98), rgba(20, 26, 38, 0.96));
  box-shadow: 0 0 0 1px rgba(59,130,246,0.18), 0 18px 34px rgba(59,130,246,0.18);
}
.todo-launcher:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.24);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
}
.todo-launcher:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
}
.todo-launcher-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59,130,246,0.16), rgba(6,182,212,0.12));
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  flex: 0 0 auto;
}
.todo-launcher-icon svg {
  display: block;
}
.todo-launcher-hint {
  display: none;
  align-items: center;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
  background: rgba(59,130,246,0.15);
  color: #dcecff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.todo-launcher--drop-ready .todo-launcher-hint,
.todo-launcher--drop-target .todo-launcher-hint {
  display: inline-flex;
}
.todo-count {
  min-width: 1.5rem;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: center;
}
.todo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(8, 10, 15, 0.52);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.todo-backdrop.open {
  opacity: 1;
}
.todo-drawer {
  position: fixed;
  top: 6.5rem;
  right: 1rem;
  z-index: 150;
  width: min(440px, calc(100vw - 2rem));
  max-height: calc(100vh - 8rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    linear-gradient(180deg, rgba(20,24,33,0.98), rgba(14,17,24,0.96)),
    radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 40%);
  box-shadow: 0 28px 64px rgba(0,0,0,0.34);
  backdrop-filter: blur(18px);
  transform: translateX(calc(100% + 1.2rem));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.todo-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.todo-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.todo-kicker {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.todo-drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 0.95;
}
.todo-drawer-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.todo-mini-btn,
.todo-close {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  border-radius: 999px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.18s ease;
}
.todo-mini-btn {
  padding: 0.58rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.todo-mini-btn:hover,
.todo-close:hover {
  background: var(--bg-panel-hover);
  border-color: var(--border-light);
}
.todo-mini-btn[aria-pressed="true"] {
  background: rgba(59,130,246,0.14);
  border-color: rgba(59,130,246,0.35);
  color: #dcecff;
}
.todo-mini-btn--ghost {
  color: var(--text-secondary);
}
.todo-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.todo-dropzone {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1rem 0.95rem;
  border-radius: 22px;
  border: 1px dashed rgba(59,130,246,0.26);
  background: rgba(59,130,246,0.08);
  color: var(--text-secondary);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.todo-dropzone.dragover {
  border-color: rgba(59,130,246,0.6);
  background: rgba(59,130,246,0.16);
  transform: translateY(-1px);
}
.todo-dropzone-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}
.todo-dropzone-subtitle {
  font-size: 0.76rem;
  line-height: 1.45;
}
.todo-list {
  display: grid;
  gap: 0.75rem;
  overflow-y: auto;
  padding-right: 0.1rem;
}
.todo-empty {
  padding: 1.1rem 0.95rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.todo-item {
  padding: 0.95rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 0.8rem;
}
.todo-item--completed {
  opacity: 0.62;
  filter: grayscale(0.15);
}
.todo-item--completed-anim {
  animation: todoCompletePulse 0.42s ease-out;
}
.todo-item--completed-anim .todo-item-check span {
  animation: todoCheckPop 0.42s ease-out;
}
.todo-item--swipe-out {
  animation: todoSwipeOut 0.26s ease forwards;
  pointer-events: none;
}
.todo-item--collapse-anim {
  animation: todoCollapseCard 0.28s ease-out;
}
.todo-item--expand-anim {
  animation: todoExpandCard 0.28s ease-out;
}
.todo-item--collapse-anim .todo-item-context,
.todo-item--collapse-anim .todo-item-controls,
.todo-item--collapse-anim .todo-item-note,
.todo-item--collapse-anim .todo-item-footer {
  animation: todoSectionCollapse 0.28s ease-out;
}
.todo-item--expand-anim .todo-item-context,
.todo-item--expand-anim .todo-item-controls,
.todo-item--expand-anim .todo-item-note,
.todo-item--expand-anim .todo-item-footer {
  animation: todoSectionExpand 0.28s ease-out;
}
.todo-item--collapsed {
  gap: 0.1rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}
.todo-item--collapsed:hover {
  border-color: rgba(59,130,246,0.28);
  background: rgba(59,130,246,0.07);
}
.todo-item--collapsed .todo-item-context,
.todo-item--collapsed .todo-item-controls,
.todo-item--collapsed .todo-item-note,
.todo-item--collapsed .todo-item-footer {
  display: none;
}
.todo-item--collapsed .todo-item-header {
  align-items: center;
  gap: 0.4rem;
}
.todo-item--collapsed .todo-item-title {
  font-size: 0.84rem;
  line-height: 1.18;
}
.todo-item--collapsed .todo-item-tags {
  display: none;
}
.todo-item--collapsed .todo-item-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
}
.todo-item--collapsed .todo-item-due {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  white-space: nowrap;
}
.todo-item-due {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.todo-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}
.todo-item-check {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}
.todo-item-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.todo-item-check span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.03);
  position: relative;
}
.todo-item-check input:checked + span {
  background: var(--green-dim);
  border-color: rgba(34,197,94,0.45);
}
.todo-item-check input:checked + span::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--green);
}
.todo-item-title-wrap {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.45rem;
}
.todo-item-title {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
}
.todo-item-title::placeholder {
  color: var(--text-muted);
}
.todo-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.todo-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.todo-item-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.18s ease;
}
.todo-item-delete:hover {
  color: var(--text-primary);
  border-color: rgba(239,68,68,0.38);
  background: var(--red-dim);
}
.todo-item-context {
  display: grid;
  gap: 0.25rem;
}
.todo-item-context-line {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}
.todo-item-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.todo-item-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.todo-control {
  display: grid;
  gap: 0.32rem;
}
.todo-control--wide {
  grid-column: 1 / -1;
}
.todo-control span {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.todo-control input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15,18,26,0.92);
  color: var(--text-primary);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
}
.todo-control select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15,18,26,0.92);
  color: var(--text-primary);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
}
.todo-control input:focus,
.todo-control select:focus,
.todo-item-note:focus,
.todo-item-title:focus {
  outline: none;
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.todo-reminder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.todo-reminder-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.todo-reminder-chip:hover {
  background: var(--bg-panel-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.todo-reminder-chip.active {
  background: rgba(59,130,246,0.14);
  border-color: rgba(59,130,246,0.35);
  color: #dcecff;
}
.todo-reminder-summary {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.todo-reminder-custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.todo-reminder-custom input {
  padding-inline: 0.7rem;
}
.todo-item-note {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15,18,26,0.92);
  color: var(--text-primary);
  padding: 0.7rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
}
.todo-item-note::placeholder {
  color: var(--text-muted);
}
.todo-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.todo-item-context,
.todo-item-controls,
.todo-item-note,
.todo-item-footer {
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 0.28s ease,
    opacity 0.22s ease,
    transform 0.28s ease,
    margin 0.28s ease,
    padding 0.28s ease;
}
.todo-created {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.todo-item--ghost {
  border-style: dashed;
  border-color: rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.08);
}
.todo-item--ghost .todo-item-title,
.todo-item--ghost .todo-item-context-line {
  color: var(--text-primary);
}
.todo-item--ghost .todo-item-note,
.todo-item--ghost .todo-item-controls,
.todo-item--ghost .todo-item-footer {
  display: none;
}

@keyframes todoCollapseCard {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(59,130,246,0);
  }
  45% {
    transform: scale(0.985);
    box-shadow: 0 12px 30px rgba(59,130,246,0.08);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(59,130,246,0);
  }
}
@keyframes todoExpandCard {
  0% {
    transform: scale(0.985);
    box-shadow: 0 12px 30px rgba(59,130,246,0.08);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(59,130,246,0);
  }
}
@keyframes todoSectionCollapse {
  0% {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
  }
}
@keyframes todoSectionExpand {
  0% {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
  }
  100% {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes todoCompletePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.0); }
  28% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(34,197,94,0.12); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.0); }
}
@keyframes todoCheckPop {
  0% { transform: scale(1); }
  36% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@keyframes todoSwipeOut {
  0% { transform: translateX(0); opacity: 0.62; max-height: 400px; margin-bottom: 0; }
  100% { transform: translateX(22px); opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; }
}
.todo-drag-ghost {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  width: 260px;
  padding: 0.75rem 0.8rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24,28,38,0.98), rgba(18,21,29,0.94));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  color: var(--text-primary);
}
.todo-drag-ghost-stripe {
  width: 6px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.todo-drag-ghost-body {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}
.todo-drag-ghost-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-drag-ghost-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.event-item[draggable="true"] {
  cursor: grab;
}
.event-item.dragging {
  opacity: 0.65;
  transform: scale(0.98);
}
.live-indicator {
  display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 600; color: var(--green); text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.55rem 0.8rem; border-radius: 999px; background: var(--green-dim); border: 1px solid rgba(34,197,94,0.12);
}
.live-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(34,197,94,0); } }
.topbar-time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); padding-right: 0.3rem; }

/* ---- TAB PANES ---- */
.tab-pane {
  display: none;
  padding: 1rem;
  max-width: 1920px;
  margin: 0 auto;
}

/* Swipe capture strips */
.swipe-zone {
  display: none;
}

@media (max-width: 1366px) {
  .swipe-zone {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 22px;
    z-index: 9000;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
  }
  .swipe-zone--left  { left: 0; }
  .swipe-zone--right { right: 0; }

  /* Swipe strips sit above inventory fullscreen (z 9000 vs 2000); disable so tab swipe cannot start and edge drags reach the table */
  body.inventory-fullscreen-active .swipe-zone {
    pointer-events: none;
  }

  /* Page swipe transitions are driven by JS (spring physics) on mobile.
     Keep the pane composited and free of layout-affecting transitions. */
  .tab-pane.active {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout paint style;
  }

  /* Inventory transport fullscreen uses position:fixed; transform/contain on the tab pane
     makes fixed descendants relative to the pane and clips them — breaks the overlay. */
  body.inventory-fullscreen-active #tab-inventory.tab-pane.active {
    transform: none;
    will-change: auto;
    contain: none;
    backface-visibility: visible;
  }

  /* An open scan-table filter menu is position:fixed; the pane transform/contain
     above would make it pane-relative and clip it. Neutralize while one is open. */
  body.dops-filter-open .tab-pane.active {
    transform: none;
    will-change: auto;
    contain: none;
    backface-visibility: visible;
  }

  /* Ticket Tracker: tall wrapped rows must contribute full layout height; `contain: paint`
     clips overflow painting and hides wrapped TYPE text beyond the initial viewport. */
  #tab-arit.tab-pane.active {
    contain: none;
  }

  #tab-treasury.tab-pane.active {
    contain: none;
    transform: none;
    will-change: auto;
    backface-visibility: visible;
  }
  .tab-pane.is-swiping {
    transition: none !important;
  }
  /* Outgoing pane during a commit transition — fixed overlay so the
     incoming pane can render in flow underneath while both animate. */
  .tab-pane.tab-pane--swipe-out {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    overflow: hidden;
    will-change: transform;
    contain: layout paint style;
    pointer-events: none;
  }
}

.tab-pane.active {
  display: block;
}

.source-page {
  position: relative;
  z-index: 1;
  max-width: 1820px;
  margin: 0 auto;
  --source-accent: var(--accent);
}

.source-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid color-mix(in srgb, var(--source-accent) 20%, rgba(255,255,255,0.05));
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(20,24,33,0.98), rgba(14,17,24,0.94)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--source-accent) 22%, transparent), transparent 34%);
  box-shadow: var(--shadow-panel);
  position: relative;
  overflow: hidden;
}

.source-hero::after {
  content: '';
  position: absolute;
  inset: auto -8% -42% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--source-accent) 28%, transparent) 0%, transparent 68%);
  pointer-events: none;
}

.source-hero-copy { min-width: 0; }
.source-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  color: var(--source-accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.source-kicker::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--source-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--source-accent) 14%, transparent);
}
.source-hero-copy h2 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 0.55rem;
}
.source-hero-copy p {
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}
.source-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(84px, 1fr));
  gap: 0.7rem;
  flex: 0 0 auto;
}
.source-mini-stat {
  min-width: 86px;
  padding: 0.75rem 0.85rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--source-accent) 8%, rgba(255,255,255,0.03)), rgba(255,255,255,0.03));
  border: 1px solid color-mix(in srgb, var(--source-accent) 14%, rgba(255,255,255,0.05));
}
.source-mini-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.source-mini-label {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.source-page-kpis {
  margin-top: 1rem;
}
.source-page-kpis .kpi-card {
  border-color: color-mix(in srgb, var(--source-accent) 12%, rgba(255,255,255,0.04));
}
.source-page-kpis .kpi-card:first-child .kpi-icon,
.source-page-kpis .kpi-card:last-child .kpi-icon {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--source-accent) 15%, transparent);
}
.source-page-kpis .kpi-card:first-child .kpi-value,
.source-page-kpis .kpi-card:last-child .kpi-value {
  color: color-mix(in srgb, var(--source-accent) 88%, white);
}
.main-grid--source {
  padding-top: 1rem;
}
.main-grid--source .event-feed {
  min-height: 680px;
}
.main-grid--source .right-col {
  align-content: start;
}
.main-grid--source .panel-header h2 {
  color: color-mix(in srgb, var(--source-accent) 58%, var(--text-secondary));
}

/* ---- TREASURY TRACKER (matches ARIT ticket tracker chrome) ---- */
#tab-treasury.tab-pane {
  overflow-x: hidden;
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
}

.treasury-page-mount {
  min-height: 12rem;
  overflow: visible;
}

#tab-archway.tab-pane {
  overflow-x: hidden;
  padding: 0 1rem max(2rem, env(safe-area-inset-bottom, 0px));
}

.archway-page-mount {
  min-height: 12rem;
}

/* ---- ARIT TICKET TRACKING ---- */
#tab-arit.tab-pane {
  overflow-x: hidden;
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
}

#tab-arit.tab-pane.active .arit-page {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
  height: calc(100dvh - var(--topbar-height, 60px));
  max-height: calc(100dvh - var(--topbar-height, 60px));
  overflow: hidden;
}

#tab-arit.tab-pane.active .arit-kpi-grid {
  flex-shrink: 0;
}

#tab-arit.tab-pane.active .arit-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#tab-arit.tab-pane.active .arit-table-panel {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.arit-page {
  flex-direction: column;
  gap: 0.8rem;
}

.arit-page.active {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
}

.arit-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.arit-page-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.arit-page-head p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.arit-page-actions,
.arit-filters,
.arit-tabs,
.arit-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.arit-tabs {
  flex: 1 1 auto;
  justify-content: space-between;
}

.arit-tool-btn,
.arit-create-btn {
  height: 2.15rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.68);
  color: var(--text-secondary);
  padding: 0 0.8rem;
  font: 800 0.72rem var(--font-body);
  cursor: pointer;
}

.arit-create-btn {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.82));
  color: white;
}

.arit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  justify-items: stretch;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  .arit-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.arit-kpi-card,
.arit-table-panel,
.arit-detail-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.55rem;
  background: rgba(8, 20, 33, 0.88);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
}

.arit-kpi-card {
  position: relative;
  aspect-ratio: 5 / 2;
  min-height: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1.32rem minmax(0, 1fr);
  gap: 0.22rem;
  padding: 0.2rem 0.32rem 0.34rem;
  overflow: hidden;
  color: var(--accent);
}

.arit-kpi-card::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  right: 0.3rem;
  bottom: 0.1rem;
  height: 7px;
  opacity: 0.82;
  background: var(--sparkline, none) center bottom / 100% 100% no-repeat;
}

.arit-kpi-card--blue {
  color: var(--accent);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 22 L18 18 L36 21 L54 13 L72 16 L90 10 L108 19 L126 12 L144 18 L162 10 L180 15' stroke='%233b82f6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.arit-kpi-card--orange {
  color: var(--warning);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 L18 15 L36 17 L54 21 L72 12 L90 19 L108 11 L126 20 L144 12 L162 17 L180 10' stroke='%23f59e0b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.arit-kpi-card--green {
  color: var(--green);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 21 L18 14 L36 16 L54 22 L72 15 L90 10 L108 18 L126 12 L144 20 L162 14 L180 9' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.arit-kpi-card--purple { color: var(--purple); }
.arit-kpi-card--slate { color: var(--slate); }

.arit-kpi-icon {
  width: 1.32rem;
  height: 1.32rem;
  display: grid;
  place-items: center;
  border-radius: 0.34rem;
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: currentColor;
}

.arit-kpi-icon svg {
  width: 0.78rem;
  height: 0.78rem;
}

.arit-kpi-card span:not(.arit-kpi-icon),
.arit-kpi-card small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.54rem;
  font-weight: 800;
}

.arit-kpi-card strong {
  display: block;
  margin-top: 0.05rem;
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.05;
}

.arit-kpi-card strong#sourceKpiLatest-arit {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arit-kpi-card small#sourceKpiLatest-aritSub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arit-kpi-card small {
  margin-top: 0.1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.arit-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.arit-table-panel {
  min-width: 0;
  min-height: 0;
  max-height: calc(100dvh - var(--topbar-height, 60px) - 11.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.arit-table-panel > .arit-table-toolbar,
.arit-table-panel > .arit-error,
.arit-table-panel > .arit-banner--warn,
.arit-table-panel > .arit-table-footer {
  flex-shrink: 0;
}

.arit-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.arit-detail-panel {
  overflow: hidden;
}

.arit-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.arit-tab {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.55rem 0.65rem;
  font: 800 0.72rem var(--font-body);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.arit-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.arit-filters select,
.arit-filters input[type="date"],
.arit-search input {
  height: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.4rem;
  background: rgba(2, 12, 24, 0.76);
  color: var(--text-secondary);
  font: 700 0.72rem var(--font-body);
}

.arit-filters select {
  min-width: 7.4rem;
  padding: 0 1.6rem 0 0.65rem;
}

.arit-search {
  position: relative;
}

.arit-search input {
  width: 16rem;
  padding: 0 2rem 0 0.7rem;
}

.arit-search span {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.arit-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.arit-table-scroll .arit-table-wrap {
  overflow: visible;
}

.arit-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.arit-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

.arit-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.71rem;
}

.arit-table th,
.arit-table td {
  padding: 0.72rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.arit-table th {
  color: var(--text-muted);
  font-size: 0.61rem;
  text-transform: uppercase;
  font-weight: 900;
  vertical-align: middle;
}

.arit-table-scroll .arit-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(8, 20, 33, 0.98);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.14);
}

.arit-table thead th {
  border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.arit-table thead th:last-child {
  border-right: none;
}

.arit-th-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.arit-th-title-sort {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0.32rem;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  font-weight: inherit;
  cursor: pointer;
  text-align: left;
}

.arit-th-title-sort:hover .arit-th-sort-text {
  color: var(--text-primary);
}

.arit-th-sort-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arit-th-sort-indicator {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.88;
  width: 0.75rem;
  text-align: center;
}

.arit-th-filter-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 0.36rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.arit-th-filter-toggle:hover {
  color: var(--text-primary);
}

.arit-th-filter-toggle[aria-expanded="true"] {
  color: var(--accent);
}

.arit-th-filter-toggle--on {
  color: var(--accent);
}

.arit-th-filter-toggle--on .arit-th-filter-toggle-icon {
  opacity: 1;
}

.arit-th-filter-toggle-icon {
  display: block;
  font-size: 0.92rem;
  line-height: 1;
  opacity: 0.82;
  transform: scaleY(1.15);
}

.arit-th-head--sort-active .arit-th-sort-text {
  color: var(--text-primary);
}

.arit-th-head--sort-active .arit-th-sort-indicator {
  color: var(--accent);
}

.arit-th-head--filtered .arit-th-sort-text {
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.55);
  text-underline-offset: 2px;
}

.arit-th-cell {
  position: relative;
}

.arit-th-cell--action {
  width: 2rem;
  min-width: 2rem;
}

.arit-th-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  min-width: 11.5rem;
  z-index: 80;
  padding: 0.45rem 0 0.35rem;
  border-radius: 0.45rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.arit-th-filter-block {
  padding: 0 0.55rem 0.55rem;
}

.arit-th-filter-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
}

.arit-th-filter-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 2rem;
  padding: 0 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 12, 24, 0.9);
  color: var(--text-secondary);
  font: 700 0.68rem var(--font-body);
  cursor: pointer;
}

.arit-th-filter-select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
}

.arit-table-row {
  cursor: pointer;
}

.arit-table-row:hover td,
.arit-table-row.is-active td {
  background: rgba(59, 130, 246, 0.05);
}

.arit-table strong {
  display: block;
  color: var(--text-primary);
}

.arit-table small {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.61rem;
}

/* Type column: two lines max, ellipsis if longer */
.arit-table th:nth-child(4) {
  white-space: nowrap;
  vertical-align: middle;
}

.arit-table td:nth-child(4) {
  min-width: 14rem;
  max-width: 22rem;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.arit-type-cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  text-overflow: ellipsis;
}

.arit-table th:nth-child(1),
.arit-table td:nth-child(1) { min-width: 7.5rem; }
.arit-table th:nth-child(2),
.arit-table td:nth-child(2) { min-width: 8.5rem; }
.arit-table th:nth-child(3),
.arit-table td:nth-child(3) { min-width: 5.75rem; }
.arit-table th:nth-child(5),
.arit-table td:nth-child(5) { min-width: 9rem; }
.arit-table th:nth-child(6),
.arit-table td:nth-child(6) { min-width: 7.5rem; }

.arit-table th:nth-child(7),
.arit-table td:nth-child(7) {
  min-width: 2rem;
  text-align: right;
  vertical-align: middle;
}

.arit-error {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  margin: 0 0 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.35);
  color: var(--text-primary);
  font-size: 0.78rem;
}

/* UA [hidden] can lose to author `display:flex` in some embedded browsers — force collapse */
.arit-error[hidden] {
  display: none !important;
}

.arit-error-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(239,68,68,0.25);
  color: var(--red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-mono);
}
.arit-error-body { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.arit-error-body strong { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.arit-error-body small { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arit-error-retry {
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.arit-error-retry:hover { filter: brightness(1.08); }

.arit-creator {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
  max-width: 100%;
  cursor: help;
}
.arit-creator strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arit-creator small {
  display: block;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.arit-creator:hover strong { color: var(--accent); }
a.arit-creator:hover small { color: var(--text-secondary); }
.arit-creator--unknown strong { color: var(--text-muted); font-style: italic; text-transform: none; letter-spacing: 0; }

.arit-status,
.arit-priority {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.25rem;
  padding: 0.25rem 0.48rem;
  font: 900 0.58rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.arit-status--new,
.arit-status--pending {
  background: var(--accent-dim);
  color: var(--accent);
}
.arit-status--in-progress,
.arit-status--escalated {
  background: var(--purple-dim);
  color: var(--purple);
}
.arit-status--resolved {
  background: var(--green-dim);
  color: var(--green);
}

.arit-priority {
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.arit-priority i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--green);
}
.arit-priority--medium i { background: var(--amber); }
.arit-priority--high i { background: var(--red); }

.arit-row-action {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.arit-freshness {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  white-space: nowrap;
  user-select: none;
}
.arit-freshness::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--slate);
  box-shadow: 0 0 0 0 rgba(148,163,184,0);
}
.arit-freshness[data-state="live"] {
  color: var(--green);
  border-color: rgba(34,197,94,0.35);
}
.arit-freshness[data-state="live"]::before {
  background: var(--green);
  animation: aritFreshnessPulse 2s ease-in-out infinite;
}
.arit-freshness[data-state="refreshing"] {
  color: var(--accent);
  border-color: rgba(59,130,246,0.35);
}
.arit-freshness[data-state="refreshing"]::before {
  background: var(--accent);
  animation: aritFreshnessPulse 1s ease-in-out infinite;
}
.arit-freshness[data-state="loading"] {
  color: var(--amber);
  border-color: rgba(245,158,11,0.35);
}
.arit-freshness[data-state="loading"]::before {
  background: var(--amber);
  animation: aritFreshnessPulse 1s ease-in-out infinite;
}
@keyframes aritFreshnessPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); opacity: 0.55; }
}

/* ---- ARIT TICKET LIFECYCLE MODAL ---- */
.modal.modal--arit {
  max-width: 960px;
  padding: 1.8rem 2rem;
}

.arit-modal-hero {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
}
.arit-modal-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.arit-modal-meta .modal-source-badge { margin-bottom: 0; }
.arit-modal-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.arit-modal-title {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0.35rem 0 0.5rem;
  color: var(--text-primary);
}
.arit-modal-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.arit-modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.arit-stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}
.arit-stat-card label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
}
.arit-stat-card strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.arit-lifecycle {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 1.1rem 1.2rem 0.6rem;
}
.arit-lifecycle-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}
.arit-lifecycle-head h4 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--text-primary);
}
.arit-lifecycle-head small {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.arit-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.arit-timeline-skel {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.6rem 0;
}

.arit-tl-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.95rem;
  position: relative;
  padding-bottom: 1rem;
}
.arit-tl-item:last-child { padding-bottom: 0.2rem; }

.arit-tl-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.arit-tl-dot {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-light, rgba(255,255,255,0.12));
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1;
  flex-shrink: 0;
}
.arit-tl-line {
  flex: 1;
  width: 2px;
  background: var(--border);
  margin-top: 4px;
  border-radius: 2px;
}
.arit-tl-item:last-child .arit-tl-line { display: none; }

.arit-tl-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem 0.8rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.arit-tl-item:hover .arit-tl-card {
  border-color: var(--border-light, rgba(255,255,255,0.18));
}
.arit-tl-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.arit-tl-type {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(148,163,184,0.14);
  color: var(--slate);
}
.arit-tl-time {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.arit-tl-sample {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  background: rgba(148,163,184,0.16);
  color: var(--text-muted);
  border: 1px dashed rgba(148,163,184,0.3);
}
.arit-tl-desc {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin: 0 0 0.45rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.arit-tl-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.arit-tl-actor {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
}
.arit-tl-status {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* Tone variants */
.arit-tl-item--blue .arit-tl-dot {
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.5);
  color: var(--accent);
}
.arit-tl-item--blue .arit-tl-type {
  background: rgba(59,130,246,0.16);
  color: var(--accent);
}
.arit-tl-item--green .arit-tl-dot {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.5);
  color: var(--green);
}
.arit-tl-item--green .arit-tl-type {
  background: rgba(34,197,94,0.16);
  color: var(--green);
}
.arit-tl-item--amber .arit-tl-dot {
  background: rgba(245,158,11,0.18);
  border-color: rgba(245,158,11,0.5);
  color: var(--amber);
}
.arit-tl-item--amber .arit-tl-type {
  background: rgba(245,158,11,0.16);
  color: var(--amber);
}
.arit-tl-item--orange .arit-tl-dot {
  background: rgba(251,146,60,0.18);
  border-color: rgba(251,146,60,0.5);
  color: var(--orange);
}
.arit-tl-item--orange .arit-tl-type {
  background: rgba(251,146,60,0.16);
  color: var(--orange);
}
.arit-tl-item--red .arit-tl-dot {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.5);
  color: var(--red);
}
.arit-tl-item--red .arit-tl-type {
  background: rgba(239,68,68,0.16);
  color: var(--red);
}
.arit-tl-item--teal .arit-tl-dot {
  background: rgba(20,184,166,0.18);
  border-color: rgba(20,184,166,0.5);
  color: var(--teal);
}
.arit-tl-item--teal .arit-tl-type {
  background: rgba(20,184,166,0.16);
  color: var(--teal);
}
.arit-tl-item--purple .arit-tl-dot {
  background: rgba(167,139,250,0.18);
  border-color: rgba(167,139,250,0.5);
  color: var(--purple);
}
.arit-tl-item--purple .arit-tl-type {
  background: rgba(167,139,250,0.16);
  color: var(--purple);
}

.arit-tl-item--current .arit-tl-dot {
  animation: aritPulse 1.8s ease-in-out infinite;
}
@keyframes aritPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.45); }
  50% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
}

.arit-modal-extra {
  margin-top: 1.2rem;
}
.arit-modal-actions {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  border-radius: var(--radius-md, 12px);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.arit-modal-actions h4 { margin: 0 0 0.7rem; font-size: 0.9rem; }
.arit-detail-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.arit-detail-tab {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 0.45rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.arit-detail-tab.is-active {
  color: var(--text-primary);
  border-color: rgba(59,130,246,0.45);
  background: rgba(59,130,246,0.14);
}
.arit-detail-panel { display: none; }
.arit-detail-panel.is-active { display: block; }
.arit-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.arit-actions-grid label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.arit-actions-grid select {
  height: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.4rem;
  background: rgba(2, 12, 24, 0.76);
  color: var(--text-secondary);
  font: 700 0.72rem var(--font-body);
  padding: 0 0.6rem;
}
#aritActionFeedback { display: block; margin-top: 0.5rem; min-height: 1rem; }
.arit-email-card,
.arit-note-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
}
.arit-email-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}
.arit-email-card p,
.arit-note-card p {
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.arit-notes-compose {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.arit-notes-compose textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(2, 12, 24, 0.76);
  color: var(--text-secondary);
  padding: 0.55rem 0.65rem;
  resize: vertical;
}
.arit-modal-extra summary {
  cursor: pointer;
  padding: 0.55rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  list-style: none;
  user-select: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.arit-modal-extra summary::-webkit-details-marker { display: none; }
.arit-modal-extra summary::before {
  content: '▸ ';
  color: var(--text-muted);
  margin-right: 0.25rem;
  display: inline-block;
  transition: transform 0.2s ease;
}
.arit-modal-extra[open] summary::before {
  content: '▾ ';
}
.arit-modal-extra summary:hover {
  color: var(--text-primary);
  border-color: var(--border-light, rgba(255,255,255,0.18));
}
.arit-modal-extra[open] summary { margin-bottom: 0.8rem; }
.arit-modal-raw {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 720px) {
  .modal.modal--arit { max-width: 95%; padding: 1.3rem 1.1rem; }
  .arit-modal-title { font-size: 1.25rem; }
  .arit-tl-item { grid-template-columns: 26px 1fr; gap: 0.65rem; }
  .arit-tl-dot { width: 24px; height: 24px; font-size: 0.72rem; }
  .arit-tl-card { padding: 0.6rem 0.75rem; }
  .arit-tl-time { margin-left: 0; width: 100%; }
  .arit-actions-grid { grid-template-columns: 1fr; }
}

.arit-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.arit-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.arit-detail-panel {
  padding: 0.95rem;
}

.arit-detail-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.arit-detail-head strong {
  color: var(--accent-light);
  font-size: 0.8rem;
  margin-right: auto;
}

.arit-detail-head button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.arit-detail-panel h3 {
  margin: 0.75rem 0 0.25rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.25;
}

.arit-detail-panel > p {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.arit-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.8rem 0;
}

.arit-detail-metrics div {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 0.55rem;
}

.arit-detail-metrics span,
.arit-detail-list dt,
.arit-detail-timeline small {
  display: block;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.arit-detail-metrics strong {
  display: inline-flex;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.66rem;
}

.sla-on-track {
  color: var(--green) !important;
}

.arit-detail-panel h4 {
  margin: 1rem 0 0.6rem;
  color: var(--text-primary);
  font-size: 0.76rem;
}

.arit-detail-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.arit-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.arit-detail-list dd {
  margin: 0;
  color: var(--text-secondary);
  text-align: right;
  font-size: 0.66rem;
}

.arit-detail-list a,
.arit-detail-timeline-head a {
  color: var(--accent-light);
  text-decoration: none;
}

.arit-detail-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arit-detail-timeline {
  display: grid;
  gap: 0.65rem;
}

.arit-detail-timeline div {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.45rem;
}

.arit-detail-timeline i {
  width: 0.58rem;
  height: 0.58rem;
  margin-top: 0.17rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.arit-detail-timeline span {
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 800;
}

.arit-detail-timeline small {
  grid-column: 2;
  margin-top: -0.42rem;
}

.arit-detail-button {
  width: 100%;
  height: 2.35rem;
  margin-top: 1rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-primary);
  font: 900 0.72rem var(--font-body);
}

.daily-ops-board {
  position: relative;
  z-index: 1;
  max-width: 1820px;
  margin: 0 auto;
  padding: 0.88rem 0.95rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--amber) 18%, rgba(255,255,255,0.05));
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(17, 20, 28, 0.98), rgba(14, 17, 24, 0.95)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--amber) 18%, transparent), transparent 34%);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

#tab-daily_ops .daily-ops-board {
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#tab-daily_ops .daily-ops-board::after {
  display: none;
}

#tab-daily_ops .daily-ops-dashboard {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
}

.daily-ops-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.daily-ops-page-head h2 {
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 800;
}
.daily-ops-page-head p {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.daily-ops-workbook-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 35, 0.88);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.62rem 0.85rem;
  cursor: pointer;
}

.daily-ops-stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  min-height: 108px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-bottom: 3px solid color-mix(in srgb, var(--stat-accent, var(--accent)) 78%, transparent);
  border-radius: 10px;
  background: rgba(17, 26, 39, 0.9);
}

.daily-ops-stat-card--accent { --stat-accent: var(--accent); }
.daily-ops-stat-card--danger { --stat-accent: var(--red); }
.daily-ops-stat-card--success { --stat-accent: var(--green); }
.daily-ops-stat-card--purple { --stat-accent: var(--purple); }
.daily-ops-stat-card--neutral { --stat-accent: var(--slate); }

.daily-ops-stat-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--stat-accent) 22%, rgba(255,255,255,0.04));
  color: color-mix(in srgb, var(--stat-accent) 86%, white);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.daily-ops-stat-label,
.daily-ops-stat-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.daily-ops-stat-card strong {
  display: block;
  margin: 0.22rem 0;
  color: var(--text-primary);
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 800;
}

.daily-ops-stat-card--danger strong { color: var(--orange); }
.daily-ops-stat-card--success strong { color: var(--green); }
.daily-ops-stat-card--purple strong { color: var(--text-primary); }
.daily-ops-stat-card--neutral strong { font-size: 1rem; }

.daily-ops-sections-panel {
  margin-top: 1.4rem;
}

.daily-ops-sections-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.daily-ops-sections-header h2 {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.daily-ops-sections-header p {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.daily-ops-sections-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.daily-ops-section-search {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(8, 13, 22, 0.62);
  color: var(--text-muted);
}

.daily-ops-section-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
}

.daily-ops-section-search input::placeholder {
  color: var(--text-muted);
}

.daily-ops-tool-btn,
.daily-ops-view-toggle button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(15, 23, 35, 0.88);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 0.8rem;
  cursor: pointer;
}

.daily-ops-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
}

.daily-ops-view-toggle button {
  width: 38px;
  padding: 0;
}

.daily-ops-view-toggle button.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(59, 130, 246, 0.35);
}

.daily-ops-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.daily-ops-section-card {
  min-height: 208px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(13, 22, 34, 0.92);
  overflow: hidden;
}

.daily-ops-section-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  padding: 1rem 1rem 0.75rem;
}

.daily-ops-section-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--group-accent) 24%, rgba(255,255,255,0.04));
  color: color-mix(in srgb, var(--group-accent) 86%, white);
  font-size: 0.85rem;
  font-weight: 900;
}

.daily-ops-section-card h3 {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.daily-ops-section-card p {
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.daily-ops-section-pill {
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.daily-ops-section-rows {
  padding: 0 1rem;
}

.daily-ops-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.63rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.daily-ops-item-count {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.daily-ops-item-count--danger {
  color: var(--red);
  background: var(--red-dim);
}

.daily-ops-item-count--warning {
  color: var(--amber);
  background: var(--amber-dim);
}

.daily-ops-item-count--success {
  color: var(--green);
  background: var(--green-dim);
}

.daily-ops-section-link {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.daily-ops-section-link span {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.daily-ops-command-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.daily-ops-panel {
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 10px;
  background: rgba(13, 22, 34, 0.92);
  overflow: hidden;
}
.daily-ops-panel--overview { grid-column: 1 / span 6; }
.daily-ops-panel--focus { grid-column: 7 / span 6; }
.daily-ops-panel--activity { grid-column: 1 / span 8; }
.daily-ops-panel--quick { grid-column: 9 / span 4; }
.daily-ops-panel-head {
  padding: 1rem 1rem 0.65rem;
}
.daily-ops-panel-head h3 {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 800;
}
.daily-ops-panel-head p {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.daily-ops-overview-row,
.daily-ops-activity-row {
  display: grid;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.055);
  color: var(--text-secondary);
  font-size: 0.76rem;
}
.daily-ops-overview-row {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 86px 68px 18px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.daily-ops-overview-row--head,
.daily-ops-activity-row--head {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: default;
}
.daily-ops-overview-row span:first-child {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.daily-ops-overview-row i {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.68rem;
  font-style: normal;
  flex: 0 0 auto;
}
.daily-ops-status-pill,
.daily-ops-impact {
  width: fit-content;
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  font-size: 0.64rem;
  font-weight: 800;
}
.daily-ops-status-pill--success,
.daily-ops-impact--low { color: var(--green); background: var(--green-dim); }
.daily-ops-status-pill--danger,
.daily-ops-impact--high { color: var(--red); background: var(--red-dim); }
.daily-ops-status-pill--warning,
.daily-ops-impact--medium { color: var(--amber); background: var(--amber-dim); }
.daily-ops-focus-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(72px, auto) 18px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem 0.95rem;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.055);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.045), transparent 58%);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.daily-ops-focus-row:hover {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.09), rgba(59, 130, 246, 0.045));
}
.daily-ops-focus-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--red-dim);
  color: var(--red);
  font-weight: 900;
}
.daily-ops-focus-row strong,
.daily-ops-quick-row strong { color: var(--text-primary); font-size: 0.82rem; }
.daily-ops-focus-row small {
  display: block;
  margin-top: 0.16rem;
  color: var(--text-muted);
  font-size: 0.66rem;
}
.daily-ops-focus-row b {
  min-width: 4.65rem;
  padding: 0.36rem 0.5rem;
  border-radius: 0.55rem;
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  font-size: 1rem;
  text-align: right;
}
.daily-ops-focus-row b small {
  margin-top: 0.05rem;
  color: var(--text-muted);
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.daily-ops-quick-row em {
  color: var(--accent);
  font-style: normal;
  font-size: 0.72rem;
}
.daily-ops-focus-row i {
  color: var(--accent);
  font-style: normal;
  text-align: right;
}
.daily-ops-activity-row {
  grid-template-columns: 72px 1fr 1.2fr 1.2fr 70px;
}
.daily-ops-quick-row {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.58rem 1rem;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.055);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.daily-ops-quick-row span {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
}
.daily-ops-panel-link {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0.72rem 1rem;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.055);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

@media (min-width: 901px) and (max-width: 1280px) {
  #tab-daily_ops .daily-ops-dashboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .daily-ops-stat-card {
    min-height: 92px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.72rem;
  }
  .daily-ops-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 0.58rem;
  }
  .daily-ops-stat-label,
  .daily-ops-stat-sub {
    font-size: 0.62rem;
  }
  .daily-ops-stat-card strong {
    font-size: 1.08rem;
  }
  .daily-ops-stat-card--neutral strong {
    font-size: 0.82rem;
  }
  .daily-ops-command-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .daily-ops-panel--overview { grid-column: 1 / span 6; }
  .daily-ops-panel--focus { grid-column: 7 / span 6; }
  .daily-ops-panel--activity { grid-column: 1 / span 8; }
  .daily-ops-panel--quick { grid-column: 9 / span 4; }
  .daily-ops-panel-head {
    padding: 0.78rem 0.78rem 0.52rem;
  }
  .daily-ops-overview-row,
  .daily-ops-activity-row {
    padding: 0.5rem 0.75rem;
    gap: 0.45rem;
    font-size: 0.68rem;
  }
  .daily-ops-overview-row {
    grid-template-columns: minmax(0, 1fr) 70px 52px 14px;
  }
  .daily-ops-focus-row {
    grid-template-columns: 32px minmax(0, 1fr) minmax(58px, auto) 14px;
    gap: 0.55rem;
    padding: 0.68rem 0.75rem;
  }
  .daily-ops-focus-icon {
    width: 30px;
    height: 30px;
  }
  .daily-ops-activity-row {
    grid-template-columns: 58px 0.9fr 1fr 1fr 58px;
  }
  .daily-ops-quick-row,
  .daily-ops-panel-link {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 900px) {
  #tab-daily_ops .daily-ops-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .daily-ops-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .daily-ops-command-grid {
    grid-template-columns: 1fr;
  }
  .daily-ops-panel--overview,
  .daily-ops-panel--focus,
  .daily-ops-panel--activity,
  .daily-ops-panel--quick {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  #tab-daily_ops .daily-ops-dashboard,
  .daily-ops-section-grid {
    grid-template-columns: 1fr;
  }
  .daily-ops-sections-header,
  .daily-ops-sections-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .daily-ops-section-search {
    width: 100%;
  }
  .daily-ops-page-head {
    flex-direction: column;
  }
  .daily-ops-activity-row,
  .daily-ops-focus-row {
    grid-template-columns: 1fr;
  }
}

.daily-ops-board::after {
  content: '';
  position: absolute;
  inset: auto -10% -42% auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--amber) 20%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.daily-ops-board-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.daily-ops-board-copy {
  min-width: 0;
}

.daily-ops-board-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
  color: color-mix(in srgb, var(--amber) 84%, white);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.daily-ops-board-kicker::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 12%, transparent);
}

.daily-ops-board-copy h2 {
  font-family: var(--font-body);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-bottom: 0.38rem;
}

.daily-ops-board-copy p {
  max-width: 1120px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

.daily-ops-board-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(148px, 1fr));
  gap: 0.7rem;
  flex: 0 0 auto;
  min-width: 332px;
}

.daily-ops-board-stat {
  min-width: 0;
  padding: 0.82rem 0.92rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--amber) 14%, rgba(255,255,255,0.05));
  background: linear-gradient(180deg, rgba(30, 24, 16, 0.62), rgba(255,255,255,0.03));
}

.daily-ops-board-stat--muted {
  opacity: 0.74;
}

.daily-ops-board-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.36rem;
  font-weight: 700;
  line-height: 1;
}

.daily-ops-board-stat-label {
  display: block;
  margin-top: 0.24rem;
  color: var(--text-muted);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.daily-ops-store-breakdown {
  margin-top: 0.62rem;
  padding: 0.68rem 0.82rem 0.78rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, rgba(255,255,255,0.05));
  background: linear-gradient(180deg, rgba(23, 30, 44, 0.9), rgba(16, 21, 31, 0.88));
}

.daily-ops-store-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.72rem;
}

.daily-ops-store-copy {
  min-width: 0;
}

.daily-ops-store-kicker {
  color: color-mix(in srgb, var(--accent) 84%, white);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.28rem;
}

.daily-ops-store-copy p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.42;
}

.daily-ops-store-meta {
  flex: 0 0 auto;
  display: grid;
  gap: 0.28rem;
  text-align: right;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.daily-ops-store-meta strong {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.daily-ops-store-table-wrap {
  margin-top: 0.5rem;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.daily-ops-store-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.daily-ops-store-table th,
.daily-ops-store-table td {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
}

.daily-ops-store-table thead th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.daily-ops-store-table tbody td {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.daily-ops-store-table tbody tr:last-child td {
  border-bottom: 0;
}

.daily-ops-note {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.daily-ops-dashboard {
  position: relative;
  z-index: 1;
  margin-top: 0.72rem;
  display: grid;
  gap: 0.72rem;
}

.daily-ops-board-section {
  display: grid;
  gap: 0.72rem;
  padding: 0.72rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.9), rgba(13, 17, 26, 0.86));
  border: 1px solid color-mix(in srgb, var(--group-accent) 20%, rgba(255,255,255,0.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 24px rgba(0,0,0,0.15);
}

/* legacy daily-ops-band stubs — superseded by rules below */
.daily-ops-band-count {
  flex: 0 0 auto;
  padding: 0.36rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.daily-ops-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(var(--snapshot-columns, 3), minmax(0, 1fr));
  gap: 0.75rem;
}

.daily-ops-snapshot-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daily-ops-snapshot-grid--two-three {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.daily-ops-snapshot-grid--two-three .daily-ops-snapshot-card:nth-child(1),
.daily-ops-snapshot-grid--two-three .daily-ops-snapshot-card:nth-child(2) {
  grid-column: span 3;
}

.daily-ops-snapshot-grid--two-three .daily-ops-snapshot-card:nth-child(3),
.daily-ops-snapshot-grid--two-three .daily-ops-snapshot-card:nth-child(4),
.daily-ops-snapshot-grid--two-three .daily-ops-snapshot-card:nth-child(5) {
  grid-column: span 2;
}

.daily-ops-snapshot-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.62rem;
  text-align: center;
  cursor: pointer;
  min-height: 172px;
  padding: 0.8rem 0.85rem 0.88rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--group-accent) 8%, rgba(255,255,255,0.02)) 0%, rgba(18,22,30,0.96) 28%, rgba(14,17,24,0.92) 100%);
  border: 1px solid color-mix(in srgb, var(--group-accent) 16%, rgba(255,255,255,0.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.daily-ops-snapshot-card:hover,
.daily-ops-snapshot-card:focus-visible,
.daily-ops-snapshot-card.active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--group-accent) 30%, rgba(255,255,255,0.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 30px rgba(0,0,0,0.18);
  outline: none;
}

.daily-ops-snapshot-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.2rem 0;
  color: color-mix(in srgb, var(--text-primary) 88%, white);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.daily-ops-snapshot-detail {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.52;
}

.daily-ops-snapshot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.1rem;
}

.daily-ops-snapshot-source {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.daily-ops-snapshot-link {
  color: color-mix(in srgb, var(--group-accent) 84%, white);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.daily-ops-workbook-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 0.8rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
}

.daily-ops-workbook-nav-wrap {
  min-width: 0;
  overflow: hidden;
}

.daily-ops-workbook-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 1rem 0.45rem;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(93, 111, 154, 0.7) transparent;
}

.daily-ops-workbook-search {
  padding-right: 1rem;
}

.daily-ops-workbook-search .filter-select {
  width: 100%;
  min-width: 0;
}

.daily-ops-workbook-nav::-webkit-scrollbar {
  height: 8px;
}

.daily-ops-workbook-nav::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}

.daily-ops-workbook-nav::-webkit-scrollbar-thumb {
  background: rgba(93, 111, 154, 0.82);
  border-radius: 999px;
}

.daily-ops-workbook-tab {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.52rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.daily-ops-workbook-tab:hover,
.daily-ops-workbook-tab:focus-visible,
.daily-ops-workbook-tab.active {
  border-color: color-mix(in srgb, var(--accent) 34%, rgba(255,255,255,0.06));
  background: color-mix(in srgb, var(--accent) 16%, rgba(255,255,255,0.03));
  color: color-mix(in srgb, var(--text-primary) 94%, white);
  transform: translateY(-1px);
  outline: none;
}

.daily-ops-workbook-stage {
  display: grid;
  padding-top: 0.85rem;
}

.daily-ops-workbook-section {
  padding: 1rem;
  border-radius: 26px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, rgba(255,255,255,0.05));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, rgba(20,24,33,0.98)), rgba(14,17,24,0.9));
  box-shadow: var(--shadow-panel);
  scroll-margin-top: 120px;
}

.daily-ops-workbook-section--store-level {
  min-width: 0;
}

.daily-ops-workbook-section--store-level .daily-ops-store-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.daily-ops-workbook-section--store-level .daily-ops-store-table {
  min-width: 1120px;
  /* Columns size to their content (cells are nowrap) instead of equal fixed widths. */
  table-layout: auto;
}

.daily-ops-workbook-section--store-level .daily-ops-store-table th,
.daily-ops-workbook-section--store-level .daily-ops-store-table td {
  text-align: left;
}

.daily-ops-workbook-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.daily-ops-workbook-summary-item {
  padding: 0.68rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, rgba(21,25,34,0.94), rgba(16,20,28,0.9));
}

.daily-ops-workbook-summary-item span {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.daily-ops-workbook-summary-item strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.daily-ops-workbook-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.daily-ops-workbook-copy {
  min-width: 0;
}

.daily-ops-workbook-kicker {
  display: inline-flex;
  margin-bottom: 0.38rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.daily-ops-workbook-copy h3 {
  font-family: var(--font-body);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.daily-ops-workbook-copy p {
  max-width: 760px;
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.58;
}

.daily-ops-workbook-badge {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 11%, rgba(255,255,255,0.03));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, rgba(255,255,255,0.05));
  color: color-mix(in srgb, var(--accent) 84%, white);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.daily-ops-workbook-body {
  display: grid;
  grid-template-columns: 1.618fr 1fr;
  gap: 1rem;
}

.daily-ops-workbook-panel {
  padding: 0.95rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18,22,30,0.94), rgba(14,17,24,0.9));
  border: 1px solid rgba(255,255,255,0.05);
}

.daily-ops-workbook-panel-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.daily-ops-workbook-panel p {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.55;
}

.daily-ops-workbook-links {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.daily-ops-jump-btn,
.daily-ops-card {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.daily-ops-jump-btn {
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.daily-ops-jump-btn:hover,
.daily-ops-jump-btn:focus-visible,
.daily-ops-jump-btn.active,
.daily-ops-card:hover,
.daily-ops-card:focus-visible,
.daily-ops-card.active {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--group-accent) 24%, rgba(255,255,255,0.06));
  box-shadow: 0 14px 22px rgba(0,0,0,0.14);
  outline: none;
}

.main-grid--daily-ops {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-top: 1rem;
}

.main-grid--daily-ops > .daily-ops-panel {
  order: 1;
}

.daily-ops-panel {
  min-height: 0;
}

.daily-ops-map {
  display: grid;
  gap: 0.65rem;
}

.daily-ops-map-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(21,24,33,0.95), rgba(15,18,26,0.88));
  border: 1px solid color-mix(in srgb, var(--group-accent) 14%, rgba(255,255,255,0.05));
}

.daily-ops-map-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.daily-ops-map-meta {
  flex: 0 0 auto;
  color: var(--group-accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.daily-ops-jump-nav {
  display: grid;
  gap: 0.85rem;
}

.daily-ops-jump-group {
  display: grid;
  gap: 0.5rem;
}

.daily-ops-jump-group-title {
  color: var(--group-accent);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.daily-ops-jump-group-links {
  display: grid;
  gap: 0.4rem;
}

.daily-ops-empty {
  padding: 1.25rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.84rem;
}

/* ============================================================
   DISTRICT OVERVIEW MAP
   ============================================================ */

:root {
  --health-critical: #ef4444;
  --health-elevated: #f59e0b;
  --health-watch: #3b82f6;
  --health-healthy: #22c55e;
  --card-border-critical: rgba(239, 68, 68, 0.3);
  --card-border-elevated: rgba(245, 158, 11, 0.3);
  --card-border-watch: rgba(59, 130, 246, 0.3);
  --card-border-healthy: rgba(34, 197, 94, 0.3);
  --glow-critical: 0 0 16px rgba(239, 68, 68, 0.4);
  --glow-elevated: 0 0 12px rgba(245, 158, 11, 0.3);
  --glow-watch: 0 0 8px rgba(59, 130, 246, 0.2);
  --glow-healthy: 0 0 6px rgba(34, 197, 94, 0.1);
}

.district-map-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.map-title h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.map-title p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
}

.map-refresh {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.map-refresh:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.map-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.map-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.map-query-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.map-search-input,
.map-sort-select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(12, 18, 29, 0.8);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0 0.75rem;
}

.map-search-input {
  width: min(240px, 44vw);
}

.map-sort-select {
  min-width: 160px;
}

.map-search-input:focus,
.map-sort-select:focus {
  outline: 2px solid rgba(59, 130, 246, 0.4);
  outline-offset: 1px;
}

.filter-chips {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.5rem 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-soft);
  border-radius: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.chip:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent);
}

.chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.map-legend {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.map-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0 1.5rem;
}

.map-summary-pill {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(18, 25, 38, 0.75);
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.map-summary-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.map-summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--text-primary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.critical {
  background: var(--health-critical);
}

.legend-dot.elevated {
  background: var(--health-elevated);
}

.legend-dot.watch {
  background: var(--health-watch);
}

.legend-dot.healthy {
  background: var(--health-healthy);
}

.map-canvas {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.districts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.district-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  gap: 0.5rem;
  height: 180px;
  min-height: 180px;
}

.district-card[data-status="critical"] {
  border-left-color: var(--health-critical);
  border-color: var(--card-border-critical);
  box-shadow: var(--glow-critical), var(--shadow-sm);
}

.district-card[data-status="elevated"] {
  border-left-color: var(--health-elevated);
  border-color: var(--card-border-elevated);
  box-shadow: var(--glow-elevated), var(--shadow-sm);
}

.district-card[data-status="watch"] {
  border-left-color: var(--health-watch);
  border-color: var(--card-border-watch);
  box-shadow: var(--glow-watch), var(--shadow-sm);
}

.district-card[data-status="healthy"] {
  border-left-color: var(--health-healthy);
  border-color: var(--card-border-healthy);
  box-shadow: var(--glow-healthy), var(--shadow-sm);
}

.district-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.district-card.selected {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 0 2px var(--accent);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-district {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-status {
  padding: 0.3rem 0.7rem;
  border-radius: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-status--critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--health-critical);
}

.card-status--elevated {
  background: rgba(245, 158, 11, 0.15);
  color: var(--health-elevated);
}

.card-status--watch {
  background: rgba(59, 130, 246, 0.15);
  color: var(--health-watch);
}

.card-status--healthy {
  background: rgba(34, 197, 94, 0.15);
  color: var(--health-healthy);
}

.card-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.card-stores {
  color: var(--text-secondary);
  font-weight: 500;
}

.card-time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.card-signals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  flex: 1;
}

.signal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--bg-hover);
  border-radius: 0.4rem;
  text-align: center;
}

.signal-icon {
  font-size: 1.2rem;
}

.signal-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.signal-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
  text-align: right;
}

.card-risk-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.card-risk-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.card-score {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Detail Drawer */
.map-detail-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.drawer-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.drawer-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drawer-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-hover);
  border-radius: 0.5rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-critical {
  color: var(--health-critical);
}

.metric-warning {
  color: var(--health-elevated);
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.store-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.store-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-hover);
  border-radius: 0.4rem;
  font-size: 0.8rem;
}

.store-code {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.store-urgent,
.store-open {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.action-btn {
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--accent-light);
}

/* Empty State */
.map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.map-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1rem 0 0.5rem 0;
}

.map-empty p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 1024px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-health-grid {
    grid-template-columns: 1fr;
  }

  .overview-actions {
    grid-template-columns: 1fr;
  }

  .overview-activity,
  .overview-health,
  .overview-alerts {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .daily-ops-board-title {
    flex-direction: column;
  }

  .daily-ops-board-stats {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid--daily-ops {
    grid-template-columns: 1fr;
  }

  .daily-ops-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-ops-workbook-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-ops-workbook-summary {
    grid-template-columns: 1fr;
  }

  .daily-ops-workbook-top {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .daily-ops-workbook-search {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 860px) {
  .daily-ops-board-stats,
  .daily-ops-workbook-body {
    grid-template-columns: 1fr;
  }

  .daily-ops-store-head {
    flex-direction: column;
  }

  .daily-ops-store-meta {
    text-align: left;
  }

  .daily-ops-snapshot-footer {
    flex-direction: column;
    align-items: center;
  }

  .daily-ops-workbook-nav {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }
}

/* ---- KPI STRIP ---- */
.kpi-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
}

/* Overview: two groups of 3; wide = one row of 6, narrow = horizontal scroll, 3 per snap */
.kpi-strip--overview {
  display: block;
  width: 100%;
  margin: 0.4rem 0;
}
.kpi-strip-overview-scroll {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  gap: 0.6rem;
}
.kpi-strip-overview-group {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

/* Wide / tablet: one even row of six—avoid the “double gap” between groups 1 and 2 */
@media (min-width: 641px) {
  .kpi-strip-overview-scroll {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .kpi-strip-overview-group {
    display: contents;
  }
}

.kpi-strip--overview .kpi-card {
  align-items: flex-start;
  min-height: 0;
  height: 100%;
  padding: 0.4rem 0.55rem 0.35rem 0.5rem;
  gap: 0.22rem;
  box-sizing: border-box;
  border-left-width: 5px;
  border-left-style: solid;
  background: var(--bg-surface);
}

/* Color-matched left bar + light tint to icon (overview strip only) */
.kpi-strip--overview .kpi-card:has(.kpi-icon--open) {
  border-left-color: var(--accent);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), var(--bg-surface));
}
.kpi-strip--overview .kpi-card:has(.kpi-icon--urgent) {
  border-left-color: var(--critical);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.07), var(--bg-surface));
}
.kpi-strip--overview .kpi-card:has(.kpi-icon--resolved) {
  border-left-color: var(--success);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.07), var(--bg-surface));
}
.kpi-strip--overview .kpi-card:has(.kpi-icon--intransit) {
  border-left-color: var(--cyan);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), var(--bg-surface));
}
.kpi-strip--overview .kpi-card:has(.kpi-icon--stale) {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--bg-surface));
}
.kpi-strip--overview .kpi-card:has(.kpi-icon--pending) {
  border-left-color: var(--teal);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), var(--bg-surface));
}

.kpi-strip--overview .kpi-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.kpi-strip--overview .kpi-content {
  flex: 1 1 0;
  min-width: 0;
  gap: 0.12rem;
}

.kpi-strip--overview .kpi-value {
  font-size: 1.45rem;
  line-height: 1.05;
}

.kpi-strip--overview .kpi-label {
  font-size: 0.6rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Period-over-period row (shared structure; rendered by applyOverviewKpiChange in app.js) */
.kpi-strip--overview .kpi-change {
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
  align-self: stretch;
  padding-top: 0.15rem;
}

.kpi-change__divider {
  display: block;
  height: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.15rem 0 0.25rem;
  width: 100%;
}

.kpi-change__row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.22rem 0.35rem;
  font-size: 0.58rem;
  line-height: 1.25;
  min-width: 0;
  width: 100%;
}

.kpi-change__arrow {
  font-size: 0.68rem;
  line-height: 1;
  flex-shrink: 0;
  font-weight: 700;
  font-family: var(--font-mono);
}

.kpi-change__pct {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.kpi-change__context {
  color: var(--text-muted);
  font-size: 0.54rem;
  text-transform: lowercase;
  flex: 1 1 auto;
  min-width: 0;
}

.kpi-change--tone-good .kpi-change__arrow,
.kpi-change--tone-good .kpi-change__pct {
  color: var(--success);
}

.kpi-change--tone-bad .kpi-change__arrow,
.kpi-change--tone-bad .kpi-change__pct {
  color: var(--critical);
}

.kpi-change--tone-warn .kpi-change__arrow,
.kpi-change--tone-warn .kpi-change__pct {
  color: var(--warning);
}

.kpi-change--tone-neutral .kpi-change__arrow,
.kpi-change--tone-neutral .kpi-change__pct {
  color: var(--text-muted);
}

/* Hidden on wide / tablet+; shown only in 640px scroll mode (see media block below) */
.kpi-strip-overview-dots {
  display: none;
}

/* Narrow phones only: 3 KPIs per snap + horizontal scroll. iPad Air (~744–1180px CSS) and up stay on one row with flexible tile width. */
@media (max-width: 640px) {
  .kpi-strip--overview {
    display: block;
  }

  .kpi-strip-overview-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    gap: 0.5rem;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
  }

  .kpi-strip-overview-group {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .kpi-strip-overview-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.45rem;
    padding: 0 0.25rem;
  }
}

.kpi-strip-overview-pill {
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.kpi-strip-overview-pill:hover {
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.22);
}
.kpi-strip-overview-pill.is-active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--accent-light);
}
.kpi-strip-overview-pill:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card--critical {
  border-left-color: var(--critical);
  background: linear-gradient(135deg,
    rgba(239, 68, 68, 0.04),
    var(--bg-surface));
}

.kpi-card--warning {
  border-left-color: var(--warning);
  background: linear-gradient(135deg,
    rgba(245, 158, 11, 0.04),
    var(--bg-surface));
}

.kpi-card--success {
  border-left-color: var(--success);
  background: linear-gradient(135deg,
    rgba(34, 197, 94, 0.04),
    var(--bg-surface));
}

.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.kpi-icon--open { background: var(--accent-dim); color: var(--accent); }
.kpi-icon--urgent { background: var(--critical-dim); color: var(--critical); }
.kpi-icon--resolved { background: var(--success-dim); color: var(--success); }
.kpi-icon--sources { background: var(--purple-dim); color: var(--purple); }
.kpi-icon--intransit { background: var(--cyan-dim); color: var(--cyan); }
.kpi-icon--stale { background: var(--warning-dim); color: var(--warning); }
.kpi-icon--pending { background: var(--teal-dim); color: var(--teal); }
.kpi-icon--snapshot { background: var(--purple-dim); color: var(--purple); }
.kpi-icon--stores { background: var(--accent-dim); color: var(--accent); }
.kpi-icon--districts { background: var(--warning-dim); color: var(--warning); }
.kpi-icon--markets { background: var(--teal-dim); color: var(--teal); }
.kpi-icon--states { background: var(--pink-dim); color: var(--pink); }

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-delta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---- FILTER BAR ---- */
.filter-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.filter-group { display: flex; align-items: center; gap: 0.4rem; }
.filter-group--scroll { overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 4px; }
.filter-group--scroll::-webkit-scrollbar { display: none; }

.filter-btn { font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; padding: 0.52rem 0.95rem; border: 1px solid var(--border); border-radius: 100px; background: rgba(255,255,255,0.02); color: var(--text-secondary); cursor: pointer; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.filter-btn:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-light); }
.filter-btn.active { background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(6,182,212,0.11)); color: var(--accent); border-color: rgba(59, 130, 246, 0.24); }

.filter-select {
  font-family: var(--font-body); font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(19,22,29,0.92); color: var(--text-secondary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c6178' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center;
  padding-right: 2rem;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
input.filter-select {
  background-image: none;
  padding-right: 0.9rem;
}
input.filter-select::placeholder { color: var(--text-muted); }

/* ---- MAIN GRID ---- */
.main-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 1.1rem;
  padding: 0.9rem 0 2.6rem;
  width: 100%;
}
.main-grid--tasks {
  grid-template-columns: 360px minmax(0, 1fr);
}

/* Swap column order — sidebar (right-col) appears first on the left */
.main-grid > .right-col { order: 1; }
.main-grid > .event-feed,
.main-grid > .inv-table-panel { order: 2; }
.main-grid > .store-table-panel { order: 2; }
.main-grid--tasks > .right-col { order: 1; }
.main-grid--tasks > .tasks-panel { order: 2; min-height: 100%; }
.main-grid--tasks .tasks-list {
  min-height: 72vh;
}

/* ---- TASKS PAGE ---- */
.tasks-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1.5rem;
}

.tasks-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.tasks-page-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  font-weight: 500;
}

.tasks-page-head p {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.tasks-page-actions,
.tasks-filters,
.tasks-tabs,
.tasks-table-footer,
.tasks-pagination,
.tasks-assignee,
.tasks-quick-actions {
  display: flex;
  align-items: center;
}

.tasks-page-actions {
  gap: 0.55rem;
}

.tasks-tool-btn,
.tasks-create-btn {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font: 800 0.72rem var(--font-body);
  cursor: pointer;
  min-height: 36px;
  padding: 0 0.85rem;
}

.tasks-tool-btn {
  background: rgba(8, 14, 24, 0.82);
}

.tasks-create-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.tasks-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(8.5rem, 1fr));
  gap: 0.7rem;
}

.tasks-kpi-card {
  min-height: 86px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(18, 29, 45, 0.98), rgba(12, 22, 34, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.tasks-kpi-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.tasks-kpi-card--blue .tasks-kpi-icon { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.tasks-kpi-card--orange .tasks-kpi-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tasks-kpi-card--purple .tasks-kpi-icon { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.tasks-kpi-card--green .tasks-kpi-icon { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.tasks-kpi-card--red .tasks-kpi-icon { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.tasks-kpi-card span:not(.tasks-kpi-icon) {
  display: block;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
}

.tasks-kpi-card strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-primary);
  font: 800 1.6rem/1 var(--font-body);
}

.tasks-kpi-card small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.tasks-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 0.8rem;
  align-items: start;
}

.tasks-table-panel,
.tasks-side-card {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 29, 43, 0.96), rgba(11, 22, 34, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.tasks-table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tasks-tabs {
  gap: 1.35rem;
  min-width: 0;
}

.tasks-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  font: 800 0.72rem var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}

.tasks-tab.active {
  color: #dcecff;
  border-color: #3b82f6;
}

.tasks-filters {
  gap: 0.45rem;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.tasks-filters select,
.tasks-search input {
  height: 34px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(7, 15, 25, 0.88);
  color: var(--text-primary);
  font: 700 0.68rem var(--font-body);
}

.tasks-filters select {
  width: 108px;
  padding: 0 0.45rem;
}

.tasks-search {
  position: relative;
}

.tasks-search input {
  width: 155px;
  padding: 0 0.65rem 0 1.7rem;
}

.tasks-search span {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.tasks-table-wrap {
  overflow-x: auto;
}

.tasks-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  table-layout: auto;
}

.tasks-table th,
.tasks-table td {
  padding: 0.78rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-align: left;
  vertical-align: middle;
}

.tasks-table th {
  color: var(--text-muted);
  font: 900 0.58rem var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Column widths come from cell content (table-layout: auto); no forced
   percentage widths so no column is padded wider than its content. */

.tasks-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
}

.tasks-task-title {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.25;
}

.tasks-task-subtitle,
.tasks-date-sub {
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.25;
}

.tasks-category-pill,
.tasks-status {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 0.34rem 0.5rem;
  font: 800 0.62rem var(--font-body);
}

.tasks-category-pill {
  color: #8bb6ff;
  background: rgba(37, 99, 235, 0.11);
}

.tasks-priority {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
}

.tasks-priority i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.tasks-priority--urgent,
.tasks-priority--high { color: #f87171; }
.tasks-priority--normal { color: #f59e0b; }
.tasks-priority--low { color: #4ade80; }

.tasks-date-main {
  color: var(--text-primary);
  font-size: 0.68rem;
  font-weight: 800;
}

.tasks-status--due-today,
.tasks-status--overdue {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.11);
}

.tasks-status--pending {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}

.tasks-status--not-started {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
}

.tasks-status--completed {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.tasks-assignee {
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
}

.tasks-assignee span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dcecff;
  color: #1e293b;
  font-size: 0.62rem;
}

.tasks-assignee em {
  font-style: normal;
}

.tasks-row-menu {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.tasks-table tr.is-completed {
  opacity: 0.6;
}

.tasks-table-footer {
  justify-content: space-between;
  padding: 0.85rem 0.95rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.tasks-pagination {
  gap: 0.45rem;
}

.tasks-pagination button,
.tasks-pagination span {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(7, 15, 25, 0.72);
  color: var(--text-secondary);
}

.tasks-side-panel {
  display: grid;
  gap: 0.7rem;
}

.tasks-side-card {
  padding: 0.85rem;
}

.tasks-side-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 900;
}

.tasks-side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tasks-side-head a {
  color: #60a5fa;
  text-decoration: none;
  font-size: 0.66rem;
  font-weight: 800;
}

.tasks-calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}

.tasks-calendar-nav button {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.25rem;
}

.tasks-calendar-nav strong {
  color: var(--text-primary);
  font-size: 0.72rem;
}

.tasks-calendar-weekdays,
.tasks-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.tasks-calendar-weekdays {
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 900;
}

.tasks-calendar-grid {
  gap: 0.25rem;
  margin-top: 0.45rem;
}

.tasks-calendar-grid span {
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 800;
}

.tasks-calendar-day.active {
  background: #2563eb;
  color: #fff;
}

.tasks-calendar-day.has-task:not(.active) {
  color: #f87171;
}

/* ── Audits tab shell & Merchandising Walkthrough ─────────── */
#tab-audits .audits-tab-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.audits-page-mount {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-items: stretch;
}

/* Mobile: hard-cap the audits content to the viewport width so nothing can
   make the page horizontally pannable. This matters in the installed iOS PWA,
   where <body> is a `position: fixed; overflow-y: auto` touch-scroll container
   and iOS Safari ignores `overflow-x: hidden` there — a wide descendant (the
   780px-min-width Past Walkthroughs table, or an iOS momentum-scroll leak from
   its inner scroller) would otherwise let the whole page pan sideways and drag
   the absolutely-positioned walkthrough setup-search results off both edges.
   `overflow-x: clip` (unlike `hidden`) clips ONE axis without turning the
   vertical axis into a scroll container, so the results dropdown — which opens
   downward out of its card — is never vertically clipped. */
@media (max-width: 767px) {
  .audits-page-mount {
    overflow-x: clip;
  }
}

#tab-audits .audits-page-mount > .audit-mwalk,
#tab-audits .audits-page-mount > section.audits-mw-past {
  width: 100%;
  max-width: none;
  align-self: stretch;
  box-sizing: border-box;
}

.audits-mw-past {
  padding: 0 0 0.5rem;
  min-width: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.audits-mw-past-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.audits-mw-past-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
  min-width: 0;
}

.audits-mw-past-header-row .audits-mw-past-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.audits-mw-past-header-row .audits-mw-past-cloud-toolbar {
  flex: 0 1 18rem;
  max-width: 100%;
  min-width: min(14rem, 100%);
}

.audits-mw-past-cloud {
  min-width: 0;
}

.audits-mw-past-cloud-toolbar {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 26rem;
}

.audits-mw-past-search-wrap {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  cursor: text;
}

.audits-mw-past-search-svg {
  flex-shrink: 0;
  display: block;
  color: #64748b;
}

.audits-mw-past-search-wrap:focus-within .audits-mw-past-search-svg {
  color: #94a3b8;
}

.audits-mw-past-search-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.65);
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  font: 600 0.78rem/1.35 var(--font-body);
}

.audits-mw-past-search-input::placeholder {
  color: #64748b;
}

.audits-mw-past-search-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.12);
}

.audits-mw-past-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  margin-top: 0.55rem;
  padding: 0.15rem 0.1rem 0;
}

.audits-mw-past-pager-meta {
  margin: 0;
  font: 600 0.72rem/1.35 var(--font-body);
  color: #94a3b8;
}

.audits-mw-past-pager-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.audits-mw-past-pager-page {
  font: 600 0.7rem/1 var(--font-body);
  color: #64748b;
}

.audits-mw-past-pager-btn {
  padding: 0.32rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.65);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font: 700 0.68rem/1 var(--font-body);
  cursor: pointer;
}

.audits-mw-past-pager-btn:hover:not(:disabled) {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fef3c7;
}

.audits-mw-past-pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.audits-mw-past-title {
  margin: 0 0 0.65rem;
  font: 800 1rem/1.25 var(--font-body);
  color: #e2e8f0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audits-mw-past-empty {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px dashed rgba(71, 85, 105, 0.55);
  background: rgba(15, 23, 42, 0.35);
  color: #94a3b8;
  font: 600 0.82rem/1.45 var(--font-body);
}

.audits-mw-past-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.audits-mw-past-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(15, 23, 42, 0.55);
  box-sizing: border-box;
}

.audits-mw-past-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.audits-mw-past-date {
  font: 600 0.78rem/1.35 var(--font-body);
  color: #94a3b8;
}

.audits-mw-past-pdf-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.14);
  color: #fdba74;
  font: 800 0.68rem/1 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.audits-mw-past-pdf-btn:hover {
  background: rgba(249, 115, 22, 0.24);
}

.audits-mw-past-store {
  font: 700 0.92rem/1.3 var(--font-body);
  color: #f8fafc;
}

.audits-mw-past-store-num {
  font-weight: 600;
  color: #94a3b8;
}

.audits-mw-past-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
}

.audits-mw-past-stats li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font: 600 0.72rem/1.2 var(--font-body);
  color: #cbd5e1;
}

.audits-mw-past-stat-ic {
  display: flex;
  color: #64748b;
  flex-shrink: 0;
}

.audits-mw-past-stats li span:nth-of-type(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.audits-mw-past-stats strong {
  font: 800 0.78rem/1 var(--font-body);
  color: #fdba74;
  margin-left: auto;
}

.audits-mw-past-cloud-msg {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(71, 85, 105, 0.45);
  color: #cbd5e1;
  font: 600 0.8rem/1.4 var(--font-body);
}

.audits-mw-past-cloud-msg--muted {
  color: #94a3b8;
  border-style: dashed;
}

.audits-mw-past-cloud-fail {
  margin-bottom: 0.75rem;
}

.audits-mw-past-cloud-fail .audits-mw-past-cloud-msg {
  margin-bottom: 0.5rem;
}

.audits-mw-past-cloud-err {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.65rem;
  max-height: 7rem;
  overflow: auto;
  border-radius: 8px;
  background: rgba(30, 27, 22, 0.85);
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: #fde68a;
  font: 600 0.68rem/1.35 ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.audits-mw-past-cloud-hint {
  margin: 0 0 0.55rem;
  font: 500 0.72rem/1.45 var(--font-body);
  color: #94a3b8;
}

.audits-mw-past-cloud-hint code {
  font-size: 0.68rem;
  color: #cbd5e1;
}

.audits-mw-past-cloud-retry {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fef3c7;
  font: 700 0.75rem/1 var(--font-body);
  cursor: pointer;
}

.audits-mw-past-cloud-retry:hover {
  background: rgba(251, 191, 36, 0.22);
}

.audits-mw-past-table-wrap {
  overflow-x: auto;
  /* Keep this table's horizontal scroll self-contained so it can't chain into
     the page/body scroll (which on iOS would let the whole page pan sideways). */
  overscroll-behavior-x: contain;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(15, 23, 42, 0.45);
}

.audits-mw-past-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font: 600 0.76rem/1.35 var(--font-body);
  color: #e2e8f0;
}

.audits-mw-past-th-sortable {
  padding: 0;
}

.audits-mw-past-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.55rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.audits-mw-past-sort-btn:hover {
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.4);
}

.audits-mw-past-sort-btn:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.55);
  outline-offset: -2px;
}

.audits-mw-past-sort-btn-label {
  flex: 1 1 auto;
  min-width: 0;
}

.audits-mw-past-sort-ind {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #fbbf24;
  line-height: 1;
}

.audits-mw-past-table th,
.audits-mw-past-table td {
  padding: 0.5rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  vertical-align: middle;
  white-space: nowrap;
}

.audits-mw-past-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  max-width: none;
}

.audits-mw-past-status-inline .audits-mw-past-mini {
  margin-top: 0;
}

.audits-mw-past-table th {
  font: 800 0.62rem/1.2 var(--font-body);
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.audits-mw-past-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.42), rgba(15, 23, 42, 0.32));
}

.audits-mw-past-table-actions {
  white-space: nowrap;
}

.audits-mw-past-row-btn {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.78));
  color: #e2e8f0;
  font: 700 0.65rem/1 var(--font-body);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.audits-mw-past-row-btn:hover {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fef3c7;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.24);
  transform: translateY(-1px);
}

.audits-mw-past-row-btn--pdf {
  border-color: rgba(249, 115, 22, 0.45);
  color: #fdba74;
}

.audits-mw-past-mono {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: #94a3b8;
  word-break: break-all;
}

.audits-mw-past-status {
  display: inline-block;
  font: 800 0.62rem/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #86efac;
}

.audits-mw-past-status--pending {
  color: #92600a;
}

.audits-mw-past-local {
  margin-bottom: 1rem;
}

.audits-mw-past-local-label {
  margin: 0 0 0.45rem;
  font: 700 0.72rem/1.35 var(--font-body);
  color: #92600a;
}

.audits-mw-past-mini {
  margin-top: 0.38rem;
}

.audits-mw-past-mini-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.32rem;
}

.audits-mw-past-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.16rem 0.34rem;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
  font: 700 0.62rem/1 var(--font-body);
}

.audits-mw-past-mini-badge strong {
  color: #e2e8f0;
  font-weight: 800;
}

.audits-mw-past-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.audits-mw-past-pdf-btn--ghost {
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.45);
}

.audits-mw-past-local-tag {
  margin: 0.35rem 0 0;
  font: 600 0.62rem/1.2 var(--font-body);
  color: #64748b;
  letter-spacing: 0.04em;
}

body.audits-mw-past-detail-open {
  overflow: hidden;
}

body.audits-mw-past-detail-open .swipe-zone {
  pointer-events: none;
}

#auditsMwPastDetailBackdrop.audits-mw-past-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding:
    max(0.45rem, env(safe-area-inset-top, 0px))
    max(0.45rem, env(safe-area-inset-right, 0px))
    max(0.45rem, env(safe-area-inset-bottom, 0px))
    max(0.45rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  background: rgba(13, 27, 49, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
}

#auditsMwPastDetailBackdrop.audits-mw-past-detail-backdrop[hidden] {
  display: none !important;
}

.audits-mw-past-detail-panel {
  width: min(1040px, 100%);
  max-height: min(100vh - 0.85rem, 100dvh - 0.85rem);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(13, 27, 49, 0.35);
  overflow-x: hidden;
  overflow-y: hidden;
  box-sizing: border-box;
}

.audits-mw-past-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.65rem;
  row-gap: 0.35rem;
  padding: 1.05rem 1.15rem 1rem;
  border-bottom: 0;
  background: linear-gradient(90deg, #13315a 0%, #000000 100%);
  flex-shrink: 0;
}

.audits-mw-past-detail-head-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.audits-mw-past-detail-title {
  margin: 0;
  font: 900 1.35rem/1.15 var(--font-body);
  letter-spacing: 0.01em;
  color: #f8fafc;
}

.audits-mw-past-detail-datetime {
  margin: 0;
  font: 500 0.84rem/1.35 var(--font-body);
  color: rgba(255, 255, 255, 0.78);
}

.audits-mw-past-detail-crumbs {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.22rem 0.35rem;
  font: 600 0.72rem/1.35 var(--font-body);
  color: rgba(226, 232, 240, 0.88);
}

.audits-mw-past-detail-crumb-sep {
  color: #6EC1E4;
  font-weight: 800;
  padding: 0 0.1rem;
}

.audits-mw-past-detail-crumb-txt {
  letter-spacing: 0.015em;
}

.audits-mw-past-detail-manager {
  margin: 0.12rem 0 0;
  font: 600 0.78rem/1.35 var(--font-body);
  color: rgba(226, 232, 240, 0.95);
}

.audits-mw-past-detail-manager-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.audits-mw-past-detail-manager-name {
  font-weight: 700;
  color: #f8fafc;
}

.audits-mw-past-detail-source {
  margin: 0;
  font: 600 0.62rem/1.3 var(--font-body);
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.audits-mw-past-detail-head-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
}

.audits-mw-past-detail-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.4rem 0.62rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: 700 0.68rem/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease, color 0.12s ease;
}

.audits-mw-past-detail-pdf-ic {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.audits-mw-past-detail-pdf:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

.audits-mw-past-detail-close {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.audits-mw-past-detail-close:hover {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.18);
}

.audits-mw-past-detail-close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.audits-mw-past-detail-body {
  padding: 0.85rem 1.05rem;
  overflow-y: auto;
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(78dvh, 720px);
  -webkit-overflow-scrolling: touch;
  background: #f4f7fb;
}

.audits-mw-past-detail-stat-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.32rem;
  margin-bottom: 0.92rem;
  min-width: 0;
}

.audits-mw-past-detail-stat-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 2.5rem;
  padding: 0.38rem 0.4rem;
  border-radius: 8px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  box-sizing: border-box;
}

.audits-mw-past-detail-stat-ic {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #009FDB;
}

.audits-mw-past-detail-stat-ic svg {
  display: block;
  width: 15px;
  height: 15px;
}

.audits-mw-past-detail-stat-lab {
  flex: 1 1 auto;
  min-width: 0;
  font: 700 0.58rem/1.1 var(--font-body);
  color: #5b6372;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audits-mw-past-detail-stat-gap {
  align-self: stretch;
  flex-shrink: 0;
  width: 1px;
  min-width: 1px;
  background: #e4e9f1;
  margin: 0;
}

.audits-mw-past-detail-stat-num {
  flex-shrink: 0;
  font: 800 0.84rem/1 var(--font-body);
  color: #1B4278;
  font-variant-numeric: tabular-nums;
  min-width: 0.85rem;
  text-align: right;
}

.audits-mw-past-detail-pages {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.audits-mw-past-detail-page {
  flex: 0 1 auto;
  min-height: 0;
  outline: none;
}

.audits-mw-past-detail-sheet {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  box-sizing: border-box;
}

.audits-mw-past-detail-sec-head {
  display: flex;
  align-items: center;
  gap: 0.52rem;
  margin-bottom: 0.72rem;
}

.audits-mw-past-detail-sec-ic {
  display: grid;
  place-items: center;
  color: #009FDB;
}

.audits-mw-past-detail-sec-ic svg {
  display: block;
}

.audits-mw-past-detail-sec-title {
  margin: 0;
  font: 800 0.74rem/1.2 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1B4278;
}

.audits-mw-past-detail-notes-frame {
  flex: 1 1 auto;
  min-height: 12rem;
  border-radius: 10px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.audits-mw-past-detail-notes-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0, 159, 219, 0.8), transparent);
}

.audits-mw-past-detail-notes-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  padding: 1rem 1.08rem;
  font: 500 0.86rem/1.55 var(--font-body);
  color: #243042;
  white-space: pre-wrap;
  -webkit-overflow-scrolling: touch;
}

.audits-mw-past-detail-table-shell {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(52dvh, 440px);
  border-radius: 10px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.audits-mw-past-detail-sheet:has(.audits-mw-past-detail-notes-frame) {
  min-height: min(320px, 46dvh);
}

.audits-mw-past-detail-table {
  width: 100%;
  border-collapse: collapse;
  font: 600 0.82rem/1.35 var(--font-body);
  color: #243042;
  /* Continuous navy header band: the gradient lives on the TABLE element and
     header cells stay transparent; opaque body rows cover the rest. Putting it
     on thead/th paints per-cell (segmented) in some browsers. */
  background: linear-gradient(90deg, #13315a 0%, #000000 100%);
}

.audits-mw-past-detail-table thead tr {
  border-bottom: 0;
}

.audits-mw-past-detail-table th {
  padding: 0.58rem 0.72rem;
  text-align: left;
  font: 750 0.58rem/1.2 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.audits-mw-past-detail-table tbody tr {
  background: #ffffff;
}

.audits-mw-past-detail-table tbody tr:nth-child(even) {
  background: #f6f9fd;
}

.audits-mw-past-detail-th-check {
  width: 2.5rem;
}

.audits-mw-past-detail-th-num {
  text-align: right;
}

.audits-mw-past-detail-th-photo {
  text-align: center;
}

.audits-mw-past-detail-table td {
  padding: 0.65rem 0.72rem;
  vertical-align: middle;
  border-bottom: 1px solid #e4e9f1;
}

.audits-mw-past-detail-table tbody tr:last-child td {
  border-bottom-color: transparent;
}

.audits-mw-past-detail-tr-muted td {
  color: #8a93a3;
  font-weight: 550;
}

.audits-mw-past-detail-tr-pad td {
  height: 2.05rem;
  padding: 0.25rem;
  opacity: 0.45;
}

.audits-mw-past-detail-bullet {
  display: block;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  color: #009FDB;
}

.audits-mw-past-detail-faux-check {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 1px solid #b3bccb;
  background: #ffffff;
}

.audits-mw-past-detail-faux-check.is-done {
  border-color: #16a34a;
  background: #16a34a;
}

.audits-mw-past-detail-faux-check.is-done::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.audits-mw-past-detail-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.62rem;
  border-radius: 6px;
  border: 1px solid #d8e0ea;
  background: #eef3fa;
  color: #1B4278;
  font: 650 0.68rem/1.2 var(--font-body);
}

.audits-mw-past-detail-badge--loc {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audits-mw-past-detail-badge--pill {
  border-radius: 999px;
  text-transform: none;
}

.audits-mw-past-detail-badge--priority {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audits-mw-past-detail-badge--priority-high {
  border-color: #f3b4b4;
  color: #b91c1c;
  background: #fdecec;
}

.audits-mw-past-detail-badge--priority-medium {
  border-color: #ecc98c;
  color: #92600a;
  background: #fdf3e0;
}

.audits-mw-past-detail-badge--priority-low {
  border-color: #b5dfc2;
  color: #1d7a3e;
  background: #eaf7ef;
}

.audits-mw-past-detail-th-pri,
.audits-mw-past-detail-td-pri {
  text-align: center;
  vertical-align: middle;
}

.audits-mw-past-detail-table--todos th:nth-child(3),
.audits-mw-past-detail-table--todos td:nth-child(3) {
  width: 4.95rem;
  max-width: 5.35rem;
}

.audits-mw-past-detail-td-task {
  color: #243042;
}

.audits-mw-past-detail-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.audits-mw-past-detail-td-photo {
  text-align: center;
  vertical-align: middle;
}

.audits-mw-past-detail-table--todos {
  table-layout: auto;
}

.audits-mw-past-detail-table--todos th:nth-child(2),
.audits-mw-past-detail-table--todos td:nth-child(2) {
  /* Size to content; cap long location text instead of forcing a fixed share. */
  max-width: 8.75rem;
}

.audits-mw-past-detail-table--orders {
  table-layout: auto;
}

.audits-mw-past-detail-td-task--stretch {
  min-width: 0;
  word-break: break-word;
}

.audits-mw-past-detail-table--todos .audits-mw-past-detail-th-photo,
.audits-mw-past-detail-table--todos .audits-mw-past-detail-td-thumb {
  width: 3.35rem;
  box-sizing: border-box;
}

.audits-mw-past-detail-table--orders .audits-mw-past-detail-th-photo,
.audits-mw-past-detail-table--orders .audits-mw-past-detail-td-photo {
  width: 3.35rem;
  box-sizing: border-box;
}

.audits-mw-past-detail-table--orders tbody td:nth-child(1),
.audits-mw-past-detail-table--orders tbody td:nth-child(2) {
  min-width: 0;
  word-break: break-word;
}

.audits-mw-past-detail-table--orders .audits-mw-past-detail-td-photo {
  padding-inline: 0.35rem;
}

.audits-mw-past-detail-td-thumb {
  text-align: center;
  vertical-align: middle;
  padding: 0.5rem 0.35rem;
}

.audits-mw-past-detail-tr-photo td {
  padding-top: 0.45rem;
  padding-bottom: 0.82rem;
  border-bottom: 1px solid #e4e9f1;
  text-align: center;
}

.audits-mw-past-detail-inline-thumb {
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #d8e0ea;
  background: #f1f5f9;
}

.audits-mw-past-detail-inline-thumb--tile {
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
  width: 2.75rem;
  height: 2.75rem;
  max-width: 2.75rem;
  aspect-ratio: 1;
  margin-inline: auto;
}

.audits-mw-past-detail-inline-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audits-mw-past-detail-emdash {
  color: #8a93a3;
  font-weight: 600;
}

.audits-mw-past-detail-filecell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.audits-mw-past-detail-file-ic {
  flex-shrink: 0;
  color: #009FDB;
  display: grid;
  place-items: center;
}

.audits-mw-past-detail-file-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.13em;
  font-weight: 650;
}

.audits-mw-past-detail-foot {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.72rem 1.05rem 0.88rem;
  border-top: 1px solid #d8e0ea;
  background: #ffffff;
}

.audits-mw-past-detail-foot-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.audits-mw-past-detail-foot-id {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.audits-mw-past-detail-foot-svg {
  flex-shrink: 0;
  color: #009FDB;
}

.audits-mw-past-detail-foot-label {
  flex-shrink: 0;
  font: 650 0.72rem/1.2 var(--font-body);
  color: #5b6372;
}

.audits-mw-past-detail-foot-id code {
  min-width: 0;
  font: 630 0.68rem/1.25 ui-monospace, monospace;
  word-break: break-all;
  color: #1B4278;
}

.audits-mw-past-detail-foot-label:after {
  content: ":";
  margin-left: 0.06rem;
  color: #8a93a3;
}

.audits-mw-past-detail-foot-pager {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.audits-mw-past-detail-page-meta {
  font: 640 0.76rem/1.2 var(--font-body);
  color: #1B4278;
  padding: 0 0.2rem;
  min-width: 6rem;
  text-align: center;
}

.audits-mw-past-detail-page-btn {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #c9d4e2;
  background: #ffffff;
  color: #1B4278;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background 0.12s ease,
    color 0.12s ease;
}

.audits-mw-past-detail-page-btn:not(:disabled):hover {
  border-color: #009FDB;
  color: #009FDB;
  background: rgba(0, 159, 219, 0.08);
}

.audits-mw-past-detail-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.audits-mw-past-detail-loading,
.audits-mw-past-detail-empty {
  margin: 0;
  color: #5b6372;
  font: 600 0.85rem/1.45 var(--font-body);
}

.audits-mw-past-detail-err {
  color: #CC4B37;
  font-size: 0.78rem;
}

.audits-mw-past-sub {
  margin-top: 0.38rem;
  color: #5b6372;
  font-weight: 500;
}

.audits-mw-past-done {
  color: #1d7a3e;
  font: 800 0.62rem/1 var(--font-body);
}

.audits-mw-past-open {
  color: #92600a;
  font: 800 0.62rem/1 var(--font-body);
}

@media (max-width: 767px) {
  #auditsMwPastDetailBackdrop.audits-mw-past-detail-backdrop {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding:
      max(0.35rem, env(safe-area-inset-top, 0px))
      max(0.35rem, env(safe-area-inset-right, 0px))
      max(0.35rem, env(safe-area-inset-bottom, 0px))
      max(0.35rem, env(safe-area-inset-left, 0px));
  }

  .audits-mw-past-detail-panel {
    width: 100%;
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
  }

  .audits-mw-past-detail-body {
    max-height: none;
  }

  .audits-mw-past-detail-table-shell {
    max-height: min(52dvh, 480px);
  }

  .audits-mw-past-detail-foot-main {
    flex-wrap: wrap;
  }

  .audits-mw-past-detail-foot-pager {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .audits-mw-past-detail-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 0.85rem 0.72rem 0.8rem;
    column-gap: 0.45rem;
  }

  .audits-mw-past-detail-head-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    width: auto;
  }

  .audits-mw-past-detail-stat-row {
    gap: 0.22rem;
    margin-bottom: 0.72rem;
  }

  .audits-mw-past-detail-stat-card {
    padding: 0.3rem 0.26rem;
    gap: 0.22rem;
    min-height: 2.2rem;
  }

  .audits-mw-past-detail-stat-lab {
    font-size: 0.52rem;
    letter-spacing: 0;
  }

  .audits-mw-past-detail-stat-num {
    font-size: 0.72rem;
    min-width: 0.7rem;
  }

  .audits-mw-past-detail-stat-ic svg {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 420px) {
  .audits-mw-past-detail-pdf {
    padding: 0.38rem 0.42rem;
  }

  .audits-mw-past-detail-pdf span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .audits-mw-past-detail-close {
    width: 2.1rem;
    height: 2.1rem;
  }

  .audits-mw-past-detail-close svg {
    width: 16px;
    height: 16px;
  }
}


#auditsMwWalkPopout.audit-mwalk-popout {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(0.35rem, env(safe-area-inset-top, 0px))
    max(0.35rem, env(safe-area-inset-right, 0px))
    max(0.35rem, env(safe-area-inset-bottom, 0px))
    max(0.35rem, env(safe-area-inset-left, 0px));
  background: rgba(4, 6, 12, 0.92);
  backdrop-filter: blur(14px);
}

#auditsMwWalkPopout.audit-mwalk-popout.audit-mwalk-popout--file-drag {
  outline: 2px dashed rgba(251, 191, 36, 0.55);
  outline-offset: -6px;
  background: rgba(8, 12, 22, 0.94);
}

.audit-mwalk-popout-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.65rem 0.5rem;
}

.audit-mwalk-popout-endbar {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.65rem 0.65rem;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(6, 10, 18, 0.96);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.audit-mwalk-popout-endbar .audit-mw-end {
  width: 100%;
  max-width: 1180px;
}

.audit-mwalk.audit-mwalk--popout {
  width: min(100%, 1180px);
  max-width: 1180px;
  flex: 1 1 auto;
  min-height: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.audit-mwalk.audit-mwalk--popout > .audit-mw-evidence,
.audit-mwalk.audit-mwalk--popout > .audit-mw-notes,
.audit-mwalk.audit-mwalk--popout > .audit-mw-attachments,
.audit-mwalk.audit-mwalk--popout > .audit-mw-empty-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-bottom: 0;
}

.audit-mw-attachments {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.15rem 0.05rem 0.5rem;
  box-sizing: border-box;
}

.audit-mw-attach-drop {
  flex-shrink: 0;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.audit-mw-attach-drop--active,
.audit-mw-attach-drop:hover {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(30, 41, 59, 0.65);
}

.audit-mw-attach-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.1rem 0.85rem;
  text-align: center;
}

.audit-mw-attach-drop-svg {
  display: flex;
  color: rgba(148, 163, 184, 0.9);
}

.audit-mw-attach-drop-title {
  margin: 0;
  font: 700 0.88rem/1.25 var(--font-body);
  color: #e2e8f0;
}

.audit-mw-attach-drop-hint {
  margin: 0;
  max-width: 22rem;
  font: 500 0.72rem/1.35 var(--font-body);
  color: rgba(148, 163, 184, 0.95);
}

.audit-mw-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.audit-mw-attach-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.audit-mw-attach-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.audit-mw-attach-thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.95);
}

.audit-mw-attach-thumb--icon svg {
  width: 22px;
  height: 22px;
}

.audit-mw-attach-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.audit-mw-attach-name {
  font: 600 0.82rem/1.25 var(--font-body);
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-mw-attach-mime {
  font: 500 0.68rem/1.2 var(--font-body);
  color: rgba(148, 163, 184, 0.9);
}

.audit-mw-attach-remove {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: 600 0.68rem/1 var(--font-body);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
  cursor: pointer;
}

.audit-mw-attach-remove:hover {
  background: rgba(127, 29, 29, 0.4);
}

.audit-mw-attach-empty {
  margin: 0;
  padding: 0.65rem 0.5rem;
  font: 500 0.78rem/1.35 var(--font-body);
  color: rgba(148, 163, 184, 0.95);
  text-align: center;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
}

.audit-mwalk.audit-mwalk--popout > .audit-mw-notes {
  min-height: 0;
}

.audit-mwalk.audit-mwalk--popout > .audit-mw-notes .audit-mw-notes-textarea {
  min-height: 8rem;
  flex: 1 1 auto;
}

.audit-mwalk.audit-mwalk--popout > .audit-mwalk-head,
.audit-mwalk.audit-mwalk--popout > .audit-mw-dash,
.audit-mwalk.audit-mwalk--popout > .audit-mw-tabs {
  flex-shrink: 0;
}

.audit-mwalk-head--popout {
  position: relative;
  padding-right: 5.85rem;
}

.audit-mwalk-popout-head-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.audit-mwalk-popout-head-actions button {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.audit-mwalk-popout-minimize {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.audit-mwalk-popout-minimize:hover {
  background: rgba(51, 65, 85, 0.65);
  border-color: rgba(148, 163, 184, 0.55);
  color: #f8fafc;
}

.audit-mwalk-popout-cancel {
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(69, 10, 10, 0.35);
  color: #fecaca;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.audit-mwalk-popout-cancel:hover {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fff;
}

.audit-mwalk-minimized-audits-hint {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.45);
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
  font: 600 0.82rem/1.4 var(--font-body);
  max-width: 32rem;
}

#auditsMwWalkMinDock.audit-mwalk-min-dock {
  position: fixed;
  right: max(0.65rem, env(safe-area-inset-right, 0px));
  bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  z-index: 9250;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  max-width: min(100vw - 1.3rem, 22rem);
  padding: 0.55rem 0.6rem 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(165deg, rgba(22, 28, 45, 0.98) 0%, rgba(12, 16, 28, 0.98) 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

@media (max-width: 767px) {
  #auditsMwWalkMinDock.audit-mwalk-min-dock {
    /* Above fixed bottom horizontal command rail (.command-rail height 64px) */
    bottom: calc(
      64px + 0.5rem + env(safe-area-inset-bottom, 0px)
    );
  }
}

.audit-mwalk-min-dock-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.audit-mwalk-min-dock-kicker {
  font: 800 0.58rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fdba74;
}

.audit-mwalk-min-dock-store {
  font: 700 0.78rem/1.25 var(--font-body);
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-mwalk-min-dock-time {
  font: 700 0.68rem/1 var(--font-mono, monospace);
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.audit-mwalk-min-dock-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
}

.audit-mwalk-min-dock-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.audit-mwalk-min-dock-btn:hover {
  background: rgba(51, 65, 85, 0.75);
  border-color: rgba(148, 163, 184, 0.55);
}

.audit-mwalk-min-dock-btn--close {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.2);
}

.audit-mwalk-min-dock-btn--close:hover {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

body.audit-mwalk-popout-open {
  overflow: hidden;
}

body.audit-mwalk-popout-open .swipe-zone {
  pointer-events: none;
}

/* Past Walkthroughs on screen: block edge swipe strips (tab swipe is already blocked in JS). */
body.audits-mw-past-in-view .swipe-zone {
  pointer-events: none;
}

.audit-mwalk {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(165deg, rgba(22, 28, 45, 0.98) 0%, rgba(12, 16, 28, 0.99) 100%);
  padding: 1.15rem 1.1rem 1.25rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.audit-mwalk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.audit-mwalk-title {
  margin: 0;
  font: 800 1.35rem/1.15 var(--font-body);
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.audit-mwalk-sub {
  margin: 0.25rem 0 0;
  font: 600 0.78rem var(--font-body);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.audit-mwalk-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  font: 700 0.72rem var(--font-body);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.audit-mwalk-sync:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.55);
}

.audit-mw-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 980px) {
  .audit-mw-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .audit-mw-context-grid {
    grid-template-columns: 1fr;
  }
}

.audit-mw-setup-search-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 0.85rem;
}

.audit-mw-card--setup-search {
  position: relative;
  width: 100%;
  min-height: unset;
  padding-bottom: 0.45rem;
}

.audit-mw-card-icon--search {
  top: 0.48rem;
}

.audit-mw-setup-search-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.06rem;
  min-width: 0;
}

.audit-mw-setup-search-input {
  flex: 1;
  min-width: 0;
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(15, 23, 42, 0.9);
  color: #f1f5f9;
  font: 700 0.82rem var(--font-body);
  outline: none;
}

.audit-mw-setup-search-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.audit-mw-setup-search-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
}

.audit-mw-setup-search-status {
  flex-shrink: 0;
  font: 600 0.65rem var(--font-body);
  color: #94a3b8;
  white-space: nowrap;
}

.audit-mw-setup-search-dropdown {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  top: calc(100% + 4px);
  z-index: 80;
  max-width: 100%;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  background: rgba(18, 24, 41, 0.98);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

.audit-mw-setup-search-hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font: 600 0.78rem/1.35 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.audit-mw-setup-search-hit:hover,
.audit-mw-setup-search-hit:focus-visible {
  background: rgba(59, 130, 246, 0.12);
  outline: none;
}

.audit-mw-setup-search-muted {
  color: #94a3b8;
  font-weight: 500;
}

.audit-mw-setup-search-hit-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-mw-setup-search-sub {
  margin-top: 0.28rem;
  font: 600 0.72rem var(--font-body);
  color: #a5b4c8;
}

.audit-mw-setup-search-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  font: 800 0.58rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(167, 139, 250, 0.15);
  color: #ddd6fe;
}

.audit-mw-setup-search-badge--store {
  background: rgba(14, 165, 233, 0.16);
  color: #bae6fd;
}

.audit-mw-setup-search-msg {
  padding: 0.5rem;
  font: 600 0.76rem var(--font-body);
  color: #94a3b8;
}

.audit-mw-setup-search-msg strong {
  color: #e2e8f0;
  font-weight: 700;
}

.audit-mw-setup-search-msg--warn {
  color: #fb923c;
}

.audit-mw-setup-search-msg--mute {
  color: rgba(148, 163, 184, 0.75);
}

.audit-mw-selector {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.audit-mw-selector-copy {
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 42%),
    rgba(15, 23, 42, 0.8);
}

.audit-mw-selector-kicker {
  display: inline-block;
  margin-bottom: 0.4rem;
  font: 800 0.65rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fdba74;
}

.audit-mw-selector-title {
  margin: 0;
  font: 800 1rem/1.3 var(--font-body);
  color: #f8fafc;
}

.audit-mw-selector-text {
  margin: 0.45rem 0 0;
  font: 500 0.82rem/1.45 var(--font-body);
  color: #cbd5e1;
}

.audit-mw-start {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #fff7ed;
  font: 800 0.92rem var(--font-body);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.audit-mw-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(249, 115, 22, 0.34);
  filter: brightness(1.03);
}

.audit-mw-start:active {
  transform: translateY(0);
}

.audit-mw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.55rem 0.5rem 2.15rem;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  background: rgba(15, 23, 42, 0.65);
  min-height: 3.35rem;
  min-width: 0;
}

.audit-mw-card-icon {
  position: absolute;
  left: 0.45rem;
  top: 0.5rem;
  color: #94a3b8;
  display: grid;
  place-items: center;
}

.audit-mw-card-label {
  font: 700 0.58rem var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.audit-mw-card-value {
  font: 600 0.78rem var(--font-body);
  color: #e2e8f0;
  padding-top: 0.1rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.audit-mw-card-chev {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  opacity: 0.7;
}

.audit-mw-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 0.05rem;
  padding: 0.15rem 1.4rem 0.15rem 0;
  border: 0;
  background: transparent;
  color: #f1f5f9;
  font: 700 0.78rem var(--font-body);
  cursor: pointer;
  appearance: none;
  overflow-wrap: anywhere;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.1rem center;
}

.audit-mw-select:disabled,
.audit-mw-select.audit-mw-select--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #94a3b8;
}

.audit-mw-card--manager-readonly .audit-mw-manager-value {
  display: block;
  margin-top: 0.05rem;
  min-height: 1.1rem;
}

.audit-mw-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.audit-mw-tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  margin-bottom: 0.9rem;
  overflow: visible;
}

.audit-mw-tab {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.55rem 0.35rem 0.65rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: #94a3b8;
  font: 800 0.58rem var(--font-body);
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
}

.audit-mw-tab svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.audit-mw-tab.is-active {
  color: #fb923c;
  border-bottom-color: #f97316;
}

.audit-mw-tab-label {
  display: inline;
}

.audit-mw-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.22);
  color: #fdba74;
  font-size: 0.58rem;
  font-weight: 900;
}

/* Mobile: the walkthrough section tabs show ICONS ONLY (no text label) so all
   five fit comfortably on narrow screens. The count badge stays as a small
   superscript-style chip next to the icon; the accessible name is preserved via
   the button's aria-label. */
@media (max-width: 767px) {
  .audit-mw-tab-label {
    display: none;
  }

  .audit-mw-tab {
    gap: 0.18rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .audit-mw-tab svg {
    width: 18px;
    height: 18px;
  }
}

.audit-mw-dash {
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.45);
  background: rgba(8, 12, 24, 0.55);
  padding: 0.85rem 0.75rem;
  margin-bottom: 0.85rem;
}

.audit-mw-dash-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 0.75rem;
  align-items: start;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}

.audit-mw-progress-label {
  font: 700 0.62rem var(--font-body);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.audit-mw-progress-pct {
  font: 800 1.65rem var(--font-body);
  color: #f8fafc;
  line-height: 1.1;
  margin: 0.15rem 0;
}

.audit-mw-progress-sub {
  font: 600 0.68rem var(--font-body);
  color: #94a3b8;
  margin-bottom: 0.45rem;
}

.audit-mw-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.85);
  overflow: hidden;
}

.audit-mw-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ea580c, #fb923c);
  transition: width 0.25s ease;
}

.audit-mw-mini-stats {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 5.5rem;
}

.audit-mw-mini {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.audit-mw-mini > div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.audit-mw-mini strong {
  font-size: 0.82rem;
  color: #f1f5f9;
}

.audit-mw-mini span:last-child {
  font-size: 0.58rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.audit-mw-mini-ic {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.audit-mw-mini-ic--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.audit-mw-mini-ic--clock {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

.audit-mw-mini-ic--rem {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.audit-mw-dash-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.4rem;
}

.audit-mw-status-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  font: 800 0.55rem var(--font-body);
  letter-spacing: 0.06em;
}

.audit-mw-session-meta {
  margin: 0.35rem 0 0;
  font: 600 0.68rem var(--font-body);
  color: #94a3b8;
  line-height: 1.35;
}

.audit-mw-session-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}

.audit-mw-session-head {
  min-width: 0;
}

.audit-mw-timer-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}

.audit-mw-session-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.audit-mw-session-context-item {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  border: 1px solid rgba(71, 85, 105, 0.4);
  background: rgba(15, 23, 42, 0.5);
}

.audit-mw-session-context-item span {
  font: 800 0.52rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.audit-mw-session-context-item strong {
  font: 700 0.72rem/1.25 var(--font-body);
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-mw-timer-label {
  font: 700 0.55rem var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0;
}

.audit-mw-timer {
  font: 800 1.45rem var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.audit-mw-ring-wrap {
  justify-self: end;
}

.audit-mw-ring-bg {
  stroke: rgba(51, 65, 85, 0.9);
}

.audit-mw-ring-fg {
  stroke: #f97316;
}

.audit-mw-ring-txt {
  fill: #f8fafc;
  font: 800 13px var(--font-body);
}

.audit-mw-evidence {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.audit-mw-evidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(15, 23, 42, 0.52);
}

.audit-mw-evidence-card--draft {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.audit-mw-walk-composer-hint {
  margin: 0 0 0.45rem;
  font: 600 0.72rem/1.35 var(--font-body);
  color: #94a3b8;
}

.audit-mw-evidence-draft-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: nowrap;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-draft-inner {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.audit-mw-evidence-draft-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.55rem;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-actions--leading,
.audit-mw-evidence-card--draft .audit-mw-evidence-actions--trailing {
  flex: 0 0 auto;
  flex-shrink: 0;
  align-self: flex-end;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-actions--leading {
  min-width: 2.65rem;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-actions--trailing {
  min-width: 4.75rem;
  width: max-content;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-photo-wrap--order-draft,
.audit-mw-evidence-card--draft .audit-mw-evidence-photo-wrap--evidence-draft {
  margin-top: 0.55rem;
  align-self: flex-start;
}

.audit-mw-evidence-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-fields {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.6rem;
  align-items: flex-end;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-field:not(.audit-mw-evidence-field--order-qty) {
  flex: 1 1 0;
  min-width: 0;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-field--order-qty {
  flex: 0 0 auto;
}


.audit-mw-evidence-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.audit-mw-evidence-field.audit-mw-evidence-field--order-qty {
  box-sizing: border-box;
  align-items: stretch;
  gap: 0.22rem;
  flex: 0 0 auto;
  width: 11.5rem;
  min-width: 9.5rem;
  max-width: 100%;
}

.audit-mw-evidence-field--order-qty > span {
  display: block;
  text-align: left;
  line-height: 1;
}

.audit-mw-evidence-field span,
.audit-mw-evidence-label {
  font: 800 0.62rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.audit-mw-evidence-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.62rem 0.72rem;
  border-radius: 9px;
  border: 1px solid rgba(51, 65, 85, 0.68);
  background: rgba(8, 12, 24, 0.72);
  color: #f8fafc;
  font: 600 0.78rem var(--font-body);
}

.audit-mw-evidence-input::placeholder {
  color: #64748b;
}

select.audit-mw-evidence-input.audit-mw-evidence-input--ticket-subject {
  cursor: pointer;
  appearance: none;
  padding-right: 1.85rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.audit-mw-evidence-input.audit-mw-evidence-input--order-qty {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.audit-mw-qty-stepper {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  max-width: 100%;
}

.audit-mw-qty-stepper-btn {
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  margin: 0;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.72);
  background: rgba(15, 23, 42, 0.92);
  color: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.audit-mw-qty-stepper-btn:hover:not(:disabled) {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(59, 130, 246, 0.12);
  color: #f8fafc;
}

.audit-mw-qty-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.audit-mw-qty-stepper .audit-mw-evidence-input--order-qty {
  flex: 0 0 2.25rem;
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  aspect-ratio: 1;
  box-sizing: border-box;
  padding: 0 0.2rem;
  margin: 0;
}

.audit-mw-order-tile-field--qty .audit-mw-qty-stepper {
  margin-top: 0.1rem;
}

.audit-mw-evidence-actions {
  min-width: 8.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

.audit-mw-evidence-actions--leading {
  min-width: auto;
  align-items: center;
}

.audit-mw-evidence-actions--trailing {
  min-width: 8.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

.audit-mw-evidence-action-label {
  font: 800 0.58rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: center;
}

.audit-mw-evidence-action-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
}

.audit-mw-evidence-action-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
}

.audit-mw-evidence-btn {
  flex: 1;
  padding: 0.68rem 0.8rem;
  border-radius: 9px;
  border: 1px solid rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
  font: 800 0.72rem var(--font-body);
  cursor: pointer;
}

.audit-mw-evidence-btn--icon {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
}

.audit-mw-evidence-icon-btn {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  cursor: pointer;
}

.audit-mw-evidence-icon-btn--add {
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.16);
}

/* Draft row: Add / Upload / Paste match trash control footprint */
.audit-mw-evidence-card--draft .audit-mw-evidence-icon-btn,
.audit-mw-evidence-card--draft .audit-mw-evidence-btn.audit-mw-evidence-btn--icon {
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
  border-radius: 9px;
}

.audit-mw-evidence-card--draft .audit-mw-evidence-icon-btn svg,
.audit-mw-evidence-card--draft .audit-mw-evidence-btn--icon svg {
  width: 14px;
  height: 14px;
}

.audit-mw-evidence-priority-btn-letter {
  font: 800 0.72rem var(--font-body);
  letter-spacing: 0.06em;
  line-height: 1;
}

.audit-mw-evidence-priority-btn.audit-mw-evidence-btn--icon {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(30, 41, 59, 0.75);
}

.audit-mw-evidence-priority-btn--high.audit-mw-evidence-btn--icon {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(127, 29, 29, 0.4);
}

.audit-mw-evidence-priority-btn--medium.audit-mw-evidence-btn--icon {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(120, 53, 15, 0.35);
}

.audit-mw-evidence-priority-btn--low.audit-mw-evidence-btn--icon {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.32);
}

.audit-mw-evidence-priority-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.75);
  font: 750 0.68rem var(--font-body);
  line-height: 1.15;
}

.audit-mw-evidence-priority-pill--high {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.28);
}

.audit-mw-evidence-priority-pill--medium {
  border-color: rgba(251, 191, 36, 0.42);
  color: #fcd34d;
  background: rgba(120, 53, 15, 0.24);
}

.audit-mw-evidence-priority-pill--low {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  background: rgba(6, 78, 59, 0.22);
}

.audit-mw-evidence-priority-readout {
  margin-bottom: 0.1rem;
}

.audit-mw-evidence-btn--ghost {
  border-color: rgba(71, 85, 105, 0.7);
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
}

.audit-mw-photo-input {
  display: none;
}

.audit-mw-evidence-card--checkable {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.audit-mw-evidence-card--saved {
  align-items: center;
}

.audit-mw-evidence-card--editable {
  cursor: pointer;
}

.audit-mw-evidence-card--complete {
  grid-template-columns: minmax(0, 1fr) 8.4rem auto;
  align-items: center;
}

.audit-mw-evidence-card--complete.audit-mw-evidence-card--checkable {
  grid-template-columns: auto minmax(0, 1fr) 8.4rem;
}

.audit-mw-evidence-check {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  cursor: pointer;
}

.audit-mw-evidence-check input {
  position: absolute;
  opacity: 0;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  cursor: pointer;
}

.audit-mw-evidence-check-ui {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  border: 2px solid #64748b;
  background: rgba(8, 12, 24, 0.95);
  display: grid;
  place-items: center;
  transition: border-color 0.12s, background 0.12s;
}

.audit-mw-evidence-check input:checked + .audit-mw-evidence-check-ui {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.18);
}

.audit-mw-evidence-check input:checked + .audit-mw-evidence-check-ui::after {
  content: "";
  width: 0.32rem;
  height: 0.6rem;
  border-right: 2px solid #86efac;
  border-bottom: 2px solid #86efac;
  transform: rotate(45deg) translate(-1px, -1px);
}

.audit-mw-evidence-trash {
  width: 2.1rem;
  height: 2.1rem;
  align-self: center;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.16);
  color: #fca5a5;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.audit-mw-evidence-trash:hover {
  background: rgba(127, 29, 29, 0.26);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.audit-mw-evidence-photo-wrap {
  position: relative;
  width: 8.4rem;
  height: 5.6rem;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  background: rgba(8, 12, 24, 0.95);
}

.audit-mw-evidence-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.audit-mw-evidence-icon-btn--photo {
  position: absolute;
  top: 0.35rem;
  z-index: 1;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
}

.audit-mw-evidence-icon-btn--photo-replace {
  left: 0.35rem;
}

.audit-mw-evidence-icon-btn--photo-remove {
  right: 0.35rem;
}

.audit-mw-evidence-icon-btn--danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
}

.audit-mw-evidence-copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.audit-mw-evidence-copy--order-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.28rem 0.45rem;
  align-items: center;
}

.audit-mw-order-tile-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.audit-mw-order-tile-field--qty {
  justify-self: start;
  align-self: center;
  text-align: left;
}

.audit-mw-evidence-card--order-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.audit-mw-order-tile-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.audit-mw-evidence-card--order-tile .audit-mw-evidence-trash {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 10px;
  align-self: start;
  flex-shrink: 0;
}

.audit-mw-evidence-card--order-tile .audit-mw-evidence-trash svg {
  width: 22px;
  height: 22px;
}

.audit-mw-order-tile-thumb {
  flex-shrink: 0;
  width: 8.4rem;
  height: 5.6rem;
  box-sizing: border-box;
}

.audit-mw-order-tile-thumb .audit-mw-evidence-photo-wrap--order-tile {
  width: 100%;
  height: 100%;
}

.audit-mw-order-tile-thumb--empty {
  position: relative;
  display: block;
  border-radius: 10px;
  border: 1px dashed rgba(71, 85, 105, 0.75);
  background: rgba(8, 12, 24, 0.72);
  overflow: hidden;
}

.audit-mw-order-tile-thumb-add {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin: 0;
  padding: 0.35rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: 700 0.62rem/1 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.12s ease, background 0.12s ease;
}

.audit-mw-order-tile-thumb-add:hover {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.08);
}

.audit-mw-order-tile-thumb-add-label {
  display: block;
}

.audit-mw-evidence-title {
  font: 800 0.94rem/1.2 var(--font-body);
  color: #f8fafc;
}

.audit-mw-evidence-text {
  font: 600 0.76rem/1.35 var(--font-body);
  color: #cbd5e1;
}

.audit-mw-empty-panel {
  margin-bottom: 0.85rem;
  padding: 1rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.4);
  background: rgba(15, 23, 42, 0.45);
  text-align: center;
  color: #94a3b8;
  font: 700 0.78rem var(--font-body);
}

.audit-mw-notes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  min-height: min(42vh, 22rem);
}

.audit-mw-notes-label {
  font: 800 0.68rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.audit-mw-notes-textarea {
  flex: 1;
  width: 100%;
  min-height: min(38vh, 20rem);
  box-sizing: border-box;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.68);
  background: rgba(8, 12, 24, 0.85);
  color: #f8fafc;
  font: 600 0.88rem/1.45 var(--font-body);
  resize: vertical;
}

.audit-mw-notes-textarea::placeholder {
  color: #64748b;
}

.audit-mw-notes-textarea:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2);
}

.audit-mw-task-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  align-items: center;
}

.audit-mw-search {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  font: 600 0.75rem var(--font-body);
}

.audit-mw-search::placeholder {
  color: #64748b;
}

.audit-mw-cat {
  padding: 0.45rem 1.6rem 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font: 700 0.68rem var(--font-body);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
}

.audit-mw-filter-ic {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
  cursor: pointer;
}

.audit-mw-task-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.audit-mw-task {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 0.45rem 0.4rem;
  align-items: center;
  padding: 0.55rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.4);
  background: rgba(15, 23, 42, 0.45);
}

.audit-mw-task--empty {
  grid-template-columns: 1fr;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.audit-mw-task-check {
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.audit-mw-task-check input {
  position: absolute;
  opacity: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  cursor: pointer;
}

.audit-mw-task-check-ui {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
  border: 2px solid #64748b;
  background: rgba(15, 23, 42, 0.9);
  display: grid;
  place-items: center;
  transition: border-color 0.12s, background 0.12s;
}

.audit-mw-task-check input:checked + .audit-mw-task-check-ui {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.25);
}

.audit-mw-task-check input:checked + .audit-mw-task-check-ui::after {
  content: '';
  width: 5px;
  height: 8px;
  border: solid #fb923c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.audit-mw-task-title {
  font: 700 0.78rem var(--font-body);
  color: #f1f5f9;
}

.audit-mw-task-desc {
  font: 600 0.65rem var(--font-body);
  color: #94a3b8;
  margin-top: 0.12rem;
}

.audit-mw-pri {
  font: 800 0.52rem var(--font-body);
  letter-spacing: 0.06em;
  padding: 0.18rem 0.38rem;
  border-radius: 5px;
  white-space: nowrap;
}

.audit-mw-pri--high {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.audit-mw-pri--medium {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
}

.audit-mw-pri--low {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.audit-mw-task-date {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font: 600 0.62rem var(--font-body);
  color: #94a3b8;
  white-space: nowrap;
}

.audit-mw-task-date svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.audit-mw-row-ic {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
}

.audit-mw-row-ic--done {
  color: #4ade80;
}

.audit-mw-row-ic--progress {
  color: #fb923c;
}

.audit-mw-row-ic--todo {
  color: #64748b;
}

.audit-mw-notes {
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.45);
  background: rgba(8, 12, 24, 0.45);
  padding: 0.65rem 0.7rem 0.75rem;
  margin-bottom: 0.85rem;
}

.audit-mw-notes-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font: 800 0.72rem var(--font-body);
  letter-spacing: 0.05em;
  color: #e2e8f0;
  margin-bottom: 0.45rem;
}

.audit-mw-notes-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(15, 23, 42, 0.75);
  color: #f1f5f9;
  font: 600 0.75rem var(--font-body);
  resize: vertical;
  min-height: 2.6rem;
}

.audit-mw-notes-recent {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
}

.audit-mw-notes-quote {
  margin: 0;
  font: 600 0.74rem var(--font-body);
  color: #cbd5e1;
  line-height: 1.4;
}

.audit-mw-notes-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font: 600 0.62rem var(--font-body);
  color: #64748b;
}

.audit-mw-notes-all {
  color: #fb923c;
  font-weight: 800;
  text-decoration: none;
}

.audit-mw-notes-all:hover {
  text-decoration: underline;
}

.audit-mw-end {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
  color: #0f172a;
  font: 900 0.82rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
  transition: filter 0.12s, transform 0.08s;
}

.audit-mw-end:hover {
  filter: brightness(1.05);
}

.audit-mw-end:active {
  transform: scale(0.99);
}

@media (max-width: 640px) {
  .audit-mw-session-context {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .audit-mw-evidence-card:not(.audit-mw-evidence-card--draft),
  .audit-mw-evidence-card--complete {
    grid-template-columns: 1fr;
  }

  .audit-mw-evidence-card--draft .audit-mw-evidence-actions--trailing {
    min-width: 4.6rem;
  }

  .audit-mw-evidence-fields {
    grid-template-columns: 1fr;
  }

  .audit-mw-evidence-card--draft .audit-mw-evidence-fields {
    display: flex;
    flex-direction: row;
  }

  .audit-mw-evidence-copy--order-tile {
    grid-template-columns: 1fr;
  }

  .audit-mw-order-tile-field--qty {
    justify-self: start;
    text-align: left;
    align-self: center;
  }

  .audit-mw-evidence-actions {
    min-width: 0;
  }

  .audit-mw-evidence-photo-wrap {
    width: 100%;
    height: 8.5rem;
  }

  .audit-mw-order-tile-thumb {
    width: 100%;
    height: 8.5rem;
  }

  .audit-mw-order-tile-row {
    grid-template-columns: 1fr;
  }

  .audit-mw-evidence-card--order-tile .audit-mw-evidence-trash {
    justify-self: end;
  }

  .audit-mw-session-context {
    grid-template-columns: 1fr;
  }

  .audit-mw-session-top {
    grid-template-columns: 1fr;
  }

  .audit-mw-timer-block {
    align-items: flex-start;
    text-align: left;
  }

  .audit-mw-task {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
  }

  .audit-mw-task-check {
    grid-row: 1 / span 2;
  }

  .audit-mw-pri,
  .audit-mw-task-date,
  .audit-mw-row-ic {
    justify-self: start;
  }
}

.tasks-overview-body {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.tasks-donut {
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: conic-gradient(#ef4444 0 80deg, #f59e0b 80deg 130deg, #8b5cf6 130deg var(--done), #334155 var(--done) 360deg);
  position: relative;
}

.tasks-donut::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: #102033;
}

.tasks-donut strong,
.tasks-donut span {
  position: relative;
  z-index: 1;
}

.tasks-donut strong {
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1;
}

.tasks-donut span {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.54rem;
  line-height: 1;
}

.tasks-overview-legend {
  display: grid;
  gap: 0.42rem;
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 800;
}

.tasks-overview-legend span {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  line-height: 1.1;
}

.tasks-overview-legend i {
  width: 6px;
  height: 6px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
}

.tasks-overview-legend .red { background: #ef4444; }
.tasks-overview-legend .orange { background: #f59e0b; }
.tasks-overview-legend .purple { background: #8b5cf6; }
.tasks-overview-legend .slate { background: #64748b; }

.tasks-upcoming-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.tasks-upcoming-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.62rem;
}

.tasks-upcoming-item span {
  color: var(--text-muted);
}

.tasks-upcoming-item strong {
  color: var(--text-secondary);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-upcoming-item em {
  border-radius: 5px;
  padding: 0.24rem 0.34rem;
  background: rgba(255,255,255,0.05);
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.tasks-empty-side {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.tasks-quick-actions {
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tasks-quick-actions button {
  flex: 1;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font: 800 0.62rem var(--font-body);
}

@media (max-width: 1180px) {
  .tasks-page {
    gap: 0.65rem;
  }

  .tasks-kpi-grid {
    gap: 0.5rem;
  }

  .tasks-kpi-card {
    min-height: 76px;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 0.7rem;
  }

  .tasks-kpi-icon {
    width: 26px;
    height: 26px;
  }

  .tasks-kpi-card strong {
    font-size: 1.3rem;
  }

  .tasks-workspace {
    grid-template-columns: minmax(0, 1fr) 212px;
    gap: 0.6rem;
  }

  .tasks-table-toolbar {
    gap: 0.55rem;
    padding: 0.65rem;
  }

  .tasks-tabs {
    gap: 0.8rem;
  }

  .tasks-filters {
    gap: 0.32rem;
  }

  .tasks-filters select {
    width: 92px;
  }

  .tasks-search input {
    width: 122px;
  }

  .tasks-tool-btn,
  .tasks-create-btn {
    padding: 0 0.6rem;
    font-size: 0.66rem;
  }

  .tasks-table {
    min-width: 650px;
  }

  .tasks-table th,
  .tasks-table td {
    padding: 0.62rem 0.48rem;
  }

  .tasks-task-title,
  .tasks-date-main {
    font-size: 0.66rem;
  }

  .tasks-task-subtitle,
  .tasks-date-sub,
  .tasks-assignee,
  .tasks-priority,
  .tasks-category-pill,
  .tasks-status {
    font-size: 0.56rem;
  }

  .tasks-side-card {
    padding: 0.68rem;
  }

  .tasks-overview-body {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 0.55rem;
  }

  .tasks-donut {
    width: 66px;
    height: 66px;
  }

  .tasks-upcoming-item {
    grid-template-columns: 34px minmax(0, 1fr) 40px;
    gap: 0.3rem;
  }
}

@media (max-width: 860px) {
  .tasks-page-head,
  .tasks-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tasks-kpi-grid,
  .tasks-workspace {
    grid-template-columns: 1fr;
  }

  .tasks-filters,
  .tasks-tabs {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .tasks-side-panel {
    grid-template-columns: 1fr;
  }
}

/* ---- PANELS ---- */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.3rem;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
}

.panel-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}
.panel-toolbar--inventory {
  position: sticky;
  top: 0;
  z-index: 11;
  backdrop-filter: blur(12px);
}
.panel-toolbar--events {
  border-bottom: 1px solid var(--border);
}
.panel-toolbar .filter-group {
  flex-wrap: wrap;
}
.panel-toolbar .filter-group:last-child {
  margin-left: auto;
}
.event-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.panel-list-filter {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}
.panel-list-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.panel-list-input::placeholder { color: var(--text-muted); }
.panel-list-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- EVENT FEED ---- */
.event-feed { max-height: calc(100vh - 295px); display: flex; flex-direction: column; }
.event-list { flex: 1; overflow-y: auto; }

.event-item {
  display: flex;
  gap: 0;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  align-items: flex-start;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: element;
  touch-action: none;
}

.event-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.event-item:active {
  cursor: grabbing;
}

.event-item * {
  -webkit-user-drag: none;
}

.event-item--urgent {
  border-left-color: var(--critical);
}

.event-item--warning {
  border-left-color: var(--warning);
}

.event-item--success {
  border-left-color: var(--success);
}

.event-stripe {
  width: 4px;
  height: 100%;
  min-height: 46px;
  border-radius: 999px;
  margin: -1rem 0 -1rem -1rem;
  flex-shrink: 0;
}

.event-stripe--archway_ticket { background: var(--teal); }
.event-stripe--archway_order { background: var(--cyan); }
.event-stripe--archway_info { background: var(--slate); }
.event-stripe--arit { background: var(--amber); }
.event-stripe--closing_checklist { background: var(--lime); }
.event-stripe--cash_count { background: var(--green); }
.event-stripe--cash_variance { background: var(--red); }
.event-stripe--facilities { background: var(--orange); }
.event-stripe--vector_security { background: var(--pink); }
.event-stripe--corporate { background: var(--purple); }
.event-stripe--teams { background: var(--purple); }
.event-stripe--booking { background: var(--green); }
.event-stripe--email { background: var(--accent); }
.event-stripe--directive { background: var(--red); }

.event-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-source { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; padding: 0.15rem 0.45rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }

.event-source--archway_ticket { background: var(--teal-dim); color: var(--teal); }
.event-source--archway_order { background: var(--cyan-dim); color: var(--cyan); }
.event-source--archway_info { background: var(--slate-dim); color: var(--slate); }
.event-source--arit { background: var(--amber-dim); color: var(--amber); }
.event-source--closing_checklist { background: var(--lime-dim); color: var(--lime); }
.event-source--cash_count { background: var(--green-dim); color: var(--green); }
.event-source--cash_variance { background: var(--red-dim); color: var(--red); }
.event-source--facilities { background: var(--orange-dim); color: var(--orange); }
.event-source--vector_security { background: var(--pink-dim); color: var(--pink); }
.event-source--corporate { background: var(--purple-dim); color: var(--purple); }
.event-source--teams { background: var(--purple-dim); color: var(--purple); }
.event-source--booking { background: var(--green-dim); color: var(--green); }
.event-source--email { background: var(--accent-dim); color: var(--accent); }
.event-source--directive { background: var(--red-dim); color: var(--red); }

.event-district, .event-time-ago { font-size: 0.72rem; color: var(--text-muted); }
.event-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.event-drag-handle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  user-select: none;
  -webkit-user-select: none;
}
.event-status { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 500; padding: 0.2rem 0.5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.event-status--new { background: var(--accent-dim); color: var(--accent); }
.event-status--in-progress { background: var(--amber-dim); color: var(--amber); }
.event-status--pending { background: var(--purple-dim); color: var(--purple); }
.event-status--resolved { background: var(--green-dim); color: var(--green); }
.event-status--escalated { background: var(--red-dim); color: var(--red); }
.event-store { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }

/* ---- EVENTS DASHBOARD ---- */
.events-page {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.events-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.events-page-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.events-page-head p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.events-page-actions,
.events-filters,
.events-tabs,
.events-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.events-tool-btn,
.events-create-btn {
  height: 2.25rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.68);
  color: var(--text-secondary);
  padding: 0 0.8rem;
  font: 800 0.72rem var(--font-body);
  cursor: pointer;
}

.events-create-btn {
  border-color: rgba(59, 130, 246, 0.55);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.82));
  color: white;
}

.events-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 1.42fr;
  gap: 0.75rem;
}

.events-kpi-card,
.events-summary-card,
.events-table-panel,
.events-detail-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.55rem;
  background: rgba(8, 20, 33, 0.88);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
}

.events-kpi-card {
  position: relative;
  min-height: 108px;
  display: grid;
  grid-template-columns: 2.05rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.85rem 0.95rem 1.6rem;
  overflow: hidden;
  --sparkline: none;
}

.events-kpi-card::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.35rem;
  height: 24px;
  background: var(--sparkline) center bottom / 100% 100% no-repeat;
  opacity: 0.76;
}

.events-kpi-card--blue {
  color: var(--accent);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 34' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 22 L22 23 L40 18 L58 19 L76 12 L94 20 L112 14 L130 16 L148 8 L166 15 L184 13 L202 17 L220 9' stroke='%233b82f6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.events-kpi-card--red {
  color: var(--red);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 34' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 19 L18 16 L36 22 L54 17 L72 14 L90 20 L108 18 L126 9 L144 20 L162 17 L180 10 L198 21 L220 18' stroke='%23ef4444' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.events-kpi-card--green {
  color: var(--green);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 34' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 24 L22 16 L40 20 L58 14 L76 18 L94 21 L112 17 L130 11 L148 17 L166 18 L184 14 L202 16 L220 9' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.events-kpi-card--purple {
  color: var(--purple);
  --sparkline: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 34' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 24 L20 20 L38 14 L56 18 L74 23 L92 20 L110 13 L128 15 L146 22 L164 18 L182 10 L200 14 L220 12' stroke='%238b5cf6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.events-kpi-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: currentColor;
}

.events-kpi-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.45rem;
  line-height: 1;
}

.events-kpi-card span,
.events-kpi-card small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.events-kpi-card small {
  margin-top: 0.45rem;
  color: color-mix(in srgb, currentColor 70%, var(--text-muted));
  font-size: 0.66rem;
}

.events-summary-card {
  padding: 0.9rem 1rem;
}

.events-summary-title {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.events-summary-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.65rem;
}

.events-summary-donut {
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(8, 20, 33, 0.96) 0 48%, transparent 49%),
    conic-gradient(var(--green) 0 calc(var(--resolved) * 1%), var(--accent) 0 calc((var(--resolved) + var(--open)) * 1%), var(--red) 0 100%);
}

.events-summary-donut strong,
.events-summary-donut span {
  grid-area: 1 / 1;
}

.events-summary-donut strong {
  margin-top: -0.25rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.events-summary-donut span {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.events-summary-legend {
  display: grid;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.events-summary-legend span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
}
.legend-dot--green { background: var(--green); }
.legend-dot--blue { background: var(--accent); }
.legend-dot--red { background: var(--red); }

.events-summary-card a {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  color: var(--accent-light);
  font-size: 0.72rem;
  text-decoration: none;
}

.events-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
}

.events-table-panel,
.events-detail-panel {
  overflow: hidden;
}

.events-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.events-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.55rem 0.65rem;
  font: 800 0.72rem var(--font-body);
  cursor: pointer;
}

.events-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.events-filters select,
.events-search input {
  height: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.4rem;
  background: rgba(2, 12, 24, 0.76);
  color: var(--text-secondary);
  font: 700 0.72rem var(--font-body);
}

.events-filters select {
  min-width: 7.8rem;
  padding: 0 1.7rem 0 0.65rem;
}

.events-search {
  position: relative;
}

.events-search input {
  width: 17rem;
  padding: 0 2rem 0 0.75rem;
}

.events-search span {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.events-table-wrap {
  overflow: auto;
}

.events-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.73rem;
}

.events-table th,
.events-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: middle;
}

.events-table th {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.events-table td {
  color: var(--text-secondary);
}

.events-table-row {
  cursor: pointer;
}

.events-table-row.is-active td,
.events-table-row:hover td {
  background: rgba(59, 130, 246, 0.05);
}

/* Columns size to content (table-layout: auto); only keep the last column's
   right alignment, not a forced width. */
.events-table th:nth-child(7),
.events-table td:nth-child(7) {
  text-align: right;
}

.events-event-cell {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  border-left: 3px solid var(--accent);
  margin-left: -0.8rem;
  padding-left: 0.65rem;
}

.events-event-cell--resolved { border-left-color: var(--green); }
.events-event-cell--escalated { border-left-color: var(--red); }
.events-event-cell--in-progress { border-left-color: var(--amber); }
.events-event-cell strong,
.events-table td strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.72rem;
}

.events-event-cell small,
.events-table td small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1.3;
}

.events-event-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.13);
}

.events-event-cell--resolved .events-event-icon { color: var(--green); background: var(--green-dim); }
.events-event-cell--escalated .events-event-icon { color: var(--red); background: var(--red-dim); }
.events-event-cell--in-progress .events-event-icon { color: var(--amber); background: var(--amber-dim); }

.events-priority {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.events-priority i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--green);
}
.events-priority--medium i { background: var(--amber); }
.events-priority--high i { background: var(--red); }

.events-row-actions {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.events-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.events-pagination button,
.events-pagination span {
  min-height: 1.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.62);
  color: var(--text-secondary);
  padding: 0 0.7rem;
  font: 800 0.7rem var(--font-body);
}

.events-detail-panel {
  padding: 0.95rem;
  min-height: 100%;
}

.events-detail-close {
  float: right;
  color: var(--text-muted);
  font-size: 1.4rem;
}

.events-detail-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--green);
  font: 900 0.68rem var(--font-mono);
  text-transform: uppercase;
}

.events-detail-status--escalated { color: var(--red); }
.events-detail-status--in-progress,
.events-detail-status--pending { color: var(--amber); }

.events-detail-panel h3 {
  clear: both;
  margin: 0.75rem 0 0;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.2;
}

.events-detail-pills {
  display: flex;
  gap: 0.4rem;
  margin: 0.6rem 0 1rem;
}

.events-detail-pills span {
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-light);
  padding: 0.25rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 800;
}

.events-detail-panel h4,
.events-detail-timeline-head h4 {
  margin: 1rem 0 0.6rem;
  color: var(--text-primary);
  font-size: 0.76rem;
}

.events-detail-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.events-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.events-detail-list dt,
.events-detail-panel p,
.events-detail-timeline small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.events-detail-list dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-align: right;
}

.events-detail-panel p {
  line-height: 1.5;
}

.events-detail-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.events-detail-timeline-head a {
  color: var(--accent-light);
  font-size: 0.68rem;
  text-decoration: none;
}

.events-detail-timeline {
  display: grid;
  gap: 0.65rem;
}

.events-detail-timeline div {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.45rem;
}

.events-detail-timeline i {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.15rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-dim);
}

.events-detail-timeline span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
}

.events-detail-timeline small {
  grid-column: 2;
  margin-top: -0.45rem;
}

.events-detail-button {
  width: 100%;
  margin-top: 1rem;
  height: 2.35rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-primary);
  font: 900 0.72rem var(--font-body);
}

/* ---- INVENTORY TABLE ---- */
.inventory-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.inventory-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.inventory-page-head h2 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.inventory-page-head p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.inventory-workbook-btn,
.inventory-tool-btn {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  border-radius: 0.45rem;
  padding: 0.62rem 0.85rem;
  font: 700 0.76rem var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}

.inventory-workbook-btn:hover,
.inventory-tool-btn:hover {
  border-color: rgba(59, 130, 246, 0.38);
  color: var(--text-primary);
  background: rgba(30, 41, 59, 0.72);
}

.inventory-metrics-panel {
  display: grid;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.95rem;
  background: rgba(7, 18, 30, 0.42);
}

.inventory-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 98px);
  gap: 0.75rem;
  justify-content: start;
  align-items: start;
}

.inventory-kpi-card {
  position: relative;
  min-height: 132px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.05rem 2.45rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, currentColor 14%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 20, 33, 0.9));
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.22);
  overflow: hidden;
  --sparkline: none;
}

.inventory-kpi-card::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.32rem;
  height: 30px;
  opacity: 0.74;
  background-image: var(--sparkline);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
  pointer-events: none;
}

.inventory-kpi-card--cyan {
  color: var(--cyan);
}
.inventory-kpi-card--teal {
  color: var(--teal);
}
.inventory-kpi-card--orange {
  color: var(--warning);
}
.inventory-kpi-card--green {
  color: var(--green);
}
.inventory-kpi-card--purple {
  color: var(--purple);
}
.inventory-kpi-card--blue {
  color: var(--accent);
}

.inventory-kpi-card--red {
  color: var(--red);
}

.inventory-kpi-card[data-inv-kpi-scroll],
#invKpiItemLookupTrigger.inventory-kpi-card {
  cursor: pointer;
}

.inventory-kpi-card[data-inv-kpi-scroll]:focus-visible,
#invKpiItemLookupTrigger.inventory-kpi-card:focus-visible {
  outline: 2px solid rgba(234, 179, 8, 0.55);
  outline-offset: 3px;
}

/* Table title icons: stroke via currentColor; tinted per panel to match h3 (see tab overrides below) */
.inventory-table-kpi-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}

.inventory-table-kpi-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

/* Base panel titles — icon matches adjacent h3 */
.daily-ops-shrink-head > .inventory-table-kpi-icon,
.daily-ops-nonsellable-head > .inventory-table-kpi-icon,
.daily-ops-cartons-head > .inventory-table-kpi-icon {
  color: var(--red);
}

.daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .inventory-table-kpi-icon {
  color: #4ade80;
}

.daily-ops-sts-head > .inventory-table-kpi-icon {
  color: #38bdf8;
}

.daily-ops-eol-head > .inventory-table-kpi-icon {
  color: #fb7185;
}

.daily-ops-obs-acc-head > .inventory-table-kpi-icon {
  color: #eab308;
}

.daily-ops-scans-panel--monthly .daily-ops-scans-head > .inventory-table-kpi-icon {
  color: #4ade80;
}

.daily-ops-da-head > .inventory-table-kpi-icon {
  color: #63b3ed;
}

.daily-ops-ipog-head > .inventory-table-kpi-icon {
  color: #818cf8;
}

#tab-inventory [id^="inv-panel-"],
#tab-inventory #inventory-transport-carousel {
  scroll-margin-top: 4.75rem;
}

.inventory-kpi-icon {
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
}

.inventory-kpi-icon svg {
  width: 1rem;
  height: 1rem;
}

.inventory-kpi-card span:not(.inventory-kpi-icon) {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
}

.inventory-kpi-card strong {
  display: block;
  margin-top: 0.16rem;
  color: var(--text-primary);
  font-size: 1.68rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.inventory-kpi-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.64rem;
  line-height: 1.1;
}

.inventory-kpi-card.inventory-kpi-card--metric-square {
  box-sizing: border-box;
  width: 98px;
  height: 98px;
  min-width: 98px;
  max-width: 98px;
  min-height: 98px;
  max-height: 98px;
  justify-self: start;
  align-self: start;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.45rem 0.88rem;
}

.inventory-kpi-card.inventory-kpi-card--metric-square::after {
  display: none;
}

.inventory-kpi-card.inventory-kpi-card--metric-square .inventory-kpi-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.inventory-kpi-card.inventory-kpi-card--metric-square .inventory-kpi-icon svg {
  width: 0.82rem;
  height: 0.82rem;
}

.inventory-kpi-card.inventory-kpi-card--metric-square span:not(.inventory-kpi-icon) {
  font-size: 0.54rem;
  line-height: 1.06;
  max-height: 2.35em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.inventory-kpi-card.inventory-kpi-card--metric-square strong {
  font-size: 1.08rem;
  margin-top: 0.1rem;
}

.inventory-snapshot-panel {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(8, 20, 33, 0.92), rgba(5, 15, 28, 0.94));
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
  overflow: hidden;
}

.inventory-snapshot-panel--fullscreen {
  position: fixed;
  z-index: 2000;
  inset: max(0.75rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  max-height: none;
  border-radius: 1rem;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

body.inventory-fullscreen-active {
  overflow: hidden;
}

body.inventory-fullscreen-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.inventory-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.inventory-snapshot-panel--fullscreen .inventory-snapshot-head {
  padding-right: 3.6rem;
}

.inventory-fullscreen-close {
  box-sizing: border-box;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: rgba(253, 224, 71, 0.92);
  font: 700 1.1rem/1 var(--font-body);
  cursor: pointer;
  padding: 0;
  display: none;
  position: static;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.inventory-snapshot-panel--fullscreen .inventory-fullscreen-close {
  display: inline-flex;
}

.inventory-snapshot-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.inventory-snapshot-head p {
  margin: 0.28rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.inventory-toolbar--tile-actions {
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.inventory-tool-btn--icon {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 1.05rem;
  line-height: 1;
}

.inventory-snapshot-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.inventory-toolbar select,
.inventory-search input {
  height: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.45rem;
  background: rgba(2, 12, 24, 0.76);
  color: var(--text-secondary);
  font: 600 0.74rem var(--font-body);
}

.inventory-toolbar select {
  min-width: 8.6rem;
  padding: 0 1.95rem 0 0.75rem;
}

.inventory-search {
  position: relative;
}

.inventory-search input {
  width: min(17rem, 28vw);
  padding: 0 2rem 0 0.75rem;
}

.inventory-search span {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.inventory-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inventory-summary-row > div {
  min-height: 96px;
  padding: 1rem 1.05rem;
  border: 1px solid color-mix(in srgb, currentColor 24%, rgba(148, 163, 184, 0.12));
  border-radius: 0.95rem;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, currentColor 12%, transparent), transparent 44%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(8, 20, 33, 0.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), 0 14px 28px rgba(2, 6, 23, 0.16);
}

.inventory-summary-card {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: start;
  gap: 0.9rem;
}

.inventory-summary-icon {
  position: relative;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  align-self: start;
  justify-self: center;
  margin-top: 0.02rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, currentColor 18%, rgba(15, 23, 42, 0.55));
  color: currentColor;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 900;
}

.inventory-summary-icon svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  transform: translate(-50%, -50%);
}

.inventory-summary-card--cyan .inventory-summary-icon { color: var(--cyan); }
.inventory-summary-card--orange .inventory-summary-icon { color: var(--warning); }
.inventory-summary-card--green .inventory-summary-icon { color: var(--green); }
.inventory-summary-card--red .inventory-summary-icon { color: var(--red); }

.inventory-summary-card--cyan { color: var(--cyan); }
.inventory-summary-card--orange { color: var(--warning); }
.inventory-summary-card--green { color: var(--green); }
.inventory-summary-card--red { color: var(--red); }

.inventory-summary-row span,
.inventory-summary-row small {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.1;
}

.inventory-summary-row strong {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-primary);
  font-size: 1.62rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.inventory-summary-row small {
  margin-top: 0.42rem;
  color: var(--accent-light);
  font-weight: 650;
}

.inventory-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  background: rgba(2, 12, 24, 0.22);
}

.inventory-snapshot-panel--fullscreen .inventory-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.inventory-snapshot-panel--fullscreen .inventory-summary-row {
  flex: 0 0 auto;
}

.inventory-snapshot-panel--fullscreen .inventory-footer {
  flex: 0 0 auto;
}

.inventory-snapshot-panel--fullscreen .inventory-pagination {
  display: none;
}

/* Item lookup — horizontally centered; ~25vh below safe top (upper area: three-quarters up from bottom) */
.inventory-lookup-bubble-root[hidden] {
  display: none !important;
}

.inventory-lookup-bubble-root:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 9450;
  pointer-events: none;
}

.inventory-lookup-bubble-root__backdrop {
  display: block;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: rgba(2, 6, 23, 0.52);
  pointer-events: auto;
  cursor: default;
}

/* Expanded lookup: dim edge-to-edge like other fullscreen popouts */
.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble-root__backdrop {
  top: 0;
}

.inventory-lookup-bubble-shell {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  --lookup-shell-top-offset: calc(max(0.75rem, env(safe-area-inset-top, 0px)) + 25vh);
  padding: var(--lookup-shell-top-offset) max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble-shell {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  --lookup-shell-top-offset: max(0.75rem, env(safe-area-inset-top, 0px));
  padding: max(0.75rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  min-height: 0;
}

.inventory-lookup-bubble {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(42rem, calc(100vw - 1.25rem));
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(234, 179, 8, 0.18);
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  padding: 0 0.85rem 0.85rem;
  pointer-events: auto;
  flex-shrink: 0;
  transform-origin: center center;
  animation: inventoryLookupBubblePopIn 0.16s ease-out;
}

.inventory-lookup-bubble-root:not(.inventory-lookup-bubble-root--expanded) .inventory-lookup-bubble__arrow {
  display: none;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble {
  left: auto !important;
  top: auto !important;
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  padding: 0 1rem 1rem;
  animation: inventoryLookupBubbleExpandIn 0.18s ease-out;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble__compact-row {
  flex: 0 0 auto;
}

/* Icon + title bar + × share one vertical rhythm (close centered to strip height) */
.inventory-lookup-bubble__head-strip {
  position: relative;
  flex-shrink: 0;
  margin-left: -0.85rem;
  margin-right: -0.85rem;
  margin-bottom: 0.55rem;
  z-index: 2;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-lookup-bubble__head-strip {
  margin-left: -1rem;
  margin-right: -1rem;
  margin-bottom: 0.65rem;
}

.inventory-lookup-bubble__head-strip .inventory-lookup-bubble__close-corner {
  position: absolute;
  left: calc(max(0px, env(safe-area-inset-left, 0px)) + var(--inventory-fullscreen-x-inset));
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.inventory-lookup-bubble__title-bar-wrap {
  position: relative;
  flex-shrink: 0;
  margin: 0;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-lookup-bubble__title-bar-wrap {
  flex: 0 0 auto;
}

.inventory-lookup-bubble__title-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 2.5rem 0.52rem calc(max(0px, env(safe-area-inset-left, 0px)) + var(--inventory-fullscreen-x-inset) + 1.85rem + 0.35rem);
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
  border-radius: 10px 10px 0 0;
  background: rgba(234, 179, 8, 0.1);
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-lookup-bubble__title-bar {
  padding: 0.58rem 2.75rem 0.58rem calc(max(0px, env(safe-area-inset-left, 0px)) + var(--inventory-fullscreen-x-inset) + 1.85rem + 0.4rem);
}

.inventory-lookup-bubble__title-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 1.65rem;
}

.inventory-lookup-bubble__title-icon {
  display: inline-flex;
  color: #eab308;
  flex-shrink: 0;
}

.inventory-lookup-bubble__title-icon svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.inventory-lookup-bubble__title-bar .inventory-lookup-bubble__title {
  letter-spacing: 0.12em;
}

@keyframes inventoryLookupBubblePopIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes inventoryLookupBubbleExpandIn {
  from {
    opacity: 0.94;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.inventory-lookup-bubble:focus {
  outline: none;
}

.inventory-lookup-bubble__arrow {
  position: absolute;
  top: -7px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid rgba(13, 18, 30, 0.94);
  filter: drop-shadow(0 -1px 0 rgba(234, 179, 8, 0.22));
  pointer-events: none;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble__arrow {
  display: none;
}

.inventory-lookup-bubble--flip-arrow .inventory-lookup-bubble__arrow {
  top: auto;
  bottom: -7px;
  border-bottom: none;
  border-top: 7px solid rgba(13, 18, 30, 0.94);
  filter: drop-shadow(0 1px 0 rgba(234, 179, 8, 0.22));
}

.inventory-lookup-bubble__compact-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inventory-lookup-bubble__compact-row .inventory-lookup-bubble__input {
  flex: 1 1 auto;
  min-width: 12rem;
}

.inventory-lookup-bubble__expanded {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(234, 179, 8, 0.18);
}

.inventory-lookup-bubble__title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 800 0.8rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #eab308;
}

.inventory-lookup-bubble__export-btn {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 2.35rem;
  height: 2.35rem;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.inventory-lookup-bubble__export-btn svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.inventory-lookup-bubble__export-btn:hover {
  border-color: rgba(234, 179, 8, 0.38);
  background: rgba(234, 179, 8, 0.14);
  color: #fde047;
}

.inventory-lookup-bubble__export-btn:focus-visible {
  outline: 2px solid rgba(234, 179, 8, 0.55);
  outline-offset: 2px;
}

.inventory-lookup-bubble__input {
  border: 1px solid rgba(234, 179, 8, 0.22);
  border-radius: 999px;
  background: rgba(12, 18, 30, 0.96);
  color: var(--text-primary);
  padding: 0.48rem 1rem;
  font: 600 0.78rem var(--font-body);
}

.inventory-lookup-bubble__input:focus {
  outline: none;
  border-color: rgba(234, 179, 8, 0.48);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.12);
}

.inventory-lookup-bubble__search-btn {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 2.35rem;
  height: 2.35rem;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.inventory-lookup-bubble__search-btn svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.inventory-lookup-bubble__search-btn:hover {
  border-color: rgba(234, 179, 8, 0.38);
  background: rgba(234, 179, 8, 0.14);
  color: #fde047;
}

.inventory-lookup-bubble__search-btn:focus-visible {
  outline: 2px solid rgba(234, 179, 8, 0.55);
  outline-offset: 2px;
}

.inventory-lookup-bubble__search-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Item lookup × — matches fullscreen inventory close chrome (positioned in `.inventory-lookup-bubble__head-strip`) */
.inventory-lookup-bubble__close-corner {
  box-sizing: border-box;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: rgba(253, 224, 71, 0.92);
  font: 700 1.1rem/1 var(--font-body);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.inventory-lookup-bubble__close-corner:hover,
.inventory-fullscreen-close:hover {
  border-color: rgba(234, 179, 8, 0.45);
  color: #fef9c3;
  background: rgba(234, 179, 8, 0.14);
}

.inventory-lookup-bubble__close-corner:focus-visible,
.inventory-fullscreen-close:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-raw-search__meta {
  flex: 0 0 auto;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-raw-search__table {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-raw-search__footer {
  flex: 0 0 auto;
}

/* Item Lookup drill-in — carton viewer merged into the lookup popout (one window) */
/* Only the active view renders — :not([hidden]) so the `hidden` toggle (which
   swaps results <-> carton viewer) wins. Without it, display:flex overrode
   [hidden] and BOTH stacked top/bottom, clipping the viewer on long results. */
.inventory-lookup-results:not([hidden]) { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.inventory-lookup-detail:not([hidden]) { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; gap: 0.6rem; }
.inventory-lookup-results[hidden],
.inventory-lookup-detail[hidden] { display: none !important; }
.inventory-lookup-detail__bar { flex: 0 0 auto; }
.inventory-lookup-detail__back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid rgba(234, 179, 8, 0.28);
  background: rgba(234, 179, 8, 0.08);
  color: #fde047;
  font: 700 0.72rem var(--font-body);
  letter-spacing: 0.04em;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.inventory-lookup-detail__back:hover { background: rgba(234, 179, 8, 0.16); border-color: rgba(234, 179, 8, 0.45); color: #fff; }
.inventory-lookup-detail__back svg { display: block; }
#rawLookupDetailContent {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  background: #fff;
}
/* The carton viewer's own close button is redundant inside the merged popout. */
#rawLookupDetailView .carton-modal-close { display: none !important; }

.inventory-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: auto;
}

.inventory-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 22, 38, 0.96);
  backdrop-filter: blur(10px);
}

.inventory-table th {
  position: relative;
  text-align: center;
  padding: 0.72rem 0.95rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.inventory-table th:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: rgba(148, 163, 184, 0.18);
}

.inventory-column-control {
  position: relative;
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) 1.1rem;
  justify-content: stretch;
  gap: 0.5rem;
  align-items: center;
}

.inventory-filter-btn,
.inventory-column-title {
  min-width: 0;
  grid-column: 2;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
  text-transform: inherit;
  letter-spacing: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-column-title {
  cursor: default;
}

.inventory-filter-btn:hover,
.inventory-filter-btn.active {
  color: var(--accent-light);
}

.inventory-filter-btn.active::after {
  content: " •";
  color: var(--accent);
}

.inventory-sort-btn {
  grid-column: 3;
  width: 1.05rem;
  height: 1.05rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.68rem;
  line-height: 1;
}

.inventory-sort-btn:hover,
.inventory-sort-btn.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.inventory-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.inventory-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.38rem);
  left: 0;
  width: min(15rem, 72vw);
  max-height: 19rem;
  padding: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.55rem;
  background: rgba(4, 13, 26, 0.98);
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.42);
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
}

.inventory-filter-menu--right {
  left: auto;
  right: 0;
}

.inventory-filter-search {
  width: 100%;
  height: 1.85rem;
  margin-bottom: 0.45rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.45rem;
  background: rgba(2, 12, 24, 0.82);
  color: var(--text-primary);
  font: 600 0.74rem var(--font-body);
}

.inventory-filter-menu-actions {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.inventory-filter-menu-actions button {
  flex: 1;
  height: 1.65rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-secondary);
  cursor: pointer;
  font: 700 0.68rem var(--font-body);
}

.inventory-filter-options {
  max-height: 13rem;
  overflow: auto;
  display: grid;
  gap: 0.12rem;
}

.inventory-filter-option {
  display: grid;
  grid-template-columns: 0.85rem minmax(0, 1fr);
  gap: 0.38rem;
  align-items: center;
  padding: 0.22rem 0.12rem;
  color: var(--text-secondary);
  font-size: 0.69rem;
  font-weight: 600;
  cursor: pointer;
}

.inventory-filter-option span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-filter-empty {
  padding: 0.5rem 0.15rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.inventory-table td {
  padding: 0.82rem 0.95rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.11);
  color: var(--text-secondary);
  vertical-align: middle;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.inventory-table td.inventory-wrap-cell {
  white-space: nowrap;
  line-height: 1.14;
}

.inventory-table .mono,
.inventory-table .inv-tracking,
.inventory-table .num {
  font-variant-numeric: tabular-nums;
}

.inventory-table .inv-tracking {
  text-align: left;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow-wrap: normal;
}

.inventory-table .mono {
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow-wrap: normal;
}

.inv-store {
  line-height: 1.15;
}

.inv-store-name,
.inv-store-opus {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  overflow-wrap: normal;
}

.inv-store-name {
  color: var(--text-secondary);
  font-weight: 650;
}

/* In Transit table: the Location (store) column reads as normal weight, and
   inherits the cell text color so it matches the Opus ID column (the base
   .inv-store-name color: var(--text-secondary) made it a lighter gray). */
#inv-panel-in-transit .inv-store-name {
  font-weight: 400;
  color: inherit;
}

/* In Transit table: DAYS OLD column is bold. Higher specificity + !important
   so it survives the global table-row font normalization (forces 400). */
#inv-panel-in-transit .inventory-table tbody td.inv-days-cell,
#inv-panel-in-transit .inventory-table tbody td.inv-days-cell .inv-days {
  font-weight: 700 !important;
}

.inv-store-opus {
  margin-top: 0.16rem;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.inventory-table .inv-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.6rem;
  white-space: nowrap;
}

.inventory-table th:nth-child(2),
.inventory-table td:nth-child(2),
.inventory-table th:nth-child(3),
.inventory-table td:nth-child(3) {
  padding-left: 1.05rem;
}

.inventory-table th:nth-child(1),
.inventory-table th:nth-child(2),
.inventory-table th:nth-child(3),
.inventory-table td:nth-child(1),
.inventory-table td:nth-child(2),
.inventory-table td:nth-child(3) {
  text-align: left;
}

.inventory-table th:nth-child(1) .inventory-column-control,
.inventory-table th:nth-child(2) .inventory-column-control,
.inventory-table th:nth-child(3) .inventory-column-control {
  grid-template-columns: minmax(0, 1fr) 1.1rem;
  justify-content: stretch;
}

.inventory-table th:nth-child(1) .inventory-filter-btn,
.inventory-table th:nth-child(2) .inventory-filter-btn,
.inventory-table th:nth-child(3) .inventory-filter-btn {
  grid-column: 1;
  text-align: left;
}

.inventory-table th:nth-child(5),
.inventory-table td:nth-child(5),
.inventory-table th:nth-child(6),
.inventory-table td:nth-child(6) {
  text-align: center;
}

.inventory-table th:nth-child(6) .inventory-column-control {
  justify-content: stretch;
}

/* Wide raw / filter tables only — not in-transit or delivered (5-col) */
.inventory-table.inventory-table--wide th:nth-child(1),
.inventory-table.inventory-table--wide td:nth-child(1) { min-width: 15rem; }
.inventory-table.inventory-table--wide th:nth-child(2),
.inventory-table.inventory-table--wide td:nth-child(2) { min-width: 10rem; }
.inventory-table.inventory-table--wide th:nth-child(3),
.inventory-table.inventory-table--wide td:nth-child(3) { min-width: 12rem; }
.inventory-table.inventory-table--wide th:nth-child(4),
.inventory-table.inventory-table--wide td:nth-child(4) { min-width: 12rem; }
.inventory-table.inventory-table--wide th:nth-child(5),
.inventory-table.inventory-table--wide td:nth-child(5) { min-width: 10rem; }
.inventory-table.inventory-table--wide th:nth-child(6),
.inventory-table.inventory-table--wide td:nth-child(6) { min-width: 7rem; }
.inventory-table.inventory-table--wide th:nth-child(7),
.inventory-table.inventory-table--wide td:nth-child(7) { min-width: 9rem; }
.inventory-table.inventory-table--wide th:nth-child(8),
.inventory-table.inventory-table--wide td:nth-child(8) {
  min-width: 9rem;
  text-align: center;
}

.inventory-table th:nth-child(8) .inventory-column-control {
  width: 100%;
  grid-template-columns: 1.1rem minmax(0, 1fr) 1.1rem;
  justify-content: stretch;
  justify-items: stretch;
}

.inventory-table th:nth-child(8) {
  text-align: center;
}

.inventory-table th:nth-child(7),
.inventory-table td:nth-child(7) {
  text-align: center;
}
.inventory-table tr:hover td {
  background: rgba(59, 130, 246, 0.075);
  color: var(--text-primary);
}

.inventory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

.inv-table-panel { max-height: calc(100vh - 295px); display: flex; flex-direction: column; }
.inv-table-wrap { flex: 1; overflow: auto; }

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.inv-table thead,
.table-sticky-head {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
  border-bottom: 2px solid var(--border-soft);
}

.inv-table th,
.table-sticky-head th {
  text-align: left;
  padding: 0.9rem 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.inv-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
  height: 44px;
}

.inv-table tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.inv-table tr:last-child td {
  border-bottom: none;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ops-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
  border-bottom: 2px solid var(--border-soft);
}

.ops-table th {
  text-align: left;
  padding: 0.9rem 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ops-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
  height: 44px;
}

.ops-table tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ops-table tr:last-child td {
  border-bottom: none;
}

.inv-table td.mono { font-family: var(--font-mono); font-size: 0.75rem; }
.inv-table td.num { font-family: var(--font-mono); font-size: 0.8rem; text-align: right; font-weight: 500; }

.inv-store { color: var(--text-primary); font-weight: 500; max-width: 200px; }
.inv-tracking { color: var(--text-primary); font-family: var(--font-mono); font-size: 0.72rem; }
.inv-tracking-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.inv-tracking-link:hover {
  color: #8bb6ff;
  border-color: currentColor;
}
.inv-sku { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inv-days { font-family: var(--font-mono); font-weight: 600; }
.inv-days--fresh { color: var(--green); }
.inv-days--normal { color: var(--text-secondary); }
.inv-days--stale { color: var(--amber); }
.inv-days--old { color: var(--red); }

.inv-status-pill,
.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.inv-status-pill--NotDelivered,
.status-pill--pending {
  background: var(--warning-dim);
  color: var(--warning);
}

.inv-status-pill--Delivered,
.status-pill--complete {
  background: var(--success-dim);
  color: var(--success);
}

.status-pill--open {
  background: var(--accent-dim);
  color: var(--accent);
}

.status-pill--stale {
  background: var(--warning-dim);
  color: var(--warning);
}

.status-pill--unknown {
  background: var(--slate-dim);
  color: var(--slate);
}
.inv-status-pill--Delivered { background: var(--green-dim); color: var(--green); }
.inv-status-pill--Unknown { background: var(--slate-dim); color: var(--slate); }
.inv-status-pill--Stale { background: var(--red-dim); color: var(--red); }

/* ---- TRANSFER TABLE ---- */
.transfer-table-panel { min-width: 0; }
.transfer-latest {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transfer-table td { vertical-align: top; }
.transfer-file {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transfer-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.18rem;
}
.transfer-route {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 240px;
}
.transfer-sku {
  max-width: 260px;
  overflow: hidden;
}
.transfer-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.transfer-status-pill--complete { background: var(--green-dim); color: var(--green); }
.transfer-status-pill--open { background: var(--amber-dim); color: var(--amber); }
.transfer-status-pill--stale { background: var(--red-dim); color: var(--red); }
.transfer-status-pill--other { background: var(--cyan-dim); color: var(--cyan); }
.transfer-status-pill--unknown { background: var(--slate-dim); color: var(--slate); }

/* ---- RIGHT COLUMN ---- */
.right-col { display: flex; flex-direction: column; gap: 1rem; }
.timeline { padding: 1rem 1.2rem; }
.timeline-item { display: flex; gap: 0.75rem; padding-bottom: 1rem; position: relative; }
.timeline-item:not(:last-child)::after { content: ''; position: absolute; left: 5px; top: 18px; bottom: 0; width: 1px; background: var(--border-light); }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; border: 2px solid; }
.timeline-dot--new { border-color: var(--accent); background: var(--accent-dim); }
.timeline-dot--resolved { border-color: var(--green); background: var(--green-dim); }
.timeline-dot--escalated { border-color: var(--red); background: var(--red-dim); }
.timeline-dot--update { border-color: var(--amber); background: var(--amber-dim); }
.timeline-content { min-width: 0; }
.timeline-text { font-size: 0.8rem; line-height: 1.4; }
.timeline-time { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); margin-top: 0.15rem; }

.source-list { padding: 1rem 1.2rem; }
.source-item { display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.source-item:last-child { border-bottom: none; }
.source-info { display: flex; align-items: center; gap: 0.6rem; }
.source-dot { width: 8px; height: 8px; border-radius: 50%; }
.source-dot--active { background: var(--green); }
.source-dot--idle { background: var(--amber); }
.source-dot--error { background: var(--red); }
.source-name { font-size: 0.8rem; font-weight: 500; }
.source-last-sync { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }

.district-bars { padding: 1rem 1.2rem; }
.district-row { margin-bottom: 0.8rem; }
.district-row:last-child { margin-bottom: 0; }
.district-label { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 0.3rem; }
.district-name { font-weight: 500; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.district-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.district-bar-bg { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.district-bar-fill { height: 100%; border-radius: 6px; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); }

/* ---- STORE DIRECTORY ---- */
#tab-stores .store-directory-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

#tab-stores .store-summary-grid,
#tab-stores .store-directory-panel,
#tab-stores .panel.map-panel {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.store-directory-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2.6rem;
}
.store-directory-title {
  display: grid;
  gap: 0.25rem;
}
.store-directory-title h2 {
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.store-directory-title p {
  color: var(--text-muted);
  font-size: 0.82rem;
}
.store-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.store-summary-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(19, 28, 41, 0.86);
}
.store-summary-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}
.store-summary-card strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.45rem;
  line-height: 1;
}
.store-summary-card--online strong { color: var(--green); }
.store-summary-card--attention strong { color: var(--orange); }
.store-summary-card--offline strong { color: var(--red); }
.store-summary-card--score strong { color: var(--accent); }
.store-summary-subtext {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.store-directory-panel {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(13, 20, 31, 0.92);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.store-directory-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
}
.store-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(8, 13, 22, 0.62);
  color: var(--text-muted);
}
.store-search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
}
.store-search-wrap input::placeholder {
  color: var(--text-muted);
}
.store-filter-field {
  display: grid;
  gap: 0.25rem;
  flex: 1 1 0;
  min-width: 0;
}
.store-filter-field span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.store-filter-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(15, 23, 35, 0.96);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  padding: 0 2rem 0 0.65rem;
}
.store-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.store-toolbar-btn {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(15, 23, 35, 0.88);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 0.8rem;
  cursor: pointer;
}
.store-toolbar-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}
.store-directory-table-wrap {
  overflow: auto;
}
.store-directory-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.store-directory-table thead {
  background: rgba(26, 38, 54, 0.9);
}
.store-directory-table th {
  text-align: left;
  padding: 0.85rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.store-directory-table td {
  height: 48px;
  padding: 0.72rem 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--text-secondary);
  vertical-align: middle;
  white-space: nowrap;
}
.store-directory-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
}
.store-score {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.08);
}
.store-score--attention {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
}
.store-score--offline {
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}
.store-row-actions {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.2rem;
}
.store-directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
}
.store-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
  gap: 0.35rem;
}
@media (max-width: 1180px) {
  .store-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .store-directory-toolbar {
    gap: 0.45rem;
  }
  .store-filter-field span {
    font-size: 0.62rem;
  }
  .store-filter-field select {
    padding-left: 0.5rem;
    padding-right: 1.35rem;
  }
  .store-toolbar-btn {
    padding: 0 0.62rem;
  }
}
@media (max-width: 700px) {
  .store-summary-grid {
    grid-template-columns: 1fr;
  }
  .store-directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .store-directory-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
.store-table-panel { min-width: 0; }
.store-table td { vertical-align: top; }
.store-primary { display: grid; gap: 0.18rem; }
.store-name { font-weight: 600; color: var(--text-primary); }
.store-meta { font-size: 0.72rem; color: var(--text-muted); }
.store-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.store-market-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.store-contact {
  display: grid;
  gap: 0.18rem;
  font-size: 0.78rem;
}
.store-contact a {
  color: var(--accent);
  text-decoration: none;
}
.store-contact a:hover { text-decoration: underline; }
.store-notes {
  padding: 1.15rem 1.2rem;
  display: grid;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ---- STORE DIRECTORY V2 ---- */
#tab-stores.store-v2-page,
#tab-stores .store-v2-page {
  padding-bottom: 2rem;
}

#tab-stores .store-v2-shell {
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(7, 22, 49, 0.96), rgba(3, 14, 38, 0.96));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
  padding: 1rem;
}

#tab-stores .store-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

#tab-stores .store-v2-title-wrap h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #e2e8f0;
}

#tab-stores .store-v2-title-wrap p {
  margin: 0.3rem 0 0;
  color: rgba(148, 163, 184, 0.9);
}

#tab-stores .store-v2-export {
  min-height: 40px;
  padding: 0 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

#tab-stores .store-v2-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px auto;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

#tab-stores .store-v2-search input,
#tab-stores .store-v2-market-select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 10, 30, 0.72);
  color: #e2e8f0;
  font-size: 0.86rem;
  padding: 0 0.9rem;
}

#tab-stores .store-v2-filter-btn {
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 10, 30, 0.72);
  color: rgba(226, 232, 240, 0.88);
  cursor: pointer;
}

#tab-stores .store-v2-tabs {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.25rem;
  margin: 0 0 0.9rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
}

#tab-stores .store-v2-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: rgba(226, 232, 240, 0.75);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

#tab-stores .store-v2-tab:hover {
  color: #FFFFFF;
}

#tab-stores .store-v2-tab.is-active {
  background: rgba(59, 130, 246, 0.18);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

#tab-stores .store-v2-tab-pane[hidden] { display: none; }

#tab-stores .store-v2-people-panel {
  margin-top: 0;
}

#tab-stores .store-v2-people-head,
#tab-stores .store-v2-people-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1.4fr 1fr 1fr;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
}

#tab-stores .store-v2-people-row + .store-v2-people-row {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

#tab-stores .store-v2-people-row:hover {
  background: rgba(59, 130, 246, 0.06);
}

#tab-stores .store-v2-people-cell {
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-stores .store-v2-people-cell--name {
  font-weight: 600;
}

/* Click-to-copy affordance on Stores data cells (people cells + store names). */
#tab-stores .store-v2-people-cell,
#tab-stores .store-v2-store-name {
  cursor: pointer;
}
#tab-stores .store-v2-people-cell:hover,
#tab-stores .store-v2-store-name:hover {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.store-copy-toast {
  position: fixed;
  z-index: 4000;
  background: #0F1E3A;
  color: #fff;
  font: 600 11px/1 var(--font-body, system-ui, sans-serif);
  letter-spacing: .03em;
  padding: 6px 10px;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(11, 23, 48, .3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.store-copy-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

#tab-stores .store-v2-people-email {
  color: var(--accent, #3b82f6);
  text-decoration: none;
}

#tab-stores .store-v2-people-email:hover {
  text-decoration: underline;
}

#tab-stores .store-v2-people-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

#tab-stores .store-v2-people-empty--error {
  color: #f87171;
}

@media (max-width: 640px) {
  #tab-stores .store-v2-people-head {
    display: none;
  }
  #tab-stores .store-v2-people-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  #tab-stores .store-v2-people-cell {
    white-space: normal;
  }
  #tab-stores .store-v2-people-cell--name {
    font-size: 0.95rem;
  }
}

#tab-stores .store-v2-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

#tab-stores .store-v2-kpi {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(8, 19, 43, 0.75);
  padding: 0.85rem 0.95rem;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 84px;
}

#tab-stores .store-v2-kpi::before {
  content: none;
}

#tab-stores .store-v2-kpi-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent, #3b82f6);
  flex-shrink: 0;
}

#tab-stores .store-v2-kpi-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

#tab-stores .store-v2-kpi-body {
  min-width: 0;
}

#tab-stores .store-v2-kpi-label {
  color: rgba(148, 163, 184, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

#tab-stores .store-v2-kpi-value {
  margin-top: 0.18rem;
  color: #f8fafc;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.05;
}

#tab-stores .store-v2-kpi-sub {
  margin-top: 0.18rem;
  color: rgba(148, 163, 184, 0.86);
  font-size: 0.68rem;
  line-height: 1.25;
}

#tab-stores .store-v2-hierarchy-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(5, 16, 37, 0.72);
}

#tab-stores .store-v2-view-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(4, 14, 34, 0.68);
}

#tab-stores .store-v2-view-btn {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.62);
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

#tab-stores .store-v2-view-btn.is-active {
  color: #eaf2ff;
  border-color: rgba(96, 165, 250, 0.7);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.34), rgba(30, 64, 175, 0.2));
}

#tab-stores .store-v2-hierarchy-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

#tab-stores .store-v2-market-wrap + .store-v2-market-wrap {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

#tab-stores .store-v2-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

#tab-stores .store-v2-row:hover {
  background: rgba(30, 64, 175, 0.08);
}

#tab-stores .store-v2-cell {
  color: rgba(226, 232, 240, 0.9);
  font-size: 1.05rem;
}

#tab-stores .store-v2-cell--name {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#tab-stores .store-v2-status {
  color: #4ade80;
  font-weight: 700;
}

#tab-stores .store-v2-market-badge {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, currentColor 14%, transparent);
  flex-shrink: 0;
}
#tab-stores .store-v2-market-badge svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

#tab-stores .store-v2-market-badge--blue { color: #60a5fa; }
#tab-stores .store-v2-market-badge--teal { color: #22d3ee; }
#tab-stores .store-v2-market-badge--purple { color: #c084fc; }
#tab-stores .store-v2-market-badge--pink { color: #f472b6; }
#tab-stores .store-v2-market-badge--amber { color: #f59e0b; }
#tab-stores .store-v2-market-badge--green { color: #4ade80; }

#tab-stores .store-v2-district-icon,
#tab-stores .store-v2-store-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #60a5fa;
  flex-shrink: 0;
}
#tab-stores .store-v2-district-icon svg,
#tab-stores .store-v2-store-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

/* Chevron is now an SVG. It rotates 90° when the row is expanded;
   data-expanded="1" is set by renderStoreTable on the parent button. */
#tab-stores .store-v2-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: rgba(148, 163, 184, 0.9);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
#tab-stores .store-v2-chevron svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: currentColor;
}
#tab-stores [data-expanded="1"] .store-v2-chevron {
  transform: rotate(90deg);
}

#tab-stores .store-v2-chevron--end {
  margin-left: 0.6rem;
}

#tab-stores .store-v2-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.3rem;
  min-height: 1.8rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid transparent;
}

#tab-stores .store-v2-pill--active {
  color: #4ade80;
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(74, 222, 128, 0.24);
}

#tab-stores .store-v2-pill--inactive {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(252, 165, 165, 0.22);
}

#tab-stores .store-v2-district-list {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 9, 26, 0.45);
  padding-left: 0.55rem;
}

#tab-stores .store-v2-district-wrap + .store-v2-district-wrap {
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

#tab-stores .store-v2-row--district {
  padding-left: 2rem;
}

#tab-stores .store-v2-store-list {
  padding: 0.25rem 1rem 0.75rem 3.05rem;
  position: relative;
}

#tab-stores .store-v2-store-list::before {
  content: '';
  position: absolute;
  left: 1.85rem;
  top: 0.2rem;
  bottom: 0.7rem;
  width: 1px;
  background: rgba(96, 165, 250, 0.22);
}

/* All the stores in one district share ONE horizontal scroller. Inside it the
   stores render as an Excel-style grid: aligned columns with full cell borders.
   The tree connector lives on the non-scrolling .store-v2-store-list so it
   isn't clipped. */
#tab-stores .store-v2-store-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

#tab-stores .store-v2-store-scroll::-webkit-scrollbar { height: 7px; }
#tab-stores .store-v2-store-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 3px;
}

#tab-stores .store-v2-grid {
  /* separate borders (not collapse) so the sticky first column keeps its
     borders while scrolling; full grid achieved via per-cell right/bottom
     borders + a top/left edge. */
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  font-size: 0.8rem;
  background: #ffffff;
  color: #364152;
}

#tab-stores .store-v2-grid th,
#tab-stores .store-v2-grid td {
  border-right: 1px solid #d8dce2;
  border-bottom: 1px solid #d8dce2;
  padding: 0.34rem 0.62rem;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

#tab-stores .store-v2-grid th { border-top: 1px solid #d8dce2; }
#tab-stores .store-v2-grid th:first-child,
#tab-stores .store-v2-grid td:first-child { border-left: 1px solid #d8dce2; }

#tab-stores .store-v2-grid th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5b6472;
  background: #eef1f5;
}

/* Freeze the Store column while the data columns scroll horizontally. */
#tab-stores .store-v2-grid th:first-child,
#tab-stores .store-v2-grid td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}
#tab-stores .store-v2-grid td:first-child { background: #ffffff; }
#tab-stores .store-v2-grid th:first-child { background: #eef1f5; z-index: 2; }

#tab-stores .store-v2-grid-store {
  font-weight: 600;
  color: var(--alliance-primary, #1b4278);
}
#tab-stores .store-v2-grid-store .store-v2-store-icon { margin-right: 0.35rem; }
#tab-stores .store-v2-grid-cell { cursor: pointer; }

#tab-stores .store-v2-grid tbody tr:hover td { background: #f3f8fc; }
#tab-stores .store-v2-grid tbody tr:hover td:first-child { background: #eaf4fb; }

#tab-stores .store-v2-store-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#tab-stores .store-v2-store-name {
  color: rgba(226, 232, 240, 0.85);
}

#tab-stores .store-v2-store-status {
  color: #4ade80;
  font-weight: 700;
}

#tab-stores .store-v2-store-more {
  margin-top: 0.45rem;
  color: #60a5fa;
  font-size: 0.92rem;
  font-weight: 600;
}

#tab-stores .store-v2-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.8rem;
  color: rgba(148, 163, 184, 0.92);
}

#tab-stores .store-v2-empty {
  padding: 1.2rem;
  color: rgba(148, 163, 184, 0.95);
}

@media (max-width: 980px) {
  #tab-stores .store-v2-toolbar {
    grid-template-columns: 1fr;
  }
  #tab-stores .store-v2-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #tab-stores .store-v2-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #tab-stores .store-v2-view-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #tab-stores .store-v2-view-btn {
    width: 100%;
    min-width: 0;
  }
  #tab-stores .store-v2-hierarchy-head,
  #tab-stores .store-v2-row {
    grid-template-columns: minmax(0, 1fr) 76px 76px;
  }
  #tab-stores .store-v2-cell {
    font-size: 0.88rem;
  }
}

/* ---- MODAL ---- */
/* z-index above .topbar (1300) so modals / expand views aren’t covered by fixed chrome */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); z-index: 2200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal { background: rgba(19,22,29,0.96); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-lg); width: 90%; max-width: 640px; max-height: 85vh; overflow-y: auto; padding: 1.6rem; position: relative; transform: translateY(20px) scale(0.97); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 28px 64px rgba(0,0,0,0.3); }
/* Carton viewer + Daily Ops expand: fill padded overlay (uniform inset + safe areas via `.modal-overlay` `:has()` rule below). */
/* Carton Contents modal: centered 1060px card (mockup), not fullscreen. */
.modal.modal--carton {
  width: min(1060px, 100%);
  max-width: min(1060px, 100%);
  height: auto;
  max-height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.modal--carton .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.modal.modal--carton .carton-modal-table-wrap {
  /* Let the table fill the remaining vertical space inside the modal. */
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
/* The navy head carries its own close button. */
.modal.modal--carton .modal-close { display: none !important; }

/* Carton modal: safe-area inset + top-centered card. */
.modal-overlay.active:has(.modal.modal--carton) {
  padding: max(1.5rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  align-items: flex-start;
  justify-content: center;
}

/* Nearly fullscreen Daily Ops expand: viewport inset respects safe areas when `:has()` is supported */
.modal-overlay.active:has(.modal.modal--dops-expand) {
  padding: max(0.75rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}

.modal-overlay.active:has(.modal.modal--dops-expand) {
  background: rgba(2, 6, 23, 0.72);
  /* Slightly tighter chrome than carton modal so the data area reads wider */
  padding: max(0.45rem, env(safe-area-inset-top, 0px))
    max(0.45rem, env(safe-area-inset-right, 0px))
    max(0.45rem, env(safe-area-inset-bottom, 0px))
    max(0.45rem, env(safe-area-inset-left, 0px));
}

.modal-overlay.active:has(.modal.modal--dops-expand) .modal.modal--dops-expand {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
}

/* Daily Ops: full-column popout — Inventory tab uses gold/chrome aligned with `.inventory-table` */

.modal.modal--dops-expand {
  width: calc(100vw - 1.5rem);
  max-width: calc(100vw - 1.5rem);
  height: calc(100vh - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  height: calc(100dvh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(234, 179, 8, 0.18);
  border-radius: 0.95rem;
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.55);
}

.modal.modal--dops-expand .dops-expand-modal-table-head {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  /* `row-gap: 0` — `.daily-ops-shrink-head` sets `gap: 0.125rem 0.75rem`; we only inherit row-gap otherwise */
  gap: 0 0.5rem;
  align-content: start;
  /* No bottom margin — avoids a strip of dead space above the column header row */
  margin: -1.35rem -1.5rem 0;
  padding: 0.4rem 3.25rem;
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
  background: rgba(234, 179, 8, 0.1);
}

.modal.modal--dops-expand .dops-expand-modal-table-head > .inventory-popout-title-cluster {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-width: 0;
  min-height: 1.85rem;
}

.modal.modal--dops-expand .dops-expand-modal-table-head .inventory-popout-title-cluster > .inventory-table-kpi-icon {
  width: 1.65rem;
  height: 1.65rem;
  color: #eab308 !important;
}

.modal.modal--dops-expand .dops-expand-modal-table-head .inventory-popout-title-cluster > h3 {
  margin: 0;
  display: flex;
  align-items: center;
  line-height: 1;
  min-height: 1.65rem;
  color: #eab308 !important;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal.modal--dops-expand .dops-expand-title-short {
  display: none;
}

@media (max-width: 540px) {
  .modal.modal--dops-expand .dops-expand-modal-title--nonsellable .dops-expand-title-full,
  .modal.modal--dops-expand .dops-expand-modal-title--cartons .dops-expand-title-full {
    display: none !important;
  }

  .modal.modal--dops-expand .dops-expand-modal-title--nonsellable .dops-expand-title-short,
  .modal.modal--dops-expand .dops-expand-modal-title--cartons .dops-expand-title-short {
    display: inline !important;
  }
}

.modal.modal--dops-expand .dops-expand-modal-table-head > .daily-ops-head-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  position: static;
  transform: none;
  top: auto;
  right: auto;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 1.85rem;
}

.modal.modal--dops-expand .dops-expand-table th {
  background: rgba(32, 28, 8, 0.95);
  color: rgba(253, 224, 71, 0.7);
  border-bottom-color: rgba(234, 179, 8, 0.15);
}

.modal.modal--dops-expand .dops-expand-table td {
  border-bottom-color: rgba(234, 179, 8, 0.06);
}

.modal.modal--dops-expand .dops-expand-table tbody tr:hover {
  background: rgba(234, 179, 8, 0.05);
}

.modal.modal--dops-expand .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal.modal--dops-expand .dops-expand-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-top: 0;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-top: 0;
  border: none;
  border-radius: 0;
  background: rgba(2, 12, 24, 0.22);
}

.dops-expand-table {
  margin: 0;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 0.72rem;
  min-width: max-content;
}
.dops-expand-table th,
.dops-expand-table td {
  padding: 0.38rem 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  vertical-align: top;
}
.dops-expand-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.62rem;
  white-space: nowrap;
}
.dops-expand-table td {
  color: var(--text-secondary);
  white-space: nowrap;
}
.dops-expand-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.06);
}

/* IPOG fullscreen: fill the modal width but let columns size to their content
   (table-layout: auto) rather than forcing every column to an equal share. */
.modal.modal--dops-expand .dops-expand-table--ipog {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.modal.modal--dops-expand .dops-expand-table--ipog th,
.modal.modal--dops-expand .dops-expand-table--ipog td {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.daily-ops-head-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Supabase `created_at` freshness stamp — pinned left on table title bars */
.dops-table-updated-at {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  max-width: min(42vw, 11rem);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  z-index: 2;
}

.dops-table-updated-at__line {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- "Last updated" column -----------------------------------------------
   initTableUpdatedColumn (app.js) prepends an Updated column to every
   dops-style table, each row repeating the table's last-updated date. The
   title-bar stamps stay in the DOM as the data source but are hidden. */
table .upd-col {
  white-space: nowrap;
  width: 0;
  text-align: left;
}
td.upd-col {
  font-size: 0.64rem;
  color: var(--text-muted);
}
/* The stamps stay hidden in the title bars — the column is the placement. */
.daily-ops-shrink-head .dops-table-updated-at,
.daily-ops-nonsellable-head .dops-table-updated-at,
.daily-ops-cartons-head .dops-table-updated-at,
.daily-ops-scans-head .dops-table-updated-at,
.daily-ops-sts-head .dops-table-updated-at,
.daily-ops-eol-head .dops-table-updated-at,
.daily-ops-obs-acc-head .dops-table-updated-at,
.daily-ops-ipog-head .dops-table-updated-at,
.daily-ops-da-head .dops-table-updated-at,
.daily-ops-drawers-head .dops-table-updated-at,
.daily-ops-prodnote-head .dops-table-updated-at,
.daily-ops-nonsell-log-head .dops-table-updated-at,
.dops-expand-modal-table-head .dops-table-updated-at,
.inventory-fs-popout-head > .dops-table-updated-at,
.inventory-transport-carousel-stamp-cell {
  display: none;
}

#tab-inventory .inventory-snapshot-panel.inventory-snapshot-panel--fullscreen .inventory-fs-popout-head {
  position: relative;
}

#tab-inventory .inventory-fs-popout-head > .dops-table-updated-at--fullscreen-transport {
  max-width: min(46vw, 12rem);
  font-size: 0.58rem;
}

#tab-inventory .dops-table-updated-at {
  color: rgba(253, 224, 71, 0.82);
}

#tab-daily_ops .dops-table-updated-at {
  color: rgba(254, 215, 170, 0.88);
}

#tab-compliance .dops-table-updated-at {
  color: rgba(186, 230, 253, 0.85);
}

#tab-cash .dops-table-updated-at {
  color: rgba(167, 243, 208, 0.88);
}

.modal.modal--dops-expand .dops-table-updated-at {
  color: rgba(253, 224, 71, 0.85);
  /* Sit immediately to the right of the × button */
  left: calc(max(0px, env(safe-area-inset-left, 0px)) + var(--inventory-fullscreen-x-inset) + 1.85rem + 0.45rem);
}

/* Daily Ops table title bars: KPI + title centered on full bar (symmetric gutters for expand btn).
   Padding matches `.daily-ops-nonsellable-head` (0.65rem × 0.9rem vertical; horizontal reserves actions). */
.daily-ops-shrink-head,
.daily-ops-cartons-head,
.daily-ops-nonsellable-head,
.daily-ops-drawers-head,
.daily-ops-prodnote-head,
.daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head,
.daily-ops-scans-panel--monthly .daily-ops-scans-head,
.daily-ops-da-head,
.daily-ops-ipog-head,
.daily-ops-sts-head,
.daily-ops-eol-head,
.daily-ops-obs-acc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  gap: 0.125rem 0.75rem;
  position: relative;
  padding: 0.65rem 3.25rem;
  box-sizing: border-box;
}

.daily-ops-shrink-head > .inventory-table-kpi-icon,
.daily-ops-cartons-head > .inventory-table-kpi-icon,
.daily-ops-nonsellable-head > .inventory-table-kpi-icon,
.daily-ops-drawers-head > .inventory-table-kpi-icon,
.daily-ops-prodnote-head > .inventory-table-kpi-icon,
.daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .inventory-table-kpi-icon,
.daily-ops-scans-panel--monthly .daily-ops-scans-head > .inventory-table-kpi-icon,
.daily-ops-da-head > .inventory-table-kpi-icon,
.daily-ops-ipog-head > .inventory-table-kpi-icon,
.daily-ops-sts-head > .inventory-table-kpi-icon,
.daily-ops-eol-head > .inventory-table-kpi-icon,
.daily-ops-obs-acc-head > .inventory-table-kpi-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2rem;
  height: 2rem;
}

.daily-ops-shrink-head > h3,
.daily-ops-cartons-head > h3,
.daily-ops-nonsellable-head > h3,
.daily-ops-drawers-head > h3,
.daily-ops-prodnote-head > h3,
.daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > h3,
.daily-ops-scans-panel--monthly .daily-ops-scans-head > h3,
.daily-ops-da-head > h3,
.daily-ops-ipog-head > h3,
.daily-ops-sts-head > h3,
.daily-ops-eol-head > h3,
.daily-ops-obs-acc-head > h3 {
  flex: 0 1 auto;
  margin: 0;
  text-align: center;
  line-height: 1;
  display: flex;
  align-items: center;
  min-height: 2rem;
}

.daily-ops-shrink-head > .daily-ops-shrink-meta,
.daily-ops-cartons-head > .daily-ops-cartons-meta,
.daily-ops-nonsellable-head > .daily-ops-nonsellable-meta,
.daily-ops-drawers-head > .daily-ops-drawers-meta,
.daily-ops-prodnote-head > .daily-ops-prodnote-meta,
.daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .daily-ops-scans-meta,
.daily-ops-scans-panel--monthly .daily-ops-scans-head > .daily-ops-scans-meta,
.daily-ops-da-head > .daily-ops-da-meta,
.daily-ops-ipog-head > .daily-ops-ipog-meta,
.daily-ops-sts-head > .daily-ops-sts-meta,
.daily-ops-eol-head > .daily-ops-eol-meta,
.daily-ops-obs-acc-head > .daily-ops-obs-acc-meta {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
  padding: 0 0.25rem;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
}

.daily-ops-shrink-head > .daily-ops-head-actions,
.daily-ops-cartons-head > .daily-ops-head-actions,
.daily-ops-nonsellable-head > .daily-ops-head-actions,
.daily-ops-drawers-head > .daily-ops-head-actions,
.daily-ops-prodnote-head > .daily-ops-head-actions,
.daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .daily-ops-head-actions,
.daily-ops-scans-panel--monthly .daily-ops-scans-head > .daily-ops-head-actions,
.daily-ops-da-head > .daily-ops-head-actions,
.daily-ops-ipog-head > .daily-ops-head-actions,
.daily-ops-sts-head > .daily-ops-head-actions,
.daily-ops-eol-head > .daily-ops-head-actions,
.daily-ops-obs-acc-head > .daily-ops-head-actions {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  margin-left: 0;
  flex-shrink: 0;
}

/* Average-compliance chip beside the Device Alive / IPOG table titles.
   White pill so the red→green compliance color (inline, from
   compliancePctColorAttr) stays readable on the dark head band. */
.dops-head-avg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.dops-head-avg__label {
  color: #13315a;
  letter-spacing: 0.06em;
}

.dops-table-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dops-table-expand-btn:hover {
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(30, 41, 59, 0.9);
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elevated); color: var(--text-secondary); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { color: var(--text-primary); border-color: var(--border-light); }

.modal.modal--dops-expand .modal-close {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: rgba(253, 224, 71, 0.92);
  font: 700 1.1rem/1 var(--font-body);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  z-index: 6;
  /* Same left nudge as transport / item lookup fullscreen × */
  top: calc(0.4rem + (1.65rem - 1.85rem) / 2);
  left: calc(max(0px, env(safe-area-inset-left, 0px)) + var(--inventory-fullscreen-x-inset));
  right: auto;
}
.modal.modal--dops-expand .modal-close:hover {
  border-color: rgba(234, 179, 8, 0.45);
  color: #fef9c3;
  background: rgba(234, 179, 8, 0.14);
}
.modal.modal--dops-expand .modal-close:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

.modal-source-badge { display: inline-block; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.6rem; }
.modal-title { font-family: var(--font-display); font-size: 2rem; font-weight: 400; line-height: 1.1; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.modal-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.26);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.modal-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.26);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.modal-action-button:hover { color: #8bb6ff; border-color: rgba(59, 130, 246, 0.4); }
.modal-action-link:hover { color: #8bb6ff; border-color: rgba(59, 130, 246, 0.4); }
.modal-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1.2rem; }
.modal-detail { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }
.modal-detail-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem; }
.modal-detail-value { font-size: 0.85rem; font-weight: 500; word-break: break-word; }
.modal-description-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.modal-description { font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary); background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 0.9rem; }
.modal-item-list {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}
.modal-item-row {
  display: grid;
  grid-template-columns: minmax(0, 150px) 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
}
.modal-item-sku {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}
.modal-item-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.modal-item-qty {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-primary);
}

/* --- Carton row clickability + detail popout ---------------------------- */
.inventory-table tbody tr.inventory-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.inventory-table tbody tr.inventory-row-clickable:hover,
.inventory-table tbody tr.inventory-row-clickable:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}
.inventory-table tbody tr.inventory-row-clickable:hover .inv-store-name {
  color: var(--text-primary);
}
.inventory-table tbody tr.inventory-row-clickable .inv-tracking-link {
  position: relative;
  z-index: 2;
}
/* Carton clickability for the Inventory "Table view" (cmscv) shipment tables. */
table.cmscv-tbl tbody tr.inventory-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
table.cmscv-tbl tbody tr.inventory-row-clickable:hover,
table.cmscv-tbl tbody tr.inventory-row-clickable:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}

.inventory-raw-search {
  display: grid;
  gap: 0.9rem;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
}
.inventory-raw-search__controls {
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}
.inventory-raw-search__field {
  display: grid;
  gap: 0.35rem;
}
.inventory-raw-search__field--grow {
  min-width: 0;
}
.inventory-raw-search__controls .inventory-tool-btn {
  height: 40px;
  white-space: nowrap;
}
.inventory-raw-search__field span {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.inventory-raw-search__field input,
.inventory-raw-search__field select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(18, 24, 34, 0.78);
  color: var(--text-primary);
  padding: 0.6rem 0.72rem;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inventory-raw-search__field input:focus,
.inventory-raw-search__field select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.inventory-raw-search__meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.35;
  padding-left: 0.1rem;
}
.inventory-raw-search__table {
  max-height: 360px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  overflow: auto;
}
.inventory-raw-search__footer {
  margin-top: -0.15rem;
}

@media (max-width: 1024px) {
  .inventory-raw-search__controls {
    grid-template-columns: 1fr;
  }
}

/*
 * Inventory tab: yellow / gold accent. Obsolete Accessories uses the same yellow theme.
 */
#tab-inventory .inventory-snapshot-panel {

  border-color: rgba(234, 179, 8, 0.18);
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
}

#tab-inventory .inventory-snapshot-panel--fullscreen {
  border-color: rgba(234, 179, 8, 0.18);
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

/* KPI tiles + ops tables — inventory tab strip theme */
#tab-inventory .inventory-metrics-panel {

  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(234, 179, 8, 0.18);
  border-radius: 0.95rem;
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
  overflow: visible;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#tab-inventory #inventory-transport-carousel,
#tab-inventory #inventoryOpsTables {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#tab-inventory #inventoryOpsTables > .daily-ops-shrink-panel,
#tab-inventory #inventoryOpsTables > .daily-ops-nonsellable-panel,
#tab-inventory #inventoryOpsTables > .daily-ops-cartons-panel,
#tab-inventory #inventoryOpsTables > .daily-ops-scans-panel,
#tab-inventory #inventoryOpsTables > .daily-ops-sts-panel,
#tab-inventory #inventoryOpsTables > .daily-ops-eol-panel,
#tab-inventory #inventoryOpsTables > .daily-ops-obs-acc-panel {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Title bar — same colors as ITEM LOOKUP `#tab-inventory .inventory-snapshot-head` */
#tab-inventory .inventory-metrics-panel > .inventory-metrics-panel__head.inventory-snapshot-head {
  margin: -0.85rem -1rem 0;
  padding: 0.4rem 0.58rem;
  border-radius: calc(0.95rem - 1px) calc(0.95rem - 1px) 0 0;
  border: 0;
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
  background: rgba(234, 179, 8, 0.1);
  box-shadow: none;
  box-sizing: border-box;
}

/* Compliance tab — cyan snapshot strip */
.compliance-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

#tab-compliance .compliance-metrics-panel {
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 0.95rem;
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
  overflow: visible;
  margin: 0.85rem 0 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: block;
}

#tab-compliance .compliance-metrics-panel > .compliance-metrics-panel__head.inventory-snapshot-head {
  margin: -0.85rem -1rem 0;
  padding: 0.4rem 0.58rem;
  border-radius: calc(0.95rem - 1px) calc(0.95rem - 1px) 0 0;
  border: 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: none;
  box-sizing: border-box;
}

#tab-compliance .inventory-snapshot-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

#tab-compliance .inventory-snapshot-title-row h2 {
  margin: 0;
  flex: 0 1 auto;
  text-align: center;
  color: #38bdf8;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  display: flex;
  align-items: center;
  min-height: 1.65rem;
  height: 1.65rem;
  max-height: 1.65rem;
}

#tab-compliance .compliance-metrics-panel .inventory-snapshot-title-row > .inventory-table-kpi-icon {
  color: #38bdf8;
}

/* Tables mount: no outer `.panel` chrome — each ops table supplies its own panel border */
#tab-compliance .compliance-tables-mount {
  margin: 0.5rem 0 1rem;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}

#tab-compliance #complianceOpsTables {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#tab-compliance #complianceOpsTables > .daily-ops-ipog-panel,
#tab-compliance #complianceOpsTables > .daily-ops-da-panel,
#tab-compliance #complianceOpsTables > .daily-ops-scans-panel {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Compliance ops tiles — match `.compliance-metrics-panel` / snapshot cyan theme (not per-table purple/green/blue). */
#tab-compliance .compliance-tables-mount .daily-ops-ipog-panel,
#tab-compliance .compliance-tables-mount .daily-ops-da-panel,
#tab-compliance .compliance-tables-mount .daily-ops-scans-panel {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 0.95rem;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-head,
#tab-compliance .compliance-tables-mount .daily-ops-da-head,
#tab-compliance .compliance-tables-mount .daily-ops-scans-head {
  background: rgba(56, 189, 248, 0.1);
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-head > .inventory-table-kpi-icon,
#tab-compliance .compliance-tables-mount .daily-ops-da-head > .inventory-table-kpi-icon,
#tab-compliance .compliance-tables-mount .daily-ops-scans-head > .inventory-table-kpi-icon {
  color: #38bdf8;
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-head h3,
#tab-compliance .compliance-tables-mount .daily-ops-da-head h3,
#tab-compliance .compliance-tables-mount .daily-ops-scans-head h3 {
  color: #38bdf8;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-meta,
#tab-compliance .compliance-tables-mount .daily-ops-da-meta,
#tab-compliance .compliance-tables-mount .daily-ops-scans-meta {
  color: rgba(125, 211, 252, 0.72);
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-table-wrap,
#tab-compliance .compliance-tables-mount .daily-ops-da-table-wrap,
#tab-compliance .compliance-tables-mount .daily-ops-scans-table-wrap {
  scrollbar-color: rgba(56, 189, 248, 0.28) transparent;
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-table thead th,
#tab-compliance .compliance-tables-mount .daily-ops-da-table thead th,
#tab-compliance .compliance-tables-mount .daily-ops-scans-table thead th {
  background: rgba(8, 14, 26, 0.96);
  color: rgba(125, 211, 252, 0.74);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-table tbody tr,
#tab-compliance .compliance-tables-mount .daily-ops-da-table tbody tr,
#tab-compliance .compliance-tables-mount .daily-ops-scans-table tbody tr {
  border-bottom: 1px solid rgba(56, 189, 248, 0.07);
}

#tab-compliance .compliance-tables-mount .daily-ops-ipog-table tbody tr:hover,
#tab-compliance .compliance-tables-mount .daily-ops-da-table tbody tr:hover,
#tab-compliance .compliance-tables-mount .daily-ops-scans-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

#tab-compliance .compliance-tables-mount table[data-dops-sort-table] thead th.dops-sortable:hover {
  color: rgba(224, 242, 254, 0.95);
}

#tab-compliance .compliance-tables-mount .dops-sort-arrow {
  color: rgba(125, 211, 252, 0.92);
}

#tab-compliance .compliance-tables-mount .dops-table-expand-btn {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(125, 211, 252, 0.92);
}

#tab-compliance .compliance-tables-mount .dops-table-expand-btn:hover {
  border-color: rgba(125, 211, 252, 0.52);
  color: rgba(224, 242, 254, 0.98);
  background: rgba(56, 189, 248, 0.14);
}

#tab-compliance .compliance-tables-mount .table-pagination.dops-pagination {
  border-top-color: rgba(56, 189, 248, 0.14);
}

#tab-compliance .compliance-tables-mount .table-pagination.dops-pagination .table-pagination__range {
  color: rgba(125, 211, 252, 0.72);
}

#tab-compliance .compliance-tables-mount .table-pg__arrow:hover:not([disabled]) {
  color: rgba(224, 242, 254, 0.95);
  background: rgba(56, 189, 248, 0.12);
}

#tab-compliance .compliance-tables-mount .table-pg__num:hover:not(.is-active) {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

#tab-compliance .compliance-tables-mount .table-pg__num.is-active {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
}

/* Cash / Financials tab — green finance snapshot + ops tiles (Open Drawers, Product Notes). */
.cash-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

#tab-cash .cash-metrics-panel {
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(34, 197, 94, 0.26);
  border-radius: 0.95rem;
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
  overflow: visible;
  margin: 0.85rem 0 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: block;
}

#tab-cash .cash-metrics-panel > .cash-metrics-panel__head.inventory-snapshot-head {
  margin: -0.85rem -1rem 0;
  padding: 0.4rem 0.58rem;
  border-radius: calc(0.95rem - 1px) calc(0.95rem - 1px) 0 0;
  border: 0;
  border-bottom: 1px solid rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.12);
  box-shadow: none;
  box-sizing: border-box;
}

#tab-cash .cash-metrics-panel .inventory-snapshot-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

#tab-cash .cash-metrics-panel .inventory-snapshot-title-row h2 {
  margin: 0;
  flex: 0 1 auto;
  text-align: center;
  color: #4ade80;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  display: flex;
  align-items: center;
  min-height: 1.65rem;
  height: 1.65rem;
  max-height: 1.65rem;
}

#tab-cash .cash-metrics-panel .inventory-snapshot-title-row > .inventory-table-kpi-icon {
  color: #4ade80;
}

#tab-cash .cash-tables-mount {
  margin: 0.5rem 0 1rem;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}

#tab-cash #cashOpsTables {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#tab-cash #cashOpsTables > .daily-ops-drawers-panel,
#tab-cash #cashOpsTables > .daily-ops-prodnote-panel {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#tab-cash .cash-tables-mount > #cashOpsTables > .daily-ops-drawers-panel:first-child {
  margin-top: 0.35rem;
}

#tab-cash .cash-tables-mount .daily-ops-drawers-panel,
#tab-cash .cash-tables-mount .daily-ops-prodnote-panel {
  border: 1px solid rgba(34, 197, 94, 0.26);
  border-radius: 0.95rem;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
}

#tab-cash .cash-tables-mount .daily-ops-drawers-head {
  background: rgba(34, 197, 94, 0.12);
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
}

#tab-cash .cash-tables-mount .daily-ops-drawers-head h3 {
  color: #4ade80;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#tab-cash .cash-tables-mount .daily-ops-drawers-meta,
#tab-cash .cash-tables-mount .daily-ops-drawers-loading {
  color: rgba(167, 243, 208, 0.82);
}

#tab-cash .cash-tables-mount .daily-ops-drawers-table-wrap {
  scrollbar-color: rgba(34, 197, 94, 0.28) transparent;
}

#tab-cash .cash-tables-mount .daily-ops-drawers-table thead th {
  background: rgba(8, 22, 14, 0.96);
  color: rgba(167, 243, 208, 0.76);
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
}

#tab-cash .cash-tables-mount .daily-ops-drawers-table tbody tr {
  border-bottom: 1px solid rgba(34, 197, 94, 0.08);
}

#tab-cash .cash-tables-mount .daily-ops-drawers-table tbody tr:hover {
  background: rgba(34, 197, 94, 0.07);
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-head {
  background: rgba(34, 197, 94, 0.12);
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-head h3 {
  color: #4ade80;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-meta {
  color: rgba(167, 243, 208, 0.82);
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-table-wrap {
  scrollbar-color: rgba(34, 197, 94, 0.28) transparent;
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-table thead th {
  background: rgba(8, 22, 14, 0.96);
  color: rgba(167, 243, 208, 0.74);
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-table tbody tr {
  border-bottom: 1px solid rgba(34, 197, 94, 0.07);
}

#tab-cash .cash-tables-mount .daily-ops-prodnote-table tbody tr:hover {
  background: rgba(34, 197, 94, 0.06);
}

#tab-cash .cash-tables-mount table[data-dops-sort-table] thead th.dops-sortable:hover {
  color: rgba(236, 253, 245, 0.96);
}

#tab-cash .cash-tables-mount .dops-sort-arrow {
  color: rgba(167, 243, 208, 0.92);
}

#tab-cash .cash-tables-mount .dops-table-expand-btn {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(167, 243, 208, 0.92);
}

#tab-cash .cash-tables-mount .dops-table-expand-btn:hover {
  border-color: rgba(134, 239, 172, 0.48);
  color: rgba(236, 253, 245, 0.98);
  background: rgba(34, 197, 94, 0.14);
}

#tab-cash .cash-tables-mount .table-pagination.dops-pagination {
  border-top-color: rgba(34, 197, 94, 0.14);
}

#tab-cash .cash-tables-mount .table-pagination.dops-pagination .table-pagination__range {
  color: rgba(167, 243, 208, 0.72);
}

#tab-cash .cash-tables-mount .table-pg__arrow:hover:not([disabled]) {
  color: rgba(236, 253, 245, 0.95);
  background: rgba(34, 197, 94, 0.12);
}

#tab-cash .cash-tables-mount .table-pg__num:hover:not(.is-active) {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
}

#tab-cash .cash-tables-mount .table-pg__num.is-active {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.16);
  color: #ecfdf5;
}

/* Floated to document.body while open — escapes tab-pane layout containment / overflow clipping */
#topbarPeriodDropdownPanel.inventory-period-dropdown-panel--floating {
  position: fixed !important;
  z-index: 10050;
  top: auto;
  right: auto;
  margin: 0;
}

/* Uses ID so styles apply when the panel is reparented under document.body — theme matches `.topbar-store-popover` */
#topbarPeriodDropdownPanel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  width: min(20.5rem, calc(100vw - 2rem));
  max-height: min(70vh, 26rem);
  display: flex;
  flex-direction: column;
  padding: 0.95rem 1rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(20, 25, 38, 0.98);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  color: var(--text-primary);
  font-size: 0.8rem;
  transform-origin: top center;
  animation: topbarStorePopIn 0.16s ease-out;
}

#topbarPeriodDropdownPanel[hidden] {
  display: none !important;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-section-label {
  margin-bottom: 0;
}

#topbarPeriodDropdownPanel .inventory-period-grain-select--panel {
  width: 100%;
  max-width: none;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner .inventory-period-anchor {
  flex-direction: column;
  align-items: stretch;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner .inventory-period-anchor .inventory-snapshot-date-label {
  align-self: flex-start;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner .inventory-snapshot-date-input,
#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner .inventory-period-number-input,
#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner .inventory-period-quarter-select {
  max-width: none;
  width: 100%;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-panel-inner .inventory-period-days-hint {
  text-align: left;
}

#topbarPeriodDropdownPanel .inventory-period-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Simplified picker: preset buttons in a 2-up grid + a From–To range row. */
#topbarPeriodDropdownPanel .inventory-period-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

#topbarPeriodDropdownPanel .inventory-period-preset-grid .inventory-period-quick-pill {
  justify-content: center;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
}

#topbarPeriodDropdownPanel .inventory-period-preset-grid .inventory-period-quick-pill:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.14);
}

#topbarPeriodDropdownPanel .inventory-period-range-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

#topbarPeriodDropdownPanel .inventory-period-range-row .inventory-snapshot-date-input {
  flex: 1 1 0;
  min-width: 0;
}

#topbarPeriodDropdownPanel .inventory-period-range-sep {
  flex: 0 0 auto;
  color: #94a3b8;
  font-weight: 700;
}

#topbarPeriodDropdownPanel .inventory-period-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(13, 17, 27, 0.7);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  user-select: none;
}

#topbarPeriodDropdownPanel .inventory-period-quick-pill input {
  margin: 0;
  flex-shrink: 0;
  accent-color: rgb(99, 102, 241);
}

#topbarPeriodDropdownPanel .inventory-period-quick-pill:has(input:checked) {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.14);
  color: var(--text-primary);
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-footer {
  flex-shrink: 0;
  padding-top: 0.55rem;
  margin-top: 0.3rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

#topbarPeriodDropdownPanel .inventory-period-dropdown-footer-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#topbarPeriodDropdownPanel .inventory-period-apply-error {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fca5a5;
  line-height: 1.35;
}

#topbarPeriodDropdownPanel .inventory-period-footer-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  min-height: 1.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-sizing: border-box;
}

#topbarPeriodDropdownPanel .inventory-period-footer-btn--ghost {
  background: rgba(13, 17, 27, 0.7);
  color: var(--text-secondary);
}

#topbarPeriodDropdownPanel .inventory-period-footer-btn--ghost:hover {
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.4);
}

#topbarPeriodDropdownPanel .inventory-period-footer-btn--primary {
  background: rgba(99, 102, 241, 0.32);
  border-color: rgba(99, 102, 241, 0.6);
  color: #fff;
}

#topbarPeriodDropdownPanel .inventory-period-footer-btn--primary:hover {
  background: rgba(99, 102, 241, 0.45);
}

#topbarPeriodDropdownPanel .inventory-period-anchor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

#topbarPeriodDropdownPanel .inventory-period-anchor--days {
  flex-basis: 100%;
  justify-content: flex-end;
}

#topbarPeriodDropdownPanel .inventory-period-days-hint {
  flex-basis: 100%;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

#topbarPeriodDropdownPanel .inventory-days-extra-input {
  min-width: 12rem;
  max-width: min(28rem, 100%);
}

#topbarPeriodDropdownPanel .inventory-period-grain-select,
#topbarPeriodDropdownPanel .inventory-period-quarter-select {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(13, 17, 27, 0.85);
  color: var(--text-primary);
  font-size: 0.8rem;
  box-sizing: border-box;
}

#topbarPeriodDropdownPanel .inventory-period-number-input {
  max-width: 6rem;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(13, 17, 27, 0.85);
  color: var(--text-primary);
  font-size: 0.8rem;
  box-sizing: border-box;
}

#topbarPeriodDropdownPanel .inventory-period-grain-select:focus-visible,
#topbarPeriodDropdownPanel .inventory-period-quarter-select:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
}

#topbarPeriodDropdownPanel .inventory-snapshot-date-input {
  min-height: 2rem;
  max-width: 11rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(13, 17, 27, 0.85);
  color: var(--text-primary);
  font-size: 0.8rem;
  box-sizing: border-box;
}

#topbarPeriodDropdownPanel .inventory-snapshot-date-input:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
}

/* Overrides global `.inventory-snapshot-date-label` amber — align with store popover labels */
#topbarPeriodDropdownPanel .inventory-snapshot-date-label,
#topbarPeriodDropdownPanel .inventory-period-dropdown-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

#topbarPeriodDropdownPanel .inventory-period-number-input:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
}

.inventory-snapshot-date-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(253, 224, 71, 0.88);
  white-space: nowrap;
}

#tab-inventory .inventory-kpi-card {

  color: #eab308;
  border-color: rgba(234, 179, 8, 0.2);
  background:
    radial-gradient(circle at 18% 0%, rgba(234, 179, 8, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(18, 24, 34, 0.96), rgba(13, 18, 30, 0.98));
  box-shadow: 0 12px 34px rgba(2, 6, 23, 0.2);
}

#tab-inventory .inventory-kpi-card[data-inv-kpi-scroll]:hover,
#tab-inventory #invKpiItemLookupTrigger.inventory-kpi-card:hover {

  border-color: rgba(234, 179, 8, 0.42);
  box-shadow: 0 14px 40px rgba(234, 179, 8, 0.1);
}

#tab-inventory .inventory-kpi-card strong {
  color: rgba(254, 243, 230, 0.98);
}

/* Inventory snapshot tiles: title strip + row (icon | metric) */
#tab-inventory .inventory-metrics-panel .inventory-kpi-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  gap: 0;
}

#tab-inventory .inventory-metrics-panel .inventory-kpi-card__head {
  flex-shrink: 0;
  padding: 0.32rem 0.55rem;
  font: 800 0.62rem / 1.2 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: #eab308;
  background: rgba(234, 179, 8, 0.1);
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-inventory .inventory-metrics-panel .inventory-kpi-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.72rem 0.62rem;
  min-height: 0;
  box-sizing: border-box;
}

#tab-inventory .inventory-metrics-panel .inventory-kpi-card__body.inventory-kpi-card__body--lookup-only {
  justify-content: center;
}

#tab-inventory .inventory-metrics-panel .inventory-kpi-card__metric {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#tab-inventory .inventory-metrics-panel .inventory-kpi-card__metric strong {
  margin-top: 0;
}

#tab-inventory .inventory-metrics-panel .inventory-kpi-card__body > .inventory-kpi-icon {
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-wide .inventory-kpi-card__head,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-tall .inventory-kpi-card__head {
  font-size: 0.65rem;
  padding: 0.3rem 0.55rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-wide .inventory-kpi-card__body {
  padding: 0.52rem 0.78rem 0.58rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-tall .inventory-kpi-card__body {
  padding: 0.58rem 0.82rem 0.62rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-compact-tile .inventory-kpi-card__head {
  font-size: 0.48rem;
  padding: 0.22rem 0.34rem;
  letter-spacing: 0.04em;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-compact-tile .inventory-kpi-card__body {
  padding: 0.26rem 0.36rem 0.34rem;
  gap: 0.32rem;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-wide .inventory-kpi-card__body,
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow .inventory-kpi-card__body,
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup .inventory-kpi-card__body {
  padding: 0.42rem 0.65rem 0.48rem;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-wide .inventory-kpi-card__head,
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow .inventory-kpi-card__head,
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup .inventory-kpi-card__head {
  font-size: 0.56rem;
  padding: 0.28rem 0.5rem;
}

/* Inventory KPI grid: row 1 = heroes; row 2 = four compacts; row 3 = in transit + delivered + item lookup (4+4+4 cols) */
#tab-inventory .inventory-kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.42rem;
  width: 100%;
  justify-items: stretch;
  align-items: stretch;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-hero-wide {
  grid-column: 1 / span 7;
  grid-row: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 6.15rem;
  height: auto;
  max-height: none;
  justify-self: stretch;
  align-self: stretch;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-hero-tall {
  grid-column: 8 / span 5;
  grid-row: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 6.35rem;
  height: auto;
  max-height: none;
  justify-self: stretch;
  align-self: stretch;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile {
  grid-row: 2;
  justify-self: stretch;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(3) {
  grid-column: 1 / span 3;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(4) {
  grid-column: 4 / span 3;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(5) {
  grid-column: 7 / span 3;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(6) {
  grid-column: 10 / span 3;
}

/* Compact row: tiles fill grid tracks — gaps match hero row */
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile.inventory-kpi-card--metric-square {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 5rem;
  height: auto;
  aspect-ratio: unset;
  max-height: none;
  justify-self: stretch;
  align-self: start;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-compact-tile .inventory-kpi-card__metric strong {
  font-size: 0.98rem;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-wide,
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow,
#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup {
  min-height: 0;
  padding: 0;
  align-items: stretch;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-wide {
  grid-column: 1 / span 4;
  grid-row: 3;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  max-height: none;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow {
  grid-column: 5 / span 4;
  grid-row: 3;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  max-height: none;
}

#tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup {
  grid-column: 9 / span 4;
  grid-row: 3;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  max-height: none;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-wide::after,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-tall::after,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-wide::after,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow::after,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup::after {
  display: none;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-wide .inventory-kpi-icon,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-tall .inventory-kpi-icon {
  width: 1.68rem;
  height: 1.68rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-wide .inventory-kpi-icon svg,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-tall .inventory-kpi-icon svg {
  width: 1.02rem;
  height: 1.02rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-wide strong,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-hero-tall strong {
  font-size: 1.48rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-wide .inventory-kpi-icon,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow .inventory-kpi-icon,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup .inventory-kpi-icon {
  width: 1.55rem;
  height: 1.55rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-wide .inventory-kpi-icon svg,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow .inventory-kpi-icon svg,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup .inventory-kpi-icon svg {
  width: 0.92rem;
  height: 0.92rem;
}

#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-wide strong,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow strong,
#tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup strong {
  margin-top: 0;
  font-size: 1.28rem;
  line-height: 1;
}

@media (max-width: 900px) {
  /* Keep Outstanding shrink + Cartons on one shared row */
  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-hero-wide {
    grid-column: 1 / span 6;
    grid-row: 1;
    min-height: 5.85rem;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-hero-tall {
    grid-column: 7 / span 6;
    grid-row: 1;
    min-height: 5.85rem;
  }

  /* Four compact KPIs — one row (3 cols each) */
  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(3) {
    grid-column: 1 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(4) {
    grid-column: 4 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(5) {
    grid-column: 7 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(6) {
    grid-column: 10 / span 3;
    grid-row: 2;
  }

  /* In transit + Delivered + Item lookup — one row (4+4+4) */
  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-wide {
    grid-column: 1 / span 4;
    grid-row: 3;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow {
    grid-column: 5 / span 4;
    grid-row: 3;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup {
    grid-column: 9 / span 4;
    grid-row: 3;
  }
}

@media (max-width: 520px) {
  /* Maintain 12 columns so heroes + four compacts stay aligned one row each */
  #tab-inventory .inventory-kpi-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-hero-wide {
    grid-column: 1 / span 6;
    grid-row: 1;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-hero-tall {
    grid-column: 7 / span 6;
    grid-row: 1;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(3) {
    grid-column: 1 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(4) {
    grid-column: 4 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(5) {
    grid-column: 7 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-compact-tile:nth-child(6) {
    grid-column: 10 / span 3;
    grid-row: 2;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-wide {
    grid-column: 1 / span 4;
    grid-row: 3;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-narrow {
    grid-column: 5 / span 4;
    grid-row: 3;
  }

  #tab-inventory .inventory-kpi-grid > .inventory-kpi-card.inventory-kpi-card--inv-transport-lookup {
    grid-column: 9 / span 4;
    grid-row: 3;
  }

  #tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-compact-tile .inventory-kpi-card__head {
    font-size: 0.48rem;
  }

  #tab-inventory .inventory-kpi-card.inventory-kpi-card--inv-compact-tile .inventory-kpi-card__metric strong {
    font-size: 0.95rem;
  }
}

/* IN TRANSIT / DELIVERED — single card with carousel panes */
#tab-inventory #inventory-transport-carousel.inventory-transport-carousel {

  position: relative;
  border-radius: 0.95rem;
  border: 1px solid rgba(234, 179, 8, 0.18);
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.2);
  overflow: hidden;
}

#tab-inventory .inventory-transport-carousel__shared-head.inventory-snapshot-head {

  position: relative;
  border-bottom-color: rgba(234, 179, 8, 0.18);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.38rem;
  padding: 0.4rem 0.58rem;
  box-sizing: border-box;
}

#tab-inventory .inventory-transport-carousel__lead {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.38rem;
  min-width: 0;
}

#tab-inventory .inventory-transport-carousel-stamp-cell {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 11rem;
  min-height: 2.25rem;
}

/* The Updated value now lives in the table's leftmost column, so the carousel
   head's own updated stamp (mobile In Transit / Delivered) is redundant.
   Higher specificity than the rule above re-showing it. */
#tab-inventory .inventory-transport-carousel-stamp-cell {
  display: none !important;
}

#tab-inventory .inventory-transport-carousel-stamp-cell:not([hidden]) {
  min-width: 8.75rem;
}

#tab-inventory .inventory-transport-carousel-stamp-cell .dops-table-updated-at {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  max-width: 100%;
}

#tab-inventory .inventory-transport-carousel__pane.inventory-snapshot-panel {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-width: 0;
}

/* Fullscreen transport pane: restore gold panel chrome (carousel layout clears border/bg on panes). */
#tab-inventory .inventory-transport-carousel__pane.inventory-snapshot-panel.inventory-snapshot-panel--fullscreen {
  display: flex !important;
  flex-direction: column;
  border: 1px solid rgba(234, 179, 8, 0.18);
  border-radius: 1rem;
  background: rgba(13, 18, 30, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

/* Daily Ops–style title strip for fullscreen transport only (inline carousel keeps shared head). */
#tab-inventory .inventory-fs-popout-head {
  display: none;
}

/* Fullscreen transport: × left; title centered in flexible middle; updated stamp right */
#tab-inventory .inventory-snapshot-panel.inventory-snapshot-panel--fullscreen .inventory-fs-popout-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.45rem;
  flex-shrink: 0;
  min-height: calc(0.4rem * 2 + 1.85rem);
  padding-left: calc(max(0px, env(safe-area-inset-left, 0px)) + var(--inventory-fullscreen-x-inset));
  padding-right: 3.25rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

/* Close column */
#tab-inventory .inventory-snapshot-panel.inventory-snapshot-panel--fullscreen .inventory-fs-popout-head > .daily-ops-head-actions {
  grid-column: 1;
  justify-self: start;
}

/* Title cluster visually centered in the bar */
#tab-inventory .inventory-fs-popout-head > .inventory-popout-title-cluster {
  grid-column: 2;
  justify-self: center;
}

/* Last updated chip — right column */
#tab-inventory .inventory-snapshot-panel.inventory-snapshot-panel--fullscreen .inventory-fs-popout-head > .dops-table-updated-at--fullscreen-transport {
  grid-column: 3;
  justify-self: end;
  position: static;
  transform: none;
  top: auto;
  left: auto;
  align-items: flex-end;
  text-align: right;
}

#tab-inventory .inventory-snapshot-panel--fullscreen .inventory-fs-popout-head .inventory-popout-title-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
}

#tab-inventory .inventory-snapshot-panel--fullscreen .inventory-fs-popout-head .inventory-popout-title-cluster > h3 {
  display: flex;
  align-items: center;
  line-height: 1;
}

#tab-inventory .inventory-snapshot-panel--fullscreen .inventory-fs-popout-head > .daily-ops-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
  min-height: 1.85rem;
  gap: 0.35rem;
}

#tab-inventory #inv-panel-in-transit .inventory-table-wrap,
#tab-inventory #inv-panel-delivered .inventory-table-wrap {
  min-width: 0;
}

/* Tracking # column appears only when pane is fullscreen (compact carousel stays five columns). */
#tab-inventory #inv-panel-in-transit .inventory-table thead .inventory-col-fs-only,
#tab-inventory #inv-panel-in-transit .inventory-table tbody .inventory-col-fs-only,
#tab-inventory #inv-panel-delivered .inventory-table thead .inventory-col-fs-only,
#tab-inventory #inv-panel-delivered .inventory-table tbody .inventory-col-fs-only {
  display: none;
}

#tab-inventory #inv-panel-in-transit.inventory-snapshot-panel--fullscreen .inventory-table thead .inventory-col-fs-only,
#tab-inventory #inv-panel-in-transit.inventory-snapshot-panel--fullscreen .inventory-table tbody .inventory-col-fs-only,
#tab-inventory #inv-panel-delivered.inventory-snapshot-panel--fullscreen .inventory-table thead .inventory-col-fs-only,
#tab-inventory #inv-panel-delivered.inventory-snapshot-panel--fullscreen .inventory-table tbody .inventory-col-fs-only {
  display: table-cell;
}

#tab-inventory .inventory-transport-carousel__pane:not(.is-active) {
  display: none;
}

#tab-inventory .inventory-transport-carousel__title-slot {
  position: relative;
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  width: max-content;
  min-height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none;
}

#tab-inventory .inventory-transport-carousel__title-slot > * {
  pointer-events: auto;
}

/* Icon + title centered as a cluster in the middle column */
#tab-inventory .inventory-transport-carousel__title.inventory-snapshot-title-row {
  position: relative;
  margin: 0;
  width: auto;
  max-width: 100%;
  font-size: 0.78rem;
  line-height: 1;
  min-height: 1.65rem;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding-left: 0;
  box-sizing: border-box;
}

#tab-inventory .inventory-transport-carousel__title.inventory-snapshot-title-row:not(.is-active-title) {
  display: none;
}

#tab-inventory .inventory-transport-carousel__title .inventory-table-kpi-icon {
  position: static;
  transform: none;
  flex-shrink: 0;
  width: 1.35em;
  height: 1.35em;
  min-width: 1.35em;
  min-height: 1.35em;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#tab-inventory .inventory-transport-carousel__title .inventory-table-kpi-icon svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
  flex-shrink: 0;
}

/* Match `#tab-inventory … inventory-tool-btn--icon` (fullscreen/export): 1.65rem square like carousel arrows */
#tab-inventory .inventory-transport-carousel__arrow {

  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

#tab-inventory .inventory-transport-carousel__arrow:hover:not(:disabled) {

  border-color: rgba(234, 179, 8, 0.38);
  color: #fde047;
  background: rgba(234, 179, 8, 0.14);
}

#tab-inventory .inventory-transport-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#tab-inventory .inventory-toolbar--transport-carousel {
  flex-shrink: 0;
  grid-column: 3;
  justify-self: end;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.38rem;
}

#tab-inventory .inventory-toolbar--transport-carousel .inventory-tool-btn--icon {
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
}

#tab-inventory .inventory-snapshot-head {

  background: rgba(234, 179, 8, 0.1);
  border-bottom-color: rgba(234, 179, 8, 0.18);
  padding: 0.4rem 0.58rem;
  box-sizing: border-box;
}

/* Inventory tab — Daily Ops–style table heads: bar height matches In transit carousel (~2.45rem) */
#tab-inventory .daily-ops-shrink-head,
#tab-inventory .daily-ops-cartons-head,
#tab-inventory .daily-ops-nonsellable-head,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head,
#tab-inventory .daily-ops-sts-head,
#tab-inventory .daily-ops-eol-head,
#tab-inventory .daily-ops-obs-acc-head,
#tab-inventory .inventory-fs-popout-head {
  padding: 0.4rem 3.25rem;
}

#tab-inventory .daily-ops-shrink-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-cartons-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-nonsellable-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-sts-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-eol-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-obs-acc-head > .inventory-table-kpi-icon,
#tab-inventory .inventory-fs-popout-head .inventory-popout-title-cluster > .inventory-table-kpi-icon {
  width: 1.65rem;
  height: 1.65rem;
}

#tab-inventory .daily-ops-shrink-head > h3,
#tab-inventory .daily-ops-cartons-head > h3,
#tab-inventory .daily-ops-nonsellable-head > h3,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > h3,
#tab-inventory .daily-ops-sts-head > h3,
#tab-inventory .daily-ops-eol-head > h3,
#tab-inventory .daily-ops-obs-acc-head > h3 {
  min-height: 1.65rem;
}

#tab-inventory .inventory-fs-popout-head .inventory-popout-title-cluster > h3 {
  min-height: 1.65rem;
  margin: 0;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}

/* Inventory / Compliance / Cash: snapshot title centered on the bar (period control moved to top bar) */
#tab-inventory .inventory-snapshot-head.inventory-snapshot-head--title-centered,
#tab-compliance .inventory-snapshot-head.inventory-snapshot-head--title-centered,
#tab-cash .inventory-snapshot-head.inventory-snapshot-head--title-centered {
  display: flex;
  justify-content: center;
  align-items: center;
}

#tab-inventory .inventory-snapshot-head--title-centered .inventory-snapshot-title-cluster,
#tab-compliance .inventory-snapshot-head--title-centered .inventory-snapshot-title-cluster,
#tab-cash .inventory-snapshot-head--title-centered .inventory-snapshot-title-cluster {
  min-width: 0;
}

#tab-inventory .inventory-snapshot-head--title-centered .inventory-snapshot-title-row > .inventory-table-kpi-icon,
#tab-compliance .inventory-snapshot-head--title-centered .inventory-snapshot-title-row > .inventory-table-kpi-icon,
#tab-cash .inventory-snapshot-head--title-centered .inventory-snapshot-title-row > .inventory-table-kpi-icon {
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#tab-inventory .inventory-snapshot-head--title-centered .inventory-snapshot-title-row h2,
#tab-compliance .inventory-snapshot-head--title-centered .inventory-snapshot-title-row h2,
#tab-cash .inventory-snapshot-head--title-centered .inventory-snapshot-title-row h2 {
  margin: 0;
}

#tab-inventory .inventory-snapshot-head h2 {

  color: #eab308;
}

#tab-inventory .inventory-snapshot-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

#tab-inventory .inventory-snapshot-title-row h2 {

  margin: 0;
  flex: 0 1 auto;
  text-align: center;
  color: #eab308;
  /* Bar height matches In transit carousel title row (~1.65rem) */
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  display: flex;
  align-items: center;
  min-height: 1.65rem;
  height: 1.65rem;
  max-height: 1.65rem;
}

#tab-inventory .inventory-transport-carousel__title.inventory-snapshot-title-row h2 {
  flex: 0 1 auto;
  margin: 0;
  padding: 0;
  text-align: center;
  font: 800 1em / 1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

#tab-inventory .inventory-toolbar--transport-carousel .inventory-tool-btn--icon.inventory-transport-title-export {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
}

#tab-inventory .inventory-toolbar--transport-carousel .inventory-tool-btn--icon.inventory-transport-title-export:hover {
  border-color: rgba(234, 179, 8, 0.38);
  color: #fde047;
  background: rgba(234, 179, 8, 0.14);
}

#tab-inventory .inventory-snapshot-title-row > .inventory-table-kpi-icon {

  color: #eab308;
}

/* A pane's inline fullscreen-open button never shows while that pane IS
   fullscreen (the popout head swaps to the × close button instead). */
.inventory-snapshot-panel--fullscreen .inventory-fs-open-btn {
  display: none;
}

/* ── Desktop (≥1024px): show In Transit + Delivered side by side instead of the
   one-at-a-time carousel, and split the unified header into one bar per table.
   The shared carousel head is hidden; each pane shows its own
   `.inventory-fs-popout-head` (the bar fullscreen mode already uses) laid out
   as: Updated stamp (left) | title (center) | CSV export + fullscreen (right).
   Below 1024px the carousel (one table + ‹ › arrows + shared bar) is kept. ── */
@media (min-width: 1024px) {
  /* Both tables, side by side. Stretch = both cards share the row height
     (the shorter table's card matches the taller one). */
  #tab-inventory .inventory-transport-carousel__panes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    align-items: stretch;
  }
  #tab-inventory .inventory-transport-carousel__pane.inventory-snapshot-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  /* The table area absorbs the extra height so the footer/pagination stays
     pinned to the card bottom in the shorter table. */
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-table-wrap {
    flex: 1 1 auto;
  }
  /* Re-show the pane the carousel hides (but leave the fullscreen overlay alone). */
  #tab-inventory .inventory-transport-carousel__pane:not(.is-active):not(.inventory-snapshot-panel--fullscreen) {
    display: flex;
  }

  /* The unified bar belongs to the carousel — hide it on desktop. */
  #tab-inventory .inventory-transport-carousel__shared-head.inventory-snapshot-head {
    display: none;
  }

  /* Per-pane title bar (inline only — fullscreen keeps its own layout). */
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-fs-popout-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.45rem;
    min-height: calc(0.4rem * 2 + 1.85rem);
  }
  /* DOM order is actions, title, stamp — place stamp left, title center, actions right. */
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-fs-popout-head > .dops-table-updated-at--fullscreen-transport {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
    /* base .dops-table-updated-at is absolutely positioned — restore flow for the grid cell */
    position: static;
    transform: none;
    left: auto;
    top: auto;
  }
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-fs-popout-head > .inventory-popout-title-cluster {
    grid-row: 1;
    grid-column: 2;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
  }
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-fs-popout-head > .daily-ops-head-actions {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
  }
  /* Inline bars get export + expand; the × close is fullscreen-only. */
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-fullscreen-close {
    display: none;
  }
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) .inventory-fs-popout-head .inventory-tool-btn--icon {
    width: 1.65rem;
    height: 1.65rem;
    min-width: 1.65rem;
  }
  /* Round each split table into its own card (clips the navy header top and
     the footer/pagination bottom). 16px = the app-wide table radius. */
  #tab-inventory .inventory-transport-carousel__pane:not(.inventory-snapshot-panel--fullscreen) {
    border-radius: 16px;
    overflow: hidden;
  }
}

/* App-wide polish: round the tables that aren't already rounded by their card.
   (Daily-Ops panels, ARIT, Archway, Treasury, Item Lookup already clip.) The
   wraps below sit at the bottom of an already-rounded panel and have their own
   overflow, so rounding their bottom corners matches them to the card
   (16px = the unified table radius in theme-alliance.css). */
.events-table-wrap,
.tasks-table-wrap {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

#tab-inventory .inventory-toolbar select,
#tab-inventory .inventory-search input {

  border-color: rgba(234, 179, 8, 0.2);
}

/* IN TRANSIT / DELIVERED — tile toolbar matches carousel control size */
#tab-inventory .inventory-toolbar--tile-actions .inventory-tool-btn--icon {

  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  border-radius: var(--radius-sm);
  border-color: rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
}

#tab-inventory .inventory-toolbar--tile-actions .inventory-tool-btn--icon:hover {

  border-color: rgba(234, 179, 8, 0.38);
  color: #fde047;
  background: rgba(234, 179, 8, 0.14);
}

#tab-inventory .inventory-tool-btn:hover,
#tab-inventory .inventory-workbook-btn:hover {

  border-color: rgba(234, 179, 8, 0.35);
  color: #fef9c3;
  background: rgba(234, 179, 8, 0.1);
}

#tab-inventory .inventory-table-wrap {
  background: rgba(2, 12, 24, 0.22);
}

#tab-inventory .inventory-table thead {

  background: rgba(32, 28, 8, 0.95);
}

#tab-inventory .inventory-table th {

  color: rgba(253, 224, 71, 0.7);
  border-bottom-color: rgba(234, 179, 8, 0.15);
}

#tab-inventory .inventory-table th:not(:last-child)::after {

  background: rgba(234, 179, 8, 0.18);
}

#tab-inventory .inventory-filter-btn:hover,
#tab-inventory .inventory-filter-btn.active {

  color: rgba(253, 224, 71, 0.95);
}

#tab-inventory .inventory-filter-btn.active::after {

  color: #eab308;
}

#tab-inventory .inventory-sort-btn {

  border-color: rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: rgba(253, 224, 71, 0.75);
}

#tab-inventory .inventory-sort-btn:hover,
#tab-inventory .inventory-sort-btn.active {

  color: #0c0a03;
  background: #eab308;
  border-color: #eab308;
}

#tab-inventory .inventory-sort-btn:focus-visible {

  outline-color: #eab308;
}

#tab-inventory .inventory-filter-menu {

  border-color: rgba(234, 179, 8, 0.22);
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.42);
}

#tab-inventory .inventory-filter-search {

  border-color: rgba(234, 179, 8, 0.18);
}

#tab-inventory .inventory-filter-menu-actions button {

  border-color: rgba(234, 179, 8, 0.18);
}

#tab-inventory .inventory-filter-menu-actions button:hover {

  border-color: rgba(234, 179, 8, 0.35);
  color: rgba(253, 224, 71, 0.9);
}

#tab-inventory .inventory-table td {

  border-bottom-color: rgba(234, 179, 8, 0.06);
}

#tab-inventory .inventory-table tbody tr:hover td {

  background: rgba(234, 179, 8, 0.05);
}

#tab-inventory .inventory-table tbody tr.inventory-row-clickable:hover,
#tab-inventory .inventory-table tbody tr.inventory-row-clickable:focus-visible {

  background: rgba(234, 179, 8, 0.06);
}

#tab-inventory .inv-tracking-link {

  color: #eab308;
}

#tab-inventory .inv-tracking-link:hover {

  color: #fde047;
  border-color: currentColor;
}

#tab-inventory .inventory-footer {

  border-top: 1px solid rgba(234, 179, 8, 0.12);
}

#tab-inventory .inventory-footer--stacked-pager {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

#tab-inventory .inventory-footer--stacked-pager .inventory-pagination {
  flex: 0 0 auto;
  width: 100%;
  justify-content: center;
}

#tab-inventory .inventory-footer--stacked-pager .inventory-pagination .table-pagination.table-pagination--stacked-range {
  width: 100%;
  justify-content: center;
}

#tab-inventory .inventory-footer--stacked-pager #invCount:not([hidden]),
#tab-inventory .inventory-footer--stacked-pager #deliveredCount:not([hidden]) {
  text-align: center;
  width: 100%;
  margin-bottom: 0.12rem;
}

#tab-inventory #inv-panel-in-transit .table-pagination--stacked-range .table-pagination__range,
#tab-inventory #inv-panel-delivered .table-pagination--stacked-range .table-pagination__range {
  /* Match the table below: Alliance navy (header gradient + pager arrows). */
  color: var(--alliance-primary);
}

/* In-transit + Delivered carousel tables: sort style matches Outstanding Shrink (clickable label + ▲/▼) */
#inv-panel-in-transit .inventory-dops-col-head,
#inv-panel-delivered .inventory-dops-col-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  position: relative;
  width: 100%;
  flex-wrap: nowrap;
  min-height: 0.92rem;
}

#inv-panel-in-transit .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-dops-sort-trigger {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.08rem;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: 700 0.58rem var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

#inv-panel-in-transit .inventory-dops-sort-trigger:hover,
#inv-panel-delivered .inventory-dops-sort-trigger:hover {
  color: rgba(253, 224, 71, 0.95);
}

#inv-panel-in-transit .inventory-dops-sort-trigger:focus-visible,
#inv-panel-delivered .inventory-dops-sort-trigger:focus-visible {
  outline: 2px solid #eab308;
  outline-offset: 2px;
}

#inv-panel-in-transit .inventory-dops-sort-trigger .dops-sort-arrow,
#inv-panel-delivered .inventory-dops-sort-trigger .dops-sort-arrow {
  font-size: 0.7em;
  color: #fff;
  margin-left: 0.08em;
}

#inv-panel-in-transit .inventory-dops-sort-label,
#inv-panel-delivered .inventory-dops-sort-label {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}



/* In transit + delivered: Updated, OPUS ID, Store, Carton #, … — column widths from cell content (table-layout: auto). Indices are +1 for the leftmost Updated column. */
#inv-panel-in-transit .inventory-table th:nth-child(2),
#inv-panel-in-transit .inventory-table td:nth-child(2),
#inv-panel-delivered .inventory-table th:nth-child(2),
#inv-panel-delivered .inventory-table td:nth-child(2) {
  width: 0;
  white-space: nowrap;
  text-align: left;
}

#inv-panel-in-transit .inventory-table th:nth-child(2) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(2) .inventory-dops-col-head {
  width: auto;
  max-width: max-content;
}

#inv-panel-in-transit .inventory-table th:nth-child(2) .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-table th:nth-child(2) .inventory-dops-sort-trigger {
  flex: 0 0 auto;
}

#inv-panel-in-transit .inventory-table th:nth-child(3),
#inv-panel-in-transit .inventory-table td:nth-child(3),
#inv-panel-delivered .inventory-table th:nth-child(3),
#inv-panel-delivered .inventory-table td:nth-child(3) {
  text-align: left;
}

#inv-panel-in-transit .inventory-table th:nth-child(2) .inventory-dops-col-head,
#inv-panel-in-transit .inventory-table th:nth-child(3) .inventory-dops-col-head,
#inv-panel-in-transit .inventory-table th:nth-child(4) .inventory-dops-col-head,
#inv-panel-in-transit .inventory-table th:nth-child(5) .inventory-dops-col-head,
#inv-panel-in-transit .inventory-table th:nth-child(6) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(2) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(3) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(4) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(5) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(6) .inventory-dops-col-head {
  justify-content: flex-start;
}

#inv-panel-in-transit .inventory-table th:nth-child(2) .inventory-dops-sort-trigger,
#inv-panel-in-transit .inventory-table th:nth-child(3) .inventory-dops-sort-trigger,
#inv-panel-in-transit .inventory-table th:nth-child(4) .inventory-dops-sort-trigger,
#inv-panel-in-transit .inventory-table th:nth-child(6) .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-table th:nth-child(2) .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-table th:nth-child(3) .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-table th:nth-child(4) .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-table th:nth-child(6) .inventory-dops-sort-trigger {
  justify-content: flex-start;
}

#inv-panel-in-transit .inventory-table thead th:nth-child(3).inv-th-store,
#inv-panel-in-transit .inventory-table tbody td:nth-child(3).inv-store,
#inv-panel-delivered .inventory-table thead th:nth-child(3).inv-th-store,
#inv-panel-delivered .inventory-table tbody td:nth-child(3).inv-store {
  text-align: left;
}

#inv-panel-in-transit .inventory-table th:nth-child(4),
#inv-panel-in-transit .inventory-table td:nth-child(4),
#inv-panel-delivered .inventory-table th:nth-child(4),
#inv-panel-delivered .inventory-table td:nth-child(4) {
  text-align: left;
}

#inv-panel-in-transit .inventory-table th:nth-child(5),
#inv-panel-in-transit .inventory-table td:nth-child(5),
#inv-panel-delivered .inventory-table th:nth-child(5),
#inv-panel-delivered .inventory-table td:nth-child(5) {
  white-space: nowrap;
  text-align: center;
}

#inv-panel-in-transit .inventory-table th:nth-child(5) .inventory-dops-col-head,
#inv-panel-in-transit .inventory-table th:nth-child(5) .inventory-dops-sort-trigger,
#inv-panel-delivered .inventory-table th:nth-child(5) .inventory-dops-col-head,
#inv-panel-delivered .inventory-table th:nth-child(5) .inventory-dops-sort-trigger {
  justify-content: center;
}

#inv-panel-in-transit .inventory-table th:nth-child(6),
#inv-panel-in-transit .inventory-table td:nth-child(6),
#inv-panel-delivered .inventory-table th:nth-child(6),
#inv-panel-delivered .inventory-table td:nth-child(6) {
  white-space: nowrap;
  text-align: left;
}


/* Leftmost "Updated" column (table-level last-updated, repeated per row) */
#inv-panel-in-transit .inventory-table .inv-th-updated,
#inv-panel-delivered .inventory-table .inv-th-updated,
#inv-panel-in-transit .inventory-table .inv-td-updated,
#inv-panel-delivered .inventory-table .inv-td-updated {
  width: 0;
  white-space: nowrap;
  text-align: left;
}
#inv-panel-in-transit .inventory-table .inv-td-updated,
#inv-panel-delivered .inventory-table .inv-td-updated {
  font-size: 0.64rem;
  color: var(--text-muted);
}

/* In transit / Delivered — tighter cell + header spacing */
#inv-panel-in-transit .inventory-table,
#inv-panel-delivered .inventory-table {
  font-size: 0.7rem;
  width: 100%;
  min-width: 0;
  max-width: none;
  table-layout: auto;
}

#inv-panel-in-transit .inventory-table th,
#inv-panel-delivered .inventory-table th {
  padding: 0.3rem 0.38rem;
  font-size: 0.66rem;
}

#inv-panel-in-transit .inventory-table td,
#inv-panel-delivered .inventory-table td {
  padding: 0.32rem 0.38rem;
}

#inv-panel-in-transit .inventory-table th:not(:last-child)::after,
#inv-panel-delivered .inventory-table th:not(:last-child)::after {
  top: 24%;
  bottom: 24%;
}

#inv-panel-in-transit .inventory-dops-col-head,
#inv-panel-delivered .inventory-dops-col-head {
  min-height: 0;
  gap: 0.18rem;
}

#tab-inventory #inv-panel-in-transit .inventory-footer,
#tab-inventory #inv-panel-delivered .inventory-footer {
  padding: 0.36rem 0.52rem;
  gap: 0.4rem;
  font-size: 0.68rem;
}

#tab-inventory #inv-panel-in-transit .inventory-footer--stacked-pager,
#tab-inventory #inv-panel-delivered .inventory-footer--stacked-pager {
  padding: 0.3rem 0.48rem;
}

#tab-inventory .inventory-pagination .table-pg__arrow:hover:not([disabled]) {

  color: rgba(253, 224, 71, 0.95);
  background: rgba(234, 179, 8, 0.1);
}

#tab-inventory .inventory-pagination .table-pg__num:hover:not(.is-active) {

  color: #eab308;
  background: rgba(234, 179, 8, 0.08);
}

#tab-inventory .inventory-pagination .table-pg__num.is-active {

  border-color: rgba(234, 179, 8, 0.45);
  color: rgba(253, 224, 71, 0.95);
}

#tab-inventory .inventory-raw-search {

  border-color: rgba(234, 179, 8, 0.18);
  background: rgba(13, 18, 30, 0.35);
}

#tab-inventory .inventory-raw-search__field input,
#tab-inventory .inventory-raw-search__field select {

  border-color: rgba(234, 179, 8, 0.2);
}

#tab-inventory .inventory-raw-search__field input:focus,
#tab-inventory .inventory-raw-search__field select:focus {

  border-color: rgba(234, 179, 8, 0.5);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.12);
}

#tab-inventory .inventory-raw-search__table {

  border-color: rgba(234, 179, 8, 0.18);
}

/* Daily Ops + Inventory — parallel rules: yellow on #tab-inventory, orange on #tab-daily_ops */
#tab-inventory .daily-ops-shrink-panel,
#tab-inventory .daily-ops-nonsellable-panel,
#tab-inventory .daily-ops-cartons-panel,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly),
#tab-inventory .daily-ops-sts-panel,
#tab-inventory .daily-ops-eol-panel {

  border-color: rgba(234, 179, 8, 0.18);
  background: rgba(13, 18, 30, 0.94);
  box-shadow: none;
}

#tab-daily_ops .daily-ops-shrink-panel,
#tab-daily_ops .daily-ops-nonsellable-panel,
#tab-daily_ops .daily-ops-cartons-panel,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly),
#tab-daily_ops .daily-ops-sts-panel,
#tab-daily_ops .daily-ops-eol-panel {

  border-color: rgba(251, 146, 60, 0.18);
  background: rgba(13, 18, 30, 0.94);
  box-shadow: none;
}

#tab-inventory .daily-ops-shrink-head,
#tab-inventory .daily-ops-nonsellable-head,
#tab-inventory .daily-ops-cartons-head,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head,
#tab-inventory .daily-ops-sts-head,
#tab-inventory .daily-ops-eol-head,
#tab-inventory .daily-ops-obs-acc-head,
#tab-inventory .inventory-fs-popout-head {

  background: rgba(234, 179, 8, 0.1);
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
}

#tab-daily_ops .daily-ops-shrink-head,
#tab-daily_ops .daily-ops-nonsellable-head,
#tab-daily_ops .daily-ops-cartons-head,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head,
#tab-daily_ops .daily-ops-sts-head,
#tab-daily_ops .daily-ops-eol-head {

  background: rgba(251, 146, 60, 0.1);
  border-bottom-color: rgba(251, 146, 60, 0.18);
}

#tab-inventory .daily-ops-shrink-head h3,
#tab-inventory .daily-ops-nonsellable-head h3,
#tab-inventory .daily-ops-cartons-head h3,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head h3,
#tab-inventory .daily-ops-sts-head h3,
#tab-inventory .daily-ops-eol-head h3,
#tab-inventory .daily-ops-obs-acc-head h3,
#tab-inventory .inventory-fs-popout-head h3 {

  color: #eab308 !important;
}

#tab-daily_ops .daily-ops-shrink-head h3,
#tab-daily_ops .daily-ops-nonsellable-head h3,
#tab-daily_ops .daily-ops-cartons-head h3,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head h3,
#tab-daily_ops .daily-ops-sts-head h3,
#tab-daily_ops .daily-ops-eol-head h3 {

  color: #fb923c !important;
}

#tab-inventory .daily-ops-shrink-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-nonsellable-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-cartons-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-sts-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-eol-head > .inventory-table-kpi-icon,
#tab-inventory .daily-ops-obs-acc-head > .inventory-table-kpi-icon,
#tab-inventory .inventory-fs-popout-head .inventory-popout-title-cluster > .inventory-table-kpi-icon {

  color: #eab308 !important;
}

#tab-daily_ops .daily-ops-shrink-head > .inventory-table-kpi-icon,
#tab-daily_ops .daily-ops-nonsellable-head > .inventory-table-kpi-icon,
#tab-daily_ops .daily-ops-cartons-head > .inventory-table-kpi-icon,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-head > .inventory-table-kpi-icon,
#tab-daily_ops .daily-ops-sts-head > .inventory-table-kpi-icon,
#tab-daily_ops .daily-ops-eol-head > .inventory-table-kpi-icon {

  color: #fb923c !important;
}

#tab-inventory .daily-ops-shrink-meta,
#tab-inventory .daily-ops-nonsellable-meta,
#tab-inventory .daily-ops-cartons-meta,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-meta,
#tab-inventory .daily-ops-sts-meta,
#tab-inventory .daily-ops-eol-meta,
#tab-inventory .daily-ops-obs-acc-meta {

  color: rgba(253, 224, 71, 0.75);
}

#tab-daily_ops .daily-ops-shrink-meta,
#tab-daily_ops .daily-ops-nonsellable-meta,
#tab-daily_ops .daily-ops-cartons-meta,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-meta,
#tab-daily_ops .daily-ops-sts-meta,
#tab-daily_ops .daily-ops-eol-meta {

  color: rgba(253, 186, 116, 0.75);
}

#tab-inventory .daily-ops-shrink-panel .daily-ops-shrink-loading,
#tab-inventory .daily-ops-nonsellable-panel .daily-ops-nonsellable-loading,
#tab-inventory .daily-ops-cartons-panel .daily-ops-cartons-loading,
#tab-inventory .daily-ops-sts-panel .daily-ops-sts-loading,
#tab-inventory .daily-ops-obs-acc-panel .daily-ops-obs-acc-loading,
#tab-inventory .daily-ops-eol-panel .daily-ops-eol-loading {

  color: rgba(253, 224, 71, 0.65);
}

#tab-daily_ops .daily-ops-shrink-panel .daily-ops-shrink-loading,
#tab-daily_ops .daily-ops-nonsellable-panel .daily-ops-nonsellable-loading,
#tab-daily_ops .daily-ops-cartons-panel .daily-ops-cartons-loading,
#tab-daily_ops .daily-ops-sts-panel .daily-ops-sts-loading,
#tab-daily_ops .daily-ops-obs-acc-panel .daily-ops-obs-acc-loading,
#tab-daily_ops .daily-ops-eol-panel .daily-ops-eol-loading {

  color: rgba(253, 186, 116, 0.65);
}

#tab-inventory .daily-ops-shrink-panel .daily-ops-shrink-table-wrap,
#tab-inventory .daily-ops-nonsellable-panel .daily-ops-nonsellable-table-wrap,
#tab-inventory .daily-ops-cartons-panel .daily-ops-cartons-table-wrap,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table-wrap,
#tab-inventory .daily-ops-sts-panel .daily-ops-sts-table-wrap,
#tab-inventory .daily-ops-eol-panel .daily-ops-eol-table-wrap {

  scrollbar-color: rgba(234, 179, 8, 0.2) transparent;
}

#tab-daily_ops .daily-ops-shrink-panel .daily-ops-shrink-table-wrap,
#tab-daily_ops .daily-ops-nonsellable-panel .daily-ops-nonsellable-table-wrap,
#tab-daily_ops .daily-ops-cartons-panel .daily-ops-cartons-table-wrap,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table-wrap,
#tab-daily_ops .daily-ops-sts-panel .daily-ops-sts-table-wrap,
#tab-daily_ops .daily-ops-eol-panel .daily-ops-eol-table-wrap {

  scrollbar-color: rgba(251, 146, 60, 0.2) transparent;
}

#tab-inventory .daily-ops-shrink-panel .daily-ops-shrink-table thead th,
#tab-inventory .daily-ops-nonsellable-panel .daily-ops-nonsellable-table thead th,
#tab-inventory .daily-ops-cartons-panel .daily-ops-cartons-table thead th,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table thead th,
#tab-inventory .daily-ops-sts-panel .daily-ops-sts-table thead th,
#tab-inventory .daily-ops-eol-panel .daily-ops-eol-table thead th {

  background: rgba(32, 28, 8, 0.95);
  color: rgba(253, 224, 71, 0.7);
  border-bottom-color: rgba(234, 179, 8, 0.15);
}

#tab-daily_ops .daily-ops-shrink-panel .daily-ops-shrink-table thead th,
#tab-daily_ops .daily-ops-nonsellable-panel .daily-ops-nonsellable-table thead th,
#tab-daily_ops .daily-ops-cartons-panel .daily-ops-cartons-table thead th,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table thead th,
#tab-daily_ops .daily-ops-sts-panel .daily-ops-sts-table thead th,
#tab-daily_ops .daily-ops-eol-panel .daily-ops-eol-table thead th {

  background: rgba(20, 10, 5, 0.95);
  color: rgba(253, 186, 116, 0.7);
  border-bottom-color: rgba(251, 146, 60, 0.15);
}

#tab-inventory .daily-ops-shrink-panel .daily-ops-shrink-table tbody tr,
#tab-inventory .daily-ops-nonsellable-panel .daily-ops-nonsellable-table tbody tr,
#tab-inventory .daily-ops-cartons-panel .daily-ops-cartons-table tbody tr,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table tbody tr,
#tab-inventory .daily-ops-sts-panel .daily-ops-sts-table tbody tr,
#tab-inventory .daily-ops-eol-panel .daily-ops-eol-table tbody tr {

  border-bottom-color: rgba(234, 179, 8, 0.06);
}

#tab-daily_ops .daily-ops-shrink-panel .daily-ops-shrink-table tbody tr,
#tab-daily_ops .daily-ops-nonsellable-panel .daily-ops-nonsellable-table tbody tr,
#tab-daily_ops .daily-ops-cartons-panel .daily-ops-cartons-table tbody tr,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table tbody tr,
#tab-daily_ops .daily-ops-sts-panel .daily-ops-sts-table tbody tr,
#tab-daily_ops .daily-ops-eol-panel .daily-ops-eol-table tbody tr {

  border-bottom-color: rgba(251, 146, 60, 0.06);
}

#tab-inventory .daily-ops-shrink-panel .daily-ops-shrink-table tbody tr:hover,
#tab-inventory .daily-ops-nonsellable-panel .daily-ops-nonsellable-table tbody tr:hover,
#tab-inventory .daily-ops-cartons-panel .daily-ops-cartons-table tbody tr:hover,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table tbody tr:hover,
#tab-inventory .daily-ops-sts-panel .daily-ops-sts-table tbody tr:hover,
#tab-inventory .daily-ops-eol-panel .daily-ops-eol-table tbody tr:hover {

  background: rgba(234, 179, 8, 0.05);
}

#tab-daily_ops .daily-ops-shrink-panel .daily-ops-shrink-table tbody tr:hover,
#tab-daily_ops .daily-ops-nonsellable-panel .daily-ops-nonsellable-table tbody tr:hover,
#tab-daily_ops .daily-ops-cartons-panel .daily-ops-cartons-table tbody tr:hover,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .daily-ops-scans-table tbody tr:hover,
#tab-daily_ops .daily-ops-sts-panel .daily-ops-sts-table tbody tr:hover,
#tab-daily_ops .daily-ops-eol-panel .daily-ops-eol-table tbody tr:hover {

  background: rgba(251, 146, 60, 0.05);
}

#tab-inventory .daily-ops-cartons-panel .cartons-tracking-link {

  color: #eab308;
}

#tab-daily_ops .daily-ops-cartons-panel .cartons-tracking-link {

  color: #fb923c;
}

#tab-inventory .daily-ops-cartons-panel .cartons-tracking-link:hover {

  color: #fde047;
}

#tab-daily_ops .daily-ops-cartons-panel .cartons-tracking-link:hover {

  color: #fdba74;
}

#tab-daily_ops .daily-ops-shrink-panel .dops-sort-arrow,
#tab-inventory .daily-ops-shrink-panel .dops-sort-arrow,
#tab-daily_ops .daily-ops-shrink-panel .shrink-sort-arrow,
#tab-inventory .daily-ops-shrink-panel .shrink-sort-arrow,
#tab-daily_ops .daily-ops-nonsellable-panel .dops-sort-arrow,
#tab-inventory .daily-ops-nonsellable-panel .dops-sort-arrow,
#tab-daily_ops .daily-ops-cartons-panel .dops-sort-arrow,
#tab-inventory .daily-ops-cartons-panel .dops-sort-arrow,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .dops-sort-arrow,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .dops-sort-arrow,
#tab-daily_ops .daily-ops-sts-panel .dops-sort-arrow,
#tab-inventory .daily-ops-sts-panel .dops-sort-arrow,
#tab-daily_ops .daily-ops-eol-panel .dops-sort-arrow,
#tab-inventory .daily-ops-eol-panel .dops-sort-arrow {
  color: #fff;
}

#tab-inventory .daily-ops-shrink-panel .dops-table-expand-btn,
#tab-inventory .daily-ops-nonsellable-panel .dops-table-expand-btn,
#tab-inventory .daily-ops-cartons-panel .dops-table-expand-btn,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .dops-table-expand-btn,
#tab-inventory .daily-ops-sts-panel .dops-table-expand-btn,
#tab-inventory .daily-ops-eol-panel .dops-table-expand-btn {

  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  border-color: rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
}

#tab-daily_ops .daily-ops-shrink-panel .dops-table-expand-btn,
#tab-daily_ops .daily-ops-nonsellable-panel .dops-table-expand-btn,
#tab-daily_ops .daily-ops-cartons-panel .dops-table-expand-btn,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .dops-table-expand-btn,
#tab-daily_ops .daily-ops-sts-panel .dops-table-expand-btn,
#tab-daily_ops .daily-ops-eol-panel .dops-table-expand-btn {

  border-color: rgba(251, 146, 60, 0.22);
  background: rgba(251, 146, 60, 0.08);
  color: #fb923c;
}

#tab-inventory .daily-ops-shrink-panel .dops-table-expand-btn:hover,
#tab-inventory .daily-ops-nonsellable-panel .dops-table-expand-btn:hover,
#tab-inventory .daily-ops-cartons-panel .dops-table-expand-btn:hover,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .dops-table-expand-btn:hover,
#tab-inventory .daily-ops-sts-panel .dops-table-expand-btn:hover,
#tab-inventory .daily-ops-eol-panel .dops-table-expand-btn:hover {

  border-color: rgba(234, 179, 8, 0.38);
  color: #fde047;
  background: rgba(234, 179, 8, 0.14);
}

#tab-daily_ops .daily-ops-shrink-panel .dops-table-expand-btn:hover,
#tab-daily_ops .daily-ops-nonsellable-panel .dops-table-expand-btn:hover,
#tab-daily_ops .daily-ops-cartons-panel .dops-table-expand-btn:hover,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .dops-table-expand-btn:hover,
#tab-daily_ops .daily-ops-sts-panel .dops-table-expand-btn:hover,
#tab-daily_ops .daily-ops-eol-panel .dops-table-expand-btn:hover {

  border-color: rgba(251, 146, 60, 0.38);
  color: #fdba74;
  background: rgba(251, 146, 60, 0.14);
}

#tab-inventory .daily-ops-shrink-panel .table-pagination.dops-pagination,
#tab-inventory .daily-ops-nonsellable-panel .table-pagination.dops-pagination,
#tab-inventory .daily-ops-cartons-panel .table-pagination.dops-pagination,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pagination.dops-pagination,
#tab-inventory .daily-ops-sts-panel .table-pagination.dops-pagination,
#tab-inventory .daily-ops-eol-panel .table-pagination.dops-pagination {

  border-top-color: rgba(234, 179, 8, 0.12);
}

#tab-daily_ops .daily-ops-shrink-panel .table-pagination.dops-pagination,
#tab-daily_ops .daily-ops-nonsellable-panel .table-pagination.dops-pagination,
#tab-daily_ops .daily-ops-cartons-panel .table-pagination.dops-pagination,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pagination.dops-pagination,
#tab-daily_ops .daily-ops-sts-panel .table-pagination.dops-pagination,
#tab-daily_ops .daily-ops-eol-panel .table-pagination.dops-pagination {

  border-top-color: rgba(251, 146, 60, 0.12);
}

#tab-inventory .daily-ops-shrink-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-inventory .daily-ops-nonsellable-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-inventory .daily-ops-cartons-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pagination.dops-pagination .table-pagination__range,
#tab-inventory .daily-ops-sts-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-inventory .daily-ops-eol-panel .table-pagination.dops-pagination .table-pagination__range {

  color: rgba(253, 224, 71, 0.7);
}

#tab-daily_ops .daily-ops-shrink-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-daily_ops .daily-ops-nonsellable-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-daily_ops .daily-ops-cartons-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pagination.dops-pagination .table-pagination__range,
#tab-daily_ops .daily-ops-sts-panel .table-pagination.dops-pagination .table-pagination__range,
#tab-daily_ops .daily-ops-eol-panel .table-pagination.dops-pagination .table-pagination__range {

  color: rgba(253, 186, 116, 0.7);
}

#tab-inventory .daily-ops-shrink-panel .table-pg__arrow:hover:not([disabled]),
#tab-inventory .daily-ops-nonsellable-panel .table-pg__arrow:hover:not([disabled]),
#tab-inventory .daily-ops-cartons-panel .table-pg__arrow:hover:not([disabled]),
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pg__arrow:hover:not([disabled]),
#tab-inventory .daily-ops-sts-panel .table-pg__arrow:hover:not([disabled]),
#tab-inventory .daily-ops-eol-panel .table-pg__arrow:hover:not([disabled]) {

  color: rgba(253, 224, 71, 0.95);
  background: rgba(234, 179, 8, 0.1);
}

#tab-daily_ops .daily-ops-shrink-panel .table-pg__arrow:hover:not([disabled]),
#tab-daily_ops .daily-ops-nonsellable-panel .table-pg__arrow:hover:not([disabled]),
#tab-daily_ops .daily-ops-cartons-panel .table-pg__arrow:hover:not([disabled]),
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pg__arrow:hover:not([disabled]),
#tab-daily_ops .daily-ops-sts-panel .table-pg__arrow:hover:not([disabled]),
#tab-daily_ops .daily-ops-eol-panel .table-pg__arrow:hover:not([disabled]) {

  color: rgba(253, 186, 116, 0.95);
  background: rgba(251, 146, 60, 0.1);
}

#tab-inventory .daily-ops-shrink-panel .table-pg__num:hover:not(.is-active),
#tab-inventory .daily-ops-nonsellable-panel .table-pg__num:hover:not(.is-active),
#tab-inventory .daily-ops-cartons-panel .table-pg__num:hover:not(.is-active),
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pg__num:hover:not(.is-active),
#tab-inventory .daily-ops-sts-panel .table-pg__num:hover:not(.is-active),
#tab-inventory .daily-ops-eol-panel .table-pg__num:hover:not(.is-active) {

  color: #eab308;
  background: rgba(234, 179, 8, 0.08);
}

#tab-daily_ops .daily-ops-shrink-panel .table-pg__num:hover:not(.is-active),
#tab-daily_ops .daily-ops-nonsellable-panel .table-pg__num:hover:not(.is-active),
#tab-daily_ops .daily-ops-cartons-panel .table-pg__num:hover:not(.is-active),
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pg__num:hover:not(.is-active),
#tab-daily_ops .daily-ops-sts-panel .table-pg__num:hover:not(.is-active),
#tab-daily_ops .daily-ops-eol-panel .table-pg__num:hover:not(.is-active) {

  color: #fb923c;
  background: rgba(251, 146, 60, 0.08);
}

#tab-inventory .daily-ops-shrink-panel .table-pg__num.is-active,
#tab-inventory .daily-ops-nonsellable-panel .table-pg__num.is-active,
#tab-inventory .daily-ops-cartons-panel .table-pg__num.is-active,
#tab-inventory .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pg__num.is-active,
#tab-inventory .daily-ops-sts-panel .table-pg__num.is-active,
#tab-inventory .daily-ops-eol-panel .table-pg__num.is-active {

  border-color: rgba(234, 179, 8, 0.42);
  color: rgba(253, 224, 71, 0.95);
}

#tab-daily_ops .daily-ops-shrink-panel .table-pg__num.is-active,
#tab-daily_ops .daily-ops-nonsellable-panel .table-pg__num.is-active,
#tab-daily_ops .daily-ops-cartons-panel .table-pg__num.is-active,
#tab-daily_ops .daily-ops-scans-panel:not(.daily-ops-scans-panel--monthly) .table-pg__num.is-active,
#tab-daily_ops .daily-ops-sts-panel .table-pg__num.is-active,
#tab-daily_ops .daily-ops-eol-panel .table-pg__num.is-active {

  border-color: rgba(251, 146, 60, 0.42);
  color: rgba(253, 186, 116, 0.95);
}

/* Shrink comment popout — same header treatment as obsolete accessories */
.shrink-comment-popout {
  border-color: rgba(251, 146, 60, 0.18);
}

.shrink-comment-popout::before {
  border-left-color: rgba(251, 146, 60, 0.22);
}

.shrink-comment-popout-head {
  background: rgba(251, 146, 60, 0.1);
  border-bottom-color: rgba(251, 146, 60, 0.18);
  color: #fb923c;
}

/* Expand control on Obsolete Accessories — yellow theme (Daily Ops + Inventory) */
#tab-inventory .daily-ops-obs-acc-panel .dops-table-expand-btn {
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
}

#tab-inventory .daily-ops-obs-acc-panel .dops-table-expand-btn,
#tab-daily_ops .daily-ops-obs-acc-panel .dops-table-expand-btn {
  border-color: rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  color: #eab308;
}

#tab-inventory .daily-ops-obs-acc-panel .dops-table-expand-btn:hover,
#tab-daily_ops .daily-ops-obs-acc-panel .dops-table-expand-btn:hover {
  border-color: rgba(234, 179, 8, 0.38);
  color: #fde047;
  background: rgba(234, 179, 8, 0.14);
}

.carton-detail-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.carton-detail-status--error {
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.07);
}
.carton-detail-status--empty {
  color: var(--text-secondary);
}
.carton-detail-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-top-color: var(--accent, #6ea8fe);
  animation: cartonDetailSpin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes cartonDetailSpin {
  to { transform: rotate(360deg); }
}
.carton-detail-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  font-family: var(--font-body);
  line-height: 1.35;
}
.carton-detail-table-wrap {
  background: var(--bg-elevated);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 60vh;
}
.carton-detail-table-wrap--horizontal {
  /* Allow the table to overflow horizontally within the modal width, and
     vertically if many matching rows come back from the lookup. */
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
}
.carton-detail-table {
  border-collapse: collapse;
  font-size: 0.88rem;
  font-family: var(--font-body);
}
.carton-detail-table--horizontal {
  /* Auto width so columns size to content; horizontal scroll handles overflow. */
  width: max-content;
  min-width: 100%;
}
.carton-detail-table thead th {
  text-align: left;
  font-size: 0.78rem;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  background: rgba(15, 18, 24, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  white-space: nowrap;
}
.carton-detail-table--horizontal thead th {
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}
.carton-detail-table--horizontal thead th:last-child {
  border-right: none;
}
.carton-detail-table tbody td {
  padding: 0.65rem 0.9rem;
  vertical-align: top;
  color: var(--text-primary);
  font-weight: 400;
  word-break: break-word;
}
.carton-detail-table--horizontal tbody td {
  border-right: 1px solid rgba(148, 163, 184, 0.06);
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carton-detail-table--horizontal tbody td:last-child {
  border-right: none;
}
.carton-detail-table--horizontal tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
}
.carton-detail-table--horizontal tbody tr:last-child {
  border-bottom: none;
}
.carton-detail-table--horizontal tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}
.carton-detail-table--horizontal thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.carton-detail-value--null {
  color: var(--text-muted);
  font-style: italic;
}
.carton-detail-value--json {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: pre-wrap;
  margin: 0;
  color: var(--text-secondary);
}
.carton-detail-store {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.carton-detail-store-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  margin-top: 0.15rem;
  white-space: nowrap;
}
.modal.modal--carton .modal-source-badge {
  font-family: var(--font-body);
  letter-spacing: 0.04em;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .main-grid { grid-template-columns: 1fr; }
  .right-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .timeline-panel { grid-column: 1 / -1; }
  /* On tablet/mobile, put the main feed/table first and sidebar below for scrolling priority */
  .main-grid > .event-feed,
  .main-grid > .inv-table-panel { order: 1; }
  .main-grid > .right-col { order: 2; }
  .main-grid--tasks { grid-template-columns: 1fr; }
  .main-grid--tasks > .tasks-panel { order: 1; }
  .main-grid--tasks > .right-col { order: 2; }
  .main-grid--tasks .tasks-list { min-height: 0; }

  .inventory-kpi-grid {
    grid-template-columns: repeat(auto-fill, 98px);
    gap: 0.55rem;
  }

  .events-kpi-grid {
    grid-template-columns: repeat(2, minmax(10rem, 1fr)) minmax(17rem, 1.3fr);
    overflow-x: auto;
  }

  .events-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .events-table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .events-filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .arit-kpi-grid {
    gap: 0.38rem;
    justify-items: stretch;
  }

  .arit-kpi-card {
    grid-template-columns: 1.15rem minmax(0, 1fr);
    gap: 0.18rem;
    padding: 0.16rem 0.24rem 0.28rem;
    aspect-ratio: 5 / 2;
  }

  .arit-kpi-card::after {
    height: 6px;
    bottom: 0.08rem;
    left: 0.22rem;
    right: 0.22rem;
  }

  .arit-kpi-icon {
    width: 1.15rem;
    height: 1.15rem;
  }

  .arit-kpi-icon svg {
    width: 0.72rem;
    height: 0.72rem;
  }

  .arit-kpi-card strong {
    font-size: 0.8rem;
  }

  .arit-kpi-card strong#sourceKpiLatest-arit {
    font-size: 0.56rem;
  }

  .arit-kpi-card span:not(.arit-kpi-icon),
  .arit-kpi-card small {
    font-size: 0.48rem;
    line-height: 1.12;
  }

  .arit-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .arit-table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .arit-filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: visible;
  }

  .arit-tabs {
    width: 100%;
  }

  .arit-tab {
    font-size: 0.68rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .arit-filters select {
    min-width: 0;
    width: 7rem;
    padding-left: 0.55rem;
    padding-right: 1.35rem;
  }

  .arit-search {
    flex: 1 1 14rem;
    min-width: 12rem;
  }

  .arit-search input {
    width: 100%;
  }

  .arit-tool-btn {
    padding: 0 0.62rem;
  }

  .arit-table {
    min-width: 100%;
    font-size: 0.64rem;
  }

  .arit-table th,
  .arit-table td {
    padding: 0.58rem 0.45rem;
  }

  .arit-table th:nth-child(1),
  .arit-table td:nth-child(1) { min-width: 6.75rem; }
  .arit-table th:nth-child(2),
  .arit-table td:nth-child(2) { min-width: 7.75rem; }
  .arit-table th:nth-child(3),
  .arit-table td:nth-child(3) { min-width: 5.25rem; }
  .arit-table th:nth-child(4),
  .arit-table td:nth-child(4) { min-width: 12rem; }
  .arit-table td:nth-child(4) { max-width: 18rem; }
  .arit-table th:nth-child(5),
  .arit-table td:nth-child(5) { min-width: 8rem; }
  .arit-table th:nth-child(6),
  .arit-table td:nth-child(6) { min-width: 6.75rem; }
  .arit-table th:nth-child(7),
  .arit-table td:nth-child(7) {
    min-width: 2rem;
    text-align: right;
    vertical-align: middle;
  }

  .arit-table strong {
    font-size: 0.64rem;
  }

  .arit-table small {
    font-size: 0.56rem;
  }

  .events-table {
    min-width: 0;
    font-size: 0.68rem;
  }

  .events-table th,
  .events-table td {
    padding: 0.65rem 0.55rem;
  }

  /* Column widths come from content (table-layout: auto) — no forced shares. */

  .events-event-cell {
    grid-template-columns: 1.35rem minmax(0, 1fr);
    gap: 0.45rem;
    margin-left: -0.55rem;
    padding-left: 0.45rem;
  }

  .events-event-cell strong,
  .events-table td strong {
    font-size: 0.68rem;
  }

  .events-event-cell small,
  .events-table td small {
    font-size: 0.61rem;
  }

  .inventory-kpi-card {
    min-height: 98px;
    padding: 0.78rem 0.8rem 1.75rem;
    gap: 0.55rem;
  }

  .inventory-kpi-card.inventory-kpi-card--metric-square {
    gap: 0.3rem;
    padding: 0.38rem 0.4rem 0.82rem;
  }

  .inventory-kpi-card strong {
    font-size: 1.35rem;
  }

  .inventory-kpi-card.inventory-kpi-card--metric-square strong {
    font-size: 1rem;
  }

  .inventory-kpi-card small {
    font-size: 0.62rem;
  }

}

@media (max-width: 768px) {
  .topbar { padding: 0.85rem 0.9rem; flex-wrap: nowrap; top: 0; border-radius: 0; gap: 0.75rem; }
  .topbar-left { gap: 0.8rem; min-width: 0; }
  .topbar-nav { width: 100%; justify-content: flex-start; align-self: flex-end; }
  .topbar-tabs { width: 100%; flex-wrap: nowrap; justify-content: flex-start; }
  .topbar-market-menu { min-width: min(220px, calc(100vw - 2rem)); }
  .topbar-brand { font-size: 1.55rem; }
  .topbar-right { gap: 0.75rem; }
  .todo-launcher { padding: 0.64rem 0.8rem; font-size: 0.72rem; }
  .todo-drawer {
    top: 5.35rem;
    right: 0.6rem;
    width: calc(100vw - 1.2rem);
    max-height: calc(100vh - 6rem);
    padding: 0.85rem;
    border-radius: 22px;
  }
  .todo-drawer-actions {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .todo-mini-btn {
    padding: 0.52rem 0.72rem;
    font-size: 0.68rem;
  }
  .todo-item-controls {
    grid-template-columns: 1fr;
  }
  .todo-reminder-custom {
    grid-template-columns: 1fr;
  }
  .inventory-page-head {
    flex-direction: column;
  }
  .source-hero { flex-direction: column; }
  .source-hero-stats { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-hero-copy h2 { font-size: 1.8rem; }
  .kpi-strip:not(.kpi-strip--overview) { grid-template-columns: repeat(2, 1fr); margin: 0.8rem auto 0; gap: 0.8rem; }
  .kpi-strip--overview { display: block; }
  .filter-bar { flex-direction: column; align-items: flex-start; padding: 0.85rem 1rem; }
  .panel-toolbar { padding: 0.85rem 1rem; }
  .panel-toolbar .filter-group:last-child { margin-left: 0; width: 100%; }
  .main-grid { padding: 0.7rem 0 2rem; }
  .right-col { grid-template-columns: 1fr; }
  .inv-table { font-size: 0.72rem; }
  .inv-table th, .inv-table td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 640px) {
  .arit-page-head,
  .events-page-head {
    flex-direction: column;
  }

  .arit-workspace,
  .events-kpi-grid,
  .events-workspace {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .arit-page-actions,
  .arit-filters,
  .arit-tabs,
  .events-filters,
  .events-tabs,
  .events-page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .arit-filters select,
  .arit-search,
  .arit-search input,
  .arit-tool-btn,
  .arit-create-btn,
  .events-filters select,
  .events-search,
  .events-search input,
  .events-tool-btn,
  .events-create-btn {
    width: 100%;
  }

  .events-table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-toolbar:not(.topbar-period-toolbar) {
    width: 100%;
    justify-content: flex-start;
  }

  .inventory-toolbar.inventory-toolbar--tile-actions {
    width: auto;
    flex-shrink: 0;
    margin-left: auto;
    justify-content: flex-end;
  }

  .inventory-snapshot-panel--fullscreen .inventory-snapshot-head {
    flex-wrap: wrap;
    padding-right: 3.4rem;
  }

  .inventory-snapshot-panel--fullscreen .inventory-summary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-kpi-grid {
    grid-template-columns: repeat(auto-fill, 98px);
  }

  .inventory-summary-row {
    grid-template-columns: 1fr;
  }

  .inventory-summary-row > div {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .inventory-toolbar select,
  .inventory-search,
  .inventory-search input,
  .inventory-tool-btn:not(.inventory-tool-btn--icon) {
    width: 100%;
  }

  .inventory-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 6px; }

/* Animations */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.event-item { animation: fadeSlideIn 0.3s ease-out backwards; }
.event-item.dragging { opacity: 0.65; transform: scale(0.98); }
.kpi-card { animation: fadeSlideIn 0.4s ease-out backwards; }
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }

/* ============================================================
   OVERVIEW PAGE STYLES
   ============================================================ */

/* Overview Header */
.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}

.overview-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.3rem 0;
}

.overview-timestamp {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* New Overview Layout with Geographic Map */
.overview-map-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  /* Pin the single row height so the right column's content can't push
     the map panel to grow taller than the grid container — that was
     causing a 120px gray "bleed" at the bottom of the map. */
  grid-template-rows: 500px;
  grid-template-areas: "map sidebar";
  gap: 1rem;
  width: 100%;
  margin: 0 0 0.4rem;
}

.map-panel {
  grid-area: map;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.map-panel .panel-header {
  flex-shrink: 0;
}

.panel-header--map {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.62rem 0.95rem;
}

.panel-header--map h2 {
  font-size: 0.82rem;
  letter-spacing: 0.07em;
}

.overview-map-zoom-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(15, 23, 35, 0.95);
  overflow: hidden;
}

.overview-map-zoom-btn {
  width: 34px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.overview-map-zoom-btn + .overview-map-zoom-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.overview-map-zoom-btn:hover {
  background: var(--bg-hover);
}

.overview-map-directory {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 30px;
  padding: 0.42rem 0.95rem 0.5rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.73rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow-x: auto;
}

.overview-map-directory-sep {
  color: var(--text-muted);
  opacity: 0.8;
}

.overview-map-directory-crumb {
  border: 0;
  background: transparent;
  color: var(--accent-light);
  cursor: pointer;
  font: inherit;
  padding: 0;
  white-space: nowrap;
}

.overview-map-directory-crumb:hover {
  text-decoration: underline;
}

.overview-map-directory-current {
  color: var(--text-primary);
  font-weight: 600;
}

.geographic-map-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.7rem;
}

.geographic-map-key {
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(12, 14, 19, 0.86);
  overflow: auto;
  padding: 0.55rem 0.5rem;
}

.panel-header--map {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.map-inline-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.map-issues-btn {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}
.map-issues-btn:hover,
.map-issues-btn:focus-visible {
  outline: rgba(32, 90, 153);
  background: rgba(16, 25, 39);
  border-color: rgba(59,130,246,0.25);
  color: var(--text-primary);
}

.geographic-map-container {
  flex: 1;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
  /* Match the panel background so any leaflet "no tile" gaps blend in */
  background: #0e1927;
}

.geographic-map-key .map-legend-control {
  margin: 0;
  max-height: none;
  overflow: visible;
  border: none;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.geographic-map-container #map {
  width: 100%;
  height: 100%;
}

/* === DARK MAP THEMING ============================================
 * The vector base map is themed in app.js so water, land, and label text
 * use exact requested hex colors. This fallback color covers load gaps.
 * ================================================================= */
.geographic-map-container .leaflet-tile-pane,
.geographic-map-container .maplibregl-canvas {
  background: #0e1927;
}

/* === MARKET MARKER DOTS ========================================== */
.map-market-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-dot-count {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  line-height: 1;
}
.map-market-icon:hover .map-market-dot {
  transform: scale(1.25);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.6);
}

/* === MAP LEGEND CONTROL (bottom-left) ============================ */
.geographic-map-container .map-legend-control {
  background: rgba(12, 14, 19, 0.88); /* matches --bg with extra contrast */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px 10px 12px;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  margin: 0 0 12px 12px;
  /* Allow scrolling if a future market list grows; cap so it doesn't
     dominate the map viewport. */
  max-height: 70%;
  overflow-y: auto;
}
.map-legend-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary, #9aa3b2);
  margin-bottom: 8px;
}
.map-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  white-space: nowrap;
}
.map-legend-row-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  padding: 4px 2px;
}
.map-legend-row-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.map-legend-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.map-legend-filter span {
  font-size: 0.64rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.map-legend-filter-select {
  width: 100%;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 28, 41, 0.9);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-family: var(--font-body);
  padding: 0 0.55rem;
}

.map-legend-filter-select:focus {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 1px;
}

@media (max-width: 900px) {
  .geographic-map-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .geographic-map-key {
    max-height: 150px;
  }
}
.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.map-legend-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* Zoom controls — match the dashboard's panel/border palette */
.geographic-map-container .leaflet-control-zoom a,
.geographic-map-container .leaflet-bar a {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.08);
}
.geographic-map-container .leaflet-control-zoom a:hover,
.geographic-map-container .leaflet-bar a:hover {
  background-color: var(--bg-hover);
}

/* Popup styling — dark to match panels */
.geographic-map-container .leaflet-popup-content-wrapper,
.geographic-map-container .leaflet-popup-tip {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.geographic-map-container .leaflet-popup-content {
  font-size: 12px;
  line-height: 1.5;
}
.geographic-map-container .leaflet-popup-close-button {
  color: var(--text-primary);
}

.overview-right-col {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  /* Lets the column shrink to fit the 500px grid row instead of pushing
     the row to grow. Combined with overflow on its scrollable child so
     users can still see all alerts. */
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* Smaller / tablet: map full width, Alerts by Type | Recent Alerts on row 2 */
@media (max-width: 1200px) {
  .overview-map-layout {
    grid-template-columns: 1fr 1fr;
    /* `auto` keeps row 2 only as tall as the alert tiles; `1fr` was growing the row
       and left a large empty band above the KPI strip. */
    grid-template-rows: minmax(300px, min(52vh, 500px)) auto;
    align-content: start;
    /* Shrink-wrapped: don’t let the main grid stretch in the tab and leave a dead band. */
    height: fit-content;
    min-height: 0;
    max-height: none;
    /* Slightly tighter stack map → alert row; column gap for the two-up row */
    gap: 0.5rem 0.9rem;
    grid-template-areas:
      "map map"
      "alerts recent";
  }

  .overview-right-col {
    display: contents;
  }

  /* Only the Alerts by Type + Recent cards in the map row. Do NOT use the bare
   * .alerts-chart-panel name — Incidents/MTTR in .overview-bottom-grid also
   * use that class, and the same grid-area would drop both into one cell. */
  .overview-map-layout > .alerts-chart-panel {
    grid-area: alerts;
    min-width: 0;
  }

  .overview-map-layout > .recent-alerts-panel {
    grid-area: recent;
    min-width: 0;
  }
}

/* Phone: map, then both panels stacked */
@media (max-width: 640px) {
  .overview-map-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .map-panel {
    grid-area: auto;
  }

  .overview-right-col {
    display: flex;
    flex-direction: column;
    grid-area: auto;
    height: auto;
    min-height: 0;
    /* Don't let this column grow and pin KPIs to the bottom with a dead band */
    flex: 0 0 auto;
    width: 100%;
    overflow: visible;
  }

  .alerts-chart-panel,
  .recent-alerts-panel {
    grid-area: auto;
  }

  #tab-overview .overview-right-col .alerts-chart-panel,
  #tab-overview .overview-right-col .recent-alerts-panel {
    max-height: none;
  }

  .geographic-map-container {
    height: 300px;
  }
}

/* Overview: square tiles in the right column and in the 2-up tablet row (sidebar only; bottom grid is separate) */
#tab-overview .overview-right-col .alerts-chart-panel,
#tab-overview .overview-right-col .recent-alerts-panel {
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  box-sizing: border-box;
}

/* Medium: two-up row — 4/3 and cap (must follow the 1/1 base rule so it wins in this range). */
@media (min-width: 641px) and (max-width: 1200px) {
  #tab-overview .overview-right-col .alerts-chart-panel,
  #tab-overview .overview-right-col .recent-alerts-panel {
    aspect-ratio: 4 / 3;
    max-height: min(36vw, 300px);
  }
}

/* Wide: taller map row; sidebar cards grow to share the column and avoid a short 210px cap on large viewports. */
@media (min-width: 1201px) {
  .overview-map-layout {
    grid-template-rows: min(60vh, 640px);
  }
  #tab-overview .overview-right-col .alerts-chart-panel,
  #tab-overview .overview-right-col .recent-alerts-panel {
    flex: 1 1 0;
    min-height: 0;
    aspect-ratio: auto;
    max-height: none;
  }
}

.alerts-chart-panel .panel-header {
  padding: 0.38rem 0.65rem 0.3rem;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}
.alerts-chart-panel .panel-header h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.alerts-chart-panel .view-all-link {
  flex-shrink: 0;
}

.alerts-chart-panel .chart-container {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  padding: 0.2rem 0.45rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

/* Donut + legend: intrinsic-width columns, centered as a group; legend aligned to donut’s vertical center */
.alerts-type-chart {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 0.65rem;
  row-gap: 0;
  align-items: center;
  justify-content: center;
  justify-items: start;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  flex: 0 1 auto;
  overflow: hidden;
}
.alerts-type-chart-donut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(176px, 100%);
  max-width: 176px;
  justify-self: center;
  margin-inline: 0;
  flex-shrink: 0;
}
.alerts-type-donut-svg {
  display: block;
  width: 100%;
  max-width: min(176px, 100%);
  height: auto;
}
.alerts-type-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 0.1rem 0.2rem 0.2rem;
}
.alerts-type-chart-donut .alerts-type-total-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.alerts-type-chart-donut .alerts-type-total-label {
  margin-top: 0.04rem;
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.alerts-type-chart-legend-block {
  min-width: 0;
  width: max-content;
  max-width: min(100%, 12.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center;
  justify-self: start;
  overflow: hidden;
  padding-top: 0;
}
.alerts-type-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  width: 100%;
  min-width: 0;
  font-size: 0.7rem;
}
.alerts-type-row {
  display: grid;
  grid-template-columns: 0.7rem minmax(1.8rem, 4.2ch) minmax(0, 1fr);
  column-gap: 0.35rem;
  align-items: center;
  min-width: 0;
  line-height: 1.12;
}
.alerts-type-swatch {
  width: 0.7rem;
  min-width: 0.7rem;
  height: 0.7rem;
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.alerts-type-count {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  color: var(--text-primary);
  text-align: right;
  min-width: 0;
  padding: 0;
  line-height: 1.2;
  align-self: center;
}
.alerts-type-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1.1;
  font-weight: 500;
}

/* Recent alerts: 2 per page, horizontal snap + page pills (no vertical scroll) */
.recent-alerts-panel .recent-alerts-carousel {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#tab-overview .recent-alerts-scroll.overview-alerts-list {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.recent-alerts-page {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  min-height: 0;
  overflow: hidden;
}

/* Slightly inset from the tile so rows don’t read edge-to-edge */
.recent-alerts-page .alert-item {
  width: calc(100% - 1rem);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.recent-alerts-paging {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem 0.45rem;
  flex-shrink: 0;
}

.recent-alerts-pill {
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.recent-alerts-pill:hover {
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.22);
}
.recent-alerts-pill.is-active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--accent-light);
}
.recent-alerts-pill--view-all-slide.is-active {
  color: var(--accent-light);
}
.recent-alerts-pill:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.recent-alerts-empty {
  padding: 1rem 0.8rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex: 0 0 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.recent-alerts-page--view-all,
.recent-alerts-page--empty-only {
  justify-content: center;
}

.recent-alerts-view-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: calc(100% - 1rem);
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-light);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.recent-alerts-view-all-btn:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--text-primary);
}
.recent-alerts-view-all-chevron {
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.9;
}
.recent-alerts-view-all-btn--compact {
  width: auto;
  min-width: 10rem;
  margin-top: 0.25rem;
}
.recent-alerts-page--empty-only {
  flex-direction: column;
  gap: 0.5rem;
}
.recent-alerts-page--empty-only .recent-alerts-empty {
  flex: 0 0 auto;
  min-width: 0;
}

@media (max-width: 480px) {
  .alerts-type-chart {
    grid-template-columns: 1fr;
    row-gap: 0.5rem;
    justify-content: start;
    justify-items: center;
    column-gap: 0;
  }
  .alerts-type-chart-donut {
    justify-self: center;
    max-width: min(170px, 100%);
  }
  .alerts-type-donut-svg {
    max-width: min(170px, 100%);
  }
  .alerts-type-chart-legend-block {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    justify-self: stretch;
  }
  .alerts-chart-panel .chart-container {
    padding: 0.2rem 0.45rem 0.32rem;
  }
}

.overview-bottom-grid {
  display: grid;
  /* minmax(0,1fr) keeps wide donut/legend or SVG from blowing out column min-widths */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  margin: 1rem 0;
}

/* Match chart layout for both Incidents and MTTR (only Incidents had .alerts-chart-panel before) */
#tab-overview .overview-bottom-grid > .panel {
  min-width: 0;
  min-height: 300px;
}
#tab-overview .overview-bottom-grid .chart-container {
  flex: 1 1 0;
  min-width: 0;
  min-height: 240px;
  height: auto;
  padding: 0.2rem 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

#tab-overview .overview-bottom-grid .alerts-type-chart {
  max-width: 100%;
  min-width: 0;
}

#tab-overview .overview-bottom-grid .alerts-type-chart-legend-block {
  max-width: 100%;
}

#tab-overview .overview-bottom-grid .mttr-trend-inner {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.35rem;
  box-sizing: border-box;
}
#tab-overview .overview-bottom-grid .mttr-trend-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(220px, 100%);
  display: block;
  flex: 0 1 auto;
}

@media (max-width: 700px) {
  .overview-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.critical-incidents-panel {
  width: 100%;
  margin-top: 1rem;
}

.chart-container {
  padding: 1rem;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-container {
  overflow-x: auto;
}

.critical-incidents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.critical-incidents-table th {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-hover);
}

.critical-incidents-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
}

.critical-incidents-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Leaflet Map Customization */
.leaflet-control-attribution {
  display: none !important;
}

.district-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.district-marker:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.district-marker--critical {
  background: var(--health-critical);
  color: white;
}

.district-marker--elevated {
  background: var(--health-elevated);
  color: white;
}

.district-marker--watch {
  background: var(--health-watch);
  color: black;
}

.district-marker--healthy {
  background: var(--health-healthy);
  color: white;
}

.view-all-link {
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.view-all-link:hover {
  color: var(--accent-light);
}

.overview-activity .timeline {
  padding: 0;
}

.overview-health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
}

.health-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem;
  background: var(--bg-hover);
  border-radius: 10px;
  border-left: 3px solid transparent;
}

.health-card--critical {
  border-left-color: var(--critical);
}

.health-card--warning {
  border-left-color: var(--warning);
}

.health-card--success {
  border-left-color: var(--success);
}

.health-card--neutral {
  border-left-color: var(--accent);
}

.health-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.health-count {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.health-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.overview-alerts-list {
  box-sizing: border-box;
}

.alert-item {
  width: 100%;
  padding: 0.85rem;
  background: var(--bg-hover);
  border-left: 3px solid var(--critical);
  border-radius: 8px;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.2s ease;
}

.alert-item:hover {
  background: var(--bg-primary);
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.alert-body {
  min-width: 0;
  flex: 1;
}

.alert-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.overview-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-hover));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.action-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.action-content {
  min-width: 0;
  flex: 1;
}

.action-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.action-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.action-arrow {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.action-card:hover .action-arrow {
  opacity: 1;
}

@media (max-width: 1024px) {
  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .overview-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-health-grid {
    grid-template-columns: 1fr;
  }

  .overview-actions {
    grid-template-columns: 1fr;
  }

  .overview-activity,
  .overview-health,
  .overview-alerts {
    max-height: none;
  }
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  transition: background 0.2s ease;
}

.timeline-item:hover {
  background: var(--bg-hover);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 60px;
  text-align: right;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Daily Ops Compact Overrides */
.daily-ops-board {
  padding: 0.7rem 0.9rem 0.82rem;
}

.daily-ops-board-copy h2 {
  font-size: 1.65rem;
  margin-bottom: 0.32rem;
}

.daily-ops-board-copy p {
  font-size: 0.8rem;
  line-height: 1.35;
}

.daily-ops-dashboard {
  margin-top: 0.56rem;
  gap: 0.5rem;
}

.daily-ops-snapshot-card {
  min-height: 140px;
  padding: 0.6rem 0.7rem 0.7rem;
  gap: 0.5rem;
}

.daily-ops-snapshot-title {
  min-height: 2.8rem;
  font-size: 0.75rem;
  line-height: 1.15;
}

.daily-ops-snapshot-detail {
  font-size: 0.75rem;
  line-height: 1.4;
}

.daily-ops-snapshot-footer {
  gap: 0.5rem;
  padding-top: 0.05rem;
}

.daily-ops-snapshot-source,
.daily-ops-snapshot-link {
  font-size: 0.6rem;
}

/* ============================================================
   RESPONSIVE TABLET & MOBILE OPTIMIZATIONS (Phase 1 Visual)
   ============================================================ */

/* TABLET PORTRAIT (768px) */
@media (max-width: 1024px) {
  .topbar { top: 0; margin-bottom: 0; padding: 0.85rem 1.1rem; border-radius: 0; }

  .kpi-strip:not(.kpi-strip--overview) {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin: 0.75rem auto 0;
  }

  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.6rem;
  }

  .main-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 0.75rem 0 2rem;
  }

  .main-grid > .right-col {
    order: 2;
  }

  .main-grid > .event-feed,
  .main-grid > .inv-table-panel,
  .main-grid > .store-table-panel {
    order: 1;
  }

  .right-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
  }

  .right-col .panel:nth-child(3n) {
    grid-column: 1 / -1;
  }

  .panel {
    max-height: none;
  }

  .event-feed {
    max-height: none;
  }

  .event-item {
    margin-bottom: 0.6rem;
  }

  .event-list {
    max-height: 50vh;
  }

  .inv-table-panel {
    max-height: none;
  }

  .inv-table {
    font-size: 0.75rem;
  }

  .inv-table th,
  .inv-table td {
    padding: 0.6rem 0.7rem;
    height: auto;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.8rem 1rem;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .filter-select {
    flex: 1;
    min-width: 140px;
  }
}

/* RAIL: stays expanded by default on tablet and desktop (>= 768px) */
@media (min-width: 768px) {
  :root {
    --rail-width: 142px;
  }

  /* Top bar spans the full screen width (over the rail zone). Logo sits at
     the very left in flow so the OPS-COMMAND title can sit directly next
     to it — no big rail-width gutter between them. Tightened flex gap
     (down from the base 1rem) so logo↔title sit close together. */
  .topbar {
    left: 0;
    padding-left: 0.55rem;
    gap: 0.5rem;
    /* Left-align so the logo + OPS-COMMAND title hug the left edge. The base
       `space-between` would spread logo and title to opposite ends whenever
       the right-side controls are empty (e.g. the Financials page). The
       right cluster is floated to the far edge via margin-left:auto below. */
    justify-content: flex-start;
  }

  /* Push the period/store controls to the far right, leaving the logo and
     title grouped together on the left regardless of right-side content. */
  .topbar-right {
    margin-left: auto;
  }

  /* Alliance logo is now an in-flow flex child of the topbar (was absolutely
     positioned inside a rail-width gutter). Sized to the topbar's own
     height so the title sits flush to its right edge. The -4px margin-top
     nudges it up slightly inside the bar — pure optical lift. */
  .topbar .rail-brand {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: auto;
    height: var(--topbar-height);
    align-items: center;
    justify-content: center;
    /* No right padding here — the topbar's own flex `gap` handles the
       breathing room between the logo and the OPS-COMMAND title. */
    padding: 0.15rem 0 0.15rem 0.4rem;
    margin: -4px 0 0;
    pointer-events: none;
  }

  .topbar .rail-brand img {
    max-width: none;
    max-height: 92%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
  }

  .command-rail {
    width: var(--rail-width);
    padding-top: 0.6rem;
  }

  /* No header chrome needed when permanently expanded */
  .command-rail .rail-header {
    display: none;
  }

  .command-rail .rail-menu {
    /* Start nav exactly at the topbar's bottom edge so the separator below
       the logo lines up with the topbar. The rail itself has a 0.6rem
       padding-top, so subtract it here: 0.6rem + (topbar-height - 0.6rem)
       puts the first menu item's top border precisely at var(--topbar-height). */
    padding: calc(var(--topbar-height) - 0.6rem) 0.55rem 0;
  }

  /* Separator line between the Alliance logo (in the top zone) and the
     "Back to MyHub" link, which is the first menu item on desktop. Sits at
     exactly var(--topbar-height) so it aligns with the topbar's bottom edge. */
  .command-rail .rail-menu-item--back {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 0.4rem;
    margin-top: 0;
  }

  .command-rail .rail-label {
    display: inline;
  }

  .command-rail .rail-link,
  .command-rail .rail-group-btn {
    justify-content: flex-start;
    padding-left: 0.62rem;
  }

  .command-rail .rail-icon {
    flex-shrink: 0;
  }
}

/* MOBILE (< 768px) */
@media (max-width: 767px) {
  :root {
    /* Room for brand + page + date on iOS */
    --topbar-height: 74px;
    /* Height of the selection strip pinned under the top bar. */
    --mobile-selbar-height: 1.95rem;
  }

  body {
    /* Top padding MUST match the actual rendered topbar height. The mobile
       topbar is `calc(var(--header-height) + safe-area-inset-top)` (see
       theme-alliance.css), i.e. 64px + inset — NOT --topbar-height (74px,
       which is only used for rail-menu spacing). Using --topbar-height here
       left a ~10px navy strip (the html safe-area background) peeking out
       below the topbar. Align to --header-height so content sits flush.
       The selection strip is pinned directly below the topbar, so add its
       height too. */
    padding: calc(var(--header-height) + env(safe-area-inset-top, 0px) + var(--mobile-selbar-height)) 0 calc(64px + env(safe-area-inset-bottom, 0px)) 0;
  }

  /* Selection strip: pinned full-width directly under the fixed top bar. */
  .topbar-selection-bar {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    z-index: 1290;
    height: var(--mobile-selbar-height);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    gap: 0.5rem;
    padding: 0 1rem;
    box-sizing: border-box;
    background: var(--chrome-topbar);
    border-bottom: 1px solid var(--border-soft);
    color: #ffffff;
    font-size: 0.68rem;
    line-height: 1.2;
    overflow: hidden;
  }
  .topbar-selection-bar .topbar-selection-line {
    justify-content: flex-start;
    min-width: 0;
  }
  .topbar-selection-bar .topbar-selection-line:first-child {
    flex: 0 1 auto;
  }
  .topbar-selection-bar .topbar-selection-line:last-child {
    flex: 0 0 auto;
  }

  /* iOS installed web-app mode (and standalone display-mode):
     Work around WebKit bugs where `position: fixed` toolbars can drift while scrolling.
     We keep the window itself non-scrollable and scroll the body instead. */
  html.is-ios-standalone,
  html.is-standalone {
    height: 100%;
    overflow: hidden;
  }

  html.is-ios-standalone body,
  html.is-standalone body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .command-rail {
    width: 100%;
    /* The visible nav row is a fixed 64px tall. The iOS home-indicator
       safe area is applied as padding-bottom ON THE RAIL ITSELF, so the
       rail's own navy background fills it: the bar runs edge-to-edge
       all the way to the physical bottom of the screen with no white
       gap below and no separate backstop element above. viewport-fit=cover
       in the <meta> viewport makes `bottom: 0` line up with the physical
       screen bottom (in standalone PWA mode html's navy background — see
       theme-alliance.css — covers the same sliver, so it stays seamless). */
    height: calc(64px + env(safe-area-inset-bottom, 0px) + var(--mobile-rail-extra-bottom, 0px));
    flex-direction: row;
    align-items: center;
    padding: 0 0.5rem env(safe-area-inset-bottom, 0px) 0.6rem;
    border-right: none;
    /* No top border / no gradient strip above — the rail sits flush
       against the page content above it with nothing separating them. */
    border-top: none;
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 101;
    gap: 0;
    overflow: visible;
    /* Paint the rail's own background so it (and its safe-area padding)
       is filled edge-to-edge regardless of the page background behind it. */
    background: var(--sidebar-gradient, #1B4278);
  }

  /* iOS standalone PWA — fix for the white strip BELOW the bottom nav.

     Per research (deep-research report): `apple-mobile-web-app-status-bar-
     style: black-translucent` shifts the whole document UP to the physical
     top of the screen, which leaves a white bar at the BOTTOM in installed
     PWAs. The documented fix is to make the root element taller by the top
     inset so the document reaches the physical bottom again. iOS Safari
     IGNORES the manifest background_color, so the safe-area region is
     painted by the page's own background — extending the document keeps the
     navy nav/page color there instead of white.

     (A plain `position: fixed; bottom: 0` element already reaches the
     physical bottom in standalone — it is NOT clamped to the safe area — so
     the rail itself just needs `padding-bottom: env(safe-area-inset-bottom)`
     + its own background, which it has in the base .command-rail rule above.
     No negative-bottom push is needed; that pushed the bar off-screen.) */
  html.is-ios-standalone,
  html.is-standalone {
    min-height: calc(100% + env(safe-area-inset-top, 0px));
  }
  @media all and (display-mode: standalone), all and (display-mode: fullscreen) {
    html {
      min-height: calc(100% + env(safe-area-inset-top, 0px));
    }
  }

  /* Match the body padding-bottom to the rail's visible height (the
     64px icon row plus the safe-area inset the rail now carries) so the
     scrollable content always clears the bottom nav. */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + var(--mobile-rail-extra-bottom, 0px)) !important;
  }

  /* Hide the old hamburger header on mobile */
  .rail-header {
    display: none;
  }

  /* Keep brand hidden unless we want it; skip it to save space */
  .rail-brand {
    display: none;
  }

  /* Icons-only horizontal strip — always visible */
  .rail-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    z-index: auto;
  }

  .rail-menu > li {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 1;
  }

  .rail-link,
  .rail-group-btn {
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 0.35rem;
    gap: 0;
  }

  .rail-icon {
    width: 26px;
    height: 26px;
  }

  /* Labels stay hidden in collapsed icon bar */
  .rail-label {
    display: none;
  }

  /* On mobile the submenu floats above the bottom rail like a chat-bubble panel. */
  .rail-submenu {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + var(--mobile-rail-extra-bottom, 0px) + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem;
    margin: 0;
    min-width: 13rem;
    max-width: calc(100vw - 1rem);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 110;
    display: grid;
    gap: 0.1rem;
  }

  .rail-submenu::after {
    content: '';
    position: absolute;
    left: calc(50% + var(--rail-submenu-tail-x, 0px));
    bottom: -7px;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .rail-submenu .rail-link {
    justify-content: flex-start;
    padding: 0.6rem 0.75rem 0.6rem 2.1rem;
    border-radius: 0.5rem;
    min-height: 40px;
  }

  .rail-submenu .rail-label {
    display: inline;
  }

  /* --- Long-press scrub preview (see initRailLongPressPreview) --- */
  /* A long-press must not trigger the iOS link callout / text selection. */
  .command-rail .rail-link,
  .command-rail .rail-group-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Bubble above the finger: destination icon + page name. Glides between
     icons (left/top transition) and fades in. pointer-events: none so
     elementFromPoint hit-testing under it keeps working. */
  .rail-scrub-bubble {
    position: fixed;
    transform: translate(-50%, -100%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.05rem;
    min-height: 3rem;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(27, 66, 120, 0.92) 0%, rgba(18, 44, 82, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.45);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    z-index: 260;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease, left 0.15s ease, top 0.15s ease;
  }

  .rail-scrub-bubble.is-visible {
    opacity: 1;
  }

  /* Tail points down at the icon under the finger; tracks it when the
     bubble is clamped at a viewport edge. */
  .rail-scrub-bubble::after {
    content: '';
    position: absolute;
    left: calc(50% + var(--rail-scrub-tail-x, 0px));
    bottom: -6px;
    width: 12px;
    height: 12px;
    transform: translateX(-50%) rotate(45deg);
    background: rgba(18, 44, 82, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .rail-scrub-bubble svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
  }

  /* The icon currently under the finger. */
  .command-rail .rail-scrub-target {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
  }

  /* Hide the left-edge active indicator in horizontal icon bar */
  .rail-link.active::before {
    display: none;
  }


  .topbar::before {
    display: none;
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
    margin-bottom: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 0.45rem) 0.9rem 0.35rem;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.7rem;
    border-radius: 0;
    background: rgba(9, 17, 26, 1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 102;
  }

  .topbar-left {
    display: flex;
    /* Center the title block against the logo so the text sits evenly
       between the logo's top and bottom edges (was flex-start, which
       pinned the text to the top of the logo). */
    align-items: center;
    flex: 1;
    gap: 0.75rem;
    min-width: 0;
  }

  .topbar-mobile-logo {
    display: block;
    height: 38px;
    width: auto;
    flex-shrink: 0;
  }

  /* Left-aligned stack: OPS-COMMAND + page title */
  .topbar-title {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.12rem;
    min-width: 0;
    pointer-events: none;
  }

  .topbar-brand {
    display: block;
    font-family: 'Russo One', 'Bebas Neue', var(--font-body);
    font-size: 1.45rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    line-height: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
    pointer-events: auto;
    white-space: nowrap;
  }

  .topbar-subtitle {
    display: block;
    position: static;
    margin: 0;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
  }

  .topbar-context-period {
    display: block;
    font-size: 0.56rem;
    text-align: left;
    white-space: normal;
    overflow: hidden;
    max-width: 100%;
    pointer-events: none;
    letter-spacing: 0.01em;
    line-height: 1.15;
  }

  .topbar-right {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .logo-mark {
    width: 40px;
    height: 40px;
  }

  .topbar-tabs {
    display: none;
  }

  .kpi-strip:not(.kpi-strip--overview) {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin: 0.5rem auto 0;
  }

  .kpi-strip--overview {
    display: block;
  }

  .kpi-card {
    padding: 0.9rem;
    gap: 0.6rem;
  }

  .kpi-value {
    font-size: 1.4rem;
  }

  .kpi-icon {
    width: 24px;
    height: 24px;
  }

  .main-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0.5rem 0 1.5rem;
  }

  .right-col {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .panel {
    border-radius: 14px;
  }

  .panel-header {
    padding: 0.9rem 1rem;
  }

  .panel-header h2 {
    font-size: 0.75rem;
  }

  .event-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
  }

  .event-title {
    font-size: 0.9rem;
  }

  .event-list {
    max-height: 60vh;
  }

  .inv-table {
    font-size: 0.7rem;
  }

  .inv-table th,
  .inv-table td {
    padding: 0.5rem 0.6rem;
    height: auto;
  }

  .filter-bar {
    flex-direction: column;
    padding: 0.7rem 0.9rem;
    gap: 0.6rem;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
  }

  .filter-select,
  .filter-btn {
    width: 100%;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  input.filter-select {
    width: 100%;
  }

  .todo-launcher {
    padding: 0.6rem 0.8rem;
    font-size: 0.7rem;
  }

  .todo-drawer {
    width: min(95vw, 380px);
    max-height: 80vh;
  }

  .district-card {
    height: auto;
    min-height: 140px;
  }

  .districts-grid {
    grid-template-columns: 1fr;
  }

  .map-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .map-filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .map-query-controls {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .map-search-input,
  .map-sort-select {
    width: 100%;
    min-width: 0;
  }

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

  .filter-chips {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .chip {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Extra breathing room when installed as a web app (PWA / A2HS). */
@media (max-width: 767px) and (display-mode: standalone) {
  html { --mobile-rail-extra-bottom: 0.85rem; }
  body {
    padding-bottom: calc(64px + 0.75rem + env(safe-area-inset-bottom, 0px) + var(--mobile-rail-extra-bottom));
  }
}

@media (max-width: 767px) and (display-mode: fullscreen) {
  html { --mobile-rail-extra-bottom: 0.85rem; }
  body {
    padding-bottom: calc(64px + 0.75rem + env(safe-area-inset-bottom, 0px) + var(--mobile-rail-extra-bottom));
  }
}

/* iOS Safari "Add to Home Screen" fallback */
@media (max-width: 767px) {
  html.is-ios-standalone { --mobile-rail-extra-bottom: 0.85rem; }
  html.is-ios-standalone body {
    padding-bottom: calc(64px + 0.75rem + env(safe-area-inset-bottom, 0px) + var(--mobile-rail-extra-bottom));
  }
}

/* Daily Operations command dashboard */
#tab-daily_ops .daily-ops-board {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#tab-daily_ops .daily-ops-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: none;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.daily-ops-page-title {
  display: flex;
  align-items: center;
  position: relative;
  padding: 1.2rem 1rem;
  margin: -0.7rem -0.7rem 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.25s, border-color 0.25s;
}

/* ── Daily Ops Navbar ────────────────────────────────────────── */
.daily-ops-navbar {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(10, 14, 22, 0.6);
}

.daily-ops-navbar::-webkit-scrollbar { display: none; }

.daily-ops-navbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 0;
  padding: 0.55rem 0.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font: 600 0.65rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  min-width: 0;
  overflow: hidden;
}

.daily-ops-navbar-btn:hover {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.06);
}

.daily-ops-navbar-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.daily-ops-navbar-icon {
  font-size: 0.75rem;
  opacity: 0.8;
}

.daily-ops-navbar-label--short { display: none; }
.daily-ops-navbar-label--full  { display: inline; }

@media (max-width: 1200px) {
  .daily-ops-navbar-label--full  { display: none; }
  .daily-ops-navbar-label--short { display: inline; }
}

.daily-ops-title-arrow {
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 900;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}

.daily-ops-title-arrow:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-primary);
}

.daily-ops-page-title-center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.daily-ops-page-title-icon {
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0.9;
  flex-shrink: 0;
}

.daily-ops-page-title-text {
  font: 800 1.05rem var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.25s;
}

.daily-ops-page-title-meta {
  position: absolute;
  right: 3.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.75;
  transition: color 0.25s;
  white-space: nowrap;
}

.daily-ops-page-title--default  { background: transparent; border-bottom-color: rgba(148,163,184,0.08); }
.daily-ops-page-title--default  .daily-ops-page-title-text { color: var(--text-muted); }

.daily-ops-page-title--danger   { background: rgba(127,29,29,0.55); border-bottom-color: rgba(239,68,68,0.2); }
.daily-ops-page-title--danger   .daily-ops-page-title-text { color: var(--red); }

.daily-ops-page-title--success  { background: rgba(6,78,59,0.55); border-bottom-color: rgba(34,197,94,0.2); }
.daily-ops-page-title--success  .daily-ops-page-title-text { color: var(--green); }

.daily-ops-page-title--warning  { background: rgba(120,53,15,0.55); border-bottom-color: rgba(249,115,22,0.2); }
.daily-ops-page-title--warning  .daily-ops-page-title-text { color: var(--orange); }

.daily-ops-page-title--info     { background: rgba(30,58,138,0.55); border-bottom-color: rgba(59,130,246,0.2); }
.daily-ops-page-title--info     .daily-ops-page-title-text { color: var(--accent-light); }

.daily-ops-page-title--purple   { background: rgba(76,29,149,0.55); border-bottom-color: rgba(167,139,250,0.2); }
.daily-ops-page-title--purple   .daily-ops-page-title-text { color: var(--purple); }

.daily-ops-control-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
}

.daily-ops-market-label {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.5rem 0 0.75rem;
  min-height: 2.4rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 35, 0.88);
}

.daily-ops-market-label > span {
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-ops-market-label select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: 700 0.82rem var(--font-body);
  cursor: pointer;
  outline: none;
}

.daily-ops-icon-btn {
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 35, 0.88);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.daily-ops-icon-btn:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent-light);
}

.daily-ops-selected-date {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0 0.65rem;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 35, 0.88);
  color: var(--text-secondary);
  font: 700 0.76rem var(--font-body);
  white-space: nowrap;
}

/* Calendar popout */
.daily-ops-cal-popout {
  position: absolute;
  z-index: 400;
  right: 0;
  width: 17rem;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.75rem;
  background: rgba(13, 18, 30, 0.98);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
}

.daily-ops-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  font: 700 0.82rem var(--font-body);
}

.daily-ops-cal-nav {
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0.45rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.daily-ops-cal-nav:hover {
  background: rgba(59, 130, 246, 0.18);
  color: var(--accent-light);
}

.daily-ops-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.25rem;
}

.daily-ops-cal-weekdays span {
  text-align: center;
  color: var(--text-muted);
  font: 700 0.62rem var(--font-body);
  letter-spacing: 0.04em;
  padding: 0.2rem 0;
}

.daily-ops-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.18rem;
}

.daily-ops-cal-empty {
  display: block;
}

.daily-ops-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--text-secondary);
  font: 500 0.76rem var(--font-body);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.daily-ops-cal-day:hover {
  background: rgba(59, 130, 246, 0.18);
  color: var(--accent-light);
}

.daily-ops-cal-day.today {
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-light);
}

.daily-ops-cal-day.selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.daily-ops-cal-day.selected:hover {
  background: var(--accent-light);
}

.daily-ops-band {
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(10, 16, 26, 0.88);
}

.daily-ops-band-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 2.3rem;
  padding: 0 0.95rem;
  color: var(--text-primary);
  font: 900 0.72rem var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.daily-ops-band-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.92rem;
}

.daily-ops-band-title > strong {
  min-width: 0;
  flex: 1 1 auto;
  font: inherit;
}

.daily-ops-band-meta {
  flex: 0 0 auto;
  color: currentColor;
  opacity: 0.78;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

.daily-ops-band--danger .daily-ops-band-title { color: var(--red); background: rgba(127, 29, 29, 0.55); border-bottom: 1px solid rgba(239, 68, 68, 0.2); }
.daily-ops-band--success .daily-ops-band-title { color: var(--green); background: rgba(6, 78, 59, 0.55); border-bottom: 1px solid rgba(34, 197, 94, 0.2); }
.daily-ops-band--warning .daily-ops-band-title { color: var(--orange); background: rgba(120, 53, 15, 0.55); border-bottom: 1px solid rgba(249, 115, 22, 0.2); }
.daily-ops-band--info .daily-ops-band-title { color: var(--accent-light); background: rgba(30, 58, 138, 0.55); border-bottom: 1px solid rgba(59, 130, 246, 0.2); }
.daily-ops-band--purple .daily-ops-band-title { color: var(--purple); background: rgba(76, 29, 149, 0.55); border-bottom: 1px solid rgba(167, 139, 250, 0.2); }

.daily-ops-band-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.7rem;
}

/* All numbered variants inherit single-row auto-column behavior */
.daily-ops-band-grid--3,
.daily-ops-band-grid--4,
.daily-ops-band-grid--5 {
  grid-template-columns: unset;
}

.daily-ops-mid-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.daily-ops-metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 7.8rem;
  padding: 0.78rem 0.88rem 0.82rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.75rem;
  background: rgba(13, 18, 30, 0.94);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.daily-ops-metric-card:hover {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(20, 28, 44, 0.98);
}

.daily-ops-metric-label {
  display: block;
  color: var(--text-muted);
  font: 600 0.67rem var(--font-body);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-ops-metric-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}

.daily-ops-metric-icon {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.52rem;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

.daily-ops-metric-card--danger .daily-ops-metric-icon { color: var(--red); background: rgba(239, 68, 68, 0.15); }
.daily-ops-metric-card--warning .daily-ops-metric-icon { color: var(--orange); background: rgba(249, 115, 22, 0.15); }
.daily-ops-metric-card--success .daily-ops-metric-icon { color: var(--green); background: rgba(34, 197, 94, 0.15); }
.daily-ops-metric-card--info .daily-ops-metric-icon { color: var(--accent-light); background: rgba(59, 130, 246, 0.15); }
.daily-ops-metric-card--purple .daily-ops-metric-icon { color: var(--purple); background: rgba(167, 139, 250, 0.15); }

.daily-ops-metric-body {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  flex: 1 1 0;
}

.daily-ops-metric-value {
  display: block;
  color: var(--text-primary);
  font-size: 1.7rem;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.daily-ops-metric-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-ops-metric-card--danger .daily-ops-metric-sub { color: var(--red); }
.daily-ops-metric-card--warning .daily-ops-metric-sub { color: var(--orange); }
.daily-ops-metric-card--success .daily-ops-metric-sub { color: var(--green); }
.daily-ops-metric-card--info .daily-ops-metric-sub { color: var(--accent-light); }
.daily-ops-metric-card--purple .daily-ops-metric-sub { color: var(--purple); }

.daily-ops-metric-progress {
  display: block;
  width: 100%;
  height: 0.26rem;
  margin-top: 0.3rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.daily-ops-metric-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

.daily-ops-metric-card--info .daily-ops-metric-progress i { background: var(--accent); }
.daily-ops-metric-card--warning .daily-ops-metric-progress i { background: var(--orange); }
.daily-ops-metric-card--danger .daily-ops-metric-progress i { background: var(--red); }
.daily-ops-metric-card--purple .daily-ops-metric-progress i { background: var(--purple); }

.daily-ops-metric-trend {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.daily-ops-metric-trend:empty { display: none; }
.daily-ops-metric-trend--up { color: var(--red); }
.daily-ops-metric-trend--down { color: var(--green); }


/* Carousel */
.daily-ops-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.daily-ops-carousel-track {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.daily-ops-carousel-track::-webkit-scrollbar { display: none; }

.daily-ops-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.daily-ops-carousel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.daily-ops-carousel-arrow {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 35, 0.72);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.daily-ops-carousel-arrow:hover {
  background: rgba(59, 130, 246, 0.18);
  color: var(--accent-light);
}

.daily-ops-carousel-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.daily-ops-carousel-dot {
  width: 0.4rem;
  height: 0.4rem;
  border: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, width 0.2s;
}

.daily-ops-carousel-dot.active {
  width: 1.5rem;
  background: var(--accent-light);
}

.daily-ops-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

/* Shrink summary table */
.daily-ops-shrink-panel {
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-shrink-head {
  border-bottom: 1px solid rgba(239, 68, 68, 0.14);
  background: rgba(127, 29, 29, 0.3);
}

.daily-ops-shrink-head h3 {
  color: var(--red);
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.daily-ops-shrink-meta {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.daily-ops-shrink-loading {
  padding: 1.2rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.daily-ops-shrink-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.2) transparent;
}

.daily-ops-shrink-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  white-space: nowrap;
}

.daily-ops-shrink-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(20, 10, 10, 0.95);
  color: var(--text-muted);
  font: 700 0.64rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(239, 68, 68, 0.12);
}

.daily-ops-shrink-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  transition: background 0.1s;
}

.daily-ops-shrink-table tbody tr:hover {
  background: rgba(239, 68, 68, 0.06);
}

.daily-ops-shrink-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-secondary);
}

.daily-ops-shrink-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.shrink-cell-store { min-width: 10rem; }
.shrink-cell-location { min-width: 9rem; max-width: 16rem; }
.shrink-cell-mono { font-family: var(--font-mono); font-size: 0.72rem; }
.shrink-cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.shrink-cell-notes { text-align: center; }
.shrink-no-comment { color: rgba(148,163,184,0.3); }

.shrink-comment-btn {
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s;
  padding: 0;
  line-height: 1;
}

.shrink-comment-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.shrink-comment-popout {
  position: fixed;
  z-index: 900;
  width: min(22rem, calc(100vw - 2rem));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.65rem;
  background: rgba(13, 18, 30, 0.98);
  box-shadow: 0 8px 32px rgba(0,0,0,0.65);
  backdrop-filter: blur(16px);
  overflow: visible;
}

/* Speech bubble tail pointing right */
.shrink-comment-popout::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: rgba(13, 18, 30, 0.98);
  border-right: 0;
}

.shrink-comment-popout::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px;
  transform: translateY(-50%);
  border: 9px solid transparent;
  border-left-color: rgba(148, 163, 184, 0.2);
  border-right: 0;
}

.shrink-comment-popout-head {
  padding: 0.55rem 0.85rem;
  background: rgba(127, 29, 29, 0.35);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 0.65rem 0.65rem 0 0;
  color: var(--red);
  font: 700 0.68rem var(--font-body);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shrink-comment-popout-body {
  padding: 0.75rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 14rem;
  overflow-y: auto;
  border-radius: 0 0 0.65rem 0.65rem;
}

.daily-ops-bottom-panel {
  display: flex;
  flex-direction: column;
  min-height: 11rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(15, 21, 32, 0.92);
  overflow: hidden;
}

.daily-ops-bottom-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.8rem 0.35rem;
}

.daily-ops-bottom-head h3 {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.daily-ops-bottom-head a {
  color: var(--accent);
  font-size: 0.68rem;
  text-decoration: none;
}

.daily-ops-bottom-panel table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.daily-ops-bottom-panel th,
.daily-ops-bottom-panel td {
  padding: 0.34rem 0.8rem;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.daily-ops-bottom-panel th {
  color: var(--text-muted);
  font-size: 0.63rem;
  font-weight: 800;
}

.daily-ops-priority {
  display: inline-flex;
  justify-content: center;
  min-width: 3.7rem;
  padding: 0.16rem 0.42rem;
  border-radius: 0.32rem;
  font: 800 0.65rem var(--font-body);
}

.daily-ops-priority--high { color: var(--red); background: rgba(239, 68, 68, 0.14); }
.daily-ops-priority--medium { color: var(--orange); background: rgba(249, 115, 22, 0.14); }
.daily-ops-priority--low { color: var(--green); background: rgba(34, 197, 94, 0.14); }

.daily-ops-recent-list,
.daily-ops-task-list {
  display: flex;
  flex-direction: column;
}

.daily-ops-recent-row,
.daily-ops-task-row {
  display: grid;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.daily-ops-recent-row {
  grid-template-columns: 4.4rem 1.85rem minmax(0, 1fr);
}

.daily-ops-task-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

.daily-ops-recent-time {
  color: var(--text-muted);
  font: 800 0.66rem var(--font-body);
  font-style: normal;
}

.daily-ops-recent-icon {
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.daily-ops-recent-icon--danger { color: var(--red); background: var(--red-dim); }
.daily-ops-recent-icon--warning { color: var(--orange); background: var(--orange-dim); }
.daily-ops-recent-icon--success { color: var(--green); background: var(--green-dim); }
.daily-ops-recent-icon--info { color: var(--accent-light); background: var(--accent-dim); }
.daily-ops-recent-icon--purple { color: var(--purple); background: var(--purple-dim); }

.daily-ops-recent-copy strong,
.daily-ops-task-copy strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 800;
}

.daily-ops-recent-copy small,
.daily-ops-task-copy small {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.daily-ops-task-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.daily-ops-task-copy {
  min-width: 0;
}

/* Large: paired mid sections */
@media (min-width: 1180px) {
  .daily-ops-mid-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Tablet: stacked mid sections */
@media (max-width: 1179px) {
  .daily-ops-mid-row {
    grid-template-columns: 1fr;
  }
}

/* Tablet portrait: collapse bottom panels to 1 col */
@media (max-width: 900px) {
  .daily-ops-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #tab-daily_ops .daily-ops-dashboard {
    padding: 0.45rem;
  }
}

/* ── Cartons Not Received Panel ──────────────────────────────── */
.daily-ops-cartons-panel {
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-cartons-head {
  border-bottom: 1px solid rgba(239, 68, 68, 0.14);
  background: rgba(127, 29, 29, 0.3);
}

.daily-ops-cartons-head h3 {
  color: var(--red);
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.daily-ops-cartons-meta {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

/* Closing Checklist Completion: photo / PDF links in the table body.
   Light blue for the dark default theme; the Alliance theme (white rows)
   overrides to its primary blue. */
.daily-ops-scans-table .cc-doc-link {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.daily-ops-cartons-loading,
.daily-ops-sts-loading,
.daily-ops-obs-acc-loading,
.daily-ops-eol-loading {
  padding: 1.2rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.daily-ops-cartons-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.daily-ops-cartons-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  white-space: nowrap;
}

.daily-ops-cartons-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(20, 10, 10, 0.95);
  color: var(--text-muted);
  font: 700 0.64rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(239, 68, 68, 0.12);
}

.daily-ops-cartons-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  transition: background 0.1s;
}

.daily-ops-cartons-table tbody tr:hover {
  background: rgba(239, 68, 68, 0.06);
}

.daily-ops-cartons-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-secondary);
}

.daily-ops-cartons-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.cartons-cell-store { min-width: 10rem; }
.cartons-cell-mono  { font-family: var(--font-mono); font-size: 0.72rem; }
.cartons-cell-num   { text-align: right; font-variant-numeric: tabular-nums; }
.cartons-aging-high { color: #ef4444; font-weight: 700; }
.cartons-tracking-link { color: var(--red); text-decoration: none; }
.cartons-tracking-link:hover { text-decoration: underline; }

/* ── Table pagination (‹ 1 2 3 … last ›) ─────────────────────── */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Pager variants: numbered row + full-width centered range below */
.table-pagination.table-pagination--stacked-range .table-pagination__range {
  flex: 1 0 100%;
  order: 10;
  margin-top: 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-pagination.dops-pagination {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

/* Full-width row below arrows + page numbers — not tucked in a corner */
.table-pagination.dops-pagination .table-pagination__range {
  flex: 1 0 100%;
  order: 10;
  margin-top: 0.15rem;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-pg__pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-pg__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--text-secondary);
  font: 700 1.1rem/1 var(--font-body);
  cursor: pointer;
  transition: color 0.12s, background 0.12s, opacity 0.12s;
}

.table-pg__arrow:hover:not([disabled]) {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.1);
}

.table-pg__arrow[disabled] {
  opacity: 0.32;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* Simplified pager: the "Page X of Y" label that sits between the
   « ‹ … › » arrows (replaces the old numbered page buttons). */
.table-pg__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  height: 2rem;
  padding: 0 0.5rem;
  color: var(--text-secondary);
  font: 600 0.8rem/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: none;
}

.table-pg__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: 600 0.8rem var(--font-body);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  line-height: 1;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.table-pg__num:hover:not(.is-active) {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.08);
}

.table-pg__num.is-active {
  border-color: rgba(226, 232, 240, 0.55);
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  cursor: default;
}

.table-pg__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
  pointer-events: none;
}

.table-pagination__range {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-pg__suffix {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.inventory-pagination .table-pagination,
.store-pagination .table-pagination {
  justify-content: flex-end;
}

.inventory-footer .table-pagination,
.store-directory-footer .table-pagination {
  width: auto;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.arit-table-footer .table-pagination {
  justify-content: flex-end;
  width: auto;
}

/* ── Open Drawers Panel ──────────────────────────────────────── */
.daily-ops-drawers-panel {
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-drawers-head {
  border-bottom: 1px solid rgba(239, 68, 68, 0.14);
  background: rgba(127, 29, 29, 0.3);
}

.daily-ops-drawers-head h3 {
  color: var(--red);
  font: 800 0.72rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.daily-ops-drawers-meta {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.daily-ops-drawers-loading {
  padding: 1.2rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.daily-ops-drawers-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.daily-ops-drawers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  white-space: nowrap;
}

.daily-ops-drawers-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(20, 10, 10, 0.95);
  color: var(--text-muted);
  font: 700 0.64rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(239, 68, 68, 0.12);
}

.daily-ops-drawers-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  transition: background 0.1s;
}

.daily-ops-drawers-table tbody tr:hover {
  background: rgba(239, 68, 68, 0.06);
}

.daily-ops-drawers-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-secondary);
}

.daily-ops-drawers-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.drawers-cell-store { min-width: 10rem; }
.drawers-cell-mono  { font-family: var(--font-mono); font-size: 0.72rem; }
.drawers-cell-num   { text-align: right; font-variant-numeric: tabular-nums; }
.drawers-cell-txn   { text-align: center; font-variant-numeric: tabular-nums; }
.drawers-cell-amt   { text-align: left; font-variant-numeric: tabular-nums; }

/* ── Nonsellable Inventory Panel ─────────────────────────────── */
.daily-ops-nonsellable-panel {
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-nonsellable-head {
  border-bottom: 1px solid rgba(239, 68, 68, 0.14);
  background: rgba(127, 29, 29, 0.3);
}

.daily-ops-nonsellable-head h3 {
  color: var(--red);
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.daily-ops-nonsellable-meta {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.daily-ops-nonsellable-loading {
  padding: 1.2rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.daily-ops-nonsellable-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.daily-ops-nonsellable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  white-space: nowrap;
}

.daily-ops-nonsellable-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(20, 10, 10, 0.95);
  color: var(--text-muted);
  font: 700 0.64rem var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(239, 68, 68, 0.12);
}

.daily-ops-nonsellable-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  transition: background 0.1s;
}

.daily-ops-nonsellable-table tbody tr:hover {
  background: rgba(239, 68, 68, 0.06);
}

.daily-ops-nonsellable-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-secondary);
}

.daily-ops-nonsellable-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

.nonsellable-cell-store { min-width: 10rem; }
.nonsellable-cell-mono  { font-family: var(--font-mono); font-size: 0.72rem; }
.nonsellable-cell-num   { text-align: right; font-variant-numeric: tabular-nums; }
.nonsellable-aging-high { color: #ef4444; font-weight: 700; }
/* DAYS OLD column — bold + colored. Higher specificity + !important so it wins
   over the global table-row normalization (which forces 400 weight). */
.daily-ops-nonsellable-table tbody td.nonsellable-cell-aging {
  font-weight: 700 !important;
  color: #c0392b !important;
}

/* Outstanding Shrink — sortable column headers */
.daily-ops-shrink-table thead th.shrink-sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.daily-ops-shrink-table thead th.shrink-sortable:hover {
  color: var(--text-primary);
}
.shrink-sort-arrow {
  font-size: 0.7em;
  color: #fff;
  margin-left: 0.15em;
}

table[data-dops-sort-table] thead th.dops-sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
table[data-dops-sort-table] thead th.dops-sortable:hover {
  color: var(--text-primary);
}
.dops-sort-arrow {
  font-size: 0.7em;
  color: #fff;
  margin-left: 0.15em;
}

/* Outstanding Shrink — Txn Type pills with directional arrows */
.shrink-txn { font-weight: 600; white-space: nowrap; }
.shrink-txn-arrow { font-size: 0.75em; line-height: 1; margin-left: 0.15em; }
.shrink-txn-out .shrink-txn-arrow { color: #ef4444; }
.shrink-txn-in  .shrink-txn-arrow { color: #22c55e; }

/* Mobile: Cartons Not Received — Store Name (left) | Carton # | Delivered */
@media (max-width: 768px) {
  .daily-ops-cartons-table {
    font-size: 0.68rem;
  }
  .daily-ops-cartons-table thead th {
    font-size: 0.56rem;
    padding: 0.3rem 0.25rem;
  }
  .daily-ops-cartons-table td {
    padding: 0.3rem 0.25rem;
  }
  .daily-ops-cartons-table thead th,
  .daily-ops-cartons-table td {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    text-align: center;
  }
  .daily-ops-cartons-table:not(.has-upd-col) thead th:nth-child(2),
  .daily-ops-cartons-table:not(.has-upd-col) tbody td:nth-child(2),
  .daily-ops-cartons-table.has-upd-col thead th:nth-child(3),
  .daily-ops-cartons-table.has-upd-col tbody td:nth-child(3) {
    text-align: left;
    padding-right: 0.1rem;
  }
  .daily-ops-cartons-table:not(.has-upd-col) thead th:nth-child(3),
  .daily-ops-cartons-table.has-upd-col thead th:nth-child(4),
  .daily-ops-cartons-table tbody td.cartons-cell-carton {
    text-align: left;
    padding-left: 0.1rem;
  }
  .cartons-cell-store {
    min-width: auto;
  }
  .cartons-cell-mono {
    font-size: 0.63rem;
  }
}

/* Mobile: Outstanding Shrink — horizontal scroll (all columns visible) */
@media (max-width: 768px) {
  .daily-ops-shrink-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .daily-ops-shrink-table {
    width: max-content;
    min-width: 100%;
    font-size: 0.7rem;
  }

  .daily-ops-shrink-table thead th,
  .daily-ops-shrink-table td {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .daily-ops-shrink-table thead th.shrink-th-store,
  .daily-ops-shrink-table td.shrink-cell-store,
  .daily-ops-shrink-table thead th.shrink-th-location,
  .daily-ops-shrink-table td.shrink-cell-location {
    text-align: left;
  }

  .daily-ops-shrink-table thead th:first-child,
  .daily-ops-shrink-table td:first-child {
    padding-left: 0.55rem;
  }

  .daily-ops-shrink-table thead th:last-child,
  .daily-ops-shrink-table td:last-child {
    padding-right: 0.55rem;
  }
}

/* Mobile: hide District / Store / Opus ID / As Of Date / Serial — keep Item, Description, Aging, Unit Price, Next */
@media (max-width: 768px) {
  .daily-ops-nonsellable-table:not(.has-upd-col) thead th:nth-child(-n+4),
  .daily-ops-nonsellable-table:not(.has-upd-col) tbody td:nth-child(-n+4),
  .daily-ops-nonsellable-table:not(.has-upd-col) thead th:nth-child(7),
  .daily-ops-nonsellable-table:not(.has-upd-col) tbody td:nth-child(7),
  .daily-ops-nonsellable-table.has-upd-col thead th:nth-child(n+2):nth-child(-n+5),
  .daily-ops-nonsellable-table.has-upd-col tbody td:nth-child(n+2):nth-child(-n+5),
  .daily-ops-nonsellable-table.has-upd-col thead th:nth-child(8),
  .daily-ops-nonsellable-table.has-upd-col tbody td:nth-child(8) {
    display: none;
  }
  /* Tighten edge gutters around the table on mobile */
  #tab-inventory.tab-pane,
  #tab-daily_ops.tab-pane {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .daily-ops-nonsellable-table thead th,
  .daily-ops-nonsellable-table td {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
  .daily-ops-nonsellable-table thead th:first-child,
  .daily-ops-nonsellable-table td:first-child {
    padding-left: 0.55rem;
  }
  .daily-ops-nonsellable-table thead th:last-child,
  .daily-ops-nonsellable-table td:last-child {
    padding-right: 0.55rem;
  }
  .daily-ops-nonsellable-table thead th,
  .daily-ops-nonsellable-table td,
  .daily-ops-nonsellable-table .nonsellable-cell-num,
  .daily-ops-nonsellable-table .nonsellable-cell-mono {
    text-align: center;
  }
  .daily-ops-nonsellable-table thead th.nonsellable-th-store,
  .daily-ops-nonsellable-table td.nonsellable-cell-store {
    text-align: left;
  }
  /* Keep Description (column 6) left-aligned for readability */
  .daily-ops-nonsellable-table:not(.has-upd-col) thead th:nth-child(6),
  .daily-ops-nonsellable-table:not(.has-upd-col) tbody td:nth-child(6),
  .daily-ops-nonsellable-table.has-upd-col thead th:nth-child(7),
  .daily-ops-nonsellable-table.has-upd-col tbody td:nth-child(7) {
    text-align: left;
  }
}

/* ── Product Notes Panel ─────────────────────────────────────── */
.daily-ops-prodnote-panel {
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-prodnote-head {
  background: rgba(168, 85, 247, 0.10);
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
}

.daily-ops-prodnote-head h3 {
  color: #c084fc;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.daily-ops-prodnote-meta {
  font-size: 0.68rem;
  color: rgba(233, 213, 255, 0.75);
  white-space: nowrap;
}

.daily-ops-prodnote-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.2) transparent;
}

.daily-ops-prodnote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-prodnote-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(15, 5, 25, 0.95);
  color: rgba(233, 213, 255, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
  white-space: nowrap;
}

.daily-ops-prodnote-table tbody tr {
  border-bottom: 1px solid rgba(168, 85, 247, 0.06);
  transition: background 0.1s;
}

.daily-ops-prodnote-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.05);
}

.daily-ops-prodnote-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.prodnote-cell-store { min-width: 10rem; }
.prodnote-cell-mono  { font-family: var(--font-mono); font-size: 0.72rem; }
.prodnote-cell-num   { text-align: right; font-variant-numeric: tabular-nums; }

/* ── IPOG Panel ──────────────────────────────────────────────── */
.daily-ops-ipog-panel {
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-ipog-head {
  background: rgba(129, 140, 248, 0.10);
  border-bottom: 1px solid rgba(129, 140, 248, 0.18);
}

.daily-ops-ipog-head h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.daily-ops-ipog-meta {
  font-size: 0.68rem;
  color: rgba(199, 210, 254, 0.75);
  white-space: nowrap;
}

.daily-ops-ipog-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(129, 140, 248, 0.2) transparent;
}

.daily-ops-ipog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-ipog-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(8, 8, 25, 0.95);
  color: rgba(199, 210, 254, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(129, 140, 248, 0.15);
  white-space: nowrap;
}

.daily-ops-ipog-table tbody tr {
  border-bottom: 1px solid rgba(129, 140, 248, 0.06);
  transition: background 0.1s;
}

.daily-ops-ipog-table tbody tr:hover {
  background: rgba(129, 140, 248, 0.05);
}

.daily-ops-ipog-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
  text-align: left;
}

.ipog-cell-pct  { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.ipog-cell-mono { font-family: var(--font-mono); font-size: 0.72rem; }

/* ── Device Alive Panel ──────────────────────────────────────── */
.daily-ops-da-panel {
  border: 1px solid rgba(99, 179, 237, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-da-head {
  background: rgba(99, 179, 237, 0.10);
  border-bottom: 1px solid rgba(99, 179, 237, 0.18);
}

.daily-ops-da-head h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #63b3ed;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.daily-ops-da-meta {
  font-size: 0.68rem;
  color: rgba(190, 227, 248, 0.75);
  white-space: nowrap;
}

.daily-ops-da-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 179, 237, 0.2) transparent;
}

.daily-ops-da-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-da-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(5, 10, 25, 0.95);
  color: rgba(190, 227, 248, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(99, 179, 237, 0.15);
  white-space: nowrap;
}

.daily-ops-da-table tbody tr {
  border-bottom: 1px solid rgba(99, 179, 237, 0.06);
  transition: background 0.1s;
}

.daily-ops-da-table tbody tr:hover {
  background: rgba(99, 179, 237, 0.05);
}

.daily-ops-da-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.da-cell-store       { min-width: 10rem; }
.da-cell-num         { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.da-compliance-good  { color: #4ade80; }
.da-compliance-mid   { color: #fbbf24; }
.da-compliance-low   { color: #ef4444; }
.da-issue            { color: #f97316; font-weight: 700; }

/* ── EOL Devices Panel ───────────────────────────────────────── */
.daily-ops-eol-panel {
  border: 1px solid rgba(244, 63, 94, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-eol-head {
  background: rgba(244, 63, 94, 0.10);
  border-bottom: 1px solid rgba(244, 63, 94, 0.18);
}

.daily-ops-eol-head h3 {
  margin: 0;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  color: #fb7185;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-ops-eol-meta {
  font-size: 0.68rem;
  color: rgba(253, 164, 175, 0.75);
  white-space: nowrap;
}

.daily-ops-eol-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 63, 94, 0.2) transparent;
}

.daily-ops-eol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-eol-table thead th {
  padding: 0.32rem 0.38rem;
  background: rgba(20, 5, 8, 0.95);
  color: rgba(253, 164, 175, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  border-bottom: 1px solid rgba(244, 63, 94, 0.15);
  white-space: nowrap;
}

.daily-ops-eol-table tbody tr {
  border-bottom: 1px solid rgba(244, 63, 94, 0.06);
  transition: background 0.1s;
}

.daily-ops-eol-table tbody tr:hover {
  background: rgba(244, 63, 94, 0.05);
}

.daily-ops-eol-table td {
  padding: 0.3rem 0.38rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.eol-cell-store { min-width: 8.5rem; }
.eol-cell-mono  { font-family: var(--font-mono); font-size: 0.72rem; }
.daily-ops-eol-table th.eol-cell-qty,
.daily-ops-eol-table td.eol-cell-qty {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .daily-ops-eol-table thead th,
  .daily-ops-eol-table td {
    padding: 0.28rem 0.28rem;
  }
  .daily-ops-eol-table {
    font-size: 0.7rem;
  }
  .eol-cell-mono {
    font-size: 0.68rem;
  }
  .eol-cell-store {
    min-width: 7.25rem;
  }
}

/* ── Obsolete Accessories Panel — yellow / gold theme ─────────── */
.daily-ops-obs-acc-panel {
  border: 1px solid rgba(234, 179, 8, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-obs-acc-head {
  background: rgba(234, 179, 8, 0.1);
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
}

.daily-ops-obs-acc-head h3 {
  margin: 0;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  color: #eab308;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-ops-obs-acc-meta {
  font-size: 0.68rem;
  color: rgba(253, 224, 71, 0.75);
  white-space: nowrap;
}

.daily-ops-obs-acc-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 179, 8, 0.2) transparent;
}

.daily-ops-obs-acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-obs-acc-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(32, 28, 8, 0.95);
  color: rgba(253, 224, 71, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(234, 179, 8, 0.15);
  white-space: nowrap;
}

.daily-ops-obs-acc-table tbody tr {
  border-bottom: 1px solid rgba(234, 179, 8, 0.06);
  transition: background 0.1s;
}

.daily-ops-obs-acc-table tbody tr:hover {
  background: rgba(234, 179, 8, 0.05);
}

.daily-ops-obs-acc-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.obs-acc-cell-store { min-width: 10rem; }
.daily-ops-obs-acc-table thead th.obs-acc-th-opus,
.daily-ops-obs-acc-table td.obs-acc-cell-opus {
  text-align: center;
}
.daily-ops-obs-acc-table thead th.obs-acc-th-sku,
.daily-ops-obs-acc-table td.obs-acc-cell-sku {
  text-align: center;
}
.daily-ops-obs-acc-table thead th.obs-acc-th-qty,
.daily-ops-obs-acc-table td.obs-acc-cell-qty {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.obs-acc-cell-mono  { font-family: var(--font-mono); font-size: 0.72rem; }
.obs-acc-cell-num   { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Nonsellable Logistics Panel ─────────────────────────────── */
.daily-ops-nonsell-log-panel {
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-nonsell-log-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: rgba(251, 191, 36, 0.10);
  border-bottom: 1px solid rgba(251, 191, 36, 0.18);
  flex-wrap: wrap;
}

.daily-ops-nonsell-log-head h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.daily-ops-nonsell-log-meta {
  font-size: 0.68rem;
  color: rgba(253, 224, 140, 0.75);
  white-space: nowrap;
}

.daily-ops-nonsell-log-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.2) transparent;
}

.daily-ops-nonsell-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-nonsell-log-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(20, 15, 5, 0.95);
  color: rgba(253, 224, 140, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  white-space: nowrap;
}

.daily-ops-nonsell-log-table tbody tr {
  border-bottom: 1px solid rgba(251, 191, 36, 0.06);
  transition: background 0.1s;
}

.daily-ops-nonsell-log-table tbody tr:hover {
  background: rgba(251, 191, 36, 0.05);
}

.daily-ops-nonsell-log-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.nonsell-log-cell-store  { min-width: 10rem; }
.nonsell-log-cell-mono   { font-family: var(--font-mono); font-size: 0.72rem; }
.nonsell-log-cell-num    { text-align: right; font-variant-numeric: tabular-nums; }
.nonsell-log-cell-center { text-align: center; font-weight: 600; }
.nonsell-log-aging-high  { color: #ef4444; font-weight: 700; }

/* ── STS Transfer Panel ──────────────────────────────────────── */
.daily-ops-sts-panel {
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-sts-head {
  background: rgba(56, 189, 248, 0.10);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}

.daily-ops-sts-head h3 {
  margin: 0;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  color: #38bdf8;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-ops-sts-meta {
  font-size: 0.68rem;
  color: rgba(125, 211, 252, 0.75);
  white-space: nowrap;
}

.daily-ops-sts-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.2) transparent;
}

.daily-ops-sts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-sts-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(5, 20, 35, 0.95);
  color: rgba(125, 211, 252, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  white-space: nowrap;
}

.daily-ops-sts-table tbody tr {
  border-bottom: 1px solid rgba(56, 189, 248, 0.06);
  transition: background 0.1s;
}

.daily-ops-sts-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.daily-ops-sts-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.sts-cell-store    { min-width: 10rem; }
.daily-ops-sts-table thead th.sts-th-opus,
.daily-ops-sts-table thead th.sts-th-age {
  text-align: center;
}

.daily-ops-sts-table td.sts-cell-opus {
  text-align: center;
}
.sts-cell-mono     { font-family: var(--font-mono); font-size: 0.72rem; }
.sts-cell-num      { text-align: right; font-variant-numeric: tabular-nums; }
.sts-cell-days     { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.sts-status { text-align: center; }

/* STS Transfers: size each column to its content. Opus ID, Age, Transfer # and
   Status shrink to fit (width:1% + nowrap), and Store Name takes up the slack
   so the table still fills the full-width panel without stretched gaps. */
.daily-ops-sts-table th:not(.sts-th-store),
.daily-ops-sts-table td:not(.sts-cell-store) {
  width: 1%;
  white-space: nowrap;
}
.daily-ops-sts-table th.sts-th-store,
.daily-ops-sts-table td.sts-cell-store {
  width: auto;
  white-space: nowrap;
}

/* ── Device Scans Panel ──────────────────────────────────────── */
.daily-ops-scans-panel {
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(13, 18, 30, 0.94);
  overflow: hidden;
  margin-top: 0.75rem;
}

.daily-ops-scans-head {
  background: rgba(34, 197, 94, 0.12);
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.daily-ops-scans-head h3 {
  margin: 0;
  font: 800 0.875rem var(--font-body);
  letter-spacing: 0.1em;
  color: #4ade80;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-ops-scans-meta {
  font-size: 0.68rem;
  color: rgba(134, 239, 172, 0.75);
  white-space: nowrap;
}

.daily-ops-scans-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 197, 94, 0.2) transparent;
}

.daily-ops-scans-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
  white-space: nowrap;
}

.daily-ops-scans-table thead th {
  padding: 0.45rem 0.75rem;
  background: rgba(10, 25, 15, 0.95);
  color: rgba(134, 239, 172, 0.7);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
  white-space: nowrap;
}

.daily-ops-scans-table tbody tr {
  border-bottom: 1px solid rgba(34, 197, 94, 0.06);
  transition: background 0.1s;
}

.daily-ops-scans-table tbody tr:hover {
  background: rgba(34, 197, 94, 0.05);
}

.daily-ops-scans-table td {
  padding: 0.42rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.scans-cell-store { min-width: 10rem; }

.scans-cell-completion   { font-weight: 400; text-align: center; }
.scans-status-complete   { color: #4ade80; }
.scans-status-incomplete { color: #ef4444; }

/* "SCANS THIS MONTH" cadence column: Counted scan-days / expected open days. */
.scans-cell-mtd  { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scans-mtd-warn  { color: #f59e0b; }

/* Per-column dropdown filters above the scan tables. */
.dops-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: end;
  padding: 0.5rem 0.75rem 0.75rem;
}
.dops-col-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary, #64748b);
}
.dops-col-filter-select {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #ffffff;
  color: #0f172a;
  min-width: 9rem;
  cursor: pointer;
}
.dops-col-filter-select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* ── Daily Ops tables: compact gutters (desktop/tablet — mobile keeps narrower rules above) ── */
@media (min-width: 769px) {
  .daily-ops-shrink-table thead th,
  .daily-ops-cartons-table thead th,
  .daily-ops-nonsellable-table thead th,
  .daily-ops-sts-table thead th,
  .daily-ops-obs-acc-table thead th,
  .daily-ops-scans-table thead th,
  .daily-ops-drawers-table thead th,
  .daily-ops-ipog-table thead th,
  .daily-ops-da-table thead th,
  .daily-ops-prodnote-table thead th {
    padding: 0.3rem 0.34rem;
    letter-spacing: 0.035em;
  }

  .daily-ops-shrink-table td,
  .daily-ops-cartons-table td,
  .daily-ops-nonsellable-table td,
  .daily-ops-sts-table td,
  .daily-ops-obs-acc-table td,
  .daily-ops-scans-table td,
  .daily-ops-drawers-table td,
  .daily-ops-ipog-table td,
  .daily-ops-da-table td,
  .daily-ops-prodnote-table td {
    padding: 0.26rem 0.34rem;
  }

  .daily-ops-shrink-table,
  .daily-ops-cartons-table,
  .daily-ops-nonsellable-table {
    font-size: 0.72rem;
  }

  .daily-ops-eol-table {
    font-size: 0.71rem;
  }

  .daily-ops-eol-table thead th {
    padding: 0.28rem 0.32rem;
  }

  .daily-ops-eol-table td {
    padding: 0.26rem 0.32rem;
  }

  .eol-cell-store {
    min-width: 6.75rem;
  }

  .eol-cell-mono {
    font-size: 0.69rem;
  }
}

.daily-ops-sts-table,
.daily-ops-obs-acc-table,
.daily-ops-scans-table {
  font-size: 0.7rem;
}

.shrink-cell-store,
.cartons-cell-store,
.nonsellable-cell-store,
.scans-cell-store,
.obs-acc-cell-store {
  min-width: 7.25rem;
}

.sts-cell-store {
  min-width: 5.25rem;
}

.sts-cell-mono,
.obs-acc-cell-mono,
.scans-cell-mono {
  font-size: 0.68rem;
}

.dops-pagination.table-pagination {
  padding: 0.42rem 0.45rem;
  gap: 0.22rem;
}

.table-pagination.dops-pagination .table-pg__arrow,
.table-pagination.dops-pagination .table-pg__num {
  min-width: 1.62rem;
  height: 1.62rem;
  font-size: 0.72rem;
}

@media (max-width: 768px) {
  .daily-ops-sts-table thead th,
  .daily-ops-sts-table td,
  .daily-ops-obs-acc-table thead th,
  .daily-ops-obs-acc-table td {
    padding: 0.22rem 0.24rem;
  }
  .daily-ops-sts-table,
  .daily-ops-obs-acc-table {
    font-size: 0.66rem;
  }
}

/* Store Name columns — left-aligned (Daily Ops + workbook store grid + inventory) */
.daily-ops-shrink-table thead th.shrink-th-store,
.daily-ops-shrink-table td.shrink-cell-store,
.daily-ops-cartons-table thead th.cartons-th-store,
.daily-ops-cartons-table td.cartons-cell-store,
.daily-ops-nonsellable-table thead th.nonsellable-th-store,
.daily-ops-nonsellable-table td.nonsellable-cell-store,
.daily-ops-eol-table thead th.eol-th-store,
.daily-ops-eol-table td.eol-cell-store,
.daily-ops-obs-acc-table thead th.obs-acc-th-store,
.daily-ops-obs-acc-table td.obs-acc-cell-store,
.daily-ops-sts-table thead th.sts-th-store,
.daily-ops-sts-table td.sts-cell-store,
.daily-ops-scans-table thead th.scans-th-store,
.daily-ops-scans-table td.scans-cell-store,
.daily-ops-prodnote-table thead th.prodnote-th-store,
.daily-ops-prodnote-table td.prodnote-cell-store,
.daily-ops-da-table thead th.da-th-store,
.daily-ops-da-table td.da-cell-store,
.daily-ops-drawers-table thead th.drawers-th-store,
.daily-ops-drawers-table td.drawers-cell-store {
  text-align: left;
}

.daily-ops-store-table thead th:nth-child(3),
.daily-ops-store-table tbody td:nth-child(3) {
  text-align: left;
}

.inventory-table thead th.inv-th-store,
.inventory-table tbody td.inv-store {
  text-align: left;
}

.inventory-table thead th.inv-th-store .inventory-column-control {
  justify-content: flex-start;
}

.inventory-table thead th.inv-th-store .inventory-filter-btn {
  text-align: left;
  justify-self: start;
}

.daily-ops-bottom-panel--stores table th:first-child,
.daily-ops-bottom-panel--stores table tbody td:first-child {
  text-align: left;
}

.events-table thead th.events-th-store,
.events-table tbody td.events-cell-store {
  text-align: left;
}

/* --- Upload page (password-gated) --- */
/* Must NOT use bare #tab-upload { display: flex } — ID beats .tab-pane { display: none } and would show Upload on every tab. */
/* Explicit hide when inactive; exclude .tab-pane--swipe-out so mobile swipe transitions still show the outgoing pane. */
#tab-upload.tab-pane:not(.active):not(.tab-pane--swipe-out) {
  display: none !important;
}
#tab-upload.tab-pane.active {
  display: flex;
  justify-content: center;
  min-height: min(70vh, 52rem);
}

.upload-page-shell {
  width: 100%;
  max-width: 38rem;
  margin: 1rem auto;
  padding: 0 1rem 1.5rem;
}

/* --- Requests page --- */
.requests-page-shell {
  width: 100%;
  max-width: 38rem;
  margin: 1rem auto;
  padding: 0 1rem 2.5rem;
}

.requests-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.requests-link {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.requests-link:hover {
  border-color: var(--accent);
  background: var(--bg-panel);
}

/* --- Research page --- */
.research-page-shell {
  width: 100%;
  max-width: 72rem;
  margin: 1rem auto;
  padding: 0 1rem 2.5rem;
}

.research-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.research-panel__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.research-panel-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
}

.research-panel-icon-btn:hover {
  border-color: var(--accent, var(--border));
}

.research-panel__subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-secondary, var(--text-primary));
  font-size: 0.85rem;
}

.research-panel__body {
  padding: 1rem;
}

.research-status {
  margin: 0 0 0.75rem;
  color: var(--text-secondary, var(--text-primary));
  font-size: 0.85rem;
}

.research-empty {
  margin: 0;
  color: var(--text-secondary, var(--text-primary));
}

.research-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.research-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.research-table th,
.research-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.research-table th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
}

.research-table tbody tr:hover {
  background: var(--bg-panel);
}

/* Mobile: give Adjustment Research the full viewport width and make
   sure every nested table scrolls horizontally. The desktop layout
   capped the page shell at 72rem with 1rem of horizontal padding,
   which on a phone left only a sliver for the wide adjustment
   table. */
@media (max-width: 767px) {
  #tab-research .research-page-shell {
    max-width: none;
    margin: 0.5rem 0;
    padding: 0 0.25rem 1.5rem;
  }

  #tab-research .research-panel__body {
    padding: 0.5rem;
  }

  /* The store tiles indent every nested list — kill that indent on
     phones so the per-store table inherits the full panel width. */
  #tab-research .research-store-list {
    padding-left: 0;
  }

  #tab-research .research-table-mount,
  #tab-research .research-table-host {
    width: 100%;
    max-width: 100%;
  }

  /* Both the rolled-up adjustment table and every per-store breakout
     get a touch-momentum horizontal scrollbar; .research-table itself
     keeps white-space: nowrap so the scroll is meaningful. */
  #tab-research .research-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  #tab-research .research-table {
    width: max-content;
    min-width: 100%;
  }

  /* District + store summary rows: the desktop layout packs the
     location name next to two 6.5rem metric columns and an export
     button, which on a phone squeezes the name to ~80px and truncates
     "Appalachian", "Arkansas Valley", etc. to "Appala…".
     Turn each tile's header into a horizontal scroller — the name
     gets a real min-width and shows in full, the metrics stay at
     their full width side-by-side, and the user can flick right to
     see the rest if a name is unusually long. */
  #tab-research .research-store-header {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  #tab-research .research-district-toggle,
  #tab-research .research-store-toggle {
    flex: 0 0 auto;
    width: max-content;
    min-width: calc(100% - 3.5rem);  /* leave room for the trailing export button */
    gap: 0.65rem;
    padding: 0.75rem 0.75rem;
  }
  #tab-research .research-store-name {
    flex: 0 0 auto;
    min-width: 11rem;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    padding-right: 0.4rem;
  }
  #tab-research .research-store-metric {
    flex: 0 0 auto;
    min-width: 5.25rem;
  }
  #tab-research .research-store-export,
  #tab-research .research-store-export-spacer {
    flex: 0 0 auto;
  }
}

.research-list-shell {
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-elevated);
}

.research-sort-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* Left padding aligns Location with tile names. Right padding accounts for list pad
     0.25rem + tile border + toggle pad-right 1rem + export-spacer 1.95rem + margin 0.75rem ≈ 4rem. */
  padding: 0.5rem 4rem 0.5rem 2.75rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.research-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--text-secondary, var(--text-primary));
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.research-sort-btn:hover {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.research-sort-btn--active {
  color: var(--text-primary);
}

.research-sort-btn--location {
  flex: 1 1 auto;
  justify-content: flex-start;
}

.research-sort-btn--qty,
.research-sort-btn--adj {
  flex: none;
  min-width: 6.5rem;
  justify-content: flex-end;
}

.research-sort-arrow {
  font-size: 0.65rem;
  width: 0.7rem;
  text-align: center;
}

.research-district-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
}

.research-district-tile {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  margin-bottom: 0.6rem;
  background: var(--bg-elevated);
  overflow: hidden;
}

.research-district-list .research-district-tile:last-child {
  margin-bottom: 0;
}

.research-district-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

/* Invisible placeholder in the district header that mirrors the export button's
   exact box (padding + border + 16px SVG) so QTY/ADJ TOTAL columns line up
   between district and store rows. */
.research-store-export-spacer {
  flex: none;
  align-self: center;
  margin-right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  visibility: hidden;
  pointer-events: none;
}

.research-district-toggle:hover {
  background: var(--bg-panel);
}

.research-district-tile--open > .research-district-toggle .research-store-chevron {
  transform: rotate(90deg);
}

.research-store-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.5rem 1.25rem;
}

.research-store-tile {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  margin-bottom: 0.6rem;
  background: var(--bg-elevated);
  overflow: hidden;
}

.research-store-list .research-store-tile:last-child {
  margin-bottom: 0;
}

.research-store-header {
  display: flex;
  align-items: stretch;
}

.research-store-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.research-store-export {
  flex: none;
  align-self: center;
  margin-right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
}

.research-store-export:hover {
  border-color: var(--accent, var(--border));
}

.research-store-header:hover {
  background: var(--bg-panel);
}

.research-store-chevron {
  flex: none;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.research-store-tile--open .research-store-chevron {
  transform: rotate(90deg);
}

.research-store-name {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.research-store-count {
  flex: none;
  min-width: 4.5rem;
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary, var(--text-primary));
}

.research-store-metric {
  flex: none;
  min-width: 6.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.research-store-metric-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary, var(--text-primary));
}

.research-store-metric-value {
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.research-store-metric-value.research-amount-pos {
  color: var(--green, #22c55e);
}

.research-store-metric-value.research-amount-neg {
  color: var(--red, #ef4444);
}

.research-table td.research-amount-pos {
  color: var(--green, #22c55e);
}

.research-table td.research-amount-neg {
  color: var(--red, #ef4444);
}

.research-table .research-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.research-table tfoot td {
  border-top: 2px solid var(--border);
  font-weight: 600;
}

.research-table tfoot .research-total-label {
  color: var(--text-secondary, var(--text-primary));
}

.research-table-controls {
  padding: 0.5rem 0 0.6rem;
}

.research-serial-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.research-serial-trigger--active {
  color: var(--accent, var(--text-primary));
}

.research-serial-caret {
  font-size: 0.7rem;
}

.research-serial-panel {
  margin: 0 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-panel, var(--bg-elevated));
  padding: 0.5rem 0.6rem;
}

.research-serial-panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary, var(--text-primary));
  margin-bottom: 0.4rem;
}

.research-serial-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 12rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.4rem;
  background: var(--bg-elevated);
}

.research-serial-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.3rem;
  font-size: 0.82rem;
  border-radius: 0.3rem;
  cursor: pointer;
}

.research-serial-option:hover {
  background: var(--bg-panel, transparent);
}

.research-serial-empty {
  font-size: 0.82rem;
  color: var(--text-secondary, var(--text-primary));
}

.research-serial-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.research-serial-panel-actions button {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.research-serial-panel-actions .research-serial-done {
  border-color: var(--accent, var(--border));
  font-weight: 600;
}

.research-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.research-table .research-amount .research-sort {
  justify-content: flex-end;
  text-align: right;
}

.research-sort--active {
  color: var(--accent, var(--text-primary));
}

.research-sort-arrow {
  font-size: 0.7rem;
}

.research-table-empty {
  text-align: center;
  padding: 0.85rem;
  color: var(--text-secondary, var(--text-primary));
}

.research-note-popout {
  position: fixed;
  z-index: 900;
  width: min(22rem, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-elevated);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.research-note-popout-head {
  padding: 0.55rem 0.85rem;
  background: var(--bg-panel, var(--bg-elevated));
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.research-note-popout-body {
  padding: 0.75rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 14rem;
  overflow-y: auto;
}

.research-store-body {
  padding: 0 0.75rem 0.75rem;
}

/* --- Cancel Hyla Trade-In form (hidden page) --- */
/* Fix: display:flex on .hyla-cancel-field can beat [hidden] in some mobile browsers */
#hylaReasonOtherWrap[hidden] {
  display: none !important;
}

.hyla-cancel-shell {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 0.75rem 0.75rem 3rem;
}

/* Employee lookup section sits between the titlebar and the form */
.hyla-cancel-employee-section {
  width: 100%;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hyla-cancel-employee-email-input {
  /* Override the underline style from .hyla-cancel-input for this standalone field */
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0.5rem !important;
  padding: 0.65rem 0.85rem !important;
  margin-top: 0.1rem;
}

.hyla-cancel-employee-email-input:focus {
  border-color: var(--accent) !important;
}

/* Employee info card — revealed after a successful lookup */
.hyla-employee-info {
  margin-top: 0.65rem;
}

.hyla-employee-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
}

.hyla-employee-card__row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hyla-employee-card__label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hyla-employee-card__value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

/* Loading state */
.hyla-employee-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@keyframes hyla-spin {
  to { transform: rotate(360deg); }
}

.hyla-employee-spinner {
  animation: hyla-spin 0.9s linear infinite;
  flex-shrink: 0;
}

/* Not-found / error state */
.hyla-employee-not-found {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
}

.hyla-cancel-panel {
  border-radius: 1rem;
  overflow: hidden;
}

.hyla-cancel-panel__header {
  flex-direction: column;
  align-items: flex-start;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.hyla-cancel-panel__header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.hyla-cancel-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.hyla-cancel-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

/* Each field is a full-width row with a top separator */
.hyla-cancel-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hyla-cancel-field--file {
  gap: 0.6rem;
}

.hyla-cancel-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

/* Inputs — 16px font prevents iOS auto-zoom */
.hyla-cancel-input {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 0.3rem 0 0.55rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  line-height: 1.4;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.hyla-cancel-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.hyla-cancel-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

/* Select: custom chevron */
.hyla-cancel-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.1rem center;
  padding-right: 1.5rem;
  cursor: pointer;
}

.hyla-cancel-textarea {
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  resize: vertical;
  min-height: 4.5rem;
  margin-top: 0.1rem;
}

.hyla-cancel-textarea:focus {
  border-color: var(--accent);
}

/* File upload — hide native input, show styled tap target */
.hyla-cancel-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hyla-cancel-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.hyla-cancel-file-btn:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}

.hyla-cancel-file-btn svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.hyla-cancel-filenames {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-word;
  line-height: 1.4;
}

.hyla-cancel-filenames:empty {
  display: none;
}

/* Submit + status */
.hyla-cancel-actions {
  padding: 1rem 1.25rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hyla-cancel-submit {
  width: 100%;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 0.65rem;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.hyla-cancel-submit:active {
  opacity: 0.85;
}

.hyla-cancel-submit:disabled {
  opacity: 0.45;
  cursor: progress;
}

.hyla-cancel-status {
  margin: 0;
  padding: 0.65rem 1.25rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1rem;
  text-align: center;
}

.hyla-cancel-status:empty {
  display: none;
}

.hyla-cancel-status--pending {
  color: var(--text-secondary);
}

.hyla-cancel-status--success {
  color: var(--success);
}

.hyla-cancel-status--error {
  color: var(--danger);
}

/* --- Merchandising order: repeatable item rows (reuses .hyla-cancel-* styles) --- */
.archway-order-items {
  display: flex;
  flex-direction: column;
}

.archway-order-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem 0;
}

.archway-order-item + .archway-order-item .archway-order-item__head {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
}

.archway-order-item__num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.archway-order-item__remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--danger);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.archway-order-item__remove:active {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--danger);
}

.archway-order-item__remove[hidden] {
  display: none;
}

/* Inline item row: [qty] [item text] [camera] */
.archway-order-item__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 0.15rem;
}

.archway-order-item-qty,
.archway-order-item-name {
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.6rem 0.7rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

.archway-order-item-qty {
  flex: 0 0 auto;
  width: 3.75rem;
  text-align: center;
  -moz-appearance: textfield;
}

.archway-order-item-qty::-webkit-outer-spin-button,
.archway-order-item-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.archway-order-item-name {
  flex: 1 1 auto;
  min-width: 0;
}

.archway-order-item-qty::placeholder,
.archway-order-item-name::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.archway-order-item-qty:focus,
.archway-order-item-name:focus {
  outline: none;
  border-color: var(--accent);
}

.archway-order-item__camera {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.archway-order-item__camera:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}

.archway-order-item__camera.has-photo {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.archway-order-item__camera input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.archway-order-item-filename {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 1.25rem 0.35rem;
  word-break: break-word;
  line-height: 1.4;
}

.archway-order-item-filename:empty {
  display: none;
}

.archway-order-additem-wrap {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.archway-order-additem {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.archway-order-additem:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}

/* --- Hyla Cancellations review list --- */
.hyla-list-shell {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.75rem 0.75rem 3rem;
}

/* When the list page is active, fill the viewport so the titlebar stays put
   and only the list scrolls. */
#tab-hyla-cancellations.tab-pane.active .hyla-list-shell {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-height, 60px));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.hyla-list-panel {
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.hyla-list-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.hyla-list-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.hyla-list-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hyla-list-refresh {
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hyla-list-refresh:active {
  background: rgba(255, 255, 255, 0.06);
}

/* Inner tile that holds the scrollable list, nested inside the main panel */
.hyla-list-inner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.hyla-list-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hyla-list-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hyla-list-empty--error {
  color: var(--danger);
}

/* --- Single-trade full-page view (#hyla-trade-detail/<id>) --- */
/* Reuses the list panel/tile styles; fill the viewport like the list does. */
#tab-hyla-trade-detail.tab-pane.active .hyla-list-shell {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-height, 60px));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.hyla-detail-header {
  align-items: flex-start;
}

.hyla-detail-headmain {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.hyla-detail-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hyla-detail-back:active {
  background: rgba(255, 255, 255, 0.06);
}

/* The full-page view always shows one open tile — drop the collapse affordance. */
#tab-hyla-trade-detail .hyla-tile__chevron {
  display: none;
}

#tab-hyla-trade-detail .hyla-tile__head {
  cursor: default;
}

.hyla-list-card {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hyla-list-card:first-child {
  border-top: none;
}

.hyla-list-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.hyla-list-card__tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  word-break: break-all;
  text-align: right;
}

.hyla-list-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.hyla-list-card__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
}

.hyla-list-field {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.hyla-list-field dt {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hyla-list-field dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-word;
}

.hyla-list-card__photos {
  margin-top: 0.55rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hyla-list-status {
  flex: 0 0 auto;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  padding: 0.4rem 1.7rem 0.4rem 0.65rem;
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-body);
  text-transform: capitalize;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
}

.hyla-list-status:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.hyla-tile__locked {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hyla-tile__denialwrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 0 0.7rem;
}

.hyla-tile__denialwrap[hidden] {
  display: none;
}

.hyla-tile__denial {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-body);
  line-height: 1.4;
  resize: vertical;
  min-height: 2.6rem;
}

.hyla-tile__denial:focus {
  outline: none;
  border-color: var(--accent);
}

.hyla-tile__denial:disabled {
  opacity: 0.85;
}

/* Requests page: read-only cancellation feed */
.requests-feed-panel {
  margin-top: 1rem;
}
.hyla-tile__statusrow--ro {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.hyla-tile__denial-ro {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.hyla-list-status--pending {
  border-color: #facc15;
  color: #facc15;
}

.hyla-list-status--approved {
  border-color: var(--success);
  color: var(--success);
}

.hyla-list-status--completed {
  border-color: var(--success);
  color: var(--success);
}

.hyla-list-status--denied {
  border-color: var(--danger);
  color: var(--danger);
}

/* Collapsible request tiles */
.hyla-tile {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hyla-tile:first-child {
  border-top: none;
}

.hyla-tile__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: transparent;
  border: none;
  text-align: left;
  color: inherit;
  font-family: var(--font-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hyla-tile__head:active {
  background: rgba(255, 255, 255, 0.03);
}

.hyla-tile__fs {
  flex: 0 0 auto;
  width: 7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hyla-tile__fsnum {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hyla-tile__status {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: capitalize;
}

.hyla-tile__status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.hyla-tile__status--pending { color: #facc15; }
.hyla-tile__status--approved { color: var(--success); }
.hyla-tile__status--completed { color: var(--success); }
.hyla-tile__status--denied { color: var(--danger); }

.hyla-tile__emp {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hyla-tile__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hyla-tile__sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hyla-tile__thumb {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.45rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.hyla-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hyla-tile__chevron {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.hyla-tile.is-open .hyla-tile__chevron {
  transform: rotate(90deg);
}

.hyla-tile__body {
  padding: 0.25rem 1rem 1rem;
}

.hyla-tile__statusrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.4rem 0 0.8rem;
}

.hyla-tile__statuslabel,
.hyla-tile__photoslabel {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hyla-tile__savestatus {
  padding: 0.42rem 0.9rem;
  border: 1.5px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}

.hyla-tile__savestatus:active {
  opacity: 0.85;
}

.hyla-tile__savestatus:disabled {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  opacity: 0.6;
  cursor: default;
}

.hyla-tile__addphoto {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hyla-tile__addphoto:active {
  background: rgba(255, 255, 255, 0.07);
}

.hyla-tile__addphoto.is-busy {
  opacity: 0.5;
  cursor: progress;
}

.hyla-tile__addphoto input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hyla-tile__date {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hyla-tile__photoswrap {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hyla-tile__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hyla-tile__photo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hyla-tile__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-page-panel {
  border-radius: var(--radius-md, 12px);
  box-shadow:
    var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.35)),
    0 0 0 1px rgba(56, 189, 248, 0.06);
}

.upload-page-panel__header {
  align-items: flex-start;
  padding-bottom: 1rem;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.06) 0%, transparent 100%);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.upload-page-panel__header-text h2 {
  margin: 0;
}

.upload-page-panel__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.92;
}

.upload-page-body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.upload-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-gate {
  padding: 1.25rem 1.15rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.upload-gate-lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.upload-gate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  max-width: 100%;
}

.upload-gate-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.62rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.upload-gate-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.upload-gate-submit {
  padding: 0.62rem 1.25rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(180deg, #5ecfff 0%, var(--accent) 100%);
  color: #061018;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.upload-gate-submit:hover {
  filter: brightness(1.08);
}

.upload-gate-submit:active {
  transform: translateY(1px);
}

.upload-gate-error {
  margin: 0.75rem 0 0;
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--critical, #f87171);
}

.upload-intro-callout {
  margin: 0 0 1.35rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-left: 3px solid var(--accent);
}

.upload-main-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.upload-main-intro strong {
  color: var(--text);
  font-weight: 600;
}

.upload-section {
  margin: 0 0 1.35rem;
}

.upload-section-heading {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.85;
}

.upload-field-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.upload-file-label {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.upload-file-input {
  max-width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.upload-file-list {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.upload-file-list li {
  margin-bottom: 0.25rem;
}

.upload-lock-again {
  margin-top: 0;
  padding: 0.48rem 1rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.upload-lock-again:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0;
  max-width: 100%;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.upload-field-input,
.upload-collection-select {
  width: 100%;
  max-width: 100%;
  cursor: pointer;
}

.upload-collection-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.upload-collections-error-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 1rem;
  margin: -0.35rem 0 1rem;
  max-width: 40rem;
}

.upload-collections-error {
  flex: 1;
  min-width: min(100%, 18rem);
  margin: 0;
  font-size: 0.85rem;
  color: var(--critical, #f87171);
  line-height: 1.45;
}

.upload-collections-retry {
  flex-shrink: 0;
}

.upload-drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 10rem;
  padding: 0.25rem;
  margin-bottom: 0.85rem;
  border-radius: 14px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, transparent 45%),
    rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
  outline: none;
}

.upload-drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 9.25rem;
  padding: 1rem 1.25rem;
  border-radius: 11px;
}

.upload-drop-zone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.15rem;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  transition: transform 0.18s ease, background 0.18s ease;
}

.upload-drop-zone-icon svg {
  opacity: 0.95;
}

.upload-drop-zone:hover:not(.upload-drop-zone--disabled):not(.upload-drop-zone--active) .upload-drop-zone-icon {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.16);
}

.upload-drop-zone:hover:not(.upload-drop-zone--disabled):not(.upload-drop-zone--active) {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08), 0 8px 28px rgba(0, 0, 0, 0.28);
}

.upload-drop-zone:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.upload-drop-zone--active {
  border-color: rgba(94, 234, 212, 0.65);
  border-style: solid;
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.15);
}

.upload-drop-zone--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upload-drop-zone-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.01em;
}

.upload-drop-zone-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.upload-drop-zone-formats {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
}

.upload-file-input--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-selected-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0;
}

.upload-file-count {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
}

.upload-btn-secondary {
  padding: 0.48rem 1rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-btn-secondary:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.upload-btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-batch-progress-wrap {
  display: none;
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.15);
  background: linear-gradient(165deg, rgba(56, 189, 248, 0.08) 0%, rgba(0, 0, 0, 0.28) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.upload-batch-progress-wrap.upload-batch-progress-wrap--visible {
  display: block;
}

.upload-batch-progress-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.upload-batch-progress-spinner {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.upload-batch-progress-wrap--visible .upload-batch-progress-spinner {
  opacity: 1;
  animation: upload-spin 0.65s linear infinite;
}

.upload-batch-progress-textcol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.upload-batch-progress-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-batch-progress-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-batch-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.upload-batch-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, var(--accent), #5eead4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  transition: width 0.28s ease;
}

.upload-file-list--cards {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.2rem;
  max-height: 15rem;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.28);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
}

.upload-file-list--cards::-webkit-scrollbar {
  width: 7px;
}

.upload-file-list--cards::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.28);
  border-radius: 999px;
}

.upload-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.58rem 0.55rem 0.58rem 0.65rem;
  margin-bottom: 0.2rem;
  border-radius: 8px;
  border-bottom: none;
  font-size: 0.86rem;
  transition: background 0.12s ease;
}

.upload-file-card:last-child {
  margin-bottom: 0;
}

.upload-file-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.upload-file-card--rejected {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.38);
}

.upload-file-card--rejected:hover {
  background: rgba(248, 113, 113, 0.14);
}

.upload-file-card--highlight {
  animation: upload-row-highlight-pulse 2.2s ease;
}

@keyframes upload-row-highlight-pulse {
  0% {
    box-shadow: inset 0 0 0 1px transparent;
  }
  14% {
    box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.9);
    background: rgba(56, 189, 248, 0.14);
  }
  100% {
    box-shadow: inset 0 0 0 1px transparent;
  }
}

.upload-file-rejected-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(248, 113, 113, 0.95);
}

.upload-file-card-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.upload-file-card-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.upload-file-status-icon {
  position: relative;
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-file-status-icon .upload-cloud-svg {
  display: block;
  fill: currentColor;
}

.upload-file-status-icon--waiting {
  color: rgba(255, 255, 255, 0.32);
}

.upload-file-status-icon--uploading {
  color: rgba(255, 255, 255, 0.42);
}

.upload-file-status-icon--uploaded {
  color: #5eead4;
}

.upload-file-status-icon--rejected {
  color: var(--critical, #f87171);
}

.upload-file-status-spinner {
  position: absolute;
  width: 0.62rem;
  height: 0.62rem;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: upload-spin 0.65s linear infinite;
}

.upload-file-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.upload-file-remove {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.12);
  color: var(--critical, #f87171);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.upload-file-remove:hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.25);
}

.upload-actions-row {
  margin: 0.25rem 0 1rem;
}

.upload-submit-qdrant {
  width: 100%;
  padding: 0.72rem 1.25rem;
  border-radius: 11px;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.22);
}

.upload-submit-qdrant:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.upload-progress-row {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.upload-progress-row.upload-progress-row--visible {
  display: flex;
}

.upload-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
}

.upload-progress-row--visible .upload-spinner {
  animation: upload-spin 0.65s linear infinite;
}

@keyframes upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.upload-success-message {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #86efac;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.22);
  min-height: 0;
}

.upload-error-message {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  font-size: 0.84rem;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 0;
}

.upload-footer-actions {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 540px) {
  .upload-page-shell {
    padding: 0 0.65rem 1rem;
    margin-top: 0.35rem;
  }

  .upload-page-body {
    padding: 1rem 1rem 1.25rem;
  }

  .upload-selected-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-btn-secondary {
    width: 100%;
  }

  .upload-drop-zone {
    min-height: 8.5rem;
    padding: 0.2rem;
  }

  .upload-drop-zone-inner {
    min-height: 8rem;
    padding: 0.85rem 1rem;
  }

  .upload-actions-row .upload-gate-submit {
    width: 100%;
  }

  .upload-batch-progress-title {
    white-space: normal;
    font-size: 0.82rem;
  }
}

/* ========== Daily Operations — Reminders (Apple-style checklist) ========== */
/* Full-width board matches inventory in-transit / snapshot rails; keep checklist readable width inside */
#tab-daily_ops .daily-ops-board .do-reminders-root {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 1rem 2rem;
  box-sizing: border-box;
}

/* Medium & small screens: let market/district/store tiles span full width */
@media (max-width: 1024px) {
  #tab-daily_ops .daily-ops-board .do-reminders-root {
    max-width: none;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ---- Daily Ops two-pane (desktop/large): feed left, Overview right ----
   Mobile/tablet (<1024px) shows only the feed; Overview stays its own tab,
   so the right pane is hidden and the container collapses to one column. */
.daily-ops-twopane { display: block; }
.daily-ops-twopane__overview { display: none; }
@media (min-width: 1024px) {
  .daily-ops-twopane {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0 1rem;
    box-sizing: border-box;
  }
  /* 70/30 split: Daily Ops feed (left) 70%, Operations Overview (right) 30%.
     Zero flex-basis + 7:3 grow ratio splits the space remaining after the
     gap exactly 70/30. */
  .daily-ops-twopane__main {
    flex: 7 1 0;
    min-width: 0;
  }
  .daily-ops-twopane__main .do-reminders-root {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  /* Operations Overview is no longer embedded in Daily Ops — the right pane is
     hidden so the Daily Ops feed spans the full width, and Overview is its own
     standalone nav item on desktop (same as mobile). */
  .daily-ops-twopane__overview { display: none; }
}

@media (max-width: 560px) {
  /* Widen the Daily Operations tiles on phones: trim the outer gutters and
     the page-tile inner padding so each market/district/store tile uses
     nearly the full screen width. */
  #tab-daily_ops .daily-ops-board .do-reminders-root {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }
  #tab-daily_ops .do-page-tile {
    --do-page-tile-pad-x: 0.45rem;
    border-radius: 16px;
  }
}

/* Mobile / narrow: keep store-card content inside the viewport (no right clip) */
@media (max-width: 768px) {
  /* "Last synced" pinned to the top-right of the Daily Operations tile. */
  #tab-daily_ops .do-page-tile .do-page-tile-head { position: relative; }
  #tab-daily_ops .do-page-tile .do-sync-line--below {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    margin: 0;
    padding: 0;
    max-width: 48%;
    text-align: right;
    font-size: 0.62rem;
    line-height: 1.2;
    color: rgba(226, 232, 240, 0.78);
    z-index: 2;
  }
  #tab-daily_ops .do-sc__stats {
    grid-template-columns: 1fr;
  }
  #tab-daily_ops .do-sc__tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #tab-daily_ops .do-sc__tabs::-webkit-scrollbar {
    display: none;
  }
  #tab-daily_ops .do-sc__tab {
    flex: 0 0 auto;
  }
  #tab-daily_ops .do-sc__info,
  #tab-daily_ops .do-sgt__body,
  #tab-daily_ops .do-task-body {
    min-width: 0;
  }
  #tab-daily_ops .do-task {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }
  #tab-daily_ops .do-task-right {
    min-width: 0;
  }

  /* Wrap long opus / store / district lines inside the market tile instead of ellipsis clipping */
  #tab-daily_ops .do-task-secondary,
  #tab-daily_ops .do-task-context {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
  }

  #tab-daily_ops .do-sc__name,
  #tab-daily_ops .do-sc__crumb,
  #tab-daily_ops .do-grouped-store__name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
  }

  #tab-daily_ops .do-group-toggle--store {
    align-items: flex-start;
  }
}

.do-reminders-root {
  font-family: var(--font-body);
  color: var(--text-primary);
}

.do-page-tile {
  --do-page-tile-pad-y-top: 1.05rem;
  --do-page-tile-pad-x: 1rem;
  padding: var(--do-page-tile-pad-y-top) var(--do-page-tile-pad-x) 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.55));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.do-page-tile .do-page-tile-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Store View / District View toggle (colors themed in theme-alliance.css). */
.do-level-nav {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  gap: 0.4rem;
  margin: 0.6rem 0 0.1rem;
}

.do-level-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

/* ---- District / Market scorecard tiles (refreshed look) ---- */
.do-dm-block {
  --dm-ink: #0f172a;
  --dm-slate: #475569;
  --dm-muted: #94a3b8;
  --dm-line: #e2e8f0;
  --dm-navy-1: #13315a;
  --dm-navy-2: #0b1f3a;
  --dm-inv: #f97316;
  --dm-comp: #16a34a;
  --dm-cash: #6366f1;
  --dm-zero: #c2cbd8;
  --dm-low-bg: #fff4e3; --dm-low-tx: #b4630a;
  --dm-med-bg: #ffe2c2; --dm-med-tx: #9a4a06;
  --dm-high-bg: #fde0e0; --dm-high-tx: #c0392b;
  --dm-good-bg: #e9f7ef; --dm-good-tx: #2f9e44;
  --dm-clear-tx: #1f9d54;
  margin: 0 0 1.4rem;
  padding: 16px;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 24px 48px -28px rgba(15, 23, 42, .30);
}

.do-dm-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 4px 14px;
}

.do-dm-district {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--dm-navy-1);
}

.do-dm-market {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dm-slate);
  background: #eef2f8;
  border: 1px solid #e0e7f0;
  padding: 3px 8px;
  border-radius: 6px;
}

.do-dm-storecount {
  font-size: .72rem;
  font-weight: 600;
  color: var(--dm-muted);
}

.head-stats {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.head-stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
}

.head-stats .stat--open { background: var(--dm-high-bg); color: var(--dm-high-tx); }
.head-stats .stat--scans { background: var(--dm-good-bg); color: var(--dm-good-tx); }

.do-dm-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
}

.do-dm-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(to right, var(--dm-navy-1), var(--dm-navy-2));
}

.do-dm-table th,
.do-dm-table td {
  padding: .5rem .7rem;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--dm-line);
  border-right: 1px solid var(--dm-line);
}

.do-dm-table td { background: #fff; }

/* Every leaf data column shares one fixed width. */
.do-dm-table thead tr:nth-child(2) th,
.do-dm-table tbody td { width: 6rem; min-width: 6rem; max-width: 6rem; }

/* Header — rides the table gradient (cells transparent). */
.do-dm-table thead tr:first-child th {
  background: transparent;
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-bottom: 0;
  padding-top: .55rem;
  padding-bottom: .5rem;
}

.do-dm-table thead tr:nth-child(2) th {
  background: transparent;
  color: #cdd9ec;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--dm-line);
  padding: .4rem .7rem;
}

.do-dm-section-group { position: relative; }
.do-dm-section-group::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--do-dm-accent, #64748b);
}
.do-dm-table thead .do-dm-store-col { border-bottom: 1px solid var(--dm-line); }
.grp-inv { --do-dm-accent: var(--dm-inv); }
.grp-comp { --do-dm-accent: var(--dm-comp); }
.grp-cash { --do-dm-accent: var(--dm-cash); }
.col-store { text-align: left !important; }

/* Sticky store column (solid navy = gradient's left edge). */
.do-dm-store-col {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  width: 1%;
  white-space: nowrap;
  background: var(--dm-navy-1) !important;
}
.do-dm-scroll.do-dm-overflow .do-dm-store-col { position: static; }
.do-dm-table th.do-dm-store-col,
.do-dm-table td.do-dm-store-col { text-align: left; }
.do-dm-table thead .do-dm-store-col { z-index: 3; }
.do-dm-table tbody .do-dm-store-col {
  font-weight: 700;
  color: #fff;
  border-left: 4px solid var(--row-accent, #e2e8f0);
}
.do-dm-row:hover .do-dm-store-col { background: #1b4278 !important; }

.store-sub { display: flex; align-items: center; gap: .55rem; margin-top: 2px; }
.store-num, .store-sub .pill {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(205, 217, 236, .85);
}
.pill { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.store-num::before,
.store-sub .pill::before {
  content: "";
  flex: 0 0 auto;
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  opacity: .85;
}

/* Severity rail on the store column, by the row's task total. */
.acc-clear { --row-accent: var(--dm-clear-tx); }
.acc-low { --row-accent: #f0b46a; }
.acc-med { --row-accent: var(--dm-inv); }
.acc-high { --row-accent: var(--dm-high-tx); }
.do-dm-row--clear .do-dm-store-col { color: rgba(255, 255, 255, .66); }
.do-dm-row--clear .store-num,
.do-dm-row--clear .pill { color: rgba(205, 217, 236, .55); }

/* Count heatmap cells. */
.do-dm-cell { color: var(--dm-ink); font-weight: 700; }
.do-dm-cell.is-zero { color: var(--dm-zero); font-weight: 500; }
.do-dm-cell.lvl-low { background: var(--dm-low-bg); color: var(--dm-low-tx); }
.do-dm-cell.lvl-med { background: var(--dm-med-bg); color: var(--dm-med-tx); }
.do-dm-cell.lvl-high { background: var(--dm-high-bg); color: var(--dm-high-tx); font-weight: 800; }

/* Compliance status cells (✓ / ✗ / – / aggregate %). */
.do-dm-status { font-size: .72rem; font-weight: 800; color: var(--dm-slate); }
.do-dm-status .chk,
.do-dm-status .xmark {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  margin: 0 auto;
}
.do-dm-status .chk { background: var(--dm-good-bg); color: var(--dm-good-tx); }
.do-dm-status .xmark { background: var(--dm-high-bg); color: var(--dm-high-tx); }
.do-dm-status .chk svg,
.do-dm-status .xmark svg { width: 12px; height: 12px; }
.do-dm-status .dash { color: var(--dm-zero); font-weight: 700; }
.do-dm-status .agg-pct { font-weight: 800; color: var(--dm-ink); }

/* Dividers: the colored group bars delineate sections; only Monthly is boxed. */
.do-dm-sec-start { border-left: 0 !important; }
.do-dm-grp-start { border-left: 0; }
.do-dm-grp-end { border-right: 1px solid var(--dm-line); }

/* Grand total row rides the same gradient. */
.do-dm-table .do-dm-grand-row td,
.do-dm-table .do-dm-grand-row th {
  background: transparent;
  color: #fff;
  font-weight: 800;
  border-top: 0;
  border-bottom: 0;
  border-right-color: var(--dm-line);
}
.do-dm-grand-row .do-dm-store-col { border-left: 4px solid var(--dm-navy-1); }
.do-dm-grand-row .do-dm-grp-end { border-right: 1px solid var(--dm-line) !important; }
.do-dm-grand-row .pill { color: #fff; }
.do-dm-grand-row .do-dm-status .agg-pct { color: #fff; }

.do-dm-table tbody tr:last-child td,
.do-dm-table tbody tr:last-child th { border-bottom: 0; }
.do-dm-table th:last-child,
.do-dm-table td:last-child { border-right: none; }

/* ---- Triage feed (now the sole Daily Operations layout at every width) ---- */
.do-dm-feed { display: none; }

/* Was gated to <=1024px; the desktop table layout has been retired so the
   feed (and the rules that hide the old table) apply at all widths. */
@media all {
  .do-dm-block { padding: 0; overflow: hidden; }
  .do-dm-block-head,
  .do-dm-scroll { display: none; }
  .do-dm-feed { display: block; }

  .dm-feed-head {
    background: linear-gradient(120deg, var(--dm-navy-1), var(--dm-navy-2));
    padding: 16px;
    color: #fff;
  }
  /* Store tiles a touch shorter. */
  .do-store-feed .dm-feed-head { padding: 11px 14px; position: relative; }
  /* #N task count centered against the full height of the blue bar. */
  .do-store-feed .dm-feed-tasks {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    margin: 0;
  }
  /* Reserve room on the right so the name/bubbles don't sit under the count. */
  .do-store-feed .dm-feed-top { padding-right: 3.5rem; }
  .do-store-feed .dm-feed-body { padding: 9px 12px 10px; }
  .do-store-feed .dm-feed-headline--store { margin-top: 8px; }
  .do-store-feed .dm-flag-grp { margin: 11px 4px 7px; }
  .do-store-feed .dm-flag-grp:first-child { margin-top: 2px; }
  .do-store-feed .dm-flag { margin-bottom: 6px; }
  .do-store-feed .dm-ontrack { margin-top: 12px; }
  /* Name shares the top row with the task count (store name flexes, count
     pinned right); opus chip + region wrap to the row below. */
  .dm-feed-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .dm-feed-name {
    flex: 1 1 0;
    min-width: 0;
    font-size: clamp(1rem, 4.6vw, 1.3rem);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.12;
    word-break: break-word;
  }
  /* Task count to the right of the store name. */
  .dm-feed-tasks {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
  }
  .dm-feed-tasks .big { font-size: clamp(1rem, 4.6vw, 1.3rem); font-weight: 800; line-height: 1; color: #ff9b9b; }
  .dm-feed-tasks .big.is-clear { color: #7ee2a8; }
  .dm-feed-tasks .txt { font-size: .8rem; font-weight: 700; color: #cfe0ff; }
  /* Forced line break after the name/count row (a 100%-basis flex child). */
  .dm-feed-rowbreak { flex-basis: 100%; height: 0; margin: 0; }
  /* ID line: [District bubble] [Opus bubble] #storeNum */
  .dm-feed-region {
    font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: #cfe0ff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
    padding: 3px 8px; border-radius: 6px;
  }
  .dm-feed-region--district,
  .dm-feed-region--market { letter-spacing: .04em; }
  .dm-feed-storenum {
    font-size: .58rem; font-weight: 800; letter-spacing: .04em;
    color: #cfe0ff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
    padding: 3px 8px; border-radius: 6px;
  }
  .dm-feed-count { margin-left: auto; font-size: .7rem; font-weight: 600; color: #9fb4dc; }
  .dm-feed-headline { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
  .dm-feed-headline__main { display: flex; align-items: baseline; gap: 8px; flex: 1 1 auto; min-width: 0; }
  /* Store feed: IPOG/Device Alive stats sit on their own row, left-aligned. */
  .dm-feed-headline--store { margin-top: 10px; }
  .dm-feed-headline--store .dm-feed-stats { margin-left: 0; flex-direction: row; align-items: center; }
  .dm-feed-headline .big { font-size: 2.4rem; font-weight: 800; line-height: 1; color: #ff9b9b; }
  .dm-feed-headline .big.is-clear { color: #7ee2a8; }
  .dm-feed-headline .txt { font-size: .84rem; font-weight: 700; color: #cfe0ff; line-height: 1.2; }
  /* IPOG / Device Alive % chips on the right of the headline. */
  .dm-feed-stats { margin-left: auto; flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
  .dm-feed-stat {
    display: inline-flex; align-items: baseline; gap: 6px;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  }
  .dm-feed-stat__label { font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #9fb4dc; }
  .dm-feed-stat__val { font-size: .82rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

  .dm-feed-body { padding: 12px; background: #eef1f7; }

  .dm-flag-grp {
    display: flex; align-items: center; gap: 8px;
    margin: 16px 4px 9px;
    font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--dm-slate);
  }
  .dm-flag-grp:first-child { margin-top: 2px; }
  .dm-flag-grp::after { content: ""; flex: 1; height: 1px; background: #dde3ec; }
  .dm-flag-grp .badge {
    display: grid; place-items: center;
    min-width: 18px; height: 18px; padding: 0 6px;
    border-radius: 999px; font-size: .6rem; font-weight: 800; color: #fff;
  }
  .dm-flag-grp.sec-inv .badge { background: var(--dm-inv); }
  .dm-flag-grp.sec-comp .badge { background: var(--dm-comp); }
  .dm-flag-grp.sec-cash .badge { background: var(--dm-cash); }

  .dm-flag {
    background: #fff; border: 1px solid #eef2f7;
    border-left: 4px solid var(--rail, #e2e8f0);
    border-radius: 13px; margin-bottom: 8px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  }
  .dm-flag-head {
    display: flex; align-items: center; gap: 11px;
    width: 100%; padding: 11px 12px;
    background: none; border: 0; margin: 0; text-align: left; color: inherit; font: inherit;
  }
  button.dm-flag-head { cursor: pointer; }
  .dm-flag.sev-high { --rail: #c0392b; }
  .dm-flag.sev-med { --rail: var(--dm-inv); }
  .dm-flag.sev-low { --rail: #f0b46a; }
  .dm-flag-caret {
    flex: 0 0 auto; color: var(--dm-muted); font-size: .9rem;
    transition: transform .15s ease;
  }
  .dm-flag.is-open .dm-flag-caret { transform: rotate(180deg); }
  .dm-flag-detail {
    padding: 4px 10px 10px; border-top: 1px solid #eef2f7; background: #f8fafc;
  }
  .dm-flag-detail[hidden] { display: none; }
  /* Cap the expanded rows at ~5; scroll beyond. */
  .dm-flag-detail .dm-flag-rows {
    max-height: 17.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dm-flag-val {
    flex: 0 0 auto; display: grid; place-items: center;
    min-width: 40px; height: 40px; border-radius: 10px;
    font-size: 1.15rem; font-weight: 800;
  }
  .dm-flag.sev-high .dm-flag-val { background: #fde0e0; color: #c0392b; }
  .dm-flag.sev-med .dm-flag-val { background: #ffe2c2; color: #9a4a06; }
  .dm-flag.sev-low .dm-flag-val { background: #fff4e3; color: #b4630a; }
  .dm-flag-val.ico { font-size: 1.25rem; }
  .dm-flag-text { flex: 1; min-width: 0; }
  .dm-flag-text .t1 { font-size: .9rem; font-weight: 800; line-height: 1.15; }
  .dm-flag-text .t2 { font-size: .74rem; font-weight: 600; color: var(--dm-muted); margin-top: 2px; }
  .dm-flag-tag {
    flex: 0 0 auto;
    font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 6px;
  }
  .dm-flag-tag.inv { background: #fff1e6; color: #b4630a; }
  .dm-flag-tag.comp { background: #e9f7ef; color: #1f9d54; }
  .dm-flag-tag.cash { background: #eef0fe; color: #4548c4; }

  .dm-ontrack {
    background: #e4f7ec; border: 1px solid #c3ecd1; border-radius: 14px;
    padding: 14px; margin-top: 18px;
  }
  .dm-ontrack .ot-head {
    display: flex; align-items: center; gap: 9px;
    font-size: .92rem; font-weight: 800; color: #177a40;
  }
  .dm-ontrack .ot-head .ck {
    display: grid; place-items: center;
    width: 24px; height: 24px; border-radius: 7px;
    background: #1f9d54; color: #fff; font-weight: 900;
  }
  .dm-ontrack .ot-list { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
  .dm-ontrack .ot-row {
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; font-weight: 600; color: #2f6b47;
  }
  .dm-ontrack .ot-row b { color: #155e34; }
  .dm-ontrack .ot-row .d { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #1f9d54; }
}

.do-page-tile #doRemindersMain {
  flex: 1 1 auto;
  min-height: 0;
}

.do-page-tile .do-page-header {
  margin-top: calc(-1 * var(--do-page-tile-pad-y-top));
  margin-left: calc(-1 * var(--do-page-tile-pad-x));
  margin-right: calc(-1 * var(--do-page-tile-pad-x));
  margin-bottom: 0;
  padding: calc(var(--do-page-tile-pad-y-top) + 0.6rem) calc(0.75rem + var(--do-page-tile-pad-x)) 0.75rem;
  width: calc(100% + 2 * var(--do-page-tile-pad-x));
  max-width: none;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: none;
  border-radius: calc(22px - 1px) calc(22px - 1px) 0 0;
}

/* "Last synced" sits below the Store/District/Market tabs, left-aligned,
   with no strip/background of its own. */
.do-page-tile .do-sync-line--below {
  margin: 0.35rem 0 0;
  padding: 0;
  width: auto;
  background: none !important;
  border-bottom: none !important;
  text-align: left;
}

.do-page-tile .do-sync-line {
  margin: 0 calc(-1 * var(--do-page-tile-pad-x)) 0;
  padding: 0.15rem calc(0.75rem + var(--do-page-tile-pad-x)) 0.65rem;
  width: calc(100% + 2 * var(--do-page-tile-pad-x));
  max-width: none;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.do-page-tile .do-sync-line + .do-controls-bar {
  margin-top: 0;
}

.do-page-tile .do-controls-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 0;
  margin-bottom: 0.65rem;
  margin-left: calc(-1 * var(--do-page-tile-pad-x));
  margin-right: calc(-1 * var(--do-page-tile-pad-x));
  width: calc(100% + 2 * var(--do-page-tile-pad-x));
  max-width: none;
  box-sizing: border-box;
  padding: 0.28rem calc(0.55rem + var(--do-page-tile-pad-x));
  border-radius: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.72), rgba(8, 13, 22, 0.52));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.do-page-tile .do-controls-bar .do-inv-toolbar {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  flex-wrap: nowrap;
}

.do-page-tile .do-controls-bar .do-inv-search {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 0 0.65rem;
}

.do-page-tile .do-controls-bar .do-inv-search input {
  font-size: 0.8rem;
}

.do-page-tile .do-controls-bar .do-level-nav {
  flex: 0 1 auto;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: stretch;
  width: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.do-page-tile .do-controls-bar .do-level-tab {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 0.42rem 0.45rem;
  min-height: 38px;
  font-size: 0.7rem;
  line-height: 1.25;
}

.do-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.do-page-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.do-page-date {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.do-page-filter {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
  max-width: 42rem;
}

.do-btn {
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
}

.do-btn--ghost:hover {
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.55);
}

.do-sync-line {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.do-overview-section {
  margin-bottom: 2rem;
}

.do-overview-title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.do-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.do-overview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(25, 35, 52, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.15);
  text-align: center;
}

.do-overview-icon {
  font-size: 2rem;
  line-height: 1;
}

.do-overview-count {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.do-overview-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.do-section {
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.do-section-head {
  margin: 0;
}

.do-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.do-section-title {
  flex: 1;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--do-section-accent, #f97316);
}

.do-section-badge {
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
}

.do-section-chevron {
  opacity: 0.6;
  font-size: 0.65rem;
  transition: transform 0.22s ease;
}

.do-section--collapsed .do-section-chevron {
  transform: rotate(-90deg);
}

.do-section-body {
  transition: max-height 0.32s ease, opacity 0.22s ease;
  max-height: 6000px;
  opacity: 1;
}

.do-section--collapsed .do-section-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.do-subgroup {
  padding: 0 1rem 1rem;
}

.do-subgroup + .do-subgroup {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.do-subgroup-title {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--do-accent, var(--text-muted));
}

.do-store-group {
  margin: 0.35rem 0 1.15rem;
}

.do-store-group__rule {
  height: 1px;
  margin: 0.25rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(148, 163, 184, 0.35),
    transparent
  );
}

.do-store-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
  padding: 0.4rem 0.2rem 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.do-store-group__opus {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  letter-spacing: 0.03em;
  color: var(--text-primary, #e2e8f0);
}

.do-store-group__dash {
  color: var(--text-muted);
  font-weight: 400;
}

.do-store-group__name {
  font-weight: 600;
  color: var(--do-accent, #f97316);
  letter-spacing: 0.03em;
}

.do-store-group__items .do-task-secondary {
  padding-left: 0;
}

/* Task tiles (Daily Ops) */
.do-task {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem 0.75rem 0.5rem;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.10);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.26), rgba(2, 6, 23, 0.10));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  margin: 0.55rem 0;
}

.do-task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}

.do-priority--high.do-task::before { background: rgba(239, 68, 68, 0.85); }
.do-priority--medium.do-task::before { background: rgba(245, 158, 11, 0.85); }
.do-priority--low.do-task::before { background: rgba(34, 197, 94, 0.85); }

.do-task:hover {
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.32), rgba(2, 6, 23, 0.14));
}

.do-task-check {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(2, 6, 23, 0.20);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.86);
}

.do-task-check:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.do-task-check-ring {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.do-task-check-mark {
  position: absolute;
  font-size: 0.85rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.do-task-check.is-checked {
  border-color: rgba(96, 165, 250, 0.75);
  background: rgba(59, 130, 246, 0.30);
}

.do-task-check.is-checked .do-task-check-mark {
  opacity: 1;
  transform: scale(1);
}

.do-task-body {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.do-task-primary {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.do-task-secondary {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.do-task-context {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.do-task-right {
  display: grid;
  justify-items: end;
  gap: 0.25rem;
  min-width: 96px;
}

.do-task--nonsellable-store .do-task-right {
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
}

.do-task--nonsellable-store .do-task-qty {
  align-self: center;
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  transform: translateX(-10px);
}

.do-task--nonsellable-store .do-task-qty-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.92);
  text-transform: uppercase;
}

.do-task--nonsellable-store .do-task-qty-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.do-task-date {
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.82);
  white-space: nowrap;
}

/* Hyla trade-in compact meta row: location · rep · IMEI · $value laid out
   inline on a single line on desktop (~≥720px) with bullet separators.
   Wraps to multiple lines on narrow viewports so mobile still reads cleanly.
   Replaces the previous 3-line stack (context / secondary / stats), so a
   list of trade-ins now reads like a compact table rather than four lines
   per row. */
.do-task-hyla-meta {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1rem;
  row-gap: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.3;
  color: rgba(148, 163, 184, 0.9);
}
.do-task-hyla-cell {
  white-space: nowrap;
  position: relative;
}
/* Bullet separator before each cell after the first. Sits inside the
   column-gap so the bullet is centered between the two cells visually. */
.do-task-hyla-cell + .do-task-hyla-cell::before {
  content: '·';
  position: absolute;
  left: -0.55rem;
  opacity: 0.55;
  font-weight: 700;
}
.do-task-hyla-cell--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
}
.do-task-hyla-cell--value {
  font-weight: 700;
  color: rgba(226, 232, 240, 0.98);
  font-variant-numeric: tabular-nums;
}
/* Tighter top padding on the hyla tile — only two visual lines (model +
   meta), so the standard 0.75rem feels too loose. */
.do-task--hyla {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.do-task--hyla .do-task-primary {
  margin-bottom: 0.05rem;
}

.do-task-days {
  font: 800 0.72rem/1 var(--font-body);
  padding: 0.3rem 0.55rem;
  border-radius: 9px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.do-task-days--good {
  background: rgba(22, 163, 74, 0.14);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.32);
}
.do-task-days--warn {
  background: rgba(202, 138, 4, 0.14);
  color: #ca8a04;
  border-color: rgba(202, 138, 4, 0.32);
}
.do-task-days--bad {
  background: rgba(220, 38, 38, 0.14);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.32);
}

/* Light-theme overrides for the Alliance white-tile chrome
   (inventory / daily_ops tabs in #tab-inventory / #tab-daily_ops). */
#tab-daily_ops .do-task-hyla-meta,
#tab-inventory .do-task-hyla-meta {
  color: #475569 !important;
}
#tab-daily_ops .do-task-hyla-cell--value,
#tab-inventory .do-task-hyla-cell--value {
  color: #0f172a !important;
}

.do-task-priority {
  font: 800 0.7rem/1 var(--font-body);
  padding: 0.32rem 0.6rem;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 232, 240, 0.86);
  white-space: nowrap;
}

.do-task-meta {
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.82);
}

.do-task-chevron {
  display: inline-block;
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.6;
  margin-left: 0.3rem;
  transition: transform 0.18s ease;
}
.do-task.is-expanded .do-task-chevron { transform: rotate(90deg); }

/* Inline details dropdown that opens when a task tile is clicked. Spans the
   full row width inside the .do-task grid (auto · 1fr · auto). Renders the
   source-row data as a 1-row, horizontally-scrolling mini table whose
   columns mirror the corresponding source table (e.g. /tradeportal's Hyla
   Trade-ins table) so the value layout is familiar at a glance. */
.do-task-details {
  grid-column: 1 / -1;
  margin-top: 0.55rem;
  padding: 0;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-primary, #f1f5f9);
}
.do-task-details[hidden] { display: none; }

.do-task-details-wrap {
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.do-task-details-wrap::-webkit-scrollbar { height: 8px; }
.do-task-details-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

.do-task-details-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 0.74rem;
}
.do-task-details-table thead th {
  text-align: left;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  background: rgba(2, 6, 23, 0.25);
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.do-task-details-table tbody td {
  padding: 0.55rem 0.8rem;
  color: var(--text-primary, #f1f5f9);
  border-bottom: none;
}
.do-task-details-table .do-tt-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
}
.do-task-details-table .do-tt-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Fallback (alphabetical key/value grid) when no column spec is registered
   for the item_type. */
.do-task-details > .do-modal-row:first-child,
.do-task-details > .do-modal-row {
  display: grid;
  grid-template-columns: minmax(8rem, 30%) 1fr;
  gap: 0.75rem;
  padding: 0.3rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  background: rgba(15, 23, 42, 0.35);
}
.do-task-details > .do-modal-row:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.do-task-details > .do-modal-row:last-child { border-bottom: none; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
.do-task-details .do-modal-key {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  align-self: center;
}
.do-task-details .do-modal-val { word-break: break-word; font-weight: 500; }

/* District / Market task roll-up: one combined table per task type. Reuses the
   .do-task-details-table look (incl. the light-theme overrides below) and adds
   section headers + multi-row zebra/separators. */
/* Each district / market is its own tile holding all of its sections. */
.do-rollup-block {
  margin: 0 0 1.25rem;
  border-radius: 16px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  box-shadow: 0 2px 14px rgba(27, 66, 120, 0.06);
  padding: 1rem 1.1rem 1.15rem;
}
.do-rollup-block__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}
.do-rollup-block__title {
  margin: 0;
  font: 800 1.1rem var(--font-body);
  letter-spacing: 0.01em;
  color: var(--text-primary);
}
.do-rollup-block__sub {
  font: 600 0.74rem var(--font-body);
  color: var(--text-muted);
}
/* Section grouping (Inventory / Compliance / Cash) inside a district tile. */
.do-rollup-section { margin: 0 0 1.1rem; }
.do-rollup-section:last-child { margin-bottom: 0; }
.do-rollup-section__title {
  margin: 0 0 0.6rem;
  font: 800 0.72rem var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.do-rollup-section .do-rollup:last-child { margin-bottom: 0; }
/* Each roll-up is a tile (white card, matching the store-view task tiles) with
   a larger accent titlebar carrying the task name. */
.do-rollup {
  margin: 0 0 1.1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(27, 66, 120, 0.06);
}
.do-rollup__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.6rem 0.95rem;
  /* Titlebar tinted with the task's section accent, muted toward the app's deep
     navy so it isn't too bright (keeps the hue; older browsers get the accent). */
  background: var(--do-rollup-accent, #1b4278);
  background: color-mix(in srgb, var(--do-rollup-accent, #1b4278) 55%, #0b1830);
}
.do-rollup__title {
  margin: 0;
  font: 800 1.05rem/1.15 var(--font-body);
  letter-spacing: 0.01em;
  color: #ffffff;
}
.do-rollup__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font: 800 0.72rem var(--font-body);
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}
/* Table sits flush under the titlebar (the card supplies the frame). */
.do-rollup__wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}
/* The base details-table is single-row; roll-ups are multi-row, so add
   separators + zebra striping. */
.do-rollup-table tbody tr { border-bottom: 1px solid rgba(148, 163, 184, 0.10); }
.do-rollup-table tbody tr:nth-child(even) { background: rgba(148, 163, 184, 0.05); }
.do-rollup-table tbody tr:hover { background: rgba(148, 163, 184, 0.10); }

#tab-daily_ops .do-rollup-block__title { color: #0f172a; }
#tab-daily_ops .do-rollup-section__title { color: #5b6372; }
#tab-daily_ops .do-rollup-table tbody tr { border-bottom-color: #e2e8f0; }
#tab-daily_ops .do-rollup-table tbody tr:nth-child(even) { background: #f0f4fa; }
#tab-daily_ops .do-rollup-table tbody tr:hover { background: #eef2f8; }

/* Roll-up table footer: rows-per-page selector, range label, pager, full-screen. */
.do-rollup-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-top: 0;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  font: 600 0.7rem var(--font-body);
  color: var(--text-muted);
}
.do-rollup-pagesize-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.do-rollup-pagesize {
  font: 600 0.72rem var(--font-body);
  padding: 0.2rem 1.3rem 0.2rem 0.45rem;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  cursor: pointer;
}
.do-rollup-range { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.do-rollup-pager { display: inline-flex; gap: 0.3rem; margin-left: auto; }
.do-rollup-pager-btn {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.do-rollup-pager-btn:disabled { opacity: 0.4; cursor: default; }
.do-rollup-fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  font: 700 0.68rem var(--font-body);
  cursor: pointer;
}
.do-rollup-fs-btn:hover { color: var(--text-primary); border-color: rgba(148, 163, 184, 0.55); }

/* Full-screen overlay for a single task's complete list. */
/* Full-screen overlay is mounted on <body>, so it must be self-contained
   (the #tab-daily_ops light-theme scope does NOT reach it) and sit above the
   topbar (z 1300) and other fixed chrome. */
.do-rollup-fs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 2rem);
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(2px);
}
.do-rollup-fs-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1400px;
  max-height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.do-rollup-fs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  /* Section accent band, muted toward deep navy (matches the in-page titlebar). */
  background: var(--do-rollup-accent, #13315a);
  background: color-mix(in srgb, var(--do-rollup-accent, #13315a) 55%, #0b1830);
  flex-shrink: 0;
}
.do-rollup-fs-title { margin: 0; font: 800 1rem var(--font-body); color: #ffffff; }
.do-rollup-fs-sub { font: 600 0.74rem var(--font-body); color: rgba(255, 255, 255, 0.75); }
.do-rollup-fs-actions { display: inline-flex; align-items: center; gap: 0.8rem; }
.do-rollup-fs-count { font: 700 0.72rem var(--font-body); color: rgba(255, 255, 255, 0.8); white-space: nowrap; }
.do-rollup-fs-close {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.do-rollup-fs-close:hover { background: rgba(255, 255, 255, 0.22); }
.do-rollup-fs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}
/* Self-contained light styling for the table inside the overlay. */
.do-rollup-fs-body .do-task-details-table { width: 100%; }
.do-rollup-fs-body .do-task-details-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e9eef5;
  color: #475569;
  border-bottom: 1px solid #d8e0ea;
}
.do-rollup-fs-body .do-task-details-table tbody td { color: #0f172a; }
.do-rollup-fs-body .do-rollup-table tbody tr { border-bottom: 1px solid #e2e8f0; }
.do-rollup-fs-body .do-rollup-table tbody tr:nth-child(even) { background: #f0f4fa; }
.do-rollup-fs-body .do-rollup-table tbody tr:hover { background: #eef2f8; }
body.do-rollup-fs-open { overflow: hidden; }

/* Light-theme (Alliance) overrides for the in-page footer controls (these stay
   inside #tab-daily_ops). */
#tab-daily_ops .do-rollup-pagesize,
#tab-daily_ops .do-rollup-pager-btn,
#tab-daily_ops .do-rollup-fs-btn {
  background: #ffffff;
  border-color: #d8e0ea;
  color: #0f172a;
}
#tab-daily_ops .do-rollup-range { color: #475569; }
#tab-daily_ops .do-rollup-fs-btn { color: #475569; }

/* Task color theme: the titlebar carries the section accent (set on .do-rollup
   as --do-rollup-accent); the title/count stay white on it. The column header
   keeps a light divider so the accent reads only on the titlebar. */
#tab-daily_ops .do-rollup-table thead th {
  border-bottom: 1px solid #d8e0ea !important;
}
/* Keep the titlebar text white on the accent bar (beats `.tab-pane h4`, which
   forces headings to navy). */
#tab-daily_ops .do-rollup__head .do-rollup__title { color: #ffffff; }
/* The roll-up reuses .do-task-details-wrap; inside the tile it must be flush
   (the card supplies the frame/background), not the standalone gray panel. */
#tab-daily_ops .do-rollup .do-task-details-wrap {
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* Alliance light theme overrides: dropdown reads on the white tile. */
#tab-daily_ops .do-task-details-wrap {
  background: #f4f6fa !important;
  border-color: #d8e0ea !important;
}
#tab-daily_ops .do-task-details-table thead th {
  background: #e9eef5 !important;
  color: #475569 !important;
  border-bottom-color: #d8e0ea !important;
}
#tab-daily_ops .do-task-details-table tbody td { color: #0f172a !important; }
#tab-daily_ops .do-task-details > .do-modal-row {
  background: #f4f6fa !important;
  border-bottom-color: #e2e8f0 !important;
}
#tab-daily_ops .do-task-details .do-modal-key { color: #475569 !important; }

.do-task-right-top {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.do-task--nonsellable-store .do-task-right-top {
  align-items: center;
  gap: 0.45rem;
}

.do-priority--high .do-task-priority {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: rgba(254, 202, 202, 0.92);
}

.do-priority--medium .do-task-priority {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: rgba(253, 230, 138, 0.92);
}

.do-priority--low .do-task-priority {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: rgba(187, 247, 208, 0.92);
}

.do-priority--high .do-item-badge {
  background: #ef4444;
}
.do-priority--medium .do-item-badge {
  background: #eab308;
}
.do-priority--low .do-item-badge {
  background: #22c55e;
}

.do-item-badge {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.do-item--completed .do-item-primary,
.do-item--completed .do-item-secondary,
.do-item--completed .do-item-meta-text {
  opacity: 0.5;
}

.do-item--completed .do-task-primary,
.do-item--completed .do-task-context,
.do-item--completed .do-task-secondary,
.do-item--completed .do-task-meta {
  opacity: 0.55;
}

.do-item--completed.do-task::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(148, 163, 184, 0.62);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
}

.do-grouped-market {
  margin: 1.1rem 0 1.6rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(15, 23, 42, 0.56)),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent 42%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.do-grouped-market__head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.do-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.do-grouped-market__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.92);
}

.do-grouped-market__districts {
  display: grid;
  gap: 1rem;
  padding-top: 0.15rem;
}

.do-grouped-market--collapsed .do-grouped-market__districts {
  display: none;
}

.do-grouped-district {
  display: grid;
  gap: 0.85rem;
}

.do-grouped-district__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.do-grouped-district__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.88);
}

.do-grouped-district__stores {
  display: grid;
  gap: 1rem;
}

.do-grouped-district--collapsed .do-grouped-district__stores {
  display: none;
}

.do-grouped-store {
  padding: 0.9rem;
  margin: 0 0 0.9rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(3, 12, 36, 0.9);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.22);
}

.do-grouped-store__head {
  margin: -0.9rem -0.9rem 0;
  padding: 0.5rem 0.9rem 0.55rem;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(10, 28, 62, 0.98), rgba(10, 26, 56, 0.94));
  border-bottom: 1px solid rgba(96, 165, 250, 0.18);
}

.do-grouped-store__kicker {
  display: none;
}

.do-grouped-store__title {
  margin: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.do-grouped-store__crumb {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.86);
  text-align: center;
}

.do-grouped-store__sections {
  display: grid;
  gap: 0.55rem;
  margin: 0 -0.9rem -0.9rem;
  padding: 0.45rem 0.7rem 0.7rem;
  background: rgba(3, 12, 36, 0.9);
  border-top: 0;
  border-radius: 0 0 18px 18px;
}

.do-store-subtopbar {
  margin: 0 -0.9rem 0;
  padding: 0.58rem 0.9rem;
  border-top: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(1, 10, 34, 0.98), rgba(1, 8, 27, 0.96));
}

.do-store-page-nav {
  margin: 0 -0.9rem 0;
  padding: 0.5rem 0.9rem 0.62rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  border-top: 0;
  border-bottom: 0;
  background: rgba(3, 12, 36, 0.9);
}

.do-store-page-tab {
  min-height: 34px;
  padding: 0.42rem 0.48rem;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.66);
  color: rgba(148, 163, 184, 0.95);
  font: 700 0.7rem/1.15 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
}

.do-store-page-tab.is-active {
  border-color: rgba(59, 130, 246, 0.58);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.33), rgba(30, 64, 175, 0.18));
  color: rgba(239, 246, 255, 0.98);
}

.do-store-page-tab__count {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(2, 6, 23, 0.72);
  color: rgba(226, 232, 240, 0.96);
  font: 800 0.62rem/1.1 var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.do-store-section-page {
  display: none;
}

.do-store-section-page.is-active {
  display: block;
}

.do-store-section {
  padding: 0.62rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.12));
}

.do-store-section__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.do-store-section__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--do-store-section-accent, #f97316);
}

.do-store-section__subgroups {
  display: grid;
  gap: 0.75rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(3, 12, 36, 0.9);
}

.do-store-subgroup {
  display: grid;
  gap: 0.35rem;
}

.do-store-subgroup + .do-store-subgroup {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.do-store-subgroup__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.1rem;
}

.do-store-subgroup__title {
  margin: 0;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.82);
}

.do-group-toggle__chevron {
  font-size: 0.9rem;
  line-height: 1;
  color: rgba(148, 163, 184, 0.85);
  transition: transform 180ms ease;
}

.do-grouped-market--collapsed .do-group-toggle__chevron,
.do-grouped-district--collapsed .do-group-toggle__chevron {
  transform: rotate(-90deg);
}

.do-subgroup-all-clear {
  padding: 1rem 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Compliance subgroups render as info cards instead of task lists. */
.do-compliance-cards {
  display: grid;
  gap: 0.65rem;
  padding: 0.4rem 0 0.2rem;
}

.do-compliance-cards__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .do-compliance-cards__row {
    grid-template-columns: 1fr;
  }
}

.do-compliance-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 0.55rem 0.7rem 0.65rem;
  display: grid;
  gap: 0.4rem;
}

.do-compliance-card__head {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: 0.35rem;
}

.do-compliance-card__head h5 {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.9);
  text-align: center;
}

.do-compliance-card__value {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 0.4rem 0.25rem;
  color: rgba(226, 232, 240, 0.95);
  letter-spacing: 0.01em;
}

/* Monthly scan-cadence ratio under the Daily Device Scans value. */
.do-compliance-card__sub {
  text-align: center;
  font: 700 0.72rem var(--font-body);
  padding: 0 0.25rem 0.2rem;
  color: rgba(148, 163, 184, 0.9);
}
.do-compliance-card__sub.is-good { color: #16a34a; }
.do-compliance-card__sub.is-warn { color: #d97706; }
.do-compliance-card__sub.is-bad  { color: #dc2626; }

/* "SCANS THIS MONTH" cadence column in daily-scan task tables (store detail +
   district/market roll-ups): Counted scan-days MTD / expected open days. */
.do-task-details-table .do-scan-mtd-cell {
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.do-task-details-table .do-scan-mtd-good { color: #16a34a; font-weight: 700; }
.do-task-details-table .do-scan-mtd-warn { color: #d97706; font-weight: 700; }
.do-task-details-table .do-scan-mtd-bad  { color: #dc2626; font-weight: 700; }

.do-compliance-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

@media (max-width: 540px) {
  .do-compliance-card__metrics {
    grid-template-columns: 1fr;
  }
}

.do-compliance-card__metric {
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem 0.4rem;
  background: rgba(30, 41, 59, 0.55);
  border-radius: 8px;
  text-align: center;
}

.do-compliance-card__metric-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.do-compliance-card__metric-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.95);
}

/* Status tone (driven by complianceStatusTone). */
.do-compliance-card__value.is-good,
.do-compliance-card__metric.is-good .do-compliance-card__metric-value {
  color: #4ade80;
}

.do-compliance-card__value.is-warn,
.do-compliance-card__metric.is-warn .do-compliance-card__metric-value {
  color: #fbbf24;
}

.do-compliance-card__value.is-bad,
.do-compliance-card__metric.is-bad .do-compliance-card__metric-value {
  color: #f87171;
}

.do-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.do-empty-state--soft {
  padding: 1rem;
  margin-top: 0.5rem;
}

.do-skeleton-root {
  padding: 0.5rem 0;
}

.do-skeleton-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0;
  animation: do-skel-pulse 1.1s ease-in-out infinite alternate;
}

.do-skeleton-circle {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.do-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.do-skeleton-lines i {
  display: block;
  height: 0.65rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
}

.do-skeleton-lines i:first-child {
  width: 70%;
}

.do-skeleton-lines i:last-child {
  width: 45%;
}

@keyframes do-skel-pulse {
  to {
    opacity: 0.55;
  }
}

.do-error-boundary {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.15);
}

.do-error-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.do-error-msg {
  margin: 0 0 0.75rem;
  color: #fecaca;
  font-size: 0.9rem;
}

.do-error-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.do-error-hint code {
  font-size: 0.75rem;
}

.do-error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

.do-error-actions .do-btn--primary {
  text-decoration: none;
}

@media (max-width: 420px) {
  #tab-daily_ops .daily-ops-board {
    padding: 0.35rem 0.65rem 1.5rem;
  }

  .do-page-title {
    font-size: 1.35rem;
  }

  .do-item-meta {
    max-width: 38%;
  }
}

/* ========== Daily Ops — Inventory (React client) ========== */
.do-inv-toolbar {
  margin: 0.75rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.do-inv-search {
  flex: 1;
  min-width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(8, 13, 22, 0.62);
  color: var(--text-muted);
}

.do-inv-search-icon {
  font-family: var(--font-mono);
  font-weight: 900;
  opacity: 0.65;
}

.do-inv-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.86rem;
}

.do-inv-search input::placeholder {
  color: var(--text-muted);
}

.do-level-nav {
  margin: 0.25rem 0 0.85rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.do-level-tab {
  min-height: 38px;
  padding: 0.48rem 0.62rem;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.62);
  color: rgba(148, 163, 184, 0.95);
  font: 700 0.75rem/1.2 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.do-level-tab:hover {
  border-color: rgba(96, 165, 250, 0.42);
  color: rgba(226, 232, 240, 0.94);
}

.do-level-tab:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.62);
  outline-offset: 2px;
}

.do-level-tab.is-active {
  border-color: rgba(59, 130, 246, 0.58);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.34), rgba(30, 64, 175, 0.2));
  color: rgba(239, 246, 255, 0.98);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22) inset;
}

.do-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
}

.do-modal {
  width: min(980px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(17, 20, 28, 0.98), rgba(14, 17, 24, 0.96));
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.do-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.do-modal-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.do-modal-title h4 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.do-modal-title p {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.35;
}

.do-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.do-modal-close:hover {
  color: var(--text-primary);
  border-color: rgba(59, 130, 246, 0.35);
}

.do-modal-body {
  padding: 0.9rem 1rem 1rem;
  overflow: auto;
}

.do-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.do-modal-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.do-modal-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
}

.do-modal-val {
  color: var(--text-primary);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .do-modal-row {
    grid-template-columns: 1fr;
  }
  .do-inv-search {
    min-width: 100%;
  }

  .do-page-tile .do-controls-bar {
    flex-wrap: wrap;
  }

  .do-page-tile .do-controls-bar .do-inv-toolbar {
    flex: 1 1 100%;
  }

  .do-page-tile .do-controls-bar .do-level-nav {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .do-page-tile .do-controls-bar .do-level-tab {
    width: 100%;
    min-width: 0;
  }
}

/* ===== Synced from public/style.css: do-grouped / do-sc / do-sgt (Vite bundles ROOT style.css) ===== */
/* ── Grouped hierarchy: market › district › store collapse ─────────── */

.do-grouped-market {
  margin-bottom: 0.5rem;
}

.do-grouped-market__head,
.do-grouped-district__head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.do-group-toggle--market,
.do-group-toggle--district {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.55rem 0.875rem;
  cursor: pointer;
  text-align: left;
  color: #94a3b8;
}

.do-group-toggle--market {
  border-radius: 10px 10px 0 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60a5fa;
}

.do-group-toggle--district {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-left: 1.25rem;
}

.do-grouped-market__title,
.do-grouped-district__title {
  flex: 1;
}

.do-group-toggle__chevron {
  font-size: 0.6rem;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

[aria-expanded="false"] .do-group-toggle__chevron {
  transform: rotate(-90deg);
}

.do-grouped-market--collapsed .do-grouped-market__districts,
.do-grouped-district--collapsed .do-grouped-district__stores {
  display: none;
}

.do-grouped-district {
  margin-bottom: 0.25rem;
}

.do-grouped-district__stores {
  padding: 0.375rem 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* ── Store collapse row ─────────────────────────────────────────────── */
.do-grouped-store {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.do-grouped-store__head {
  /* no extra styles needed — button fills it */
}

.do-group-toggle--store {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  text-align: left;
}

.do-group-toggle--store .do-grouped-store__icon {
  margin-top: 0.2rem;
}

.do-group-toggle--store .do-grouped-store__info .do-sc__kicker,
.do-group-toggle--store .do-grouped-store__info .do-sc__name,
.do-group-toggle--store .do-grouped-store__info .do-sc__crumb {
  display: block;
  width: 100%;
}

.do-group-toggle--store .do-sc__name,
.do-group-toggle--store .do-sc__crumb {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.do-group-toggle--store:hover {
  background: rgba(255, 255, 255, 0.03);
}

.do-grouped-store__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.do-grouped-store__icon svg {
  width: 1rem;
  height: 1rem;
}

.do-grouped-store__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.do-grouped-store__name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.do-grouped-store__crumb {
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.55);
}

.do-grouped-store__badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.do-grouped-store--collapsed .do-grouped-store__card {
  display: none;
}

.do-grouped-store__card {
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

/* Remove outer border/bg from store-card when inside grouped-store */
.do-grouped-store .do-store-card {
  border-radius: 0;
  border: none;
  background: transparent;
}

/* ── Store card (do-sc) — fresh unambiguous namespace ───────────────── */
.do-sc {
  font-size: 0.875rem;
}

/* Card header */
.do-sc__head {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0.875rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.do-sc__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(59, 130, 246, 0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}

.do-sc__icon svg { width: 1.35rem; height: 1.35rem; }

.do-sc__info {
  flex: 1;
  min-width: 0;
}

.do-sc__kicker {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fb923c;
  margin-bottom: 0.15rem;
}

.do-sc__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.do-sc__crumb {
  margin-top: 0.15rem;
  font-size: 0.67rem;
  color: rgba(148, 163, 184, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stat tiles */
.do-sc__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
}

.do-sc__stat {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.do-sc__stat-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.do-sc__stat-icon svg { width: 1rem; height: 1rem; }

.do-sc__stat--inv .do-sc__stat-icon {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
}

.do-sc__stat--cartons .do-sc__stat-icon {
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
}

.do-sc__stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
  line-height: 1.2;
}

.do-sc__stat-count {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.2;
}

.do-sc__stat-sub {
  font-size: 0.6rem;
  color: rgba(148, 163, 184, 0.55);
}

/* Tab nav */
.do-sc__tabs {
  display: flex;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0 0.5rem;
}

.do-sc__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 0.4rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(148, 163, 184, 0.55);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.do-sc__tab-icon { display: flex; align-items: center; }
.do-sc__tab-icon svg { width: 0.8rem; height: 0.8rem; }

.do-sc__tab:hover { color: #e2e8f0; }

.do-sc__tab--active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

/* Tab panels */
.do-sc__panels { padding: 0.625rem 0.75rem 0.75rem; }

.do-sc__panel { display: none; }
.do-sc__panel--active { display: block; }

/* Empty / all-clear state inside a tab panel */
.do-sc__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.55);
}

/* Footer */
.do-sc__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.875rem 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.62rem;
  color: rgba(148, 163, 184, 0.4);
}

/* ── Subgroup tiles (do-sgt) — fresh unambiguous namespace ──────────── */
.do-sgt {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.09);
  margin-bottom: 0.5rem;
}

.do-sgt__bar {
  width: 3px;
  flex-shrink: 0;
  background: var(--do-accent, #f97316);
}

.do-sgt__body {
  flex: 1;
  min-width: 0;
}

.do-sgt__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.do-sgt__icon {
  flex-shrink: 0;
  color: var(--do-accent, #f97316);
  display: flex;
  align-items: center;
}

.do-sgt__icon svg { width: 0.95rem; height: 0.95rem; }

.do-sgt__title {
  flex: 1;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.do-sgt__count {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--do-accent, #f97316);
  color: #fff;
  border-radius: 999px;
  min-width: 1.3rem;
  padding: 0.05rem 0.4rem;
  text-align: center;
}

.do-sgt__viewall-link {
  font-size: 0.67rem;
  font-weight: 600;
  color: #60a5fa;
  cursor: pointer;
  white-space: nowrap;
}

.do-sgt__viewall-link:hover { text-decoration: underline; }

.do-sgt__list,
.do-sgt__rest {
  list-style: none;
  padding: 0.25rem 0.5rem 0.25rem;
  margin: 0;
}

.do-sgt__rest[hidden] { display: none; }

.do-sgt__viewall {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.35rem 0;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  color: #60a5fa;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.do-sgt__viewall:hover { text-decoration: underline; }

/* ============================================================
   WORKBOOK PAGE (#tab-workbook) — spreadsheet-style editor
   ============================================================ */
#tab-workbook {
  padding: 0.85rem 0.85rem 1rem;
}

#tab-workbook .workbook-page {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

#tab-workbook .workbook-page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

#tab-workbook .workbook-page__title-wrap h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

#tab-workbook .workbook-page__title-wrap p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

#tab-workbook .workbook-page__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#tab-workbook .workbook-page__search {
  min-width: 14rem;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.85rem;
}

#tab-workbook .workbook-page__btn {
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

#tab-workbook .workbook-page__btn:hover {
  border-color: var(--accent, #3b82f6);
}

#tab-workbook .workbook-page__btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

/* Sheet tab strip (one button per sheet). Horizontally scrollable on
   mobile so all 11 sheets are reachable. */
#tab-workbook .workbook-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem 0.3rem 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--border);
}

#tab-workbook .workbook-tab {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.45rem 0.85rem;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#tab-workbook .workbook-tab:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-primary);
}

#tab-workbook .workbook-tab.is-active {
  background: var(--bg-elevated);
  border-color: var(--border);
  border-bottom-color: var(--bg-elevated);
  color: var(--text-primary);
  margin-bottom: -1px;
}

#tab-workbook .workbook-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.6rem 0.25rem;
}

#tab-workbook .workbook-status--error {
  color: #f87171;
}

#tab-workbook .workbook-grid-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  overflow: hidden;
}

#tab-workbook .workbook-grid-meta {
  padding: 0.45rem 0.75rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.25);
}

#tab-workbook .workbook-grid-scroll {
  max-height: calc(100vh - 320px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#tab-workbook .workbook-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 0.82rem;
}

#tab-workbook .workbook-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
  user-select: none;
}

#tab-workbook .workbook-table .workbook-sortable {
  cursor: pointer;
}

#tab-workbook .workbook-table .workbook-sortable:hover {
  background: rgba(59, 130, 246, 0.12);
}

#tab-workbook .workbook-sort-arrow {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.6rem;
  color: var(--accent, #3b82f6);
}

#tab-workbook .workbook-table .workbook-rownum {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  padding: 0.4rem 0.6rem;
  text-align: right;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

#tab-workbook .workbook-table thead th.workbook-rownum {
  z-index: 3;
}

#tab-workbook .workbook-table tbody td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  border-right: 1px solid rgba(148, 163, 184, 0.06);
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

#tab-workbook .workbook-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.18);
}

#tab-workbook .workbook-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.07);
}

#tab-workbook .workbook-cell {
  cursor: text;
  position: relative;
}

#tab-workbook .workbook-cell.is-edited::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
}

#tab-workbook .workbook-cell.is-saving {
  background: rgba(59, 130, 246, 0.18);
}

#tab-workbook .workbook-cell.is-editing {
  padding: 0;
  overflow: visible;
}

#tab-workbook .workbook-cell-input {
  width: 100%;
  min-width: 8rem;
  padding: 0.38rem 0.7rem;
  border: 2px solid var(--accent, #3b82f6);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  outline: none;
  box-sizing: border-box;
}

#tab-workbook .workbook-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 767px) {
  #tab-workbook {
    padding: 0.5rem;
  }
  #tab-workbook .workbook-page__head {
    gap: 0.5rem;
  }
  #tab-workbook .workbook-page__search {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }
  #tab-workbook .workbook-grid-scroll {
    max-height: calc(100vh - 260px);
  }
}

/* ============================================================
   AUTO-HIDE CHROME ON SCROLL (Facebook-style) — mobile only
   ------------------------------------------------------------
   When the user scrolls DOWN, the fixed top bar slides up off the
   top and the fixed bottom command rail slides down off the bottom,
   reclaiming screen height.
   Scrolling UP brings them back. Toggled by `body.chrome-hidden`,
   which is set/cleared from app.js.

   Every rule here lives inside `@media (max-width: 767px)`, so the
   desktop layout (where .command-rail is a LEFT sidebar) is never
   affected.
   ============================================================ */
@media (max-width: 767px) {
  .topbar,
  .topbar-selection-bar,
  .command-rail {
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
  }

  /* Slide the top bar fully up (its height already includes the
     safe-area-inset-top, so -100% clears the notch sliver too). */
  body.chrome-hidden .topbar {
    transform: translateY(-100%);
  }

  /* The selection strip is pinned just under the top bar (top = header +
     inset). Slide it up by its full offset + height so it disappears in
     lock-step with the top bar instead of staying stuck at the screen top. */
  body.chrome-hidden .topbar-selection-bar {
    transform: translateY(calc(-1 * (var(--header-height) + env(safe-area-inset-top, 0px) + var(--mobile-selbar-height))));
  }

  /* Slide the bottom command rail fully down (its height now includes
     the safe-area inset, so translateY(100%) clears the screen). */
  body.chrome-hidden .command-rail {
    transform: translateY(100%);
  }

  /* When the chrome is hidden, collapse the body padding that reserved the
     top/bottom bar space down to just the safe-area insets, so the page
     content fills the reclaimed space. Without this the bars slide away but
     the navy body-padding regions (html background showing through
     background-clip: content-box) stay put and read as "blue bars" behind
     the hidden chrome. (app.js resyncs the scroll tracker after the toggle
     so the reflow can't flip the hide/show state.) */
  body.chrome-hidden {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

/* Respect users who prefer reduced motion: snap instead of slide. */
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .topbar,
  .topbar-selection-bar,
  .command-rail {
    transition: none;
  }
}

/* ============================================================
   Trade Portal page (#tab-trade_portal)
   ============================================================ */
#tab-trade_portal .trade-portal-shell {
  padding: 1rem 1rem 2.5rem;
}

/* ============================================================
   Unlisted Data Tools page (#tab-data-tools)
   ============================================================ */
#tab-data-tools .datatools-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}
#tab-data-tools .datatools-head { margin-bottom: 1rem; }
#tab-data-tools .datatools-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}
#tab-data-tools .datatools-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}
#tab-data-tools .datatools-panel {
  margin-bottom: 1.1rem;
  padding: 0;
  overflow: hidden;
}
#tab-data-tools .datatools-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
}
#tab-data-tools .datatools-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}
#tab-data-tools .datatools-panel__hint {
  margin: 0.15rem 0 0;
  font-size: 0.74rem;
  color: #ffffff;
}

/* Buttons */
#tab-data-tools .datatools-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
#tab-data-tools .datatools-btn--ghost {
  background: #fff;
  border-color: #d8e0ea;
  color: var(--alliance-primary, #1b4278);
}
#tab-data-tools .datatools-btn--ghost:hover { border-color: var(--alliance-accent, #009fdb); }
#tab-data-tools .datatools-btn--primary {
  background: var(--alliance-primary, #1b4278);
  color: #fff;
}
#tab-data-tools .datatools-btn--primary:hover:not(:disabled) { background: #16386b; }
#tab-data-tools .datatools-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status table */
#tab-data-tools .datatools-status-wrap {
  overflow-x: auto;
  border: 1px solid #d8e0ea;
  border-radius: 4px;
}
#tab-data-tools .datatools-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
#tab-data-tools .datatools-status-table th,
#tab-data-tools .datatools-status-table td {
  text-align: left;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid #eef2f7;
  white-space: nowrap;
}
#tab-data-tools .datatools-status-table thead th {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  border-top: 0;
  background: #f6f8fc;
}
#tab-data-tools .datatools-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
#tab-data-tools .datatools-sortable:hover { color: var(--alliance-primary, #1b4278); }
#tab-data-tools .datatools-sortable.is-sorted { color: var(--alliance-primary, #1b4278); }
#tab-data-tools .datatools-sort-arrow { font-size: 0.7rem; }
#tab-data-tools .datatools-td-table { font-weight: 700; color: var(--text-primary, #0f172a); }
#tab-data-tools .datatools-td-rows { font-variant-numeric: tabular-nums; }
#tab-data-tools .datatools-status-empty {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 1.2rem;
}
#tab-data-tools .datatools-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
}
#tab-data-tools .datatools-age--fresh { background: #dcfce7; color: #15803d; }
#tab-data-tools .datatools-age--warn { background: #fef3c7; color: #92400e; }
#tab-data-tools .datatools-age--stale { background: #fee2e2; color: #b91c1c; }

/* Upload panel */
#tab-data-tools .datatools-upload { padding: 0 1.1rem 1.1rem; }
#tab-data-tools .datatools-label {
  display: block;
  margin: 0.6rem 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
#tab-data-tools .datatools-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
}
#tab-data-tools .datatools-input:focus {
  outline: none;
  border-color: var(--alliance-accent, #009fdb);
  box-shadow: 0 0 0 2px rgba(0, 159, 219, 0.18);
}
#tab-data-tools .datatools-drop {
  margin-top: 0.3rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.1rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
#tab-data-tools .datatools-drop.is-drag {
  border-color: var(--alliance-accent, #009fdb);
  background: #eef6fb;
}
#tab-data-tools .datatools-drop__hint {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}
#tab-data-tools .datatools-drop__link { color: var(--alliance-accent, #009fdb); font-weight: 700; }
#tab-data-tools .datatools-filelist { list-style: none; margin: 0.6rem 0 0; padding: 0; }
#tab-data-tools .datatools-fileitem {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eef2f7;
  margin-bottom: 0.35rem;
}
#tab-data-tools .datatools-filename { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 0.8rem; font-weight: 600; }
#tab-data-tools .datatools-filesize { flex: 0 0 auto; font-size: 0.72rem; color: var(--text-muted, #94a3b8); }
#tab-data-tools .datatools-fileremove {
  flex: 0 0 auto;
  width: 1.4rem; height: 1.4rem;
  border: 0; border-radius: 6px;
  background: #f1f5f9; color: #64748b;
  cursor: pointer; font-size: 1rem; line-height: 1;
}
#tab-data-tools .datatools-fileremove:hover { background: #fee2e2; color: #b91c1c; }
#tab-data-tools .datatools-upload__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
#tab-data-tools .datatools-upload__msg {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 1.1rem;
  white-space: pre-line;
}
#tab-data-tools .datatools-upload__msg.is-success { color: #15803d; }
#tab-data-tools .datatools-upload__msg.is-error { color: #b91c1c; }

/* ===========================================================================
   Overview / Home — scope-aware triage dashboard (KPI tiles)
   =========================================================================== */
.overview-home-root { width: 100%; }
.ov-home {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}
.ov-head { margin-bottom: 1.5rem; }
.ov-head__greet {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6366f1;
}
.ov-head__title {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.ov-head__meta { font-size: 0.92rem; color: #64748b; }
.ov-head__scope {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-weight: 600;
}

.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.ov-tile {
  --ov-accent: #6366f1;
  --ov-accent-soft: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  padding: 1.15rem 1.15rem;
  border-radius: 16px;
  border: 1px solid #e6eaf0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  position: relative;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.ov-tile:hover {
  transform: translateY(-2px);
  border-color: var(--ov-accent);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 36px rgba(15, 23, 42, 0.10);
}
.ov-tile:focus-visible { outline: 2px solid var(--ov-accent); outline-offset: 2px; }

.ov-tile__icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ov-accent-soft);
  color: var(--ov-accent);
}
.ov-tile__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ov-tile__value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.05;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.ov-tile__dash { color: #cbd5e1; }
.ov-tile__label {
  margin-top: 0.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}
.ov-tile__sub {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-tile__go {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 1rem;
  color: #cbd5e1;
  transition: transform 0.14s ease, color 0.14s ease;
}
.ov-tile:hover .ov-tile__go { color: var(--ov-accent); transform: translateX(3px); }

/* Tone accents */
.ov-tile--blue    { --ov-accent: #2563eb; --ov-accent-soft: rgba(37, 99, 235, 0.12); }
.ov-tile--teal    { --ov-accent: #0d9488; --ov-accent-soft: rgba(13, 148, 136, 0.12); }
.ov-tile--green   { --ov-accent: #16a34a; --ov-accent-soft: rgba(22, 163, 74, 0.12); }
.ov-tile--amber   { --ov-accent: #d97706; --ov-accent-soft: rgba(217, 119, 6, 0.14); }
.ov-tile--red     { --ov-accent: #dc2626; --ov-accent-soft: rgba(220, 38, 38, 0.12); }
.ov-tile--neutral { --ov-accent: #64748b; --ov-accent-soft: rgba(100, 116, 139, 0.12); }

/* --- Below-the-KPI sections ----------------------------------------------
   Layout: a 2-col row (Today's Focus | Quick Actions) then a full-width
   Recent Activity card. Stacks on mobile. */
.ov-row {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1rem;
}
.ov-card {
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ov-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.6rem;
}
.ov-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.005em;
}
.ov-card__sub { font-size: 0.78rem; color: #94a3b8; font-weight: 600; }
.ov-card__more {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
}
.ov-card__more:hover { background: #eef2f7; }

/* Empty state shared by Focus + Activity. */
.ov-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.6rem 1.25rem 1.8rem;
  color: #475569;
}
.ov-empty__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
}
.ov-empty--good .ov-empty__icon { background: rgba(22, 163, 74, 0.14); color: #16a34a; }
.ov-empty strong { color: #0f172a; font-weight: 700; }
.ov-empty__sub { font-size: 0.82rem; color: #64748b; margin-top: 0.15rem; }

/* Today's focus rows */
.ov-focus-list { display: flex; flex-direction: column; padding: 0.35rem 0.5rem 0.85rem; }
.ov-focus-row {
  --ov-row-accent: #64748b;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  border-left: 3px solid var(--ov-row-accent);
}
.ov-focus-row + .ov-focus-row { margin-top: 0.2rem; }
.ov-focus-row:hover { background: #f8fafc; }
.ov-focus-row--red    { --ov-row-accent: #dc2626; }
.ov-focus-row--amber  { --ov-row-accent: #d97706; }
.ov-focus-row--green  { --ov-row-accent: #16a34a; }
.ov-focus-row__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(100, 116, 139, 0.10);
  color: var(--ov-row-accent);
}
.ov-focus-row__body { display: flex; flex-direction: column; min-width: 0; }
.ov-focus-row__kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ov-row-accent);
}
.ov-focus-row__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-focus-row__meta {
  font-size: 0.78rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-focus-row__stamp {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Quick actions grid */
.ov-actions-grid {
  padding: 0.5rem 0.75rem 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.ov-action {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.ov-action:hover {
  background: #fff;
  border-color: #2563eb;
  transform: translateY(-1px);
}
.ov-action__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  flex: 0 0 auto;
}
.ov-action__main { display: flex; flex-direction: column; min-width: 0; }
.ov-action__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}
.ov-action__sub {
  font-size: 0.72rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .ov-home { padding: 0.9rem 0.75rem 4.5rem; }

  /* Compact header: drop the greeting kicker, tighten the title block. */
  .ov-head { margin-bottom: 0.85rem; }
  .ov-head__greet { display: none; }
  .ov-head__title { font-size: 1.25rem; margin: 0 0 0.25rem; }
  .ov-head__meta { font-size: 0.8rem; }

  /* KPI tiles: three compact stat cards side by side instead of three
     full-width rows — icon over value over label; secondary copy hidden. */
  .ov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .ov-tile {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.65rem 0.4rem 0.6rem;
    border-radius: 12px;
  }
  .ov-tile__icon { width: 30px; height: 30px; border-radius: 9px; }
  .ov-tile__icon svg { width: 16px; height: 16px; }
  .ov-tile__main { align-items: center; text-align: center; min-width: 0; max-width: 100%; }
  .ov-tile__value {
    font-size: clamp(0.92rem, 5.4vw, 1.2rem);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ov-tile__label {
    margin-top: 0.18rem;
    font-size: 0.6rem;
    line-height: 1.25;
    text-align: center;
  }
  .ov-tile__sub,
  .ov-tile__go { display: none; }

  /* Cards: tighter chrome, smaller gaps. */
  .ov-row { grid-template-columns: 1fr; gap: 0.6rem; margin-top: 0.75rem; }
  .ov-card { border-radius: 12px; }
  .ov-card__head { padding: 0.8rem 0.9rem 0.45rem; }
  .ov-card__title { font-size: 0.95rem; }
  .ov-focus-list { padding: 0.25rem 0.4rem 0.6rem; }
  .ov-focus-row { padding: 0.55rem 0.6rem; gap: 0.6rem; }

  /* Quick actions: two per row (they were one-per-row full width). */
  .ov-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.4rem 0.6rem 0.7rem;
    gap: 0.4rem;
  }
  .ov-action { padding: 0.55rem 0.6rem; gap: 0.5rem; }
  .ov-action__icon { width: 28px; height: 28px; }
  .ov-action__icon svg { width: 16px; height: 16px; }
  .ov-action__label { font-size: 0.78rem; }
  .ov-action__sub { font-size: 0.66rem; }
}

/* Shared empty-state body + footer for Daily Ops / Inventory tables when
   the underlying query returns 0 rows for the selected scope/day. Matches
   the look of the cartons empty state in #tab-inventory (centered
   "Nothing to report for selected day." over a "Showing 0 X" footer
   separated by a hairline). Currently consumed by Outstanding Shrink,
   Hyla Trade-ins, and Device Alive. */
.dops-empty-body {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted, rgba(148, 163, 184, 0.75));
  font-size: 0.95rem;
  font-weight: 500;
}
.dops-empty-footer {
  padding: 0.85rem 1.25rem;
  text-align: center;
  color: var(--text-muted, rgba(148, 163, 184, 0.75));
  font-size: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
/* Light-theme overrides — Alliance white-chrome panels read with darker
   grays for the empty message and the hairline separator. */
#tab-inventory .dops-empty-body,
#tab-daily_ops .dops-empty-body,
#tab-trade_portal .dops-empty-body {
  color: #475569;
}
#tab-inventory .dops-empty-footer,
#tab-daily_ops .dops-empty-footer,
#tab-trade_portal .dops-empty-footer {
  color: #64748b;
  border-top-color: #e2e8f0;
}

/* ============================================================================
   Sparse data tables — columns fit content; Store Name soaks up leftover width
   ----------------------------------------------------------------------------
   These daily-ops tables hold short codes & numbers in `nowrap` cells. Giving
   the Store Name column `width: 100%` makes it absorb any leftover panel width
   while every other column stays at its `nowrap` content width — so each cell
   fits its content and the extra space lands in the longest/primary column
   (Store Name) instead of being spread into mid-table gaps or a trailing empty
   column. Safe only on these `nowrap` tables; STS Transfers already does this
   via its own width:1%/auto rule above. Text-heavy tables (Events, Tasks,
   Research, ARIT) keep the default auto distribution.
   ============================================================================ */
.daily-ops-cartons-table th.cartons-th-store,         .daily-ops-cartons-table td.cartons-cell-store,
.daily-ops-drawers-table th.drawers-th-store,         .daily-ops-drawers-table td.drawers-cell-store,
.daily-ops-eol-table th.eol-th-store,                 .daily-ops-eol-table td.eol-cell-store,
.daily-ops-nonsellable-table th.nonsellable-th-store, .daily-ops-nonsellable-table td.nonsellable-cell-store,
.daily-ops-obs-acc-table th.obs-acc-th-store,         .daily-ops-obs-acc-table td.obs-acc-cell-store,
.daily-ops-scans-table th.scans-th-store,             .daily-ops-scans-table td.scans-cell-store,
.daily-ops-shrink-table th.shrink-th-store,           .daily-ops-shrink-table td.shrink-cell-store,
.daily-ops-prodnote-table th.prodnote-th-store,       .daily-ops-prodnote-table td.prodnote-cell-store {
  width: 100%;
}

/* =====================================================================
   SINGLE-STORE INVENTORY DETAIL VIEW (.store-detail-root)
   Shown when the topbar store filter resolves to one Opus ID. Light
   theme tokens from the store-inventory mockup; Alliance brand colors
   for accents. The rest of the inventory page is hidden while active.
   ===================================================================== */
.inventory-page.store-detail-active > :not(.store-detail-root) { display: none !important; }

.store-detail-root {
  --sd-well: #EEF3F9;
  --sd-surface: #FFFFFF;
  --sd-line: rgba(27, 66, 120, .14);
  --sd-ink: #16294A;
  --sd-ink-dim: #4A6386;
  --sd-ink-faint: #8298B5;
  --sd-cyan: #46B7E8;
  --sd-cyan-mid: #1FA0D9;
  --sd-cyan-deep: #1180B6;
  --sd-green: #179C63;
  --sd-amber: #C57E12;
  --sd-red: #D63B57;
  --sd-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sd-r: 14px;
  --sd-shadow: 0 1px 2px rgba(22, 41, 74, .05), 0 6px 18px rgba(22, 41, 74, .09);
  color: var(--sd-ink);
  font-size: 14px;
}
.store-detail-root button { font-family: inherit; cursor: pointer; }

/* ---------- hero tile ---------- */
.store-detail-root .sd-hero {
  background: var(--sd-surface);
  border: 1px solid var(--sd-line);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(11, 23, 48, .18);
  overflow: hidden;
  margin-bottom: 22px;
}
.store-detail-root .sd-hero-head {
  position: relative;
  background: linear-gradient(135deg, #1C3A6A 0%, #13264A 45%, #0B1730 100%);
  padding: 24px 26px;
}
.store-detail-root .sd-hero-export {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px; color: #E5EEF9;
}
.store-detail-root .sd-hero-export:hover { background: rgba(255, 255, 255, .13); }
.store-detail-root .sd-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-right: 52px; }
.store-detail-root .sd-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.store-detail-root .sd-store-name h1 { font-weight: 800; font-size: 27px; letter-spacing: .01em; line-height: 1.1; color: #fff; margin: 0; }
.store-detail-root .sd-status-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #3FD68F; background: rgba(63, 214, 143, .12); border: 1px solid rgba(63, 214, 143, .4);
  border-radius: 999px; padding: 4px 10px; line-height: 1;
}
.store-detail-root .sd-status-badge.is-bad { color: #FCA5A5; background: rgba(214, 59, 87, .14); border-color: rgba(214, 59, 87, .45); }
.store-detail-root .sd-store-meta { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.store-detail-root .sd-meta-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px; padding: 7px 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.store-detail-root .sd-meta-chip i { font-style: normal; font-weight: 600; font-size: 10.5px; letter-spacing: .09em; color: #8FA9CC; }

/* ---------- KPI band ---------- */
.store-detail-root .sd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 18px 20px; background: var(--sd-surface); }
.store-detail-root .sd-kpi {
  background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: var(--sd-r);
  padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--sd-shadow);
}
.store-detail-root .sd-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sd-accent, var(--sd-cyan)); border-radius: 3px 0 0 3px; }
.store-detail-root .sd-kpi-v { font-weight: 800; font-size: 25px; line-height: 1.1; letter-spacing: -.02em; }
.store-detail-root .sd-kpi-l { font-size: 11px; color: var(--sd-ink-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.store-detail-root .sd-kpi-sub { font-size: 11px; margin-top: 6px; color: var(--sd-ink-faint); }
.store-detail-root .sd-kpi-sub.up { color: var(--sd-green); }
.store-detail-root .sd-kpi-sub.warn { color: var(--sd-amber); }
.store-detail-root .sd-kpi-sub.bad { color: var(--sd-red); }

/* ---------- two-column grid + panels ---------- */
.store-detail-root .sd-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .store-detail-root .sd-grid { grid-template-columns: 1fr; } }
.store-detail-root .sd-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.store-detail-root .sd-panel { background: var(--sd-surface); border: 1px solid var(--sd-line); border-radius: var(--sd-r); padding: 18px 20px; box-shadow: var(--sd-shadow); overflow: hidden; }
.store-detail-root .sd-panel--lookup { padding: 14px 16px; }
.store-detail-root .sd-empty { padding: 10px 2px; font-size: 12.5px; color: var(--sd-ink-faint); }
.store-detail-root .sd-empty--error { color: var(--sd-red); }

/* ---------- dark tile head (mirrors daily-ops tile heads) ---------- */
.store-detail-root .sd-tile-head {
  position: relative; display: flex; align-items: center;
  margin: -18px -20px 16px; padding: 0 12px; height: 56px;
  background: linear-gradient(90deg, #26508A 0%, #15294E 38%, #0A1428 72%, #0F1E3A 100%);
  border-radius: 13px 13px 0 0;
}
.store-detail-root .sd-th-left { display: flex; flex-direction: column; font-size: 10px; line-height: 1.4; color: #8FA9CC; min-width: 0; padding-left: 4px; }
.store-detail-root .sd-th-left b { color: #C8DCF4; font-weight: 600; }
.store-detail-root .sd-th-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.store-detail-root .sd-th-center h2 { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: .01em; margin: 0; text-transform: none; }
/* Tile-head icons: same treatment as the themed district-view table heads
   (#tab-compliance rules in theme-alliance.css) — AT&T cyan, 24px box. */
.store-detail-root .sd-th-center > .inventory-table-kpi-icon {
  color: #009fdb;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.store-detail-root .sd-th-center > .inventory-table-kpi-icon svg { width: 20px; height: 20px; }
.store-detail-root .sd-th-actions { margin-left: auto; display: flex; gap: 8px; }
.store-detail-root .sd-th-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 9px; color: #fff;
}
.store-detail-root .sd-th-btn:hover { background: rgba(255, 255, 255, .16); }
@media (max-width: 640px) {
  .store-detail-root .sd-th-left { display: none; }
  .store-detail-root .sd-th-center { position: static; transform: none; margin-right: auto; }
}

/* ---------- store-scoped lookup ---------- */
.store-detail-root .sd-lookup { display: flex; align-items: center; gap: 10px; background: var(--sd-well); border: 1px solid var(--sd-line); border-radius: 12px; padding: 12px 14px; }
.store-detail-root .sd-lookup svg { flex: none; color: var(--sd-ink-faint); }
.store-detail-root .sd-lookup input { flex: 1; background: none; border: none; outline: none; color: var(--sd-ink); font-family: var(--sd-mono); font-size: 13px; }
.store-detail-root .sd-lookup input::placeholder { color: var(--sd-ink-faint); font-family: inherit; }
.store-detail-root .sd-lookup-scope { flex: none; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--sd-cyan-deep); background: rgba(70, 183, 232, .12); border: 1px solid rgba(70, 183, 232, .35); border-radius: 6px; padding: 4px 8px; }
.store-detail-root .sd-lookup-results { margin-top: 12px; overflow-x: auto; }
.store-detail-root .sd-lookup-results table { width: 100%; border-collapse: collapse; font-size: 12px; }
.store-detail-root .sd-lookup-results th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--sd-ink-dim); padding: 6px 8px; border-bottom: 1px solid var(--sd-line); white-space: nowrap; }
.store-detail-root .sd-lookup-results td { padding: 7px 8px; border-bottom: 1px solid var(--sd-line); font-family: var(--sd-mono); font-size: 11.5px; color: var(--sd-ink); }
.store-detail-root .sd-lookup-count { margin-top: 8px; font-size: 11px; color: var(--sd-ink-faint); }

/* ---------- device alive ---------- */
.store-detail-root .sd-da-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.store-detail-root .sd-ring { position: relative; width: 74px; height: 74px; flex: none; }
.store-detail-root .sd-ring svg { transform: rotate(-90deg); }
.store-detail-root .sd-ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.store-detail-root .sd-da-breakdown { display: flex; gap: 22px; }
.store-detail-root .sd-bd-n { font-weight: 800; font-size: 21px; line-height: 1.1; }
.store-detail-root .sd-bd-t { font-size: 11px; color: var(--sd-ink-dim); margin-top: 2px; }
.store-detail-root .sd-dev { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--sd-line); }
.store-detail-root .sd-dev:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-dotr { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.store-detail-root .sd-dot-off { background: var(--sd-red); }
.store-detail-root .sd-dot-noda { background: var(--sd-amber); }
.store-detail-root .sd-dev-nm { font-size: 13px; font-weight: 500; min-width: 0; }
.store-detail-root .sd-dev-imei { font-family: var(--sd-mono); font-size: 11.5px; color: var(--sd-ink-dim); white-space: nowrap; }
.store-detail-root .sd-tag { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.store-detail-root .sd-tag-off { color: var(--sd-red); background: rgba(214, 59, 87, .09); border: 1px solid rgba(214, 59, 87, .25); }
.store-detail-root .sd-tag-noda { color: var(--sd-amber); background: rgba(197, 126, 18, .09); border: 1px solid rgba(197, 126, 18, .3); }

/* ---------- inbound pipeline ---------- */
.store-detail-root .sd-pipeline { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.store-detail-root .sd-stage { padding: 0 14px; }
.store-detail-root .sd-stage + .sd-stage { border-left: 1px dashed var(--sd-line); }
.store-detail-root .sd-stage-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.store-detail-root .sd-stage-n { font-weight: 800; font-size: 24px; }
.store-detail-root .sd-stage-pill { font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--sd-ink-dim); }
.store-detail-root .sd-stage-sub { font-size: 11px; color: var(--sd-ink-faint); }
.store-detail-root .sd-stage-bar { height: 4px; border-radius: 2px; background: var(--sd-well); margin-top: 10px; overflow: hidden; }
.store-detail-root .sd-stage-bar i { display: block; height: 100%; border-radius: 2px; }
.store-detail-root .sd-carton { display: grid; grid-template-columns: auto 1fr auto auto auto auto; align-items: center; gap: 14px; padding: 11px 4px; border-top: 1px solid var(--sd-line); }
.store-detail-root .sd-carton:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-carton--clickable { cursor: pointer; }
.store-detail-root .sd-carton--clickable:focus-visible { outline: 2px solid var(--sd-cyan-mid); outline-offset: -2px; border-radius: 8px; }
.store-detail-root .sd-age-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.store-detail-root .sd-age-ok { background: var(--sd-green); }
.store-detail-root .sd-age-warn { background: var(--sd-amber); }
.store-detail-root .sd-age-bad { background: var(--sd-red); }
.store-detail-root .sd-carton-ids { min-width: 0; }
.store-detail-root .sd-carton-no { font-family: var(--sd-mono); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-detail-root .sd-carton-trk { font-size: 11px; color: var(--sd-ink-faint); font-family: var(--sd-mono); }
.store-detail-root .sd-stat { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.store-detail-root .sd-stat.is-transit { color: var(--sd-cyan-deep); }
.store-detail-root .sd-stat.is-delivered { color: var(--sd-amber); }
.store-detail-root .sd-carton-age { font-family: var(--sd-mono); font-size: 12px; color: var(--sd-ink-dim); text-align: right; min-width: 34px; }
.store-detail-root .sd-carton-car { font-size: 11px; color: var(--sd-ink-faint); min-width: 32px; text-align: right; }
.store-detail-root .sd-carton-act { justify-self: end; }
.store-detail-root .sd-btn-receive { background: rgba(23, 156, 99, .1); border: 1px solid rgba(23, 156, 99, .35); color: var(--sd-green); border-radius: 8px; padding: 5px 11px; font-size: 11px; font-weight: 600; }
.store-detail-root .sd-btn-receive:hover { background: rgba(23, 156, 99, .18); }

/* ---------- scan calendar ---------- */
.store-detail-root .sd-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 12px; }
.store-detail-root .sd-dlab { font-size: 9px; color: var(--sd-ink-faint); text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.store-detail-root .sd-day { aspect-ratio: 1; border-radius: 6px; background: var(--sd-well); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--sd-ink-faint); font-family: var(--sd-mono); border: 1px solid transparent; }
.store-detail-root .sd-day.is-s { background: rgba(23, 156, 99, .13); color: var(--sd-green); border-color: rgba(23, 156, 99, .3); }
.store-detail-root .sd-day.is-today { border-color: var(--sd-cyan-mid); color: var(--sd-cyan-deep); background: rgba(70, 183, 232, .1); }
.store-detail-root .sd-day.is-future { opacity: .45; }
.store-detail-root .sd-scan-legend { display: flex; gap: 14px; font-size: 11px; color: var(--sd-ink-faint); }
.store-detail-root .sd-scan-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.store-detail-root .sd-li-s i { background: rgba(23, 156, 99, .45); }
.store-detail-root .sd-li-t i { background: rgba(70, 183, 232, .45); }

/* ---------- check rows + foot (monthly count) ---------- */
.store-detail-root .sd-chk { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--sd-line); font-size: 13px; }
.store-detail-root .sd-chk:first-of-type { border-top: none; }
.store-detail-root .sd-chk-ok { flex: none; width: 18px; height: 18px; border-radius: 50%; background: rgba(23, 156, 99, .12); border: 1px solid rgba(23, 156, 99, .4); display: flex; align-items: center; justify-content: center; color: var(--sd-green); font-size: 10px; }
.store-detail-root .sd-chk-ok.is-bad { background: rgba(214, 59, 87, .1); border-color: rgba(214, 59, 87, .35); color: var(--sd-red); }
.store-detail-root .sd-chk-lbl { flex: 1; color: var(--sd-ink-dim); font-weight: 500; }
.store-detail-root .sd-chk-val { font-family: var(--sd-mono); font-size: 12px; color: var(--sd-green); font-weight: 600; }
.store-detail-root .sd-chk-val.is-bad { color: var(--sd-red); }
.store-detail-root .sd-foot { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--sd-line); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--sd-ink-dim); }
.store-detail-root .sd-foot b { color: var(--sd-green); }
.store-detail-root .sd-foot b.is-bad { color: var(--sd-red); }

/* ---------- ipog ---------- */
.store-detail-root .sd-ipog-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--sd-line); }
.store-detail-root .sd-ipog-row:first-of-type { border-top: none; }
.store-detail-root .sd-ipog-ml { flex: none; width: 128px; font-size: 12px; color: var(--sd-ink-dim); font-weight: 500; }
.store-detail-root .sd-ipog-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--sd-well); overflow: hidden; }
.store-detail-root .sd-ipog-bar i { display: block; height: 100%; border-radius: 4px; }
.store-detail-root .sd-ipog-mv { flex: none; min-width: 54px; text-align: right; font-family: var(--sd-mono); font-size: 12.5px; font-weight: 500; }

/* ---------- closing checklist ---------- */
.store-detail-root .sd-close-card { display: flex; flex-direction: column; }
.store-detail-root .sd-cc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--sd-line); font-size: 12.5px; }
.store-detail-root .sd-cc-row:first-of-type { border-top: none; }
.store-detail-root .sd-cc-k { color: var(--sd-ink-dim); }
.store-detail-root .sd-cc-v { font-weight: 600; text-align: right; }
.store-detail-root .sd-cc-v--mono { font-family: var(--sd-mono); font-weight: 500; }
.store-detail-root .sd-cc-v--small { font-size: 12px; word-break: break-all; }
.store-detail-root .sd-cc-links { display: flex; gap: 8px; margin-top: 13px; }
.store-detail-root .sd-cc-link { flex: 1; text-align: center; font-size: 12px; font-weight: 600; padding: 8px 0; border-radius: 8px; background: rgba(70, 183, 232, .1); border: 1px solid rgba(70, 183, 232, .3); color: var(--sd-cyan-deep); text-decoration: none; }
.store-detail-root .sd-cc-link:hover { background: rgba(70, 183, 232, .18); text-decoration: none; }
.store-detail-root .sd-cc-link.is-disabled { opacity: .45; cursor: default; }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .store-detail-root .sd-carton { grid-template-columns: auto 1fr auto auto; row-gap: 2px; }
  .store-detail-root .sd-carton-car, .store-detail-root .sd-stat { display: none; }
  .store-detail-root .sd-dev { grid-template-columns: auto 1fr auto; row-gap: 2px; }
  .store-detail-root .sd-dev-imei { display: none; }
}

/* =====================================================================
   CARTON CONTENTS MODAL (mockup redesign)
   Navy gradient head (close, eyebrow, mono carton #, export, chips +
   status pill), KPI summary strip, focused 7-column line-item table.
   ===================================================================== */
.carton-modal-head {
  position: relative;
  background: linear-gradient(135deg, #1C3A6A 0%, #13264A 45%, #0B1730 100%);
  padding: 22px 26px 24px;
}
.carton-modal-head-row { display: flex; align-items: flex-start; gap: 14px; padding-right: 96px; }
.carton-modal-close {
  flex: none; width: 34px; height: 34px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px; color: #E5EEF9; font-size: 16px; line-height: 1; cursor: pointer;
}
.carton-modal-close:hover { background: rgba(255, 255, 255, .13); }
.carton-modal-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #46B7E8; margin-bottom: 5px; }
.carton-modal-no {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600; font-size: clamp(19px, 3vw, 26px);
  color: #fff; letter-spacing: .02em; word-break: break-all;
}
.carton-modal-head-actions { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; }
.carton-modal-hbtn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px; color: #E5EEF9; cursor: pointer;
}
.carton-modal-hbtn:hover { background: rgba(255, 255, 255, .13); }
.carton-modal-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-left: 48px; }
.carton-meta-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px; padding: 7px 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.carton-meta-chip i { font-style: normal; font-weight: 600; font-size: 10.5px; letter-spacing: .09em; color: #8FA9CC; }
.carton-status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 999px; padding: 8px 14px;
  color: #FFC96B; background: rgba(246, 180, 69, .13); border: 1px solid rgba(246, 180, 69, .45);
}
.carton-status-pill .carton-pdot { width: 7px; height: 7px; border-radius: 50%; background: #FFC96B; box-shadow: 0 0 8px rgba(255, 201, 107, .7); }
.carton-status-pill.is-received { color: #3FD68F; background: rgba(63, 214, 143, .12); border-color: rgba(63, 214, 143, .4); }
.carton-status-pill.is-received .carton-pdot { background: #3FD68F; box-shadow: 0 0 8px rgba(63, 214, 143, .7); }

/* ---------- summary strip ---------- */
.carton-modal-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; padding: 18px 22px; border-bottom: 1px solid rgba(27, 66, 120, .14); background: #FFFFFF;
}
.carton-sum {
  background: #FFFFFF; border: 1px solid rgba(27, 66, 120, .14); border-radius: 14px;
  padding: 13px 16px; position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(22, 41, 74, .05), 0 6px 18px rgba(22, 41, 74, .07);
}
.carton-sum::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, #46B7E8); border-radius: 3px 0 0 3px; }
.carton-sum-v { font-weight: 800; font-size: 23px; line-height: 1.1; color: #16294A; }
.carton-sum-l { font-size: 10.5px; color: #4A6386; margin-top: 4px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* ---------- line-item table ---------- */
.carton-modal-table-wrap { padding: 18px 22px 24px; background: #FFFFFF; }
.carton-modal-table {
  width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px;
  background: linear-gradient(90deg, #26508A 0%, #15294E 55%, #0A1428 100%);
  border-radius: 12px;
}
.carton-modal-table thead th {
  background: transparent;
  color: #fff; font-weight: 700; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; text-align: left;
  padding: 9px 16px; white-space: nowrap;
}
.carton-modal-table thead th.cm-num { text-align: right; }
.carton-modal-table tbody td {
  background: #FFFFFF;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(27, 66, 120, .14);
  border-right: 1px solid rgba(27, 66, 120, .14);
  font-size: 13.5px; vertical-align: middle; color: #16294A;
}
.carton-modal-table tbody td:first-child { border-left: 1px solid rgba(27, 66, 120, .14); }
.carton-modal-table tbody tr:last-child td:first-child { border-radius: 0 0 0 12px; }
.carton-modal-table tbody tr:last-child td:last-child { border-radius: 0 0 12px 0; }
.carton-modal-table tbody tr:hover td { background: #EBF5FC; }
.carton-modal-table tbody tr:last-child td { border-bottom: none; }
.carton-modal-table td.cm-sku { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: #1180B6; }
.carton-modal-table td.cm-desc { font-weight: 500; }
.carton-modal-table td.cm-num { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; color: #4A6386; }
.carton-modal-table td.cm-num b { color: #16294A; font-weight: 600; }
.carton-modal-table td.cm-num .cm-zero { color: #8298B5; }
.carton-modal-table td.cm-num .cm-pend { color: #C57E12; font-weight: 600; }
.cm-row-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 7px; padding: 3px 9px; white-space: nowrap;
}
.cm-row-status.is-n { color: #C57E12; background: rgba(197, 126, 18, .09); border: 1px solid rgba(197, 126, 18, .32); }
.cm-row-status.is-y { color: #179C63; background: rgba(23, 156, 99, .09); border: 1px solid rgba(23, 156, 99, .32); }

/* Loading / empty / error states sit on the white body under the navy head. */
.modal.modal--carton .carton-detail-status { padding: 26px 24px; }

/* =====================================================================
   TRADE PORTAL — single-store detail view additions
   (.store-detail-root base styles shared with the Inventory store view)
   ===================================================================== */
/* Amber icon variant (Nonsellable head) — overrides the cyan default. */
.store-detail-root .sd-th-center.sd-th-icon--amber > .inventory-table-kpi-icon { color: #F6B445; }

/* dops toolbar (same delegated handlers as the multi-store tables) restyled
   to the tile-head button look when it sits inside a store-detail head. */
.store-detail-root .sd-th-actions .daily-ops-head-actions { display: flex; gap: 8px; align-items: center; }
.store-detail-root .sd-th-actions .dops-table-expand-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 9px; color: #fff; padding: 0;
}
.store-detail-root .sd-th-actions .dops-table-expand-btn:hover { background: rgba(255, 255, 255, .16); }

/* ---------- aging callout (30d+ chargeback risk) ---------- */
.store-detail-root .sd-aging-callout {
  display: flex; align-items: center; gap: 12px;
  background: rgba(214, 59, 87, .07); border: 1px solid rgba(214, 59, 87, .28);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; color: var(--sd-ink-dim);
}
.store-detail-root .sd-aging-callout b { color: var(--sd-red); }
.store-detail-root .sd-aging-callout svg { flex: none; color: var(--sd-red); }

/* ---------- hyla trade-in rows ---------- */
.store-detail-root .sd-trade {
  display: grid; grid-template-columns: auto minmax(0, 1.5fr) minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--sd-line);
}
.store-detail-root .sd-trade:first-of-type { border-top: none; }
.store-detail-root .sd-trade:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-age-bad { background: var(--sd-red); box-shadow: 0 0 0 4px rgba(214, 59, 87, .12); }
.store-detail-root .sd-trade-nm { font-size: 13.5px; font-weight: 600; }
.store-detail-root .sd-trade-imei { font-family: var(--sd-mono); font-size: 11.5px; color: var(--sd-ink-dim); margin-top: 2px; }
.store-detail-root .sd-trade-ref { min-width: 0; }
.store-detail-root .sd-trade-rep { font-size: 12px; font-weight: 500; color: var(--sd-ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-detail-root .sd-trade-inv { font-family: var(--sd-mono); font-size: 11px; color: var(--sd-ink-faint); margin-top: 2px; }
.store-detail-root .sd-trade-val { font-family: var(--sd-mono); font-size: 13.5px; font-weight: 600; text-align: right; min-width: 64px; }
.store-detail-root .sd-trade-dt { font-size: 11.5px; color: var(--sd-ink-dim); text-align: right; white-space: nowrap; }
.store-detail-root .sd-agev { font-family: var(--sd-mono); font-size: 12px; font-weight: 600; text-align: right; min-width: 36px; }
.store-detail-root .sd-agev.is-bad { color: var(--sd-red); }
.store-detail-root .sd-agev.is-warn { color: var(--sd-amber); }
.store-detail-root .sd-agev.is-ok { color: var(--sd-ink-dim); }

/* ---------- nonsellable rows ---------- */
.store-detail-root .sd-ns {
  display: grid; grid-template-columns: auto auto minmax(0, 1.6fr) minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--sd-line);
}
.store-detail-root .sd-ns:first-of-type { border-top: none; }
.store-detail-root .sd-ns:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-ns-cat {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  border-radius: 6px; padding: 4px 7px; white-space: nowrap; color: var(--sd-ink-faint);
}
.store-detail-root .sd-ns-cat.is-bba { color: var(--sd-cyan-deep); background: rgba(70, 183, 232, .1); border: 1px solid rgba(70, 183, 232, .35); }
.store-detail-root .sd-ns-cat.is-dem { color: #7A5FB8; background: rgba(122, 95, 184, .09); border: 1px solid rgba(122, 95, 184, .3); }
.store-detail-root .sd-ns-nm { font-size: 13.5px; font-weight: 600; }
.store-detail-root .sd-ns-itm { font-family: var(--sd-mono); font-size: 11px; color: var(--sd-ink-faint); margin-top: 2px; }
.store-detail-root .sd-ns-sn { font-family: var(--sd-mono); font-size: 11.5px; color: var(--sd-ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-detail-root .sd-ns-val { font-family: var(--sd-mono); font-size: 13.5px; font-weight: 600; text-align: right; min-width: 64px; }
.store-detail-root .sd-ns-val.is-zero { color: var(--sd-ink-faint); font-weight: 500; }
.store-detail-root .sd-next-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 7px; padding: 5px 9px; white-space: nowrap;
}
.store-detail-root .sd-next-pill.is-y { color: var(--sd-green); background: rgba(23, 156, 99, .09); border: 1px solid rgba(23, 156, 99, .32); }
.store-detail-root .sd-next-pill.is-n { color: var(--sd-amber); background: rgba(197, 126, 18, .09); border: 1px solid rgba(197, 126, 18, .32); }

/* ---------- mobile: rows collapse to dot + name + age ---------- */
@media (max-width: 720px) {
  .store-detail-root .sd-trade { grid-template-columns: auto 1fr auto; }
  .store-detail-root .sd-trade-ref, .store-detail-root .sd-trade-dt, .store-detail-root .sd-trade-val { display: none; }
  .store-detail-root .sd-ns { grid-template-columns: auto auto 1fr auto; }
  .store-detail-root .sd-ns-sn, .store-detail-root .sd-ns-val, .store-detail-root .sd-next-pill { display: none; }
}

/* =====================================================================
   FINANCIALS — single-store detail view additions
   (.store-detail-root base styles shared with the other store views)
   ===================================================================== */
.store-detail-root .sd-th-center.sd-th-icon--green > .inventory-table-kpi-icon { color: #3FD68F; }

/* ---------- treasury case rows ---------- */
.store-detail-root .sd-case {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--sd-line);
}
.store-detail-root .sd-case:first-of-type { border-top: none; }
.store-detail-root .sd-case:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-issue-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 7px; padding: 5px 10px; white-space: nowrap;
}
.store-detail-root .sd-issue-pill.is-co { color: var(--sd-cyan-deep); background: rgba(70, 183, 232, .1); border: 1px solid rgba(70, 183, 232, .35); }
.store-detail-root .sd-issue-pill.is-short { color: var(--sd-red); background: rgba(214, 59, 87, .08); border: 1px solid rgba(214, 59, 87, .32); }
.store-detail-root .sd-issue-pill.is-other { color: #5b4ea8; background: rgba(122, 95, 184, .09); border: 1px solid rgba(122, 95, 184, .28); }
.store-detail-root .sd-case-det { min-width: 0; }
.store-detail-root .sd-case-t { font-size: 13px; font-weight: 600; }
.store-detail-root .sd-case-facts { font-size: 11.5px; color: var(--sd-ink-faint); margin-top: 2px; }
.store-detail-root .sd-case-facts b { color: var(--sd-ink-dim); font-weight: 600; }
.store-detail-root .sd-case-tag {
  font-size: 10px; font-weight: 600; color: var(--sd-amber);
  background: rgba(197, 126, 18, .08); border: 1px solid rgba(197, 126, 18, .3);
  border-radius: 6px; padding: 4px 8px; white-space: nowrap;
}
.store-detail-root .sd-case-mail {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sd-mono); font-size: 11.5px; color: var(--sd-ink-dim); white-space: nowrap;
}
.store-detail-root .sd-case-mail svg { color: var(--sd-ink-faint); }
.store-detail-root .sd-case-amt { font-family: var(--sd-mono); font-size: 13.5px; font-weight: 600; text-align: right; min-width: 74px; }
.store-detail-root .sd-case-amt.is-neg { color: var(--sd-red); }
.store-detail-root .sd-case-amt.is-zero { color: var(--sd-ink-faint); font-weight: 500; }

/* ---------- green-check empty states ---------- */
.store-detail-root .sd-fin-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 30px 16px 26px; text-align: center;
}
.store-detail-root .sd-fin-empty-ic {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(23, 156, 99, .1); border: 1px solid rgba(23, 156, 99, .3); color: var(--sd-green);
}
.store-detail-root .sd-fin-empty-t { font-size: 13.5px; font-weight: 600; }
.store-detail-root .sd-fin-empty-s { font-size: 12px; color: var(--sd-ink-faint); max-width: 240px; }

/* ---------- open drawer rows ---------- */
.store-detail-root .sd-drawer {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--sd-line);
}
.store-detail-root .sd-drawer:first-of-type { border-top: none; }
.store-detail-root .sd-drawer:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-drawer-state { font-size: 12px; font-weight: 700; color: var(--sd-ink-dim); }
.store-detail-root .sd-drawer-eod { font-size: 12px; color: var(--sd-ink-faint); }
.store-detail-root .sd-drawer-txns { font-family: var(--sd-mono); font-size: 11.5px; color: var(--sd-ink-dim); text-align: right; }
.store-detail-root .sd-drawer-amt { font-family: var(--sd-mono); font-size: 13px; font-weight: 600; text-align: right; min-width: 70px; color: var(--sd-red); }

/* ---------- product note rows ---------- */
.store-detail-root .sd-note {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--sd-line);
}
.store-detail-root .sd-note:first-of-type { border-top: none; }
.store-detail-root .sd-note:hover { background: rgba(70, 183, 232, .05); }
.store-detail-root .sd-note-date { font-size: 11.5px; color: var(--sd-ink-dim); white-space: nowrap; }
.store-detail-root .sd-note-nm { font-size: 13px; font-weight: 600; }
.store-detail-root .sd-note-sku { font-family: var(--sd-mono); font-size: 11px; color: var(--sd-ink-faint); margin-top: 2px; }
.store-detail-root .sd-note-qty { font-family: var(--sd-mono); font-size: 13px; font-weight: 600; text-align: right; min-width: 40px; }

@media (max-width: 640px) {
  .store-detail-root .sd-case { grid-template-columns: auto auto 1fr auto; }
  .store-detail-root .sd-case-tag, .store-detail-root .sd-case-mail { display: none; }
}

/* =====================================================================
   COMPLIANCE — single-store detail view additions
   (.store-detail-root base + shared panels reused from the other views)
   ===================================================================== */
/* Even two-column grid (Compliance uses 1fr/1fr instead of 1.9fr/1fr). */
.store-detail-root .sd-grid--even { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .store-detail-root .sd-grid--even { grid-template-columns: 1fr; } }

/* Red icon variant (Monthly Scans when incomplete). */
.store-detail-root .sd-th-center.sd-th-icon--red > .inventory-table-kpi-icon { color: #FF7D93; }

/* Missed scan days on the calendar + legend swatch. */
.store-detail-root .sd-day.is-m { background: rgba(214, 59, 87, .1); color: var(--sd-red); border-color: rgba(214, 59, 87, .3); }
.store-detail-root .sd-li-m i { background: rgba(214, 59, 87, .45); }

/* Amber footer value (iPOG % below 100). */
.store-detail-root .sd-foot b.is-warn { color: var(--sd-amber); }

/* =====================================================================
   FINANCIALS (multi-store): two-column desktop layout — Open Drawers +
   Product Notes in the main column, Treasury Discrepancies as a side
   table on the right. Collapses to one column under 1024px.
   ===================================================================== */
#tab-cash .cash-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
#tab-cash .cash-ops-main,
#tab-cash .cash-ops-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Column gap owns the spacing — drop the panels' own stacking margins. */
#tab-cash .cash-tables-mount .cash-ops-grid .treasury-feed-panel,
#tab-cash .cash-tables-mount .cash-ops-grid .daily-ops-drawers-panel,
#tab-cash .cash-tables-mount .cash-ops-grid .daily-ops-prodnote-panel {
  margin-bottom: 0 !important;
}
/* Side feed can run taller than the inline version did. */
#tab-cash .cash-ops-side .treasury-feed-list { max-height: 880px; }
@media (max-width: 1023px) {
  #tab-cash .cash-ops-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   COMPLIANCE STORE SCORECARD (desktop, single-market scope)
   Self-contained, namespaced component (`cmsc-`). Variables are scoped to
   the root + the body-mounted filter popover so they never leak into — or
   inherit from — the app theme.
   ===================================================================== */
.cmsc-root, .cmsc-fmenu {
  --cmsc-well:#EEF3F9;
  --cmsc-surface:#FFFFFF;
  --cmsc-line:rgba(27,66,120,.14);
  --cmsc-ink:#16294A;
  --cmsc-ink-dim:#4A6386;
  --cmsc-ink-faint:#8298B5;
  --cmsc-cyan:#46B7E8;
  --cmsc-cyan-deep:#1180B6;
  --cmsc-green:#179C63;
  --cmsc-amber:#C57E12;
  --cmsc-red:#D63B57;
  --cmsc-mono:'JetBrains Mono',ui-monospace,monospace;
  --cmsc-display:'Archivo','Inter',sans-serif;
  --cmsc-body:'Inter',sans-serif;
  --cmsc-r:14px;
  --cmsc-shadow:0 1px 2px rgba(22,41,74,.05), 0 6px 18px rgba(22,41,74,.09);
}
.cmsc-root{
  font-family:var(--cmsc-body);
  color:var(--cmsc-ink);
  font-size:14px;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(70,183,232,.07), transparent 60%),
    #FFFFFF;
  border-radius:18px;
  padding:22px clamp(14px,2vw,26px) 30px;
}
.cmsc-root *{box-sizing:border-box}
.cmsc-root a{color:var(--cmsc-cyan-deep);text-decoration:none}
.cmsc-root button{font-family:inherit;cursor:pointer}

/* ---------- hero ---------- */
.cmsc-hero-tile{background:var(--cmsc-surface);border:1px solid var(--cmsc-line);border-radius:22px;box-shadow:0 10px 30px rgba(11,23,48,.18);overflow:hidden;margin-bottom:22px}
.cmsc-page-head{position:relative;background:linear-gradient(135deg,#1C3A6A 0%,#13264A 45%,#0B1730 100%);padding:24px 26px}
.cmsc-hero-export{position:absolute;top:18px;right:18px;width:38px;height:38px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.18);border-radius:10px;color:#E5EEF9;cursor:pointer}
.cmsc-hero-export:hover{background:rgba(255,255,255,.13)}
.cmsc-page-head h1{font-family:var(--cmsc-display);font-weight:500;font-size:27px;letter-spacing:.01em;line-height:1.1;color:#fff;padding-right:52px;margin:0;display:flex;align-items:center;gap:10px}
.cmsc-page-head__icon{display:inline-flex;align-items:center;color:#fff;flex:none}
.cmsc-scope-chips{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.cmsc-scope-chip--static{cursor:default}
.cmsc-scope-chip--static:hover{background:rgba(255,255,255,.06)}
.cmsc-scope-note{margin:8px 0 0;font-size:11px;color:#8FA9CC;letter-spacing:.02em}
.cmsc-scope-chip{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:#fff;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.16);border-radius:9px;padding:7px 12px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;cursor:pointer}
.cmsc-scope-chip:hover{background:rgba(255,255,255,.11)}
.cmsc-scope-chip i{font-style:normal;font-weight:600;font-size:10.5px;letter-spacing:.09em;color:#8FA9CC}
.cmsc-scope-chip svg{color:#8FA9CC}

/* ---------- KPI band ---------- */
.cmsc-kpi-band{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;padding:18px 20px;background:var(--cmsc-surface)}
.cmsc-kpi{background:var(--cmsc-surface);border:1px solid var(--cmsc-line);border-radius:var(--cmsc-r);padding:14px 16px;position:relative;overflow:hidden;box-shadow:var(--cmsc-shadow)}
.cmsc-kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--cmsc-accent,var(--cmsc-cyan));border-radius:3px 0 0 3px}
.cmsc-kpi .v{font-family:var(--cmsc-display);font-weight:800;font-size:24px;line-height:1.1;letter-spacing:-.02em}
.cmsc-kpi .l{font-size:11px;color:var(--cmsc-ink-dim);margin-top:4px;text-transform:uppercase;letter-spacing:.06em;font-weight:500}
.cmsc-kpi .sub{font-size:11px;margin-top:6px;color:var(--cmsc-ink-faint)}
.cmsc-kpi .sub.bad{color:var(--cmsc-red)} .cmsc-kpi .sub.warn{color:var(--cmsc-amber)} .cmsc-kpi .sub.up{color:var(--cmsc-green)}

/* ---------- panel ---------- */
.cmsc-panel{background:var(--cmsc-surface);border:1px solid var(--cmsc-line);border-radius:var(--cmsc-r);box-shadow:var(--cmsc-shadow);overflow:hidden}
.cmsc-tile-head{position:relative;display:flex;align-items:center;padding:0 12px;height:56px;background:linear-gradient(90deg,#26508A 0%,#15294E 38%,#0A1428 72%,#0F1E3A 100%)}
.cmsc-tile-head .th-left{display:flex;flex-direction:column;font-size:10px;line-height:1.4;color:#8FA9CC;padding-left:4px}
.cmsc-tile-head .th-left b{color:#C8DCF4;font-weight:600}
.cmsc-tile-head .th-center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:10px;white-space:nowrap}
.cmsc-tile-head .th-center h2{font-family:var(--cmsc-display);font-weight:800;font-size:17px;color:#fff;letter-spacing:.01em;margin:0}
.cmsc-tile-head .th-icon{display:flex;color:var(--cmsc-cyan)}
.cmsc-tile-head .th-actions{margin-left:auto;display:flex;gap:8px}
.cmsc-th-btn{width:34px;height:34px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.3);border-radius:9px;color:#fff}
.cmsc-th-btn:hover{background:rgba(255,255,255,.16)}

/* ---------- toolbar ---------- */
.cmsc-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:16px 18px 6px}
.cmsc-lookup{display:flex;align-items:center;gap:10px;flex:1;min-width:220px;background:var(--cmsc-well);border:1px solid var(--cmsc-line);border-radius:11px;padding:10px 13px}
.cmsc-lookup svg{flex:none;color:var(--cmsc-ink-faint)}
.cmsc-lookup input{flex:1;background:none;border:none;outline:none;color:var(--cmsc-ink);font-size:13px}
.cmsc-lookup input::placeholder{color:var(--cmsc-ink-faint)}

/* ---------- scorecard table ---------- */
.cmsc-tbl-scroll{overflow-x:auto;padding:8px 6px 6px}
.cmsc-table{width:calc(100% - 24px);border-collapse:separate;border-spacing:0;min-width:920px;background:linear-gradient(90deg,#26508A 0%,#15294E 60%,#0A1428 100%);border-radius:12px;margin:8px 12px 14px}
.cmsc-table thead th{background:transparent;color:#fff;font-family:var(--cmsc-display);font-weight:700;font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;text-align:center;padding:13px 12px;white-space:nowrap;user-select:none;position:relative}
.cmsc-table thead th.cmsc-store-col{text-align:left;position:sticky;left:0;background:#1B3A66;border-radius:12px 0 0 0;z-index:2}
.cmsc-table tbody td{background:var(--cmsc-surface);padding:12px;border-bottom:1px solid var(--cmsc-line);border-right:1px solid var(--cmsc-line);font-size:13px;text-align:center;vertical-align:middle}
.cmsc-table tbody td.cmsc-store-col{text-align:left;position:sticky;left:0;background:var(--cmsc-surface);border-left:3px solid var(--cmsc-line);z-index:1;box-shadow:6px 0 10px -8px rgba(22,41,74,.25)}
.cmsc-table tbody tr:hover td{background:#F4F9FE}
.cmsc-table tbody tr:hover td.cmsc-store-col{background:#F4F9FE}
.cmsc-table tbody tr:last-child td:first-child{border-radius:0 0 0 12px}
.cmsc-table tbody tr:last-child td:last-child{border-radius:0 0 12px 0}
.cmsc-table tr[data-sev="bad"] td.cmsc-store-col{border-left-color:var(--cmsc-red)}
.cmsc-table tr[data-sev="warn"] td.cmsc-store-col{border-left-color:var(--cmsc-amber)}
.cmsc-table tr[data-sev="ok"] td.cmsc-store-col{border-left-color:var(--cmsc-green)}

.cmsc-store-cell{display:flex;align-items:center;gap:11px}
.cmsc-store-cell .opus{font-family:var(--cmsc-mono);font-weight:600;font-size:11px;letter-spacing:.04em;background:var(--cmsc-well);border:1px solid var(--cmsc-line);color:var(--cmsc-ink-dim);border-radius:6px;padding:5px 7px;line-height:1;flex:none}
.cmsc-store-cell .nm{font-weight:600;font-size:13px;white-space:nowrap}
.cmsc-store-cell .dist{font-size:11px;color:var(--cmsc-ink-faint)}

.cmsc-metric{display:inline-flex;flex-direction:column;align-items:center;gap:3px;min-width:54px}
.cmsc-metric .big{font-family:var(--cmsc-mono);font-weight:600;font-size:13.5px}
.cmsc-metric .tiny{font-size:9.5px;color:var(--cmsc-ink-faint);text-transform:uppercase;letter-spacing:.05em}
.cmsc-root .v-ok{color:var(--cmsc-green)} .cmsc-root .v-warn{color:var(--cmsc-amber)} .cmsc-root .v-bad{color:var(--cmsc-red)}
.cmsc-pill{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-radius:999px;padding:5px 11px;white-space:nowrap}
.cmsc-pill-ok{color:var(--cmsc-green);background:rgba(23,156,99,.1);border:1px solid rgba(23,156,99,.35)}
.cmsc-pill-no{color:var(--cmsc-red);background:rgba(214,59,87,.09);border:1px solid rgba(214,59,87,.32)}
.cmsc-pill-warn{color:var(--cmsc-amber);background:rgba(197,126,18,.09);border:1px solid rgba(197,126,18,.32)}
.cmsc-dash{color:var(--cmsc-ink-faint)}
.cmsc-gauge{width:52px;height:5px;border-radius:3px;background:var(--cmsc-well);overflow:hidden;margin-top:1px}
.cmsc-gauge i{display:block;height:100%;border-radius:3px}

/* sortable / filterable headers */
.cmsc-th-updated{display:block;margin-top:4px;font-family:var(--cmsc-body);font-weight:600;font-size:9px;letter-spacing:.03em;text-transform:none;color:#9FB6D4}
/* Clickable metric cells → source-row drill-down popout. */
.cmsc-table tbody td.cmsc-cell{cursor:pointer}
.cmsc-table tbody td.cmsc-cell:hover{background:#EAF4FD;box-shadow:inset 0 0 0 2px rgba(70,183,232,.45)}
.cmsc-cell-popout{position:absolute;z-index:2200;width:min(560px,92vw);max-height:60vh;display:flex;flex-direction:column;background:var(--cmsc-surface,#fff);border:1px solid var(--cmsc-line,rgba(27,66,120,.14));border-radius:12px;box-shadow:0 18px 48px rgba(11,23,48,.28);overflow:hidden;font-family:var(--cmsc-body,'Inter',sans-serif)}
.cmsc-cell-popout__head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:linear-gradient(90deg,#26508A 0%,#15294E 60%,#0F1E3A 100%);color:#fff;font-size:12.5px;font-weight:700}
.cmsc-cell-popout__close{flex:none;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.25);color:#fff;border-radius:7px;width:24px;height:24px;line-height:1;cursor:pointer;font-size:12px}
.cmsc-cell-popout__close:hover{background:rgba(255,255,255,.2)}
.cmsc-cell-popout__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.cmsc-cell-popout__meta{padding:8px 12px 4px;font-size:11px;color:var(--cmsc-ink-faint,#8298B5)}
.cmsc-cell-popout__loading,.cmsc-cell-popout__empty{padding:18px 14px;font-size:12.5px;color:var(--cmsc-ink-faint,#8298B5);text-align:center}
.cmsc-cell-popout__scroll{flex:1;min-height:0;overflow:auto;padding:0 12px 12px}
.cmsc-cell-popout__scroll table{width:100%;border-collapse:collapse;font-size:11.5px}
.cmsc-cell-popout__scroll th{position:sticky;top:0;background:#EEF3F9;color:#4A6386;text-align:left;font-weight:700;font-size:9.5px;letter-spacing:.05em;text-transform:uppercase;padding:7px 8px;white-space:nowrap;border-bottom:1px solid var(--cmsc-line,rgba(27,66,120,.14))}
.cmsc-cell-popout__scroll td{padding:6px 8px;border-bottom:1px solid #eef2f7;color:#16294A;white-space:nowrap}
.cmsc-cell-popout__scroll tr:hover td{background:#F4F9FE}
.cmsc-th-wrap{display:inline-flex;align-items:center;gap:7px;cursor:pointer}
.cmsc-th-wrap .arrow{display:inline-flex;opacity:.35;transition:opacity .1s}
.cmsc-th-wrap:hover .arrow{opacity:.7}
.cmsc-table th.sorted .cmsc-th-wrap .arrow{opacity:1;color:#7FD3FF}
.cmsc-th-filter{margin-left:6px;width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.06);color:#cfe0f3;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;vertical-align:middle}
.cmsc-th-filter:hover,.cmsc-th-filter.on{background:rgba(127,211,255,.25);border-color:#7FD3FF;color:#fff}
.cmsc-fil-dot{position:absolute;top:9px;right:8px;width:6px;height:6px;border-radius:50%;background:#7FD3FF;display:none}
.cmsc-table th.filtered .cmsc-fil-dot{display:block}

/* filter popover (mounted on <body>) */
.cmsc-fmenu{position:absolute;z-index:1200;margin-top:6px;min-width:190px;background:var(--cmsc-surface);border:1px solid var(--cmsc-line);border-radius:12px;box-shadow:0 12px 30px rgba(11,23,48,.28);padding:10px;font-family:var(--cmsc-body)}
.cmsc-fmenu .ft{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--cmsc-ink-faint);padding:2px 6px 8px}
.cmsc-fmenu label{display:flex;align-items:center;gap:9px;padding:7px 6px;border-radius:7px;font-size:12.5px;color:var(--cmsc-ink-dim);cursor:pointer}
.cmsc-fmenu label:hover{background:var(--cmsc-well)}
.cmsc-fmenu input{accent-color:var(--cmsc-cyan-deep);width:14px;height:14px}
.cmsc-fmenu .fbtns{display:flex;gap:8px;margin-top:6px;padding-top:8px;border-top:1px solid var(--cmsc-line)}
.cmsc-fmenu .fbtns button{flex:1;font-size:12px;font-weight:600;padding:7px 0;border-radius:8px;border:1px solid var(--cmsc-line);background:var(--cmsc-surface);color:var(--cmsc-ink-dim)}
.cmsc-fmenu .fbtns button.apply{background:linear-gradient(135deg,#26508A,#15294E);color:#fff;border-color:transparent}
.cmsc-fmenu .fbtns button:hover{filter:brightness(1.05)}
.cmsc-result-line{padding:0 18px 18px;font-size:12px;color:var(--cmsc-ink-faint)}

/* =====================================================================
   INVENTORY STORE SCORECARD (desktop) — reuses the cmsc-* scorecard
   chrome (root carries .cmsc-root for tokens) with an invsc-* layer for
   the view toggle, numeric unit cells, and per-row severity borders.
   ===================================================================== */
/* Scorecard view hides the existing inventory content (carousel + tables). */
#tab-inventory .inventory-page.inventory-scorecard-active > :not(#inventoryScorecardRoot):not(#inventoryViewToggleBar) { display: none !important; }

/* View toggle (in the scorecard hero + the table-view bar). */
.invsc-hero-actions { position: absolute; top: 18px; right: 18px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.invsc-hero-actions .cmsc-hero-export { position: static; top: auto; right: auto; }
.invsc-root .cmsc-page-head h1 { padding-right: 300px; }
.invsc-view-toggle { display: inline-flex; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 3px; gap: 2px; }
.invsc-vt-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: #A9C1E0; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.invsc-vt-btn.active { background: #fff; color: #13264A; }
.invsc-vt-btn:not(.active):hover { color: #fff; }
.invsc-toggle-bar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.invsc-toggle-bar .invsc-view-toggle { background: linear-gradient(135deg, #1C3A6A, #0B1730); border-color: transparent; }

/* Compliance Table view — five stacked tables restyled to the scorecard chrome.
   Rendered inside #complianceScorecardRoot (.cmsc-root), so the --cmsc-* tokens
   resolve. Scoped under .cmsc-root to keep the app's global table CSS out. */
.cmsc-root .cmscv-classic { display: flex; flex-direction: column; gap: 16px; }
.cmsc-root .cmscv-table { background: var(--cmsc-surface); border: 1px solid var(--cmsc-line); border-radius: var(--cmsc-r); box-shadow: var(--cmsc-shadow); overflow: hidden; }
.cmsc-root .cmscv-head { position: relative; display: flex; align-items: center; height: 56px; padding: 0 16px; background: linear-gradient(90deg, #26508A 0%, #15294E 38%, #0A1428 72%, #0F1E3A 100%); }
.cmsc-root .cmscv-head .cmscv-icon { display: flex; color: var(--cmsc-cyan); margin-right: 10px; }
.cmsc-root .cmscv-head h3 { font-family: var(--cmsc-display); font-weight: 800; font-size: 15px; letter-spacing: .02em; color: #fff; margin: 0; }
.cmsc-root .cmscv-head .cmscv-count { margin-left: auto; font-size: 11.5px; color: #9DB9D8; font-weight: 600; font-family: var(--cmsc-mono); }
.cmsc-root .cmscv-scroll { overflow-x: auto; }
.cmsc-root .cmscv-table .table-pagination { padding: 10px 16px; border-top: 1px solid var(--cmsc-line); }
.cmsc-root table.cmscv-tbl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; }
.cmsc-root table.cmscv-tbl thead th { position: sticky; top: 0; background: var(--cmsc-well); color: var(--cmsc-ink-dim); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 10px 16px; white-space: nowrap; border-bottom: 1px solid var(--cmsc-line); z-index: 1; }
.cmsc-root table.cmscv-tbl thead th.r { text-align: right; }
.cmsc-root table.cmscv-tbl tbody td { padding: 11px 16px; border-bottom: 1px solid var(--cmsc-line); font-size: 13px; color: var(--cmsc-ink); }
.cmsc-root table.cmscv-tbl tbody td.r { text-align: right; }
.cmsc-root table.cmscv-tbl tbody td.m { font-family: var(--cmsc-mono); font-size: 12px; color: var(--cmsc-ink-dim); }
.cmsc-root table.cmscv-tbl tbody tr:last-child td { border-bottom: none; }
.cmsc-root table.cmscv-tbl tbody tr:hover td { background: #F4F9FE; }
.cmsc-root .cmscv-empty { text-align: center; color: var(--cmsc-ink-faint); padding: 22px 16px; }
.cmsc-root .cmscv-opus { font-family: var(--cmsc-mono); font-weight: 600; font-size: 11px; background: var(--cmsc-well); border: 1px solid var(--cmsc-line); color: var(--cmsc-ink-dim); border-radius: 6px; padding: 3px 6px; }
.cmsc-root .cmscv-ok { color: var(--cmsc-green); font-weight: 600; }
.cmsc-root .cmscv-warn { color: var(--cmsc-amber); font-weight: 600; }
.cmsc-root .cmscv-bad { color: var(--cmsc-red); font-weight: 600; }
.cmsc-root .cmscv-muted { color: var(--cmsc-ink-faint); }
.cmsc-root .cmscv-pill { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 7px; padding: 4px 9px; white-space: nowrap; }
.cmsc-root .cmscv-pill.ok { color: var(--cmsc-green); background: rgba(23, 156, 99, .1); border: 1px solid rgba(23, 156, 99, .32); }
.cmsc-root .cmscv-pill.no { color: var(--cmsc-red); background: rgba(214, 59, 87, .09); border: 1px solid rgba(214, 59, 87, .3); }
.cmsc-root .cmscv-pill.warn { color: var(--cmsc-amber); background: rgba(197, 126, 18, .09); border: 1px solid rgba(197, 126, 18, .3); }
.cmsc-root .cmscv-link { color: var(--cmsc-cyan-deep); font-weight: 600; font-size: 12px; }

/* Item lookup panel (hands off to the Table view's lookup on Enter). */
.invsc-lookup-panel { background: var(--cmsc-surface, #fff); border: 1px solid var(--cmsc-line, rgba(27,66,120,.14)); border-radius: 14px; box-shadow: 0 6px 18px rgba(22, 41, 74, .09); padding: 14px 16px; margin-bottom: 16px; }
.invsc-lookup { display: flex; align-items: center; gap: 10px; background: var(--cmsc-well, #EEF3F9); border: 1px solid var(--cmsc-line, rgba(27,66,120,.14)); border-radius: 11px; padding: 11px 14px; }
.invsc-lookup svg { flex: none; color: var(--cmsc-ink-faint, #8298B5); }
.invsc-lookup input { flex: 1; background: none; border: none; outline: none; color: var(--cmsc-ink, #16294A); font-family: var(--cmsc-mono, 'JetBrains Mono', ui-monospace, monospace); font-size: 13px; }
.invsc-lookup input::placeholder { color: var(--cmsc-ink-faint, #8298B5); font-family: var(--cmsc-body, 'Inter', sans-serif); }
.invsc-lookup-scope { flex: none; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--cmsc-cyan-deep, #1180B6); background: rgba(70, 183, 232, .12); border: 1px solid rgba(70, 183, 232, .35); border-radius: 6px; padding: 4px 8px; }

/* Numeric metric cells with a unit sublabel + severity tiers. */
.invsc-num { font-family: var(--cmsc-mono, 'JetBrains Mono', ui-monospace, monospace); font-weight: 600; font-size: 14px; }
.invsc-num .u { font-size: 9.5px; color: var(--cmsc-ink-faint, #8298B5); text-transform: uppercase; letter-spacing: .04em; display: block; margin-top: 1px; font-family: var(--cmsc-body, 'Inter', sans-serif); font-weight: 600; }
.invsc-num.n0 { color: var(--cmsc-ink-faint, #8298B5); font-weight: 500; }
.invsc-num.n-red { color: var(--cmsc-red, #D63B57); }
.invsc-num.n-amber { color: var(--cmsc-amber, #C57E12); }
.invsc-num.n-purple { color: var(--cmsc-purple, #7A5FB8); }
.invsc-num.n-green { color: var(--cmsc-green, #179C63); }

/* Financials scorecard — issue-type tag chips (reuses cmsc tokens). */
.cmsc-root .fnsc-itags { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.cmsc-root .fnsc-itag { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 6px; padding: 3px 6px; white-space: nowrap; }
.cmsc-root .fnsc-itag-ld { color: var(--cmsc-amber, #C57E12); background: rgba(197,126,18,.1); border: 1px solid rgba(197,126,18,.3); }
.cmsc-root .fnsc-itag-var { color: var(--cmsc-cyan-deep, #1180B6); background: rgba(70,183,232,.1); border: 1px solid rgba(70,183,232,.32); }
.cmsc-root .fnsc-itag-short { color: var(--cmsc-red, #D63B57); background: rgba(214,59,87,.09); border: 1px solid rgba(214,59,87,.3); }
.cmsc-root .fnsc-itag-over { color: #7A5FB8; background: rgba(122,95,184,.09); border: 1px solid rgba(122,95,184,.3); }
.cmsc-root .fnsc-itag-co { color: var(--cmsc-ink-dim, #4A6386); background: var(--cmsc-well, #EEF3F9); border: 1px solid var(--cmsc-line, rgba(27,66,120,.14)); }

/* Per-row severity border on the sticky store column. */
.invsc-table tbody tr[data-sev="bad"] td.cmsc-store-col { border-left-color: var(--cmsc-red, #D63B57); }
.invsc-table tbody tr[data-sev="warn"] td.cmsc-store-col { border-left-color: var(--cmsc-amber, #C57E12); }
.invsc-table tbody tr[data-sev="ok"] td.cmsc-store-col { border-left-color: var(--cmsc-green, #179C63); }

/* =====================================================================
   TRADE PORTAL STORE TRADE ACTIVITY (desktop, market/district scope)
   Self-contained, namespaced component (`tpsc-`). Variables scoped to the
   root so they never leak into — or inherit from — the app theme.
   ===================================================================== */
.tpsc-root{
  --tpsc-well:#EEF3F9;--tpsc-surface:#FFFFFF;--tpsc-line:rgba(27,66,120,.14);
  --tpsc-ink:#16294A;--tpsc-ink-dim:#4A6386;--tpsc-ink-faint:#8298B5;
  --tpsc-cyan:#46B7E8;--tpsc-cyan-mid:#1FA0D9;--tpsc-cyan-deep:#1180B6;
  --tpsc-green:#179C63;--tpsc-amber:#C57E12;--tpsc-red:#D63B57;--tpsc-purple:#7A5FB8;
  /* Match the app theme's loaded fonts. Inter/Archivo (from the mockup) are NOT
     loaded in index.html, so they fell back to system sans — out of step with
     the rest of the app (DM Sans body). Titles/numbers use --font-body, not the
     serif display font, consistent with the Daily Operations font fix. */
  --tpsc-mono:var(--font-mono,'JetBrains Mono',ui-monospace,monospace);--tpsc-display:var(--font-body,system-ui,sans-serif);--tpsc-body:var(--font-body,system-ui,sans-serif);
  --tpsc-r:14px;--tpsc-shadow:0 1px 2px rgba(22,41,74,.05),0 6px 18px rgba(22,41,74,.09);
  font-family:var(--tpsc-body);color:var(--tpsc-ink);font-size:14px;
  background:radial-gradient(1200px 600px at 85% -10%,rgba(70,183,232,.07),transparent 60%),#FFFFFF;
  border-radius:18px;padding:22px clamp(14px,2vw,26px) 30px;
}
.tpsc-root *{box-sizing:border-box}
.tpsc-root a{color:var(--tpsc-cyan-deep);text-decoration:none}
.tpsc-root button{font-family:inherit;cursor:pointer}

.tpsc-hero-tile{background:var(--tpsc-surface);border:1px solid var(--tpsc-line);border-radius:22px;box-shadow:0 10px 30px rgba(11,23,48,.18);overflow:hidden;margin-bottom:22px}
.tpsc-page-head{position:relative;background:linear-gradient(135deg,#1C3A6A 0%,#13264A 45%,#0B1730 100%);padding:24px 26px}
.tpsc-page-head h1{font-family:var(--tpsc-display);font-weight:700;font-size:27px;letter-spacing:.01em;line-height:1.1;color:#fff;padding-right:280px;margin:0;display:flex;align-items:center;gap:10px}
.tpsc-page-head__icon{display:inline-flex;align-items:center;justify-content:center;flex:none;color:#fff}
.tpsc-page-head__icon svg{width:24px;height:24px}
.tpsc-scope-chips{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.tpsc-scope-chip{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:#fff;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.16);border-radius:9px;padding:7px 12px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}
.tpsc-scope-chip i{font-style:normal;font-weight:600;font-size:10.5px;letter-spacing:.09em;color:#8FA9CC}
.tpsc-hero-actions{position:absolute;top:18px;right:18px;display:flex;align-items:center;gap:10px}
.tpsc-view-toggle{display:inline-flex;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.18);border-radius:10px;padding:3px;gap:2px}
.tpsc-vt-btn{display:inline-flex;align-items:center;gap:6px;background:none;border:none;color:#A9C1E0;font-size:12px;font-weight:600;padding:7px 12px;border-radius:8px;white-space:nowrap}
.tpsc-vt-btn svg{opacity:.85}
.tpsc-vt-btn.active{background:#fff;color:#13264A}
.tpsc-vt-btn:not(.active):hover{color:#fff}
.tpsc-hero-export{width:38px;height:38px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.18);border-radius:10px;color:#E5EEF9;cursor:pointer}
.tpsc-hero-export:hover{background:rgba(255,255,255,.13)}

.tpsc-kpi-band{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:12px;padding:18px 20px;background:var(--tpsc-surface)}
.tpsc-kpi{background:var(--tpsc-surface);border:1px solid var(--tpsc-line);border-radius:var(--tpsc-r);padding:14px 16px;position:relative;overflow:hidden;box-shadow:var(--tpsc-shadow)}
.tpsc-kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--tpsc-accent,var(--tpsc-cyan));border-radius:3px 0 0 3px}
.tpsc-kpi .v{font-family:var(--tpsc-display);font-weight:800;font-size:24px;line-height:1.1;letter-spacing:-.02em}
.tpsc-kpi .l{font-size:11px;color:var(--tpsc-ink-dim);margin-top:4px;text-transform:uppercase;letter-spacing:.06em;font-weight:500}
.tpsc-kpi .sub{font-size:11px;margin-top:6px;color:var(--tpsc-ink-faint)}
.tpsc-kpi .sub.bad{color:var(--tpsc-red)}.tpsc-kpi .sub.warn{color:var(--tpsc-amber)}.tpsc-kpi .sub.up{color:var(--tpsc-green)}

.tpsc-panel{background:var(--tpsc-surface);border:1px solid var(--tpsc-line);border-radius:var(--tpsc-r);box-shadow:var(--tpsc-shadow);overflow:hidden}
.tpsc-tile-head{position:relative;display:flex;align-items:center;height:56px;padding:0 12px;background:linear-gradient(90deg,#26508A 0%,#15294E 38%,#0A1428 72%,#0F1E3A 100%)}
.tpsc-tile-head .th-left{display:flex;flex-direction:column;font-size:10px;line-height:1.4;color:#8FA9CC;padding-left:4px}
.tpsc-tile-head .th-left b{color:#C8DCF4;font-weight:600}
.tpsc-tile-head .th-center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:10px;white-space:nowrap}
.tpsc-tile-head .th-center h2{font-family:var(--tpsc-display);font-weight:800;font-size:17px;color:#fff;letter-spacing:.01em;margin:0}
.tpsc-tile-head .th-icon{display:flex;color:var(--tpsc-cyan)}
.tpsc-tile-head .th-actions{margin-left:auto;display:flex;gap:8px}
.tpsc-th-btn{width:34px;height:34px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.3);border-radius:9px;color:#fff}
.tpsc-th-btn:hover{background:rgba(255,255,255,.16)}

.tpsc-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:16px 18px 6px}
.tpsc-search{display:flex;align-items:center;gap:10px;flex:1;min-width:220px;background:var(--tpsc-well);border:1px solid var(--tpsc-line);border-radius:11px;padding:10px 13px}
.tpsc-search svg{flex:none;color:var(--tpsc-ink-faint)}
.tpsc-search input{flex:1;background:none;border:none;outline:none;color:var(--tpsc-ink);font-size:13px}
.tpsc-search input::placeholder{color:var(--tpsc-ink-faint)}

.tpsc-tbl-scroll{overflow-x:auto;padding:8px 6px 6px}
table.tpsc-score{width:calc(100% - 24px);border-collapse:separate;border-spacing:0;min-width:900px;background:linear-gradient(90deg,#26508A 0%,#15294E 60%,#0A1428 100%);border-radius:12px;margin:8px 12px 6px}
table.tpsc-score thead th{background:transparent;color:#fff;font-family:var(--tpsc-display);font-weight:700;font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;text-align:center;padding:13px 10px;white-space:nowrap;user-select:none}
table.tpsc-score thead th.tpsc-store-col{text-align:left;position:sticky;left:0;background:#1B3A66;border-radius:12px 0 0 0;z-index:2}
.tpsc-th-wrap{display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.tpsc-th-wrap .arrow{opacity:.35}.tpsc-th-wrap:hover .arrow{opacity:.7}
table.tpsc-score th.sorted .tpsc-th-wrap .arrow{opacity:1;color:#7FD3FF}
table.tpsc-score tbody td{background:var(--tpsc-surface);padding:11px 10px;border-bottom:1px solid var(--tpsc-line);border-right:1px solid var(--tpsc-line);font-size:13px;text-align:center;vertical-align:middle}
table.tpsc-score tbody td.tpsc-store-col{text-align:left;position:sticky;left:0;background:var(--tpsc-surface);border-left:3px solid var(--tpsc-line);z-index:1;box-shadow:6px 0 10px -8px rgba(22,41,74,.25)}
table.tpsc-score tr[data-sev="bad"] td.tpsc-store-col{border-left-color:var(--tpsc-red)}
table.tpsc-score tr[data-sev="warn"] td.tpsc-store-col{border-left-color:var(--tpsc-amber)}
table.tpsc-score tr[data-sev="ok"] td.tpsc-store-col{border-left-color:var(--tpsc-green)}
table.tpsc-score tbody tr:hover td{background:#F4F9FE}
table.tpsc-score tbody tr:last-child td:first-child{border-radius:0 0 0 12px}
table.tpsc-score tbody tr:last-child td:last-child{border-radius:0 0 12px 0}
.tpsc-store-cell{display:flex;align-items:center;gap:11px}
.tpsc-store-cell .opus{font-family:var(--tpsc-mono);font-weight:600;font-size:11px;letter-spacing:.04em;background:var(--tpsc-well);border:1px solid var(--tpsc-line);color:var(--tpsc-ink-dim);border-radius:6px;padding:5px 7px;line-height:1;flex:none}
.tpsc-store-cell .nm{font-weight:600;font-size:13px;white-space:nowrap}
.tpsc-store-cell .dist{font-size:11px;color:var(--tpsc-ink-faint)}
.tpsc-num{font-family:var(--tpsc-mono);font-weight:600;font-size:14px}
.tpsc-num .u{font-size:9.5px;color:var(--tpsc-ink-faint);text-transform:uppercase;letter-spacing:.04em;display:block;margin-top:1px;font-family:var(--tpsc-body);font-weight:600}
.tpsc-n0{color:var(--tpsc-ink-faint);font-weight:500}
.tpsc-n-red{color:var(--tpsc-red)} .tpsc-n-amber{color:var(--tpsc-amber)} .tpsc-n-green{color:var(--tpsc-green)} .tpsc-n-purple{color:var(--tpsc-purple)}
.tpsc-chg{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-radius:999px;padding:5px 10px;white-space:nowrap}
.tpsc-chg-risk{color:var(--tpsc-red);background:rgba(214,59,87,.09);border:1px solid rgba(214,59,87,.32)}
.tpsc-chg-ok{color:var(--tpsc-green);background:rgba(23,156,99,.1);border:1px solid rgba(23,156,99,.32)}
.tpsc-result-line{padding:2px 18px 18px;font-size:12px;color:var(--tpsc-ink-faint)}

.tpsc-classic{display:flex;flex-direction:column;gap:16px}
.tpsc-ctable{background:var(--tpsc-surface);border:1px solid var(--tpsc-line);border-radius:var(--tpsc-r);box-shadow:var(--tpsc-shadow);overflow:hidden}
.tpsc-ct-head{position:relative;display:flex;align-items:center;height:56px;padding:0 16px;background:linear-gradient(90deg,#26508A 0%,#15294E 38%,#0A1428 72%,#0F1E3A 100%)}
.tpsc-ct-head .ct-icon{display:flex;color:var(--tpsc-cyan);margin-right:10px}
.tpsc-ct-head h3{font-family:var(--tpsc-display);font-weight:800;font-size:15px;letter-spacing:.02em;color:#fff;margin:0}
.tpsc-ct-head .ct-count{margin-left:auto;font-size:11.5px;color:#9DB9D8;font-weight:600;font-family:var(--tpsc-mono)}
/* Hyla cancellations feed (view-only) below Store Trade Activity */
.tpsc-cancellations{margin-top:14px}
.tpsc-ct-head .tpsc-cancel-btn{display:inline-flex;align-items:center;gap:7px;margin-left:12px;height:34px;padding:0 13px;border-radius:9px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.28);color:#fff;font-family:var(--tpsc-body);font-size:12.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.tpsc-ct-head .tpsc-cancel-btn:hover{background:rgba(255,255,255,.16)}
.tpsc-ct-head .tpsc-cancel-btn svg{flex:none}
@media (max-width:560px){.tpsc-ct-head .tpsc-cancel-btn span{display:none}.tpsc-ct-head .tpsc-cancel-btn{padding:0 9px}}
.tpsc-ct-scroll{overflow-x:auto}
.tpsc-ct-empty{text-align:center;color:var(--tpsc-ink-faint);padding:22px 16px}
.tpsc-ctable .table-pagination{padding:10px 16px;border-top:1px solid var(--tpsc-line)}
table.tpsc-ct{width:100%;border-collapse:separate;border-spacing:0;min-width:680px}
table.tpsc-ct thead th{position:sticky;top:0;background:var(--tpsc-well);color:var(--tpsc-ink-dim);font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;text-align:left;padding:10px 14px;white-space:nowrap;border-bottom:1px solid var(--tpsc-line);z-index:1}
table.tpsc-ct thead th.r{text-align:right}
table.tpsc-ct tbody td{padding:11px 14px;border-bottom:1px solid var(--tpsc-line);font-size:13px}
table.tpsc-ct tbody td.r{text-align:right}
table.tpsc-ct tbody td.m{font-family:var(--tpsc-mono);font-size:12px;color:var(--tpsc-ink-dim)}
table.tpsc-ct tbody tr:last-child td{border-bottom:none}
table.tpsc-ct tbody tr:hover td{background:#F4F9FE}
.tpsc-opus-tag{font-family:var(--tpsc-mono);font-weight:600;font-size:11px;background:var(--tpsc-well);border:1px solid var(--tpsc-line);color:var(--tpsc-ink-dim);border-radius:6px;padding:3px 6px}
.tpsc-mono-amt{font-family:var(--tpsc-mono);font-weight:600}
.tpsc-age-pill{font-family:var(--tpsc-mono);font-weight:600;font-size:11px;border-radius:6px;padding:3px 7px}
.tpsc-age-old{color:var(--tpsc-red);background:rgba(214,59,87,.09);border:1px solid rgba(214,59,87,.3)}
.tpsc-age-mid{color:var(--tpsc-amber);background:rgba(197,126,18,.1);border:1px solid rgba(197,126,18,.3)}
.tpsc-age-ok{color:var(--tpsc-ink-dim);background:var(--tpsc-well);border:1px solid var(--tpsc-line)}
.tpsc-next-pill{font-size:10px;font-weight:700;border-radius:6px;padding:3px 8px}
.tpsc-next-y{color:var(--tpsc-green);background:rgba(23,156,99,.1);border:1px solid rgba(23,156,99,.3)}
.tpsc-next-n{color:var(--tpsc-ink-faint);background:var(--tpsc-well);border:1px solid var(--tpsc-line)}

/* ============================================================
   Research ▸ Shrink + SKU Research workflow additions
   (flag badge, SKU Research button + manager form, blank cells)
   Scoped to #tab-research; reuses the existing research-* tree styles.
   ============================================================ */
#tab-research .research-store-tile--flagged > .research-store-header {
  box-shadow: inset 3px 0 0 0 var(--alliance-danger, #D63B57);
}
#tab-research .research-flag-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #D63B57;
  background: rgba(214, 59, 87, 0.1);
  border: 1px solid rgba(214, 59, 87, 0.32);
  white-space: nowrap;
}
#tab-research .research-flag-count {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #C57E12;
  background: rgba(197, 126, 18, 0.1);
  border: 1px solid rgba(197, 126, 18, 0.3);
  white-space: nowrap;
}
#tab-research .research-sku-btn {
  flex: none;
  margin-left: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--alliance-primary, #1b4278);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
#tab-research .research-sku-btn:hover { background: #16386b; }

/* Manager SKU Research form */
#tab-research .research-skuform {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(214, 59, 87, 0.28);
  border-radius: 12px;
  background: rgba(214, 59, 87, 0.04);
}
#tab-research .research-skuform-head {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted, #4A6386);
  margin-bottom: 10px;
}
#tab-research .research-skuform-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#tab-research .research-skuform-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line, rgba(27, 66, 120, 0.12));
  border-radius: 9px;
}
#tab-research .research-skuform-sku {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
#tab-research .research-skuform-item {
  font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink, #16294A);
}
#tab-research .research-skuform-desc {
  font-size: 0.74rem;
  color: var(--ink-faint, #8298B5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tab-research .research-skuform-oh {
  flex: none;
  font-size: 0.74rem;
  color: var(--ink-dim, #4A6386);
  font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
}
#tab-research .research-skuform-oh b { color: var(--ink, #16294A); }
#tab-research .research-skuform-count {
  flex: none;
  width: 88px;
  padding: 8px 10px;
  border: 1px solid var(--line, rgba(27, 66, 120, 0.18));
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  text-align: right;
  color: var(--ink, #16294A);
  background: #fff;
}
#tab-research .research-skuform-count:focus {
  outline: none;
  border-color: var(--alliance-accent, #009fdb);
  box-shadow: 0 0 0 3px rgba(0, 159, 219, 0.15);
}
#tab-research .research-skuform-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
#tab-research .research-skuform-msg {
  font-size: 0.78rem;
  color: var(--ink-dim, #4A6386);
  margin-right: auto;
}
#tab-research .research-skuform-submit {
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--alliance-primary, #1b4278);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
#tab-research .research-skuform-submit:hover:not(:disabled) { background: #16386b; }
#tab-research .research-skuform-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* Blank/placeholder cells (Counted / Adjust-in before a count is entered) */
#tab-research .research-sku-table .research-cell-blank { color: var(--ink-faint, #B7C4D6); }

/* Manager SKU-count link flow — ops controls + submission status pills */
#tab-research .research-link-btn,
#tab-research .research-review-btn {
  flex: none;
  margin-left: 8px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line, rgba(27, 66, 120, 0.18));
  background: #fff;
  color: var(--alliance-primary, #1b4278);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}
#tab-research .research-link-btn:hover,
#tab-research .research-review-btn:hover { border-color: var(--alliance-accent, #009fdb); }
#tab-research .research-review-btn { color: #C57E12; }
#tab-research .research-link-btn:disabled,
#tab-research .research-review-btn:disabled { opacity: 0.6; cursor: default; }
#tab-research .research-status-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
#tab-research .research-status-pill--submitted {
  color: #179C63;
  background: rgba(23, 156, 99, 0.1);
  border: 1px solid rgba(23, 156, 99, 0.32);
}
#tab-research .research-status-pill--reviewed {
  color: #4A6386;
  background: var(--well, #EEF3F9);
  border: 1px solid var(--line, rgba(27, 66, 120, 0.18));
}

#tab-research .research-status-pill--draft {
  color: #1180B6;
  background: rgba(70, 183, 232, 0.12);
  border: 1px solid rgba(70, 183, 232, 0.35);
}

/* ============================================================================
   Item Lookup — light "carton viewer" theme (matches the merged carton detail).
   Scoped to the lookup popout; appended last so it wins over the dark defaults.
   ========================================================================== */
.inventory-lookup-bubble {
  background: #fff;
  border-color: rgba(27, 66, 120, 0.16);
  box-shadow: 0 18px 48px rgba(11, 23, 40, 0.32), 0 2px 8px rgba(11, 23, 40, 0.18);
}
/* Title bar → navy gradient header, like .carton-modal-head */
.inventory-lookup-bubble__title-bar {
  background: linear-gradient(135deg, #1C3A6A 0%, #13264A 45%, #0B1730 100%);
  border-bottom: none;
}
.inventory-lookup-bubble__title-bar .inventory-lookup-bubble__title,
.inventory-lookup-bubble__title-icon { color: #fff; }
.inventory-lookup-bubble__arrow { border-bottom-color: #1C3A6A; }
.inventory-lookup-bubble--flip-arrow .inventory-lookup-bubble__arrow {
  border-top-color: #fff; border-bottom-color: transparent;
}
.inventory-lookup-bubble__expanded { border-top-color: rgba(27, 66, 120, 0.14); }
/* Close (×) → white, top-right, clearly ON the navy header (like .carton-modal-close).
   (Was navy-on-navy after the light restyle, so it vanished into the header.) */
.inventory-lookup-bubble__head-strip .inventory-lookup-bubble__close-corner {
  left: auto;
  right: calc(max(0px, env(safe-area-inset-right, 0px)) + 0.7rem);
}
.inventory-lookup-bubble__close-corner {
  width: 2rem;
  height: 2rem;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}
.inventory-lookup-bubble__close-corner:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
/* With the × on the right, center "ITEM LOOKUP" symmetrically in the header. */
.inventory-lookup-bubble__title-bar,
.inventory-lookup-bubble-root--expanded .inventory-lookup-bubble .inventory-lookup-bubble__title-bar {
  padding-left: 2.9rem;
  padding-right: 2.9rem;
}
/* Search input → white field */
.inventory-lookup-bubble__input {
  background: #fff; border-color: rgba(27, 66, 120, 0.24); color: #16294A;
}
.inventory-lookup-bubble__input:focus {
  border-color: #2C6FB8; box-shadow: 0 0 0 3px rgba(44, 111, 184, 0.15);
}
/* Round search / export buttons → navy on light */
.inventory-lookup-bubble__search-btn,
.inventory-lookup-bubble__export-btn {
  border-color: rgba(27, 66, 120, 0.22);
  background: rgba(27, 66, 120, 0.06);
  color: #1C3A6A;
}
.inventory-lookup-bubble__search-btn:hover,
.inventory-lookup-bubble__export-btn:hover {
  border-color: rgba(27, 66, 120, 0.4);
  background: rgba(27, 66, 120, 0.12);
  color: #0B1730;
}
.inventory-lookup-bubble__search-btn:focus-visible,
.inventory-lookup-bubble__export-btn:focus-visible {
  outline-color: rgba(44, 111, 184, 0.55);
}
.inventory-raw-search__meta { color: #4A6386; }
.inventory-raw-search__footer { color: #4A6386; }
/* Results table → mirror the Carton contents table (.carton-modal-table):
   navy gradient header, small uppercase white labels, white rows with thin
   navy gridlines + 13.5px navy text, light-blue hover. */
#rawLookupResultsView .inventory-table-wrap {
  background: #fff;
  border: 1px solid rgba(27, 66, 120, 0.14);
  border-radius: 12px;
  overflow: auto;
}
/* Gradient on thead (carton's colors) so the sticky header stays opaque. */
#rawLookupResultsView .inventory-table thead {
  background: linear-gradient(90deg, #26508A 0%, #15294E 55%, #0A1428 100%);
  backdrop-filter: none;
}
#rawLookupResultsView .inventory-table thead th { background: transparent; border: none; }
#rawLookupResultsView .inventory-filter-btn {
  color: #fff; font-weight: 700; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
#rawLookupResultsView .inventory-sort-btn { color: rgba(255, 255, 255, 0.8); }
#rawLookupResultsView .inventory-table tbody td {
  background: #fff;
  color: #16294A;
  font-size: 13.5px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(27, 66, 120, 0.14);
  border-right: 1px solid rgba(27, 66, 120, 0.14);
}
#rawLookupResultsView .inventory-table tbody td:first-child {
  border-left: 1px solid rgba(27, 66, 120, 0.14);
}
#rawLookupResultsView .inventory-table tbody tr:last-child td { border-bottom: none; }
#rawLookupResultsView .inventory-table tbody tr:hover td { background: #EBF5FC; }
#rawLookupResultsView .inventory-table tbody tr.inventory-row-clickable { cursor: pointer; }
/* Back-to-results button → navy on light to match */
.inventory-lookup-detail__back {
  border-color: rgba(27, 66, 120, 0.22);
  background: rgba(27, 66, 120, 0.06);
  color: #1C3A6A;
}
.inventory-lookup-detail__back:hover {
  border-color: rgba(27, 66, 120, 0.4);
  background: rgba(27, 66, 120, 0.12);
  color: #0B1730;
}
