/* ==========================================================================
   WOR Control — design system (future static/wor.css)
   Stack: Bootstrap 5.3 (data-bs-theme="dark") + Bootstrap Icons + Chart.js 4.
   Load order: bootstrap.min.css → bootstrap-icons.css → wor.css
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;0,900;1,800&family=Barlow:wght@500;600;700&family=Schibsted+Grotesk:wght@400;500;600;700&display=swap");

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --wor-bg: #080808;
  --wor-surface: #111111;
  --wor-panel: #0d0d0d;
  --wor-raised: #1a1a1a;
  --wor-raised-2: #222222;

  /* Accent (the only primary) */
  --wor-red: #E0201C;
  --wor-red-hover: #b01815;
  --wor-red-text: #ff5a55;
  --wor-red-glow: rgba(224, 32, 28, 0.55);
  --wor-red-soft: rgba(224, 32, 28, 0.12);

  /* Text */
  --wor-white: #ffffff;
  --wor-offwhite: #e8e8e8;
  --wor-ink: #ffffff;          /* primary text on the current surface (remapped by .wor-table-tower) */
  /* Text grays tuned for WCAG AA (4.5:1) on every surface up to --wor-raised #1a1a1a.
     Brand doc grays (#888/#aaa/#555) fail on dark cards at dashboard text sizes. */
  --wor-text: #a6a6a6;         /* body / secondary  7.2:1 on #1a1a1a */
  --wor-text-bright: #c8c8c8;  /* emphasized secondary */
  --wor-meta: #8c8c8c;         /* labels, timestamps, captions  5.2:1 on #1a1a1a */
  --wor-disabled: #333333;

  /* Status / series */
  --wor-gold: #c9a84c;
  --wor-gold-light: #e8c96a;
  --wor-green: #25a038;
  --wor-green-dark: #1e7a2e;
  --wor-good: #25a038;
  --wor-bad: #ff5a55;
  --wor-good-soft: rgba(37, 160, 56, 0.14);
  --wor-bad-soft: rgba(255, 90, 85, 0.12);
  --wor-gold-soft: rgba(201, 168, 76, 0.14);
  --wor-green-text: #4cc865;   /* green as text on dark */

  /* Timing-tower tables (.wor-table-tower): warm near-black rows, red header rule, red section plates.
     Contrast on --wor-tower-zebra (the lighter row): ink 16:1, text 11:1, meta 6.7:1, good 8.4:1, bad 6.1:1. */
  --wor-tower-bg: #181716;
  --wor-tower-zebra: #1d1c1a;
  --wor-tower-hover: #221816;
  --wor-tower-foot: #201e1c;
  --wor-tower-border: #2a2826;
  --wor-tower-row-border: #25231f;
  --wor-tower-ink: #f5f1ea;
  --wor-tower-text: #d4cdc2;
  --wor-tower-meta: #a9a297;
  --wor-tower-delta: #cfc8bc;
  --wor-tower-good: #5fd07a;
  --wor-tower-bad: #ff6b61;

  /* Venue palette — red is reserved for the accent, so venues use cool/warm non-red tones */
  --wor-venue-pas: #4a9eff; /* Pasadena   — azure  */
  --wor-venue-tus: #2ec4a6; /* Tustin     — teal   */
  --wor-venue-phx: #e8a33d; /* Phoenix    — desert amber */
  --wor-venue-kc:  #a78bfa; /* Kansas City — violet */

  /* Revenue split (online / walk-in / other) */
  --wor-split-online: var(--wor-red);
  --wor-split-walkin: #e8e8e8;
  --wor-split-other: #555555;

  /* Lines */
  --wor-border: rgba(255, 255, 255, 0.08);
  --wor-border-strong: rgba(255, 255, 255, 0.15);
  --wor-border-input: rgba(255, 255, 255, 0.20);

  /* Type */
  --wor-font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --wor-font-chip: "Barlow", "Schibsted Grotesk", sans-serif;
  --wor-font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape & motion */
  --wor-radius: 2px;
  --wor-ease: cubic-bezier(.2, .7, .2, 1);

  /* Shell */
  --wor-sidebar-w: 256px;
  --wor-rail-w: 72px;
  --wor-topbar-h: 56px;
  --wor-tabbar-h: 64px;
  --wor-gutter: 28px;
}

/* --------------------------------------------------------------------------
   2. Bootstrap 5.3 theming (via its CSS variables)
   -------------------------------------------------------------------------- */
html[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: var(--wor-bg);
  --bs-body-bg-rgb: 8, 8, 8;
  --bs-body-color: var(--wor-text-bright);
  --bs-body-color-rgb: 170, 170, 170;
  --bs-body-font-family: var(--wor-font-body);
  --bs-body-font-size: 0.9375rem;
  --bs-emphasis-color: #fff;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-secondary-color: var(--wor-text);
  --bs-secondary-bg: var(--wor-raised);
  --bs-tertiary-color: var(--wor-meta);
  --bs-tertiary-bg: var(--wor-surface);
  --bs-heading-color: #fff;
  --bs-primary: var(--wor-red);
  --bs-primary-rgb: 224, 32, 28;
  --bs-primary-text-emphasis: var(--wor-red-text);
  --bs-primary-bg-subtle: var(--wor-red-soft);
  --bs-primary-border-subtle: rgba(224, 32, 28, .4);
  --bs-success: var(--wor-green);
  --bs-success-rgb: 37, 160, 56;
  --bs-danger: var(--wor-red-text);
  --bs-danger-rgb: 255, 90, 85;
  --bs-warning: var(--wor-gold);
  --bs-warning-rgb: 201, 168, 76;
  --bs-link-color: #fff;
  --bs-link-color-rgb: 255, 255, 255;
  --bs-link-hover-color: var(--wor-red-text);
  --bs-link-hover-color-rgb: 255, 90, 85;
  --bs-border-color: var(--wor-border);
  --bs-border-color-translucent: var(--wor-border);
  --bs-border-radius: var(--wor-radius);
  --bs-border-radius-sm: var(--wor-radius);
  --bs-border-radius-lg: var(--wor-radius);
  --bs-border-radius-xl: var(--wor-radius);
  --bs-focus-ring-color: rgba(224, 32, 28, .35);
  --bs-form-valid-color: var(--wor-green);
  --bs-form-invalid-color: var(--wor-red-text);
  --bs-form-invalid-border-color: var(--wor-red);
}

body {
  font-family: var(--wor-font-body);
  background: var(--wor-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; }
::selection { background: var(--wor-red); color: #fff; }

/* Cards */
.card {
  --bs-card-bg: var(--wor-surface);
  --bs-card-border-color: var(--wor-border);
  --bs-card-border-radius: var(--wor-radius);
  --bs-card-inner-border-radius: var(--wor-radius);
  --bs-card-cap-bg: transparent;
  --bs-card-color: var(--wor-text-bright);
  --bs-card-spacer-y: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--wor-offwhite);
  --bs-table-border-color: var(--wor-border);
  --bs-table-striped-bg: rgba(255, 255, 255, .02);
  --bs-table-hover-bg: rgba(255, 255, 255, .035);
  --bs-table-hover-color: var(--wor-ink);
  --bs-table-active-bg: var(--wor-red-soft);
}

/* Forms */
.form-control, .form-select {
  --bs-body-bg: var(--wor-panel);
  background-color: var(--wor-panel);
  border-color: var(--wor-border-input);
  color: var(--wor-ink);
  border-radius: var(--wor-radius);
}
.form-control::placeholder { color: var(--wor-meta); }
.form-control:focus, .form-select:focus {
  background-color: var(--wor-panel);
  border-color: var(--wor-red);
  color: var(--wor-ink);
  box-shadow: 0 0 0 3px rgba(224, 32, 28, .2);
}
.form-control[type="date"] { color-scheme: dark; font-variant-numeric: tabular-nums; }
.form-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wor-meta); }
.form-check-input { background-color: var(--wor-panel); border-color: var(--wor-border-input); }
.form-check-input:checked { background-color: var(--wor-red); border-color: var(--wor-red); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(224, 32, 28, .2); border-color: var(--wor-red); }

/* Dropdown */
.dropdown-menu {
  --bs-dropdown-bg: var(--wor-raised);
  --bs-dropdown-border-color: var(--wor-border-strong);
  --bs-dropdown-border-radius: var(--wor-radius);
  --bs-dropdown-link-color: var(--wor-offwhite);
  --bs-dropdown-link-hover-bg: var(--wor-raised-2);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-active-bg: var(--wor-red);
  --bs-dropdown-divider-bg: var(--wor-border);
  --bs-dropdown-header-color: var(--wor-meta);
  --bs-dropdown-font-size: .875rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6);
}

/* Modal */
.modal {
  --bs-modal-bg: var(--wor-surface);
  --bs-modal-border-color: var(--wor-border-strong);
  --bs-modal-border-radius: var(--wor-radius);
  --bs-modal-inner-border-radius: var(--wor-radius);
  --bs-modal-header-border-color: var(--wor-border);
  --bs-modal-footer-border-color: var(--wor-border);
  --bs-modal-color: var(--wor-text-bright);
  --bs-modal-padding: 1.25rem;
}
.modal-content { border-top: 2px solid var(--wor-red); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.modal-title { font-family: var(--wor-font-display); font-weight: 800; text-transform: uppercase; font-size: 1.5rem; line-height: .95; letter-spacing: .01em; color: #fff; }
.modal-backdrop { --bs-backdrop-bg: #000; --bs-backdrop-opacity: .75; }

/* Offcanvas (used for the phone "More" sheet + tablet nav) */
.offcanvas {
  --bs-offcanvas-bg: var(--wor-surface);
  --bs-offcanvas-color: var(--wor-text-bright);
  --bs-offcanvas-border-color: var(--wor-border-strong);
}

/* Nav / pills / tabs (Bootstrap) */
.nav {
  --bs-nav-link-color: var(--wor-text);
  --bs-nav-link-hover-color: #fff;
}
.nav-tabs { --bs-nav-tabs-border-color: var(--wor-border); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-color: #fff; --bs-nav-tabs-link-active-border-color: transparent transparent var(--wor-red); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--wor-red); --bs-nav-pills-border-radius: var(--wor-radius); }

/* Toast */
.toast {
  --bs-toast-bg: var(--wor-raised);
  --bs-toast-border-color: var(--wor-border-strong);
  --bs-toast-border-radius: var(--wor-radius);
  --bs-toast-header-bg: transparent;
  --bs-toast-header-color: #fff;
  --bs-toast-header-border-color: var(--wor-border);
  --bs-toast-color: var(--wor-text-bright);
  --bs-toast-max-width: 380px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6);
}

/* Badges, progress, tooltip */
.badge { --bs-badge-border-radius: var(--wor-radius); font-family: var(--wor-font-chip); letter-spacing: .08em; text-transform: uppercase; }
.progress { --bs-progress-bg: var(--wor-raised-2); --bs-progress-bar-bg: var(--wor-red); --bs-progress-border-radius: 0; --bs-progress-height: 6px; }
.tooltip { --bs-tooltip-bg: var(--wor-raised-2); --bs-tooltip-color: #fff; --bs-tooltip-border-radius: var(--wor-radius); }

/* Buttons — primary actions are ALWAYS red */
.btn {
  --bs-btn-font-family: var(--wor-font-body);
  --bs-btn-font-size: 13px;
  --bs-btn-font-weight: 700;
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-padding-y: .55rem;
  --bs-btn-border-radius: var(--wor-radius);
  --bs-btn-focus-box-shadow: 0 0 0 3px rgba(224, 32, 28, .3);
  text-transform: uppercase;
  letter-spacing: .12em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background-color .15s var(--wor-ease), border-color .15s var(--wor-ease), box-shadow .2s var(--wor-ease), color .15s;
}
.btn-sm { --bs-btn-font-size: 11px; --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .4rem; }
.btn-lg { --bs-btn-font-size: 14px; --bs-btn-padding-x: 1.6rem; --bs-btn-padding-y: .8rem; }
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--wor-red);
  --bs-btn-border-color: var(--wor-red);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--wor-red-hover);
  --bs-btn-hover-border-color: var(--wor-red-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--wor-red-hover);
  --bs-btn-active-border-color: var(--wor-red-hover);
  --bs-btn-disabled-color: rgba(255, 255, 255, .5);
  --bs-btn-disabled-bg: #5a1513;
  --bs-btn-disabled-border-color: #5a1513;
}
.btn-primary:hover { box-shadow: 0 10px 28px var(--wor-red-glow); }
.btn-glow { box-shadow: 0 10px 28px var(--wor-red-glow); }
.btn-outline-light {
  --bs-btn-color: var(--wor-ink);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--wor-border-input);
  --bs-btn-hover-color: var(--wor-ink);
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: var(--wor-ink);
  --bs-btn-active-color: var(--wor-ink);
  --bs-btn-active-bg: rgba(255, 255, 255, .06);
  --bs-btn-active-border-color: var(--wor-ink);
  --bs-btn-disabled-color: var(--wor-meta);
  --bs-btn-disabled-border-color: var(--wor-border);
}
.btn-ghost {
  --bs-btn-color: var(--wor-text-bright);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255, 255, 255, .05);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, .08);
}
.btn-danger-ghost {
  --bs-btn-color: var(--wor-red-text);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgba(255, 90, 85, .35);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--wor-red);
  --bs-btn-hover-border-color: var(--wor-red);
}
.btn-icon { --bs-btn-padding-x: .55rem; letter-spacing: 0; }
.btn-close { --bs-btn-close-color: #fff; }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
.wor-h1, .wor-h2, .wor-h3, .wor-display {
  font-family: var(--wor-font-display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: .01em;
  color: #fff;
  margin: 0;
}
.wor-display { font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 900; }
.wor-h1 { font-size: clamp(2.25rem, 4vw, 3.25rem); font-weight: 900; }
.wor-h2 { font-size: 1.5rem; }
.wor-h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: .03em; }
/* 24x2 red accent bar above a heading */
.wor-bar-top::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--wor-red);
  margin-bottom: .6rem;
}

.wor-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wor-red-text);
}
.wor-eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--wor-red); }
.wor-eyebrow--flanked::after { content: ""; width: 18px; height: 1px; background: var(--wor-red); }

.wor-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wor-meta);
  line-height: 1.3;
}
.wor-label--red { color: var(--wor-red-text); }
.wor-meta { font-size: 12px; color: var(--wor-meta); }
.wor-muted { color: var(--wor-text); }
.wor-body { color: var(--wor-text-bright); font-size: .9375rem; line-height: 1.55; }
.wor-strong { color: var(--wor-ink); font-weight: 600; }
/* Bootstrap sizes <code> at .875em, which drops below the 11px floor inside 12px meta text. */
code { font-size: max(.875em, 11px); }

/* Numbers */
.wor-num, .num, .wor-table td, .wor-kpi__value, .wor-plate__value { font-variant-numeric: tabular-nums; }
.wor-figure {
  font-family: var(--wor-font-display);
  font-weight: 800;
  line-height: .9;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: .005em;
}
.wor-figure--xl { font-size: clamp(3.25rem, 6vw, 4.75rem); font-weight: 900; }
.wor-figure--lg { font-size: 2.5rem; }
.wor-figure--md { font-size: 1.75rem; }
.wor-figure__minor { font-size: .55em; color: var(--wor-text); font-weight: 700; margin-left: .04em; }
.wor-check { color: var(--wor-red); font-weight: 700; }

/* --------------------------------------------------------------------------
   4. App shell
   Desktop ≥1200: fixed sidebar (expanded; .is-collapsed → icon rail)
   Tablet 768–1199: icon rail; .is-expanded → overlay sidebar
   Phone <768: top bar + bottom tab bar + "More" offcanvas sheet
   -------------------------------------------------------------------------- */
.wor-shell { min-height: 100vh; min-height: 100dvh; }

.wor-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--wor-sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--wor-panel);
  border-right: 1px solid var(--wor-border);
  transition: width .22s var(--wor-ease), box-shadow .22s;
  overflow: hidden;
}
.wor-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: 72px;
  padding: 0 .6rem 0 1.25rem;
  border-bottom: 1px solid var(--wor-border);
  flex-shrink: 0;
  position: relative;
}
.wor-sidebar__brand::after { /* telemetry line */
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 56px; height: 1px;
  background: var(--wor-red);
}
.wor-sidebar__logo { display: block; flex-shrink: 0; }
.wor-sidebar__logo img { height: 28px; width: auto; display: block; }
.wor-sidebar__product {
  font-family: var(--wor-font-display);
  font-weight: 800;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--wor-text);
  border-left: 1px solid var(--wor-border-strong);
  padding-left: .7rem;
  white-space: nowrap;
}
.wor-sidebar__toggle {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--wor-meta);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--wor-radius);
  flex-shrink: 0;
}
.wor-sidebar__toggle:hover { color: #fff; background: rgba(255, 255, 255, .05); }

.wor-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; scrollbar-width: thin; }
.wor-nav__section + .wor-nav__section { margin-top: 1.25rem; }
.wor-nav__heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wor-meta);
  padding: 0 .75rem .5rem;
  white-space: nowrap;
}
.wor-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8rem;
  height: 38px;
  padding: 0 .75rem;
  color: var(--wor-text);
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--wor-radius);
  white-space: nowrap;
  transition: color .12s, background-color .12s;
}
.wor-nav__link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.wor-nav__link:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.wor-nav__link.is-active { color: #fff; background: linear-gradient(90deg, var(--wor-red-soft), transparent 85%); }
.wor-nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -.75rem; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--wor-red);
  box-shadow: 0 0 12px var(--wor-red-glow);
}
.wor-nav__link.is-active i { color: var(--wor-red-text); }
.wor-nav__count {
  margin-left: auto;
  min-width: 20px; height: 18px;
  padding: 0 6px;
  display: inline-grid; place-items: center;
  font-family: var(--wor-font-chip);
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: var(--wor-red);
  border-radius: var(--wor-radius);
  font-variant-numeric: tabular-nums;
}

.wor-sidebar__footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--wor-border);
}
.wor-avatar {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--wor-raised-2);
  border: 1px solid var(--wor-border-strong);
  color: #fff;
  font-family: var(--wor-font-display);
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .04em;
}
.wor-user { min-width: 0; line-height: 1.2; white-space: nowrap; }
.wor-user__name { color: #fff; font-size: .8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.wor-user__role { color: var(--wor-meta); font-size: 11px; }
.wor-sidebar__footer .btn { margin-left: auto; }

.wor-main {
  margin-left: var(--wor-sidebar-w);
  min-width: 0;
  transition: margin-left .22s var(--wor-ease);
}
.wor-content {
  max-width: 1480px;
  padding: 1.75rem var(--wor-gutter) 3rem;
}

/* Rail (icons only) — shared by desktop .is-collapsed and tablet default */
@media (min-width: 1200px) {
  .wor-shell.is-collapsed .wor-sidebar { width: var(--wor-rail-w); }
  .wor-shell.is-collapsed .wor-main { margin-left: var(--wor-rail-w); }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  :root { --wor-gutter: 22px; }
  .wor-sidebar { width: var(--wor-rail-w); }
  .wor-main { margin-left: var(--wor-rail-w); }
  .wor-shell.is-expanded .wor-sidebar { width: var(--wor-sidebar-w); box-shadow: 30px 0 60px rgba(0, 0, 0, .7); }
  .wor-shell.is-expanded .wor-scrim { opacity: 1; pointer-events: auto; }
}
.wor-scrim {
  position: fixed; inset: 0; z-index: 1035;
  background: rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
/* Collapsed-rail presentation */
@media (min-width: 1200px) {
  .wor-shell.is-collapsed .wor-sidebar__product,
  .wor-shell.is-collapsed .wor-nav__link span,
  .wor-shell.is-collapsed .wor-nav__count,
  .wor-shell.is-collapsed .wor-user,
  .wor-shell.is-collapsed .wor-sidebar__footer .btn { display: none; }
  .wor-shell.is-collapsed .wor-nav__heading { font-size: 0; padding: 0; margin: 0 .75rem .5rem; height: 1px; background: var(--wor-border); }
  .wor-shell.is-collapsed .wor-sidebar__brand { flex-direction: column; justify-content: center; gap: .25rem; padding: 0; }
  .wor-shell.is-collapsed .wor-sidebar__logo img { height: 18px; }
  .wor-shell.is-collapsed .wor-sidebar__toggle { margin: 0; height: 22px; }
  .wor-shell.is-collapsed .wor-nav__link { justify-content: center; padding: 0; }
  .wor-shell.is-collapsed .wor-sidebar__footer { justify-content: center; padding: .9rem 0; }
  .wor-shell.is-collapsed .wor-sidebar__toggle i { transform: rotate(180deg); }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .wor-shell:not(.is-expanded) .wor-sidebar__product,
  .wor-shell:not(.is-expanded) .wor-nav__link span,
  .wor-shell:not(.is-expanded) .wor-nav__count,
  .wor-shell:not(.is-expanded) .wor-user,
  .wor-shell:not(.is-expanded) .wor-sidebar__footer .btn { display: none; }
  .wor-shell:not(.is-expanded) .wor-nav__heading { font-size: 0; padding: 0; margin: 0 .75rem .5rem; height: 1px; background: var(--wor-border); }
  .wor-shell:not(.is-expanded) .wor-sidebar__brand { flex-direction: column; justify-content: center; gap: .25rem; padding: 0; }
  .wor-shell:not(.is-expanded) .wor-sidebar__logo img { height: 18px; }
  .wor-shell:not(.is-expanded) .wor-sidebar__toggle { margin: 0; height: 22px; }
  .wor-shell:not(.is-expanded) .wor-sidebar__toggle i { transform: rotate(180deg); }
  .wor-shell:not(.is-expanded) .wor-nav__link { justify-content: center; padding: 0; }
  .wor-shell:not(.is-expanded) .wor-sidebar__footer { justify-content: center; padding: .9rem 0; }
}

/* Phone top bar + tab bar (hidden ≥768) */
.wor-topbar, .wor-tabbar { display: none; }

@media (max-width: 767.98px) {
  :root { --wor-gutter: 16px; }
  .wor-sidebar, .wor-scrim { display: none; }
  .wor-main { margin-left: 0; }
  .wor-content { padding: 1.1rem var(--wor-gutter) calc(var(--wor-tabbar-h) + 2rem + env(safe-area-inset-bottom)); }

  .wor-topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: .75rem;
    height: var(--wor-topbar-h);
    padding: 0 var(--wor-gutter);
    background: rgba(8, 8, 8, .88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--wor-border);
  }
  .wor-topbar::after {
    content: ""; position: absolute; left: 0; bottom: -1px;
    width: 40px; height: 1px; background: var(--wor-red);
  }
  .wor-topbar__logo img { height: 24px; width: auto; display: block; }
  .wor-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
  .wor-topbar .wor-avatar { width: 30px; height: 30px; font-size: .8rem; }

  .wor-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: grid;
    grid-template-columns: repeat(var(--wor-tabs, 5), 1fr);
    height: calc(var(--wor-tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(13, 13, 13, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--wor-border);
  }
}
.wor-tabbar__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--wor-meta);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: none; border: 0;
}
.wor-tabbar__item i { font-size: 1.3rem; line-height: 1; }
.wor-tabbar__item:hover { color: var(--wor-text-bright); }
.wor-tabbar__item.is-active { color: #fff; }
.wor-tabbar__item.is-active i { color: var(--wor-red-text); }
.wor-tabbar__item.is-active::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%;
  height: 2px; background: var(--wor-red); box-shadow: 0 0 12px var(--wor-red-glow);
}
.wor-tabbar__badge {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--wor-red); color: #fff;
  font-size: 11px; letter-spacing: 0; border-radius: 8px;
}

/* "More" bottom sheet */
.wor-sheet.offcanvas-bottom { height: auto; max-height: 80vh; border-top: 2px solid var(--wor-red); }
.wor-sheet .offcanvas-header { padding: 1rem var(--wor-gutter) .5rem; }
.wor-sheet .offcanvas-body { padding: .25rem var(--wor-gutter) calc(1.5rem + env(safe-area-inset-bottom)); }
.wor-sheet__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.wor-sheet__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  aspect-ratio: 1.25;
  background: var(--wor-panel);
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  color: var(--wor-text-bright);
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.wor-sheet__item i { font-size: 1.35rem; color: #fff; }
.wor-sheet__item:hover, .wor-sheet__item.is-active { border-color: var(--wor-red); color: #fff; }
.wor-sheet__count {
  position: absolute; top: .5rem; right: .5rem;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--wor-red); color: #fff;
  font-size: 11px; letter-spacing: 0; border-radius: 9px;
  font-variant-numeric: tabular-nums;
}

/* Skip link (visible only on keyboard focus) */
.wor-skip:focus {
  position: fixed; top: .75rem; left: .75rem; z-index: 2000;
  padding: .5rem .9rem;
  background: var(--wor-red); color: #fff;
  font-size: 13px; font-weight: 700;
  border-radius: var(--wor-radius);
}

/* --------------------------------------------------------------------------
   5. Page header + shared date-range control
   -------------------------------------------------------------------------- */
.wor-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}
.wor-page-header__titles { display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.wor-page-header__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: 12px; color: var(--wor-text); }
.wor-page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.wor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  padding: .75rem 0;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--wor-border);
  border-bottom: 1px solid var(--wor-border);
}
.wor-toolbar__end { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.wor-range { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.wor-range__dates { display: flex; align-items: center; gap: .4rem; }
.wor-range__dates .form-control { width: 9.5rem; height: 34px; padding: .25rem .6rem; font-size: 13px; }
.wor-range__sep { color: var(--wor-meta); }
.wor-range__compare { font-size: 12px; color: var(--wor-meta); }
@media (max-width: 767.98px) {
  .wor-toolbar { margin-left: calc(var(--wor-gutter) * -1); margin-right: calc(var(--wor-gutter) * -1); padding-left: var(--wor-gutter); padding-right: var(--wor-gutter); }
  .wor-range, .wor-range .wor-seg { width: 100%; }
  .wor-range .wor-seg__item { flex: 1; }
  .wor-range__dates { width: 100%; }
  .wor-range__dates .form-control { flex: 1; width: auto; }
}

/* Segmented toggle */
.wor-seg {
  display: inline-flex;
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  background: var(--wor-surface);
  padding: 2px;
  gap: 2px;
}
.wor-seg__item {
  border: 0;
  background: transparent;
  color: var(--wor-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .5rem .9rem;
  border-radius: 1px;
  white-space: nowrap;
  line-height: 1.2;
  transition: background-color .12s, color .12s;
}
.wor-seg__item:hover { color: #fff; }
.wor-seg__item.is-active, .wor-seg__item[aria-selected="true"] { background: var(--wor-red); color: #fff; }
.wor-seg--sm .wor-seg__item { padding: .35rem .65rem; font-size: 11px; }

/* Underline tabs (sub-pages, e.g. Ads › Campaigns / Google / Health) */
.wor-tabs {
  display: flex;
  gap: 1.75rem;
  border-bottom: 1px solid var(--wor-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.wor-tabs__item {
  position: relative;
  padding: .75rem 0;
  color: var(--wor-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wor-tabs__item:hover { color: #fff; }
.wor-tabs__item.is-active { color: #fff; }
.wor-tabs__item.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--wor-red); }
.wor-tabs__count { color: var(--wor-meta); margin-left: .35rem; font-variant-numeric: tabular-nums; }
.wor-tabs__item.is-active .wor-tabs__count { color: var(--wor-red-text); }

/* --------------------------------------------------------------------------
   6. Cards, KPI, plate
   -------------------------------------------------------------------------- */
.wor-card {
  position: relative;
  background: var(--wor-surface);
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  padding: 1.25rem;
  height: 100%;
  min-width: 0;
}
.wor-card--flush { padding: 0; }
.wor-card--panel { background: var(--wor-panel); }
.wor-card--featured { border-color: rgba(224, 32, 28, .55); box-shadow: 0 0 0 1px rgba(224, 32, 28, .15), 0 20px 50px rgba(224, 32, 28, .08); }
.wor-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.wor-card--flush .wor-card__header { padding: 1rem 1.25rem; margin: 0; border-bottom: 1px solid var(--wor-border); }
.wor-card__title {
  font-family: var(--wor-font-display);
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1;
  color: var(--wor-ink);
  margin: 0;
}
.wor-card__footer { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--wor-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wor-card--flush .wor-card__footer { margin: 0; padding: .8rem 1.25rem; }
.wor-card__link { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wor-text); }
.wor-card__link:hover { color: var(--wor-ink); }
.wor-card__link i { color: var(--wor-red); }

/* Telemetry sweep line (1px red line along the top edge) */
.wor-sweep { overflow: hidden; }
.wor-sweep::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  height: 1px; width: 35%;
  background: linear-gradient(90deg, transparent, var(--wor-red), transparent);
  animation: wor-sweep 4.5s var(--wor-ease) infinite;
}
@keyframes wor-sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* KPI card */
.wor-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: var(--wor-surface);
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  padding: 1rem 1.1rem;
  height: 100%;
  min-width: 0;
}
.wor-kpi .wor-label { letter-spacing: .16em; }
.wor-kpi__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wor-kpi__value {
  font-family: var(--wor-font-display);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: .9;
  color: #fff;
  white-space: nowrap;
}
.wor-kpi__value small { font-size: .55em; color: var(--wor-text); font-weight: 700; }
.wor-kpi__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: auto; }
.wor-kpi--accent { border-left: 3px solid var(--wor-red); }
.wor-kpi--link { transition: border-color .15s; }
.wor-kpi--link:hover { border-color: var(--wor-border-strong); }
@media (max-width: 767.98px) {
  .wor-kpi { padding: .85rem .9rem; }
  .wor-kpi__value { font-size: 1.85rem; }
  .wor-label { letter-spacing: .18em; }
  .wor-kpi .wor-label { letter-spacing: .12em; }
}

/* Broadcast plate (timing-tower chip) */
.wor-plate {
  display: inline-flex;
  align-items: stretch;
  transform: skewX(-8deg);
  background: var(--wor-panel);
  border: 1px solid var(--wor-border);
  border-left: 4px solid var(--wor-red);
  border-radius: 0;
}
.wor-plate > * { transform: skewX(8deg); }
.wor-plate__label {
  display: flex; align-items: center;
  padding: .4rem .7rem;
  font-family: var(--wor-font-chip);
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--wor-text);
  white-space: nowrap;
}
.wor-plate__value {
  display: flex; align-items: center;
  padding: .3rem .8rem .3rem .4rem;
  font-family: var(--wor-font-display);
  font-weight: 800; font-size: 1.15rem; line-height: 1;
  color: #fff;
  white-space: nowrap;
}
.wor-plate__pos { /* position cell, e.g. "P1" or venue code */
  display: flex; align-items: center;
  padding: .3rem .55rem;
  background: var(--wor-red);
  color: #fff;
  font-family: var(--wor-font-display); font-weight: 900; font-size: 1rem; line-height: 1;
}
.wor-plate--lg .wor-plate__value { font-size: 1.6rem; padding: .45rem 1rem .45rem .5rem; }
.wor-plate--lg .wor-plate__label { font-size: 11px; padding: .5rem .8rem; }
.wor-plate--gold { border-left-color: var(--wor-gold); }
.wor-plate--green { border-left-color: var(--wor-green); }
.wor-plate--muted { border-left-color: var(--wor-meta); }
.wor-plates { display: flex; flex-wrap: wrap; gap: .5rem .75rem; padding-left: 4px; }

/* --------------------------------------------------------------------------
   7. Deltas, status dots, chips
   -------------------------------------------------------------------------- */
.wor-delta {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .15rem .4rem;
  font-family: var(--wor-font-chip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--wor-radius);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--wor-text-bright);
  background: rgba(255, 255, 255, .06);
}
.wor-delta::before { font-size: .7em; }
.wor-delta--up::before { content: "▲"; }
.wor-delta--down::before { content: "▼"; }
.wor-delta--flat::before { content: "■"; font-size: .55em; }
.wor-delta.is-good { color: var(--wor-good); background: var(--wor-good-soft); }
.wor-delta.is-bad { color: var(--wor-bad); background: var(--wor-bad-soft); }
.wor-delta.is-warn { color: var(--wor-gold-light); background: var(--wor-gold-soft); }

/* Status dot */
.wor-dot {
  position: relative;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wor-meta);
  flex-shrink: 0;
  vertical-align: middle;
}
.wor-dot--live { background: var(--wor-red); box-shadow: 0 0 10px var(--wor-red-glow); }
.wor-dot--live::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--wor-red);
  animation: wor-pulse 1.8s ease-out infinite;
}
.wor-dot--ok { background: var(--wor-green); box-shadow: 0 0 8px rgba(37, 160, 56, .6); }
.wor-dot--warn { background: var(--wor-gold); box-shadow: 0 0 8px rgba(201, 168, 76, .5); }
.wor-dot--stale { background: #444; }
@keyframes wor-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }
.wor-status { display: inline-flex; align-items: center; gap: .5rem; font-size: 12px; color: var(--wor-text-bright); white-space: nowrap; }
.wor-status strong { color: #fff; font-weight: 600; }

/* Chips */
.wor-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 24px;
  padding: 0 .55rem;
  font-family: var(--wor-font-chip);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wor-text-bright);
  background: var(--wor-raised);
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  white-space: nowrap;
}
.wor-chip i { font-size: 12px; }
.wor-chip--red { color: var(--wor-red-text); background: var(--wor-red-soft); border-color: rgba(224, 32, 28, .35); }
.wor-chip--green { color: var(--wor-green-text); background: var(--wor-good-soft); border-color: rgba(37, 160, 56, .35); }
.wor-chip--gold { color: var(--wor-gold-light); background: var(--wor-gold-soft); border-color: rgba(201, 168, 76, .35); }
.wor-chip--outline { background: transparent; border-color: var(--wor-border-input); }

/* Platform badges (Meta / Google / Messenger / Instagram / Stripe / Square) */
.wor-src {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--wor-font-chip); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--wor-text-bright);
}
.wor-src i { font-size: 13px; }

/* Venue chips — set --venue via modifier */
.venue-pas { --venue: var(--wor-venue-pas); }
.venue-tus { --venue: var(--wor-venue-tus); }
.venue-phx { --venue: var(--wor-venue-phx); }
.venue-kc  { --venue: var(--wor-venue-kc); }
.wor-venue {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 24px;
  padding: 0 .6rem 0 .5rem;
  font-family: var(--wor-font-chip);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wor-ink);
  background: color-mix(in srgb, var(--venue, var(--wor-text)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--venue, var(--wor-text)) 40%, transparent);
  border-radius: var(--wor-radius);
  white-space: nowrap;
}
.wor-venue::before { content: ""; width: 7px; height: 7px; background: var(--venue, var(--wor-text)); transform: skewX(-8deg); }
.wor-venue--code { padding: 0 .45rem; letter-spacing: .06em; }
.wor-venue-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--venue, var(--wor-text)); flex-shrink: 0; }

/* Venue card accent: top bar in venue color */
.wor-card--venue { border-top: 2px solid var(--venue); }

/* --------------------------------------------------------------------------
   8. Bars (progress / stacked / split)
   Widths are data: set inline with a custom property, e.g. style="--w:62%"
   -------------------------------------------------------------------------- */
.wor-bar {
  display: flex;
  width: 100%;
  height: 8px;
  background: var(--wor-raised-2);
  overflow: hidden;
  gap: 2px;
}
.wor-bar--thin { height: 4px; gap: 1px; }
.wor-bar--thick { height: 12px; }
.wor-bar__seg { width: var(--w, 0%); background: var(--c, var(--wor-red)); flex-shrink: 0; transition: width .6s var(--wor-ease); }
.wor-bar__seg--online { --c: var(--wor-split-online); }
.wor-bar__seg--walkin { --c: var(--wor-split-walkin); }
.wor-bar__seg--other  { --c: var(--wor-split-other); }
.wor-bar__seg--venue  { --c: var(--venue); }
.wor-bar__seg--meta   { --c: var(--wor-red); }
.wor-bar__seg--google { --c: #e8e8e8; }
.wor-bar__seg--over   { --c: var(--wor-gold); }
.wor-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .75rem; }
.wor-legend__item { display: flex; align-items: center; gap: .45rem; font-size: 12px; color: var(--wor-text); }
.wor-legend__item strong { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.wor-legend__swatch { width: 10px; height: 10px; background: var(--c, var(--wor-red)); flex-shrink: 0; }
.wor-legend__swatch--online { --c: var(--wor-split-online); }
.wor-legend__swatch--walkin { --c: var(--wor-split-walkin); }
.wor-legend__swatch--other  { --c: var(--wor-split-other); }
.wor-legend__swatch--meta   { --c: var(--wor-red); }
.wor-legend__swatch--google { --c: #e8e8e8; }
.wor-legend__swatch--dashed { background: none; border-top: 2px dashed var(--wor-text); height: 0; width: 14px; }

/* Budget meter: spend vs budget, marker at 100% */
.wor-meter { position: relative; }
.wor-meter__track { height: 6px; background: var(--wor-raised-2); position: relative; overflow: hidden; }
.wor-meter__fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); max-width: 100%; background: var(--c, var(--wor-red)); }
.wor-meter.is-over .wor-meter__fill { --c: var(--wor-gold); }

/* --------------------------------------------------------------------------
   9. Data table
   -------------------------------------------------------------------------- */
.wor-table-wrap {
  position: relative;
  overflow: auto;
  max-height: var(--wor-table-max-h, none);
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  background: var(--wor-surface);
}
.wor-card--flush .wor-table-wrap { border: 0; }
.wor-table { margin: 0; font-size: 13px; white-space: nowrap; }
.wor-table > :not(caption) > * > * { padding: .55rem .9rem; border-bottom-color: var(--wor-border); }
.wor-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--wor-panel);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--wor-meta);
  border-bottom: 1px solid var(--wor-border-strong);
  vertical-align: bottom;
}
.wor-table tbody tr { transition: background-color .1s; }
.wor-table tbody tr:hover > * { --bs-table-bg-state: rgba(255, 255, 255, .035); color: var(--wor-ink); }
.wor-table td.num, .wor-table th.num { text-align: right; }
.wor-table td.num { font-family: var(--wor-font-body); font-weight: 500; }
.wor-table .is-muted { color: var(--wor-meta); }
.wor-table tfoot td { background: var(--wor-panel); color: var(--wor-ink); font-weight: 700; border-top: 1px solid var(--wor-border-strong); border-bottom: 0; }
.wor-table th.is-sortable { cursor: pointer; user-select: none; }
.wor-table th.is-sortable::after {
  content: "\2195"; /* ↕ */
  margin-left: .35rem; opacity: .35; font-size: 11px; letter-spacing: 0;
}
.wor-table th.is-sortable:hover { color: var(--wor-text-bright); }
.wor-table th.is-sorted-asc, .wor-table th.is-sorted-desc { color: var(--wor-ink); }
.wor-table th.is-sorted-asc::after { content: "\25B2"; opacity: 1; color: var(--wor-red); font-size: 8px; }
.wor-table th.is-sorted-desc::after { content: "\25BC"; opacity: 1; color: var(--wor-red); font-size: 8px; }
.wor-table tr.is-highlight > * { --bs-table-bg-state: var(--wor-red-soft); }
.wor-table tr.is-highlight > :first-child { box-shadow: inset 3px 0 0 var(--wor-red); }
.wor-table--sticky-col td:first-child, .wor-table--sticky-col th:first-child { position: sticky; left: 0; background: var(--wor-surface); z-index: 1; }
.wor-table--sticky-col thead th:first-child { z-index: 3; background: var(--wor-panel); }

/* Section row inside a table body: <tr class="wor-table__section"><th scope="rowgroup" colspan="N"><span>Traffic</span></th></tr> */
.wor-table tr.wor-table__section > * {
  padding-top: 1rem; padding-bottom: .4rem;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--wor-red-text);
  border-bottom-color: var(--wor-border-strong);
}
.wor-table tbody tr.wor-table__section:hover > * { --bs-table-bg-state: transparent; color: var(--wor-red-text); }

/* --------------------------------------------------------------------------
   9b. Timing tower: the funnel's table treatment (warm near-black rows, red
   header rule, red section plates, coloured delta text without pills).
   Put .wor-table-tower on the .wor-card holding a table, or on a bare table
   wrap via m.table_wrap(label, cls='wor-table-tower'). It remaps the surface,
   text, border and status tokens; section rows need their label in a <span>.
   -------------------------------------------------------------------------- */
.wor-table-tower {
  --wor-ink: var(--wor-tower-ink);
  --wor-surface: var(--wor-tower-bg);
  --wor-panel: var(--wor-tower-foot);
  --wor-offwhite: var(--wor-tower-ink);
  --wor-text: var(--wor-tower-text);
  --wor-text-bright: var(--wor-tower-text);
  --wor-meta: var(--wor-tower-meta);
  --wor-border: var(--wor-tower-border);
  --wor-good: var(--wor-tower-good);
  --wor-green-text: var(--wor-tower-good);
  --wor-bad: var(--wor-tower-bad);
  --wor-red-text: var(--wor-tower-bad);
  --wor-bad-soft: rgba(255, 107, 97, .09);
  --bs-body-color: var(--wor-tower-text);
  --bs-body-color-rgb: 212, 205, 194;
  background: var(--wor-surface);
  color: var(--wor-text);
}
.wor-table-tower .wor-table { font-size: 15px; }
.wor-table-tower .wor-table > :not(caption) > * > * { border-bottom-color: var(--wor-tower-row-border); }
.wor-table-tower .wor-table thead th { font-size: 13px; line-height: 1.3; color: var(--wor-tower-meta); background: var(--wor-tower-bg); border-bottom: 2px solid var(--wor-red); white-space: normal; text-wrap: balance; }
.wor-table-tower .wor-table tbody tr:nth-child(even of :not(.wor-table__section)) > * { --bs-table-bg-type: var(--wor-tower-zebra); }
.wor-table-tower .wor-table tbody tr:hover > * { --bs-table-bg-state: var(--wor-tower-hover); }
.wor-table-tower .wor-table tbody tr:not(.wor-table__section):hover > :first-child { box-shadow: inset 3px 0 0 var(--wor-red); }
.wor-table-tower .wor-table tbody tr.wor-table__section > * { --bs-table-bg-type: transparent; --bs-table-bg-state: transparent; padding-top: 1rem; font-size: 12.5px; }
.wor-table-tower .wor-table tr.wor-table__section > * > span { display: inline-block; padding: .2rem .6rem; transform: skewX(-8deg); background: var(--wor-red); color: #fff; }
.wor-table-tower .wor-table td.num { font-weight: 600; }
.wor-table-tower .wor-table td.num .wor-meta { font-weight: 500; }
.wor-table-tower .wor-table tfoot td { background: var(--wor-tower-foot); }
.wor-table-tower :is(p, li, dd) a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
.wor-table-tower .wor-delta { padding: 0 .1rem; font-size: 14px; font-weight: 800; color: var(--wor-tower-delta); background: none; }
.wor-table-tower .wor-delta.is-good { color: var(--wor-tower-good); background: none; }
.wor-table-tower .wor-delta.is-bad { color: var(--wor-tower-bad); background: none; }
.wor-table-tower .wor-delta.is-warn { color: var(--wor-gold-light); background: none; }

/* --------------------------------------------------------------------------
   10. List rows
   -------------------------------------------------------------------------- */
.wor-list { list-style: none; margin: 0; padding: 0; }
.wor-list__row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--wor-border);
  min-width: 0;
  transition: background-color .1s;
}
.wor-list__row:last-child { border-bottom: 0; }
a.wor-list__row:hover, .wor-list__row.is-clickable:hover { background: rgba(255, 255, 255, .03); }
.wor-list__icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--wor-raised);
  border: 1px solid var(--wor-border);
  border-radius: var(--wor-radius);
  color: var(--wor-text-bright);
  font-size: 15px;
}
.wor-list__main { flex: 1; min-width: 0; }
.wor-list__title { color: #fff; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wor-list__sub { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; font-size: 12px; color: var(--wor-meta); white-space: nowrap; overflow: hidden; }
.wor-list__aside { text-align: right; flex-shrink: 0; }
.wor-list__amount { color: #fff; font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.wor-list__time { font-size: 11px; color: var(--wor-meta); font-variant-numeric: tabular-nums; }
.wor-list--compact .wor-list__row { padding: .55rem 1rem; }

/* --------------------------------------------------------------------------
   11. Notices, empty state
   -------------------------------------------------------------------------- */
.wor-notice {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .85rem 1rem;
  background: linear-gradient(90deg, rgba(224, 32, 28, .1), rgba(224, 32, 28, .02) 70%);
  border: 1px solid var(--wor-border);
  border-left: 3px solid var(--wor-red);
  border-radius: var(--wor-radius);
  color: var(--wor-text-bright);
  font-size: .875rem;
}
.wor-notice > i { color: var(--wor-red-text); font-size: 1.05rem; line-height: 1.3; }
.wor-notice__title { color: #fff; font-weight: 700; }
.wor-notice__body { flex: 1; min-width: 0; }
.wor-notice__actions { display: flex; gap: .5rem; flex-shrink: 0; align-self: center; }
.wor-notice--warn { border-left-color: var(--wor-gold); background: linear-gradient(90deg, rgba(201, 168, 76, .1), transparent 70%); }
.wor-notice--warn > i { color: var(--wor-gold-light); }
.wor-notice--ok { border-left-color: var(--wor-green); background: linear-gradient(90deg, rgba(37, 160, 56, .1), transparent 70%); }
.wor-notice--ok > i { color: var(--wor-green-text); }
.wor-notice--info { border-left-color: var(--wor-text); background: var(--wor-panel); }
.wor-notice--info > i { color: var(--wor-text-bright); }
@media (max-width: 575.98px) { .wor-notice { flex-wrap: wrap; } .wor-notice__actions { width: 100%; padding-left: 1.9rem; } }

.wor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  padding: 2.5rem 1.5rem;
  border: 1px dashed var(--wor-border-strong);
  border-radius: var(--wor-radius);
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255, 255, 255, .012) 10px 20px);
}
.wor-empty__icon { font-size: 1.75rem; color: var(--wor-meta); }
.wor-empty__title { font-family: var(--wor-font-display); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; color: #fff; line-height: 1; }
.wor-empty__text { color: var(--wor-text); font-size: .875rem; max-width: 34ch; }

/* --------------------------------------------------------------------------
   12. Skeleton loader
   -------------------------------------------------------------------------- */
.wor-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--wor-raised) 0%, var(--wor-raised-2) 40%, var(--wor-raised) 80%);
  background-size: 300% 100%;
  animation: wor-shimmer 1.4s linear infinite;
  border-radius: var(--wor-radius);
}
.wor-skeleton--text { height: 10px; width: var(--w, 100%); }
.wor-skeleton--figure { height: 34px; width: var(--w, 60%); }
.wor-skeleton--block { height: var(--h, 120px); width: 100%; }
@keyframes wor-shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   13. Toast container
   -------------------------------------------------------------------------- */
.wor-toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; }
@media (max-width: 767.98px) { .wor-toasts { left: var(--wor-gutter); right: var(--wor-gutter); bottom: calc(var(--wor-tabbar-h) + .75rem); } }
.wor-toast { border-left: 3px solid var(--wor-red); }
.wor-toast--ok { border-left-color: var(--wor-green); }
.wor-toast .toast-body { display: flex; align-items: flex-start; gap: .75rem; }
.wor-toast .toast-body > i { font-size: 1.05rem; color: var(--wor-red-text); }
.wor-toast--ok .toast-body > i { color: #4cc865; }

/* --------------------------------------------------------------------------
   14. Section + layout helpers
   -------------------------------------------------------------------------- */
.wor-section { margin-top: 2rem; }
.wor-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.wor-divider { height: 1px; background: var(--wor-border); border: 0; margin: 1.5rem 0; opacity: 1; }
.wor-stat-row { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 0; }
.wor-stat-row > * { padding: 0 1rem; border-left: 1px solid var(--wor-border); min-width: 0; }
.wor-stat-row > :first-child { padding-left: 0; border-left: 0; }
.wor-chart { position: relative; height: var(--h, 240px); }

@media (prefers-reduced-motion: reduce) {
  .wor-dot--live::after, .wor-sweep::before, .wor-skeleton { animation: none; }
}
