/* ============================================================================================
 * OST Events — "Field Ledger" theme (the approved redesign; mockups: *.dc.html).
 *
 * Loaded LAST on every page (view/_header.php: after Bootstrap 4.3.1, inc/style.css and the
 * tablesorter theme; view/_auth_top.php: after Bootstrap), so it restyles Bootstrap in place:
 * markup, form field names, JS hooks and behaviour stay as they are. Keep Bootstrap 4 classes in
 * views; reach for the .oe-* utilities below when a layout needs them.
 *
 * TOKENS (CSS variables on :root) — use var(--oe-…) instead of raw colours:
 *   --oe-ink #14161B (side menu, phone app bar, "Filter" / dark buttons)   --oe-ink-2 #262A33 (active
 *   menu item)   --oe-ink-3 #2A2E37 (lines / avatars on ink)   --oe-ink-text #C9CBD1   --oe-ink-muted #8E929B
 *   --oe-ground #F5F4F0 (page)   --oe-surface #FFFFFF (cards)   --oe-surface-alt #FAFAF8 (table heads,
 *   inputs in bars)   --oe-chip #F0EEE8 (neutral chips)
 *   --oe-border #E3E1DA (cards, bars)   --oe-divider #EEECE6 (rows)   --oe-control-border #D5D2C9
 *   --oe-text #17181C   --oe-text-2 #3F4652 (labels, codes)   --oe-muted #5B5E66   --oe-faint #8E929B
 *   --oe-accent #D1241B (OST red: primary buttons, active states, key figures only)
 *   --oe-accent-hover #B01E16   --oe-focus (accent focus ring, low alpha)
 *   status pairs --oe-{green,amber,grey,red,blue}-bg / -fg: Confirmed/Approved, Prospect,
 *   Complete, Cancelled/Rejected, Submitted   --oe-sandbox #FD7E14 (+ -border, -hover)
 *   --oe-viewas #4C1D95 (the View as banner, violet: neither the sandbox orange nor the OST red)
 *   --oe-viewas-h (0, 44px while an Admin views the app as someone: body .oe-viewing-as)
 *   --oe-font-display Archivo 600/700/800 (headings, big figures)   --oe-font-body IBM Plex Sans
 *   --oe-radius-card 12px   --oe-radius-control 8px   --oe-control-h 40px   --oe-touch 44px
 *   --oe-sidebar-w 240px   --oe-topbar-h 72px (56px on phones)   --oe-tabbar-h 64px
 *
 * UTILITY CLASSES for page views (all additive; combine with Bootstrap's grid / spacing):
 *   .oe-card            white card: 1px --oe-border, 12px radius (a Bootstrap .card looks the same)
 *   .oe-card-head       card header row: title left (h2/h3 or .oe-card-title), links/buttons right,
 *                       divider below;  .oe-card-sub  muted line under the title
 *   .oe-card-body       20px card padding (16px on phones);  .oe-card-foot  footer row, alt background
 *   .oe-kpi             KPI tile: .oe-kpi-label (13px muted) / .oe-kpi-value (Archivo 800 34px,
 *                       tabular; .is-accent = red) / .oe-kpi-note (12px muted)
 *   .oe-kpis            grid for KPI tiles: 4 across (.is-3: 3), 2 below 992px (.is-3: last one full width)
 *   .oe-pill            status pill (status_badge() emits it) + tone: .oe-pill-green (confirmed,
 *                       approved, sent, active, done) .oe-pill-amber (prospect, open) .oe-pill-grey
 *                       (complete, inactive) .oe-pill-red (cancelled, rejected, failed, overdue)
 *                       .oe-pill-blue (submitted, queued) .oe-pill-neutral (counts / chips)
 *                       .oe-pill-accent (solid red count) .oe-pill-ink .oe-pill-orange (sandbox ON);
 *                       Bootstrap .badge-* get the same look
 *   .oe-table           list table flush in a card (22px outer cell padding, caps header row,
 *                       row dividers, hover); any .table gets the header/row style
 *   .oe-muted / .oe-faint   secondary / tertiary text colour;  .oe-meta  12px muted second line
 *   .oe-num             tabular figures (money, counts, dates in columns);  .oe-figure  Archivo 800
 *                       22px tabular figure (budget strip)
 *   .oe-code            company short code (12px 700 caps, letter-spaced)
 *   .oe-eyebrow         11px 600 caps section label (NEXT UP, UPCOMING, …)
 *   .oe-toolbar         filter row in a white card: controls side by side, 12px caps labels,
 *                       wraps on small screens (put .form-group / .oe-toolbar-item children in it)
 *   .oe-empty           empty state: centred icon (.oe-empty-icon), .oe-empty-title, text, action
 *   .oe-grid-2 / .oe-grid-3 / .oe-grid-4   equal columns with a 20px gap (1 column below 992px;
 *                       grid-4: 2 columns from 576px)   .oe-grid-split  2fr + 1fr (main + aside)
 *   .oe-stack           vertical flex stack, 16px gap (.oe-stack-sm 8px, .oe-stack-lg 24px)
 *   .oe-list-row        row inside a card (flex, 12px 20px, divider between rows)
 *   .oe-strip / .oe-strip-cell   one-row summary strip in a card (budget strip): cells with
 *                       .oe-strip-label (12px caps) + .oe-figure + .oe-meta; 2-3 per row on phones
 *   .oe-progress        6px bar; child .oe-progress-bar with an inline width (accent fill)
 *   .oe-avatar          round initials (36px; .oe-avatar-sm 28px, .oe-avatar-lg 52px) — ui_initials()
 *   .oe-link            accent 600 link ("All events", "Add")
 *   .oe-icon            inline SVG icon from ui_icon() (inherits the text colour)
 *   .oe-btn-icon        square 40px icon-only button (with .btn .btn-secondary)
 *   .btn-ink            dark button (#14161B, e.g. "Filter", "Upload"); .btn-dark looks the same
 *   .oe-dropzone        dashed upload area
 *   .oe-section-nav     vertical sub-navigation card (Settings sections): links with .active
 *   .oe-seg             segmented switch: links (.active / aria-current) or labels around radios;
 *                       .oe-seg-count after a label; .oe-seg-block = equal full-width segments
 *   .oe-filterbar       filter row in a card whose controls carry their label inside:
 *                       .oe-filter-search (icon + input), .oe-filter-field (label + select),
 *                       .oe-filter-note (muted note pushed right)
 *   .oe-filter-pills    status filter links with counts (.active = accent); .oe-count = count chip
 *                       (.is-amber / .is-red)
 *   .oe-check-pills     labels around checkboxes shown as pills (checked = white, bold)
 *   .oe-pill-outline    white pill with a border ("No login")
 *   .oe-dl              label / value list (dl > dt + dd, 116px labels)
 *   .oe-grid-aside      main column + fixed side column (--oe-aside-w, 440px); .oe-grid-aside-start
 *                       side column first (216px); both one column below 1200px
 *   .oe-group-row       header row starting a group in a table body (type / category groups)
 *   .oe-table-compact   13px report table with a tinted footer; .oe-zero = a faint zero
 *   .oe-callout-sandbox orange-tinted callout (Settings → Email sandbox);  .oe-row-alert  tinted
 *                       table row with a red edge (a failed email)
 *   .gap-0 … .gap-5     flex / grid gap 0 / 4 / 8 / 12 / 16 / 20px;  .oe-min-0  min-width: 0;
 *                       .oe-icon-fill  a solid ui_icon() (ui_icon('star', 14, 'oe-icon-fill'))
 *   .oe-att-*           the files card of view/partials/_attachments.php (.oe-att-compact: links only)
 *
 * PAGE SECTIONS (after the shell and components, before Print): Event page (.oe-ev-*, the tab
 *   hooks), Events list (.ev-*), People (.staff-*, .users-*), Ops (.dash-*, .inv-*, .rep-*), Staff
 *   portal (.pt-*), Task templates (.tpl-*), Help, Team chat (.oe-chat-*, .pt-chat). Views carry no <style> blocks; page styles go in these sections.
 *
 * SHELL (view/_layout_top.php, _nav.php, _side_menu.php, _layout_bottom.php, _auth_top.php):
 *   .oe-sidebar (#sidebar-wrapper), .oe-topbar (#top-nav), #popup_container (toasts), .oe-tabbar
 *   (Staff phones), .oe-auth* (sign-in pages; .oe-google-btn = Sign in with Google, Google's colours), .oe-install-* (the install sheet, inc/app.js), .oe-viewas (the View as banner above the top bar), .email-sandbox-btn (the orange SANDBOX button;
 *   while the sandbox is on the bar is .oe-has-sandbox and <body> .oe-sandbox-on: two rows and a
 *   taller --oe-topbar-h from 768 to 1279px). Page variables for the top bar: see
 *   view/_layout_top.php.
 * LISTS: .table-responsive is position: relative (it clips the .sr-only labels inside it); the
 *   event tabs' row actions (td.oe-ev-actions) are pinned to the card's right edge from 768px;
 *   below 1400px table cells have 10px side padding.
 * Breakpoints: phones < 768px, drawer menu < 992px, desktop >= 992px.
 * ============================================================================================ */

:root {
  --oe-ink: #14161B;
  --oe-ink-2: #262A33;
  --oe-ink-3: #2A2E37;
  --oe-ink-text: #C9CBD1;
  --oe-ink-muted: #8E929B;

  --oe-ground: #F5F4F0;
  --oe-surface: #FFFFFF;
  --oe-surface-alt: #FAFAF8;
  --oe-chip: #F0EEE8;

  --oe-border: #E3E1DA;
  --oe-divider: #EEECE6;
  --oe-control-border: #D5D2C9;

  --oe-text: #17181C;
  --oe-text-2: #3F4652;
  --oe-muted: #5B5E66;
  --oe-faint: #8E929B;

  --oe-accent: #D1241B;
  --oe-accent-hover: #B01E16;
  --oe-accent-soft: #FBE5E3;
  --oe-focus: rgba(209, 36, 27, .18);

  --oe-green-bg: #E3F1E8;
  --oe-green-fg: #1E6B45;
  --oe-green-line: #BFDCC9;
  --oe-amber-bg: #FFF1D6;
  --oe-amber-fg: #7A4F00;
  --oe-amber-line: #E6C77F;
  --oe-grey-bg: #E9EBEF;
  --oe-grey-fg: #3F4652;
  --oe-red-bg: #FBE5E3;
  --oe-red-fg: #8B1D17;
  --oe-red-line: #EBC4BF;
  --oe-blue-bg: #E4ECFB;
  --oe-blue-fg: #1E40AF;
  --oe-blue-line: #C4D3F3;

  --oe-sandbox: #FD7E14;
  --oe-sandbox-border: #D9480F;
  --oe-sandbox-hover: #E8590C;

  --oe-viewas: #4C1D95;
  --oe-viewas-hover: #EDE9FE;
  --oe-viewas-h: 0px;

  --oe-font-display: 'Archivo', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --oe-font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --oe-radius-card: 12px;
  --oe-radius-control: 8px;
  --oe-radius-pill: 999px;
  --oe-control-h: 40px;
  --oe-touch: 44px;
  --oe-sidebar-w: 240px;
  --oe-topbar-h: 72px;
  --oe-topbar-h-sm: 56px;
  --oe-tabbar-h: 64px;
  --oe-shadow-pop: 0 10px 28px rgba(20, 22, 27, .14), 0 2px 6px rgba(20, 22, 27, .08);
}

/* ------------------------------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------------------------------ */

body {
  font-family: var(--oe-font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--oe-text);
  background-color: var(--oe-ground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--oe-font-display);
  font-weight: 700;
  color: var(--oe-text);
  letter-spacing: -.01em;
  line-height: 1.25;
}

h1, .h1 { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
h2, .h2 { font-size: 22px; }
h3, .h3 { font-size: 19px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 16px; }
h6, .h6 { font-size: 14px; }

small, .small {
  font-size: 85.7%;
}

a {
  color: var(--oe-text);
}

a:hover {
  color: var(--oe-accent-hover);
}

/* links inside running text stay recognisable */
p a:not(.btn), .form-text a, .alert a:not(.btn), .oe-prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

strong, b {
  font-weight: 600;
}

hr {
  border-top-color: var(--oe-divider);
}

::placeholder {
  color: var(--oe-faint);
}

:focus-visible {
  outline: 2px solid var(--oe-accent);
  outline-offset: 2px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--oe-accent);
}

.oe-skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--oe-radius-control);
  background: var(--oe-ink);
  color: #fff;
  font-weight: 600;
}

.oe-skip-link:focus {
  top: 12px;
  color: #fff;
}

#main:focus {
  outline: 0;
}

/* ------------------------------------------------------------------------------------------
 * App shell: side menu (#sidebar-wrapper), top bar (#top-nav), page body
 * ------------------------------------------------------------------------------------------ */

body.oe-app {
  overflow-x: hidden;
}

#wrapper {
  min-height: 100vh;
  align-items: stretch;
}

#page-content-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.page-body,
.page-body.container-fluid {
  flex: 1 0 auto;
  padding: 28px 32px 48px;
}

/* The Canect brand + "Events": the green C mark (img/brand/canect-mark.svg — side menu, phone
   app bar, install sheet) or the CANECT wordmark (img/brand/canect-wordmark.svg — sign-in pages,
   with a thin rule before "Events"). The green reads on the ink and on white alike. */
.oe-brand-mark,
.oe-brand-wordmark {
  display: block;
  flex: none;
  width: auto;
}

.oe-brand-mark {
  height: 30px;
}

.oe-brand-wordmark {
  height: 26px;
}

.oe-brand-wordmark + .oe-brand-name {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .28);
  line-height: 1.15;
}

.oe-brand-name {
  font-family: var(--oe-font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .2px;
  color: #fff;
}

/* Side menu */
.oe-sidebar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--oe-sidebar-w);
  width: var(--oe-sidebar-w);
  height: 100vh;
  overflow-y: auto;
  padding: 22px 14px 12px;
  background: var(--oe-ink);
  color: var(--oe-ink-text);
  scrollbar-width: thin;
  scrollbar-color: var(--oe-ink-3) transparent;
}

.oe-sidebar:focus {
  outline: 0;
}

.oe-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 22px;
}

.oe-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.oe-sidebar .sidebar-brand:hover {
  color: #fff;
}

.oe-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--oe-touch);
  height: var(--oe-touch);
  margin: -10px -12px -10px 0;
  padding: 0;
  border: 0;
  border-radius: var(--oe-radius-control);
  background: transparent;
  color: var(--oe-ink-text);
}

.oe-sidebar-close:hover {
  background: var(--oe-ink-2);
  color: #fff;
}

.oe-sidebar .list-group {
  gap: 4px;
}

.oe-sidebar .sidebar-group {
  padding: 18px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--oe-ink-muted);
}

.oe-sidebar .sidebar-group:first-child {
  padding-top: 10px;
}

.oe-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: var(--oe-radius-control);
  color: var(--oe-ink-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.oe-nav-link:hover,
.oe-nav-link:focus {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-decoration: none;
}

.oe-nav-link.active {
  background: var(--oe-ink-2);
  color: #fff;
  font-weight: 600;
}

.oe-nav-link .oe-icon {
  flex: none;
}

.oe-nav-link.active .oe-icon {
  color: var(--oe-accent);
}

.oe-nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oe-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--oe-radius-pill);
  background: var(--oe-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.oe-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--oe-ink-3);
}

.oe-sidebar .oe-sidebar-user {
  margin-top: auto;
}

.oe-sidebar > nav {
  margin-bottom: 18px;
}

.oe-sidebar-user .oe-avatar {
  width: 34px;
  height: 34px;
  background: var(--oe-ink-3);
  font-size: 13px;
}

.oe-sidebar-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.oe-sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oe-sidebar-user-role {
  color: var(--oe-ink-muted);
  font-size: 12px;
}

.oe-sidebar-backdrop {
  display: none;
}

/* Top bar */
.oe-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--oe-topbar-h);
  padding: 0 32px;
  background: var(--oe-surface);
  border-bottom: 1px solid var(--oe-border);
}

.oe-topbar-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--oe-touch);
  height: var(--oe-touch);
  margin-left: -8px;
  padding: 0;
  border: 0;
  border-radius: var(--oe-radius-control);
  background: transparent;
  color: var(--oe-text);
}

.oe-topbar-btn:hover {
  background: var(--oe-ground);
}

.oe-appbar-brand {
  display: none;
}

.oe-topbar-back {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  height: var(--oe-touch);
  margin-left: -8px;
  padding: 0 10px 0 4px;
  border-radius: var(--oe-radius-control);
  color: var(--oe-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.oe-topbar-back:hover {
  background: var(--oe-ground);
  color: var(--oe-text);
  text-decoration: none;
}

.oe-topbar-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.oe-topbar-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.oe-topbar-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--oe-font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oe-topbar-heading > :not(.oe-topbar-title) {
  flex: none;
}

.oe-topbar-subtitle {
  overflow: hidden;
  color: var(--oe-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oe-topbar-subtitle a {
  color: var(--oe-muted);
  font-weight: 600;
}

.oe-topbar-subtitle a:hover {
  color: var(--oe-accent-hover);
}

.oe-topbar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 12px;
  min-width: 0;
}

/* The SANDBOX button sits between the heading and the page actions (auto margins centre it in the
   room left). The actions always keep their natural width; when the bar is short of room the
   address in the button shortens first (ellipsis; the full text is in its tooltip), then the
   heading (never below 140px). Below 1280px the bar has two rows instead (see below). */
.oe-has-sandbox .oe-topbar-titles {
  flex: 0 1 auto;
  min-width: 140px;
}

.oe-has-sandbox .oe-topbar-end {
  flex: 0 0 auto;
}

.oe-topbar .email-sandbox-btn {
  flex-shrink: 1000000; /* the heading loses nothing (not even a fraction of a pixel, which would
                           show a "…") until the button is down to its minimum */
  margin: 0 auto;
}

.oe-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

@media (min-width: 768px) {
  .oe-topbar-actions > * {
    flex: none;
  }

  /* Staff profile / login pills in the subtitle: one line (the bar is 72px high) */
  .oe-topbar-subtitle .profile-pills,
  .oe-topbar-subtitle .users-pills {
    flex-wrap: nowrap;
  }
}

@media (min-width: 1280px) {
  .oe-topbar .email-sandbox-btn {
    min-width: 180px; /* "SANDBOX" itself is never cut */
  }
}

/* With the SANDBOX button, 1280–1439px: the Event page's Overview actions drop their visible
   labels (still read out, as on tablets), so its heading keeps its room */
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .oe-has-sandbox .oe-ev-hide-md,
  .oe-has-sandbox .oe-ev-status-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .oe-has-sandbox .oe-topbar-actions .btn .oe-icon:first-child {
    margin-right: 0;
  }
}

/* With the SANDBOX button, 768–1279px (one row has no room for heading, SANDBOX and actions):
   two rows — menu, back link, SANDBOX, avatar; then the heading and the page actions. The body
   (.oe-sandbox-on, _header.php) gets the taller --oe-topbar-h, so the toasts and the Help page's
   sticky contents stay below the bar. */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .oe-sandbox-on {
    --oe-topbar-h: 124px;
  }

  .oe-topbar.oe-has-sandbox {
    flex-wrap: wrap;
    align-content: center;
    row-gap: 4px;
    height: auto;
    min-height: var(--oe-topbar-h);
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* the line break between the two rows (its own empty line: 4px + 4px row gaps) */
  .oe-topbar.oe-has-sandbox::after {
    content: "";
    order: 4;
    flex: 0 0 100%;
  }

  .oe-has-sandbox .oe-topbar-end {
    display: contents;
  }

  /* basis 0: a long address never pushes the avatar onto a row of its own (a wrapping row is
     filled before anything shrinks); the button grows back to its natural width when there is
     room */
  .oe-topbar.oe-has-sandbox .email-sandbox-btn {
    order: 2;
    flex: 1 1 0;
    max-width: max-content;
  }

  .oe-has-sandbox .oe-user {
    order: 3;
  }

  .oe-has-sandbox .oe-topbar-titles {
    order: 5;
    flex: 1 1 0;
  }

  .oe-has-sandbox .oe-topbar-actions {
    order: 6;
    flex: none;
  }
}

.oe-topbar-actions > *,
.oe-topbar-actions .btn {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.oe-topbar-actions .btn,
.oe-topbar-actions .btn-sm {
  height: var(--oe-control-h);
  padding: 0 16px;
  font-size: 14px;
  line-height: calc(var(--oe-control-h) - 2px);
  white-space: nowrap;
}

.oe-user-btn {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  height: var(--oe-touch);
  padding: 0 4px 0 4px;
  border: 0;
  border-radius: var(--oe-radius-pill);
  background: transparent;
  color: var(--oe-muted);
}

.oe-user-btn:hover,
.oe-user.show .oe-user-btn {
  background: var(--oe-ground);
}

.oe-user .dropdown-menu {
  min-width: 250px;
  margin-top: 6px;
}

.dropdown-menu .dropdown-item > .oe-icon:first-child {
  margin-right: 4px;
  vertical-align: -3px;
}

.push-control-label {
  padding-left: 1.5em;
}

.push-control-hint {
  max-width: 17rem;
  white-space: normal;
}

.oe-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--oe-ink);
  color: #fff;
  font-family: var(--oe-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
}

.oe-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.oe-avatar-lg { width: 52px; height: 52px; font-family: var(--oe-font-display); font-size: 18px; font-weight: 700; }

/* Staff bottom tab bar: phones only (below) */
.oe-tabbar {
  display: none;
}

/* Drawer menu below 992px */
@media (max-width: 991.98px) {
  .oe-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    width: 280px;
    max-width: 86vw;
    height: auto;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .22s ease, visibility 0s linear .22s;
  }

  #wrapper.toggled .oe-sidebar {
    visibility: visible;
    transform: none;
    transition: transform .22s ease, visibility 0s;
    box-shadow: 8px 0 28px rgba(0, 0, 0, .3);
  }

  .oe-sidebar-close {
    display: inline-flex;
  }

  #wrapper.toggled .oe-sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    background: rgba(20, 22, 27, .5);
  }

  .oe-topbar {
    gap: 12px;
    padding: 0 24px;
  }

  .oe-topbar-btn {
    display: inline-flex;
  }

  .page-body,
  .page-body.container-fluid {
    padding: 24px 24px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oe-sidebar,
  #wrapper.toggled .oe-sidebar {
    transition: none;
  }
}

/* Phones */
@media (max-width: 767.98px) {
  /* Phones: the bar scrolls with the page (it can be two or three rows high) */
  .oe-topbar {
    position: relative;
    flex-wrap: wrap;
    row-gap: 6px;
    height: auto;
    min-height: var(--oe-topbar-h-sm);
    padding: 6px 12px;
  }

  .oe-topbar-end {
    display: contents;
  }

  .oe-topbar-titles { order: 1; flex: 1 1 0; }
  .oe-topbar .email-sandbox-btn { order: 2; max-width: none; margin: 0 auto; }

  /* Planners and Admins (the address is shown): basis 0, as on tablets, so menu | SANDBOX |
     avatar stay on one row whatever the address (it wraps inside the button instead) */
  body:not(.oe-staff-app) .oe-topbar .email-sandbox-btn { flex: 1 1 0; max-width: max-content; }
  body:not(.oe-staff-app) .oe-has-sandbox.oe-has-back .oe-topbar-back { flex: 0 1 auto; }
  .oe-user { order: 3; }

  body:not(.oe-staff-app) .oe-has-back .oe-topbar-back {
    flex: 1 1 auto;
  }

  body:not(.oe-staff-app) .oe-has-back .oe-topbar-titles {
    order: 5;
    flex: 1 0 100%;
    padding-bottom: 6px;
  }

  /* with the SANDBOX button: menu | SANDBOX | avatar, the heading on its own row below */
  .oe-has-sandbox .oe-topbar-titles {
    order: 5;
    flex: 1 0 100%;
    padding-bottom: 4px;
  }

  .oe-topbar-actions {
    order: 10;
    flex: 1 0 100%;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 6px;
  }

  .oe-topbar-title {
    font-size: 18px;
  }

  .oe-topbar-subtitle {
    font-size: 12px;
  }

  .oe-user-btn .oe-user-caret {
    display: none;
  }

  .oe-avatar {
    width: 34px;
    height: 34px;
  }

  .page-body,
  .page-body.container-fluid {
    padding: 16px 16px 32px;
  }

  /* Staff (level 1): ink app bar (C mark + "Events" | SANDBOX | avatar), heading below it, bottom
     tab bar (PhoneMyEvents.dc.html). The bar scrolls with the page; the tab bar stays. */
  .oe-staff-app .oe-topbar {
    position: relative;
    column-gap: 10px;
    row-gap: 0;
    padding: 0 6px 0 16px;
    background: transparent;
    border-bottom: 0;
  }

  .oe-staff-app .oe-topbar::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: -1;
    height: var(--oe-topbar-h-sm);
    background: var(--oe-ink);
  }

  .oe-staff-app #menu-toggle {
    display: none;
  }

  .oe-staff-app .oe-appbar-brand {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    gap: 10px;
    order: 0;
    height: var(--oe-topbar-h-sm);
    min-width: 0;
    color: #fff;
    text-decoration: none;
  }

  .oe-staff-app .oe-appbar-brand .oe-brand-mark {
    height: 26px;
  }

  .oe-staff-app .oe-appbar-brand .oe-brand-name {
    font-size: 16px;
  }

  .oe-staff-app .oe-topbar .email-sandbox-btn { order: 1; }
  .oe-staff-app .oe-user { order: 2; }

  .oe-staff-app .oe-user-btn {
    justify-content: center;
    width: var(--oe-touch);
    padding: 0;
    color: #fff;
  }

  .oe-staff-app .oe-user-btn:hover,
  .oe-staff-app .oe-user.show .oe-user-btn {
    background: var(--oe-ink-2);
  }

  .oe-staff-app .oe-user-btn .oe-avatar {
    width: 32px;
    height: 32px;
    background: var(--oe-ink-3);
    font-size: 12px;
  }

  .oe-staff-app .oe-topbar-titles {
    order: 5;
    flex: 1 0 100%;
    padding: 18px 10px 0 0;
  }

  .oe-staff-app .oe-topbar-title {
    font-size: 24px;
    white-space: normal;
  }

  .oe-staff-app .oe-topbar-subtitle {
    white-space: normal;
  }

  .oe-staff-app .oe-topbar-actions {
    order: 6;
    padding: 12px 10px 0 0;
  }

  /* A page with a back link (my_event): white bar with "‹ My Events" instead of the brand */
  .oe-staff-app .oe-has-back::before {
    background: var(--oe-surface);
    border-bottom: 1px solid var(--oe-border);
  }

  .oe-staff-app .oe-has-back .oe-appbar-brand {
    display: none;
  }

  .oe-staff-app .oe-has-back .oe-topbar-back {
    order: 0;
    flex: 1 1 auto;
    align-self: center;
    margin: 6px 0;
  }

  .oe-staff-app .oe-has-back .oe-topbar-back span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .oe-staff-app .oe-has-back .oe-user-btn {
    color: var(--oe-text);
  }

  .oe-staff-app .oe-has-back .oe-user-btn:hover,
  .oe-staff-app .oe-has-back .oe-user.show .oe-user-btn {
    background: var(--oe-ground);
  }

  .oe-staff-app .page-body,
  .oe-staff-app .page-body.container-fluid {
    padding: 14px 16px calc(var(--oe-tabbar-h) + 28px + env(safe-area-inset-bottom, 0px));
  }

  .oe-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: calc(var(--oe-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--oe-surface);
    border-top: 1px solid var(--oe-border);
  }

  .oe-tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--oe-touch);
    color: var(--oe-muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
  }

  .oe-tabbar-item:hover {
    color: var(--oe-text);
    text-decoration: none;
  }

  .oe-tabbar-item.active {
    color: var(--oe-accent);
    font-weight: 600;
  }

  .oe-tabbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 28px;
    border-radius: 14px;
  }

  .oe-tabbar-item.active .oe-tabbar-icon {
    background: var(--oe-chip);
  }

  .oe-tabbar-label {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .oe-tabbar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--oe-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
  }
}

/* ------------------------------------------------------------------------------------------
 * Messages (view/_header.php #popup_container, App.flash()): toasts under the top bar, top
 * right (never over the top bar and its SANDBOX button); at the bottom of the screen on phones
 * ------------------------------------------------------------------------------------------ */

#popup_container {
  position: fixed;
  top: calc(var(--oe-topbar-h) + 12px);
  right: 24px;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 380px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

#popup_container > .error,
#popup_container > .notice {
  position: relative;
  margin: 0;
  padding: 12px 44px 12px 44px;
  border: 1px solid var(--oe-border);
  border-left: 4px solid var(--oe-green-fg);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
  box-shadow: var(--oe-shadow-pop);
  color: var(--oe-text);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: auto;
  animation: oe-toast-in .2s ease-out;
}

#popup_container > .error {
  border-left-color: var(--oe-accent-hover);
}

#popup_container > .error::before,
#popup_container > .notice::before {
  content: "\f058";
  position: absolute;
  top: 12px;
  left: 14px;
  color: var(--oe-green-fg);
  font-family: "Font Awesome 5 Free";
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

#popup_container > .error::before {
  content: "\f06a";
  color: var(--oe-accent-hover);
}

#popup_container > .error h1 {
  margin: 0 0 2px;
  padding: 0;
  border: 0;
  color: var(--oe-red-fg);
  font-family: var(--oe-font-display);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

#popup_container .close-link {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--oe-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

#popup_container .close-link:hover {
  background: var(--oe-ground);
  color: var(--oe-text);
}

#popup_container .popup-item {
  padding: 0;
  overflow-wrap: anywhere;
}

#popup_container .popup-item + .popup-item {
  margin-top: 4px;
}

@keyframes oe-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #popup_container > .error,
  #popup_container > .notice {
    animation: none;
  }
}

@media (max-width: 767.98px) {
  #popup_container {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .oe-staff-app #popup_container {
    bottom: calc(var(--oe-tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
  }
}

/* ------------------------------------------------------------------------------------------
 * View as (view-as spec §7; view/_layout_top.php): while an Admin views the app as someone
 * (<body> .oe-viewing-as), a violet strip on every page of the app layout, above the top bar and
 * so above the SANDBOX button's row. It is sticky at the top; from 768px the top bar sticks under
 * it (--oe-viewas-h), and the desktop side menu, the toasts and the Help contents move down by
 * it. One line at every width: phones drop the start time and cut a long name (ellipsis).
 * ------------------------------------------------------------------------------------------ */

.oe-viewing-as {
  --oe-viewas-h: 44px;
}

.oe-viewas {
  position: sticky;
  top: 0;
  z-index: 1035; /* over the top bar (1020) and the side menu (1030); under the drawer (1040+) */
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--oe-viewas-h);
  padding: 0 12px 0 20px;
  background: var(--oe-viewas);
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
}

.oe-viewas-text {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.oe-viewas-text .oe-icon {
  flex: none;
}

.oe-viewas-who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oe-viewas-name {
  font-weight: 700;
}

.oe-viewas-since {
  flex: none;
  opacity: .85;
}

.oe-viewas-stop {
  flex: none;
  margin: 0;
}

.oe-viewas-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid #fff;
  border-radius: var(--oe-radius-control);
  background: #fff;
  color: var(--oe-viewas);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.oe-viewas-btn:hover,
.oe-viewas-btn:focus {
  background: var(--oe-viewas-hover);
  color: var(--oe-viewas);
}

.oe-viewas-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .oe-viewing-as .oe-topbar {
    top: var(--oe-viewas-h);
  }

  .oe-viewing-as #popup_container {
    top: calc(var(--oe-topbar-h) + var(--oe-viewas-h) + 12px);
  }
}

@media (min-width: 992px) {
  .oe-viewing-as .oe-sidebar {
    top: var(--oe-viewas-h);
    height: calc(100vh - var(--oe-viewas-h));
  }

  .oe-viewing-as .help-toc {
    top: calc(var(--oe-topbar-h) + var(--oe-viewas-h) + 12px);
    max-height: calc(100vh - var(--oe-topbar-h) - var(--oe-viewas-h) - 12px - 2.5rem);
  }
}

@media (max-width: 767.98px) {
  .oe-viewas {
    gap: 8px;
    padding: 0 8px 0 12px;
    font-size: 13px;
  }

  .oe-viewas-since {
    display: none;
  }

  .oe-viewas-btn {
    height: 30px;
    padding: 0 10px;
  }
}

@media print {
  .oe-viewas {
    display: none;
  }
}

/* ------------------------------------------------------------------------------------------
 * The orange SANDBOX button (email sandbox spec §5; email_sandbox_badge()): the middle of the
 * top bar, fixed at the top centre of the sign-in pages. From 992px one 40px line: when the bar
 * is short of room the address shortens (ellipsis, the full text in the tooltip), and below 3em
 * it wraps onto a second line the button hides, so "SANDBOX" stands alone and no stray "…"
 * shows. Below 992px "SANDBOX" goes over the address, which wraps (never cut off: Planners have
 * no link and phones no hover tooltip).
 * ------------------------------------------------------------------------------------------ */

.email-sandbox-btn {
  display: inline-flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  justify-content: center;
  gap: 10px;
  row-gap: 12px;
  min-width: 0;
  max-width: 50%;
  height: var(--oe-touch);
  padding: 0 18px;
  overflow: hidden;
  background-color: var(--oe-sandbox);
  border: 2px solid var(--oe-sandbox-border);
  border-radius: var(--oe-radius-control);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  color: #fff;
  line-height: calc(var(--oe-touch) - 4px);
  white-space: nowrap;
  text-decoration: none;
}

a.email-sandbox-btn:hover,
a.email-sandbox-btn:focus {
  background-color: var(--oe-sandbox-hover);
  color: #fff;
  text-decoration: none;
}

.email-sandbox-btn .fa-flask {
  flex: none;
  font-size: 16px;
}

.email-sandbox-btn .email-sandbox-label {
  flex: none;
  font-family: var(--oe-font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.email-sandbox-btn .email-sandbox-to {
  flex: 1 1 0;
  min-width: 3em;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
}

/* The one-line notice on the Dashboard and the Mail Queue */
.email-sandbox-notice {
  background-color: #FFF4E6;
  border: 1px solid var(--oe-sandbox);
  border-left-width: 6px;
  color: #7A3A00;
}

/* Sign-in pages: fixed at the top centre */
.oe-auth-page .email-sandbox-btn {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 1030;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
}

@media (max-width: 991.98px) {
  .email-sandbox-btn {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    height: auto;
    min-width: min-content; /* never narrower than "SANDBOX" (the address may wrap anywhere) */
    min-height: 40px;
    max-width: 55%;
    margin: 0;
    padding: 3px 10px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  .email-sandbox-btn .fa-flask,
  .email-sandbox-btn .email-sandbox-sep {
    display: none;
  }

  .email-sandbox-btn .email-sandbox-label {
    font-size: 15px;
    letter-spacing: 1.2px;
    overflow-wrap: normal;
  }

  .email-sandbox-btn .email-sandbox-to {
    display: block;
    flex: none;
    min-width: 0;
    font-size: 11px;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  /* sign-in pages: the button uses the page width, centred; the content starts below it */
  .oe-auth-page .email-sandbox-btn {
    right: 12px;
    left: 12px;
    width: -moz-fit-content;
    width: fit-content;
    max-width: none;
    margin: 0 auto;
    transform: none;
  }

  .email-sandbox-btn + .form-signin {
    padding-top: 3.5rem;
  }
}

/* ------------------------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--oe-radius-control);
  font-family: var(--oe-font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.btn .fas,
.btn .far,
.btn .oe-icon {
  vertical-align: -2px;
}

.btn .oe-icon {
  vertical-align: -3px;
}

/* icon + label: the gap above (the space between them is dropped in a flex box) */
.btn > .oe-icon,
.btn > .fas,
.btn > .far {
  flex: none;
}

.btn-block {
  display: flex;
}

.btn:focus,
.btn.focus {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.btn.disabled,
.btn:disabled {
  opacity: .55;
}

.btn-sm,
.btn-group-sm > .btn {
  padding: 6px 12px;
  border-radius: var(--oe-radius-control);
  font-size: 13px;
  line-height: 20px;
}

.btn-lg,
.btn-group-lg > .btn {
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 24px;
}

.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--oe-accent);
  border-color: var(--oe-accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
  background-color: var(--oe-accent-hover);
  border-color: var(--oe-accent-hover);
  color: #fff;
}

.btn-primary.disabled,
.btn-primary:disabled {
  background-color: var(--oe-accent);
  border-color: var(--oe-accent);
}

.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus,
.btn-primary:focus {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

/* Secondary: white with a #D5D2C9 border (every outline / light / secondary variant) */
.btn-secondary,
.btn-outline-secondary,
.btn-light,
.btn-outline-primary,
.btn-outline-dark,
.btn-outline-info,
.btn-outline-light,
.btn-info {
  background-color: var(--oe-surface);
  border-color: var(--oe-control-border);
  color: var(--oe-text);
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-light:hover,
.btn-outline-primary:hover,
.btn-outline-dark:hover,
.btn-outline-info:hover,
.btn-outline-light:hover,
.btn-info:hover,
.btn-secondary:focus,
.btn-outline-secondary:focus,
.btn-light:focus,
.btn-outline-primary:focus,
.btn-outline-dark:focus,
.btn-outline-info:focus,
.btn-outline-light:focus,
.btn-info:focus {
  background-color: var(--oe-surface-alt);
  border-color: #BDB9AE;
  color: var(--oe-text);
}

.btn-secondary:not(:disabled):not(.disabled):active,
.btn-secondary:not(:disabled):not(.disabled).active,
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled).active,
.btn-light:not(:disabled):not(.disabled):active,
.btn-light:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-dark:not(:disabled):not(.disabled):active,
.btn-outline-dark:not(:disabled):not(.disabled).active,
.btn-outline-info:not(:disabled):not(.disabled):active,
.btn-outline-info:not(:disabled):not(.disabled).active,
.show > .btn-secondary.dropdown-toggle,
.show > .btn-outline-secondary.dropdown-toggle,
.show > .btn-light.dropdown-toggle {
  background-color: var(--oe-chip);
  border-color: #BDB9AE;
  color: var(--oe-text);
  box-shadow: none;
}

.btn-secondary.disabled, .btn-secondary:disabled,
.btn-outline-secondary.disabled, .btn-outline-secondary:disabled,
.btn-light.disabled, .btn-light:disabled,
.btn-outline-primary.disabled, .btn-outline-primary:disabled {
  background-color: var(--oe-surface);
  border-color: var(--oe-control-border);
  color: var(--oe-muted);
}

/* Dark ("Filter", "Upload") */
.btn-ink,
.btn-dark,
.btn-ink:not(:disabled):not(.disabled):active,
.btn-dark:not(:disabled):not(.disabled):active {
  background-color: var(--oe-ink);
  border-color: var(--oe-ink);
  color: #fff;
}

.btn-ink:hover, .btn-ink:focus,
.btn-dark:hover, .btn-dark:focus {
  background-color: var(--oe-ink-2);
  border-color: var(--oe-ink-2);
  color: #fff;
}

/* Approve */
.btn-success,
.btn-success:not(:disabled):not(.disabled):active {
  background-color: var(--oe-green-fg);
  border-color: var(--oe-green-fg);
  color: #fff;
}

.btn-success:hover, .btn-success:focus {
  background-color: #185638;
  border-color: #185638;
  color: #fff;
}

.btn-outline-success {
  background-color: var(--oe-surface);
  border-color: var(--oe-green-line);
  color: var(--oe-green-fg);
}

.btn-outline-success:hover, .btn-outline-success:focus,
.btn-outline-success:not(:disabled):not(.disabled):active {
  background-color: var(--oe-green-bg);
  border-color: var(--oe-green-line);
  color: var(--oe-green-fg);
}

/* Destructive: white, red text, red-tinted border (Delete, Reject) */
.btn-danger,
.btn-outline-danger {
  background-color: var(--oe-surface);
  border-color: var(--oe-red-line);
  color: var(--oe-red-fg);
}

.btn-danger:hover, .btn-danger:focus,
.btn-outline-danger:hover, .btn-outline-danger:focus,
.btn-danger:not(:disabled):not(.disabled):active,
.btn-outline-danger:not(:disabled):not(.disabled):active,
.btn-outline-danger:not(:disabled):not(.disabled).active {
  background-color: var(--oe-red-bg);
  border-color: #E0A9A2;
  color: var(--oe-red-fg);
}

.btn-danger:disabled, .btn-outline-danger:disabled {
  background-color: var(--oe-surface);
  color: var(--oe-red-fg);
}

/* Caution (Deactivate) */
.btn-warning,
.btn-outline-warning {
  background-color: var(--oe-surface);
  border-color: var(--oe-amber-line);
  color: var(--oe-amber-fg);
}

.btn-warning:hover, .btn-warning:focus,
.btn-outline-warning:hover, .btn-outline-warning:focus,
.btn-warning:not(:disabled):not(.disabled):active,
.btn-outline-warning:not(:disabled):not(.disabled):active {
  background-color: var(--oe-amber-bg);
  border-color: var(--oe-amber-line);
  color: var(--oe-amber-fg);
}

.btn-danger:focus, .btn-outline-danger:focus,
.btn-success:focus, .btn-outline-success:focus,
.btn-warning:focus, .btn-outline-warning:focus,
.btn-secondary:focus, .btn-outline-secondary:focus, .btn-light:focus,
.btn-outline-primary:focus, .btn-dark:focus, .btn-ink:focus {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.btn-link {
  color: var(--oe-accent);
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover,
.btn-link:focus {
  color: var(--oe-accent-hover);
  text-decoration: underline;
  box-shadow: none;
}

.btn-link.text-danger {
  color: var(--oe-accent-hover) !important;
}

.btn-block + .btn-block {
  margin-top: 10px;
}

.oe-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--oe-control-h);
  height: var(--oe-control-h);
  padding: 0;
}

.btn-sm.oe-btn-icon {
  width: 34px;
  height: 34px;
}

.close {
  color: var(--oe-text);
  opacity: .45;
  text-shadow: none;
}

.close:hover {
  color: var(--oe-text);
  opacity: .8;
}

@media (max-width: 767.98px) {
  /* 44px touch targets */
  .btn {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .btn-sm,
  .btn-group-sm > .btn {
    padding-top: 9px;
    padding-bottom: 9px;
    min-height: 40px;
  }

  .btn-lg {
    padding-top: 13px;
    padding-bottom: 13px;
  }
}

/* ------------------------------------------------------------------------------------------
 * Forms: 40px controls, 8px radius, accent focus ring (44px, 16px text on phones)
 * ------------------------------------------------------------------------------------------ */

label {
  margin-bottom: 6px;
}

.form-group > label:not(.form-check-label),
.col-form-label,
.oe-label {
  color: var(--oe-text-2);
  font-size: 13px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-control,
.form-control-sm,
.custom-select,
.custom-select-sm {
  height: var(--oe-control-h);
  padding: 0 12px;
  border: 1px solid var(--oe-control-border);
  border-radius: var(--oe-radius-control);
  background-color: var(--oe-surface);
  color: var(--oe-text);
  font-family: var(--oe-font-body);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.form-control-lg {
  height: 50px;
  padding: 0 14px;
  border-radius: var(--oe-radius-control);
  font-size: 16px;
}

textarea.form-control,
textarea.form-control-sm,
textarea.form-control-lg,
select.form-control[multiple],
select.form-control[size] {
  height: auto;
  padding: 10px 12px;
  line-height: 1.45;
}

.form-control:focus,
.custom-select:focus {
  border-color: var(--oe-accent);
  box-shadow: 0 0 0 3px var(--oe-focus);
  color: var(--oe-text);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--oe-surface-alt);
  color: var(--oe-muted);
}

.form-control-plaintext {
  color: var(--oe-text);
}

select.form-control:not([multiple]):not([size]),
.custom-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B5E66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

select.form-control::-ms-expand {
  display: none;
}

input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
  padding-right: 8px;
}

input[type="file"].form-control-file {
  font-size: 13px;
}

.form-control.is-invalid,
.was-validated .form-control:invalid,
.custom-select.is-invalid {
  border-color: var(--oe-accent);
  background-image: none;
  padding-right: 12px;
}

select.form-control.is-invalid:not([multiple]):not([size]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B5E66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  padding-right: 34px;
}

.form-control.is-invalid:focus {
  border-color: var(--oe-accent);
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.invalid-feedback {
  color: var(--oe-accent-hover);
  font-size: 12px;
  font-weight: 500;
}

.form-text,
small.form-text {
  color: var(--oe-muted) !important;
  font-size: 12px;
}

.req-star {
  color: var(--oe-accent);
  font-weight: 700;
}

.input-group-text {
  padding: 0 12px;
  border-color: var(--oe-control-border);
  border-radius: var(--oe-radius-control);
  background-color: var(--oe-surface-alt);
  color: var(--oe-muted);
  font-size: 14px;
}

.input-group-sm > .form-control:not(textarea),
.input-group-sm > .custom-select,
.input-group-sm > .input-group-prepend > .input-group-text,
.input-group-sm > .input-group-append > .input-group-text,
.input-group-sm > .input-group-prepend > .btn,
.input-group-sm > .input-group-append > .btn {
  height: var(--oe-control-h);
  font-size: 14px;
  border-radius: var(--oe-radius-control);
}

.input-group > .input-group-append > .btn,
.input-group > .input-group-prepend > .btn {
  padding-top: 0;
  padding-bottom: 0;
  line-height: calc(var(--oe-control-h) - 2px);
}

.input-group-sm > .input-group-prepend > .btn,
.input-group-sm > .input-group-append > .btn {
  line-height: calc(var(--oe-control-h) - 2px);
}

.input-group > .form-control:not(:last-child),
.input-group > .custom-select:not(:last-child),
.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-prepend > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .custom-select:not(:first-child),
.input-group > .input-group-append > .input-group-text,
.input-group > .input-group-append > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.custom-control-label::before {
  border-color: var(--oe-control-border);
}

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--oe-accent);
  border-color: var(--oe-accent);
}

.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
  border-color: var(--oe-accent);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--oe-green-fg);
  border-color: var(--oe-green-fg);
}

.form-check-label {
  font-size: 14px;
}

fieldset legend {
  color: var(--oe-text-2);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .form-control,
  .form-control-sm,
  .custom-select,
  .custom-select-sm,
  .input-group-sm > .form-control:not(textarea),
  .input-group-sm > .input-group-prepend > .input-group-text,
  .input-group-sm > .input-group-append > .input-group-text {
    height: var(--oe-touch);
    font-size: 16px;
  }

  .input-group-sm > .input-group-prepend > .btn,
  .input-group-sm > .input-group-append > .btn,
  .input-group > .input-group-append > .btn,
  .input-group > .input-group-prepend > .btn {
    height: var(--oe-touch);
    line-height: calc(var(--oe-touch) - 2px);
  }

  textarea.form-control,
  textarea.form-control-sm {
    height: auto;
  }
}

/* ------------------------------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------------------------------ */

.card,
.oe-card {
  position: relative;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background-color: var(--oe-surface);
  box-shadow: none;
}

.oe-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card > .list-group:first-child .list-group-item:first-child {
  border-top-left-radius: calc(var(--oe-radius-card) - 1px);
  border-top-right-radius: calc(var(--oe-radius-card) - 1px);
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--oe-divider);
  background-color: var(--oe-surface);
  font-weight: 600;
}

.card-header:first-child {
  border-radius: calc(var(--oe-radius-card) - 1px) calc(var(--oe-radius-card) - 1px) 0 0;
}

.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6,
.card-header .card-title {
  margin: 0;
  font-size: 17px;
}

.card-body,
.oe-card-body {
  padding: 20px;
}

.card-title,
.oe-card-title {
  margin-bottom: 12px;
  font-family: var(--oe-font-display);
  font-size: 17px;
  font-weight: 700;
}

.card-subtitle {
  color: var(--oe-muted) !important;
}

.card-footer,
.oe-card-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--oe-divider);
  background-color: var(--oe-surface-alt);
}

.card-footer:last-child,
.oe-card-foot:last-child {
  border-radius: 0 0 calc(var(--oe-radius-card) - 1px) calc(var(--oe-radius-card) - 1px);
}

.oe-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--oe-divider);
}

.oe-card-head h2, .oe-card-head h3, .oe-card-head h4, .oe-card-head .oe-card-title {
  margin: 0;
  font-family: var(--oe-font-display);
  font-size: 17px;
  font-weight: 700;
}

.oe-card-sub {
  margin: 3px 0 0;
  color: var(--oe-muted);
  font-size: 12.5px;
}

/* a table (or its scroll box) that ends a card keeps the card's rounded bottom corners */
.card > .table-responsive:last-child,
.oe-card > .table-responsive:last-child {
  border-bottom-right-radius: calc(var(--oe-radius-card) - 1px);
  border-bottom-left-radius: calc(var(--oe-radius-card) - 1px);
}

.card > .table:last-child > :last-child > tr:last-child > :first-child,
.oe-card > .table:last-child > :last-child > tr:last-child > :first-child {
  border-bottom-left-radius: calc(var(--oe-radius-card) - 1px);
}

.card > .table:last-child > :last-child > tr:last-child > :last-child,
.oe-card > .table:last-child > :last-child > tr:last-child > :last-child {
  border-bottom-right-radius: calc(var(--oe-radius-card) - 1px);
}

@media (max-width: 767.98px) {
  .card-body,
  .oe-card-body {
    padding: 16px;
  }

  .card-header,
  .oe-card-head,
  .card-footer,
  .oe-card-foot {
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* ------------------------------------------------------------------------------------------
 * Tables: caps header row (12px 600 muted, letter-spaced), row dividers, hover
 * ------------------------------------------------------------------------------------------ */

.table {
  color: var(--oe-text);
  font-size: 14px;
}

/* The scroll box is the containing block of what is absolutely positioned inside it (the
   .sr-only labels of icon buttons and header cells), so those are clipped with the table instead
   of widening the page on phones */
.table-responsive {
  position: relative;
}

.table th,
.table td {
  padding: 12px 16px;
  border-top: 1px solid var(--oe-divider);
  vertical-align: middle;
}

.table thead th {
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 0;
  border-bottom: 1px solid var(--oe-divider);
  background-color: var(--oe-surface-alt);
  color: var(--oe-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.table thead th a {
  color: inherit;
}

.table tbody + tbody {
  border-top: 1px solid var(--oe-divider);
}

.table tfoot td,
.table tfoot th {
  border-top: 1px solid var(--oe-border);
  font-weight: 600;
}

.table-sm th,
.table-sm td {
  padding: 8px 12px;
}

.table-sm thead th {
  padding-top: 8px;
  padding-bottom: 8px;
}

.table-hover tbody tr:hover {
  background-color: var(--oe-surface-alt);
  color: var(--oe-text);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--oe-surface-alt);
}

.table-bordered,
.table-bordered th,
.table-bordered td {
  border-color: var(--oe-divider);
}

.table-active,
.table-active > td,
.table-active > th,
.table-hover .table-active:hover,
.table-hover .table-active:hover > td {
  background-color: var(--oe-chip);
}

.table-danger,
.table-danger > td,
.table-danger > th {
  background-color: var(--oe-red-bg);
}

.table-warning,
.table-warning > td,
.table-warning > th {
  background-color: var(--oe-amber-bg);
}

.table-success,
.table-success > td,
.table-success > th {
  background-color: var(--oe-green-bg);
}

.table-info,
.table-info > td,
.table-info > th {
  background-color: var(--oe-blue-bg);
}

.table-light,
.table-light > td,
.table-light > th {
  background-color: var(--oe-surface-alt);
}

.table td.text-right,
.table th.text-right,
.table .oe-num {
  font-variant-numeric: tabular-nums;
}

/* A table flush with the edge of its card: the outer cells get the card's 20-22px padding */
.oe-table th:first-child, .oe-table td:first-child,
.card > .table th:first-child, .card > .table td:first-child,
.card > .table-responsive > .table th:first-child, .card > .table-responsive > .table td:first-child,
.oe-card > .table th:first-child, .oe-card > .table td:first-child,
.oe-card > .table-responsive > .table th:first-child, .oe-card > .table-responsive > .table td:first-child,
.card-body.p-0 > .table th:first-child, .card-body.p-0 > .table td:first-child,
.card-body.p-0 > .table-responsive > .table th:first-child, .card-body.p-0 > .table-responsive > .table td:first-child {
  padding-left: 22px;
}

.oe-table th:last-child, .oe-table td:last-child,
.card > .table th:last-child, .card > .table td:last-child,
.card > .table-responsive > .table th:last-child, .card > .table-responsive > .table td:last-child,
.oe-card > .table th:last-child, .oe-card > .table td:last-child,
.oe-card > .table-responsive > .table th:last-child, .oe-card > .table-responsive > .table td:last-child,
.card-body.p-0 > .table th:last-child, .card-body.p-0 > .table td:last-child,
.card-body.p-0 > .table-responsive > .table th:last-child, .card-body.p-0 > .table-responsive > .table td:last-child {
  padding-right: 22px;
}

.oe-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.card > .table,
.card > .table-responsive > .table,
.oe-card > .table,
.oe-card > .table-responsive > .table,
.oe-table {
  margin-bottom: 0;
}

.card > .table:last-child tr:last-child td,
.card > .table-responsive:last-child > .table tr:last-child td {
  border-bottom: 0;
}

.card > .table:first-child thead th:first-child,
.card > .table-responsive:first-child > .table thead th:first-child {
  border-top-left-radius: calc(var(--oe-radius-card) - 1px);
}

.card > .table:first-child thead th:last-child,
.card > .table-responsive:first-child > .table thead th:last-child {
  border-top-right-radius: calc(var(--oe-radius-card) - 1px);
}

/* tablesorter's default theme (inc/tablesorter.default.css): same look, arrows kept */
.table.tablesorter-default {
  margin: 0 0 1rem;
  background-color: transparent;
  color: var(--oe-text);
}

.table.tablesorter-default thead th,
.table.tablesorter-default thead .tablesorter-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--oe-divider);
  background-color: var(--oe-surface-alt);
  color: var(--oe-muted);
  font-weight: 600;
}

.table.tablesorter-default thead .tablesorter-header:not(.sorter-false) {
  padding-right: 26px;
  background-position: right 8px center;
}

.table.table-sm.tablesorter-default thead th,
.table.table-sm.tablesorter-default thead .tablesorter-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

.table.tablesorter-default thead .tablesorter-headerAsc,
.table.tablesorter-default thead .tablesorter-headerDesc {
  border-bottom: 1px solid var(--oe-divider);
  color: var(--oe-text);
}

.table.tablesorter-default tbody > tr:hover > td,
.table.tablesorter-default tbody > tr.hover > td,
.table.tablesorter-default tbody > tr.even:hover > td,
.table.tablesorter-default tbody > tr.odd:hover > td {
  border-top: 1px solid var(--oe-divider);
  border-bottom: 0;
}

.card > .table.tablesorter-default,
.card > .table-responsive > .table.tablesorter-default,
.oe-card > .table.tablesorter-default,
.oe-card > .table-responsive > .table.tablesorter-default,
.table.tablesorter-default.mb-0 {
  margin-bottom: 0;
}

/* Laptops (below 1400px, the 240px side menu leaves ~1000px): tighter columns, so the wide lists
   (event tabs, Events, Dashboard) fit their cards; the outer cells keep the card's padding */
@media (max-width: 1399.98px) {
  .table th,
  .table td,
  .table.tablesorter-default thead th,
  .table.tablesorter-default thead .tablesorter-header {
    padding-right: 10px;
    padding-left: 10px;
  }

  .table.tablesorter-default thead .tablesorter-header:not(.sorter-false) {
    padding-right: 24px;
  }

  .table-sm th,
  .table-sm td,
  .table.table-sm.tablesorter-default thead th,
  .table.table-sm.tablesorter-default thead .tablesorter-header {
    padding-right: 8px;
    padding-left: 8px;
  }

  .table.table-sm.tablesorter-default thead .tablesorter-header:not(.sorter-false) {
    padding-right: 22px;
  }
}

/* ------------------------------------------------------------------------------------------
 * Status pills (status_badge()) and Bootstrap badges
 * ------------------------------------------------------------------------------------------ */

.oe-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--oe-radius-pill);
  font-family: var(--oe-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: nowrap;
  vertical-align: middle;
}

.status-badge {
  font-size: 12px;
}

.oe-pill-green, .badge-success { background-color: var(--oe-green-bg); color: var(--oe-green-fg); }
.oe-pill-amber, .badge-warning { background-color: var(--oe-amber-bg); color: var(--oe-amber-fg); }
.oe-pill-grey, .badge-secondary { background-color: var(--oe-grey-bg); color: var(--oe-grey-fg); }
.oe-pill-red, .badge-danger { background-color: var(--oe-red-bg); color: var(--oe-red-fg); }
.oe-pill-blue, .badge-info, .badge-primary { background-color: var(--oe-blue-bg); color: var(--oe-blue-fg); }
.oe-pill-neutral, .badge-light { background-color: var(--oe-chip); color: var(--oe-text-2); }
.oe-pill-accent { background-color: var(--oe-accent); color: #fff; }
.oe-pill-ink, .badge-dark { background-color: var(--oe-ink); color: #fff; }
.oe-pill-orange { background-color: var(--oe-sandbox); color: #fff; letter-spacing: .8px; }

a.badge:hover,
a.oe-pill:hover {
  filter: brightness(.96);
  text-decoration: none;
}

.badge-pill {
  padding-right: 10px;
  padding-left: 10px;
}

.oe-pill .fas,
.oe-pill .oe-icon {
  font-size: 11px;
}

/* ------------------------------------------------------------------------------------------
 * Tabs, pills, section navigation
 * ------------------------------------------------------------------------------------------ */

.nav-tabs {
  gap: 4px;
  border-bottom: 1px solid var(--oe-border);
}

.nav-tabs .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 -1px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--oe-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  border-bottom-color: var(--oe-control-border);
  color: var(--oe-text);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  border-bottom-color: var(--oe-accent);
  background: transparent;
  color: var(--oe-text);
  font-weight: 600;
}

.nav-tabs .nav-link .fas,
.nav-tabs .nav-link .oe-icon {
  color: var(--oe-faint);
}

.nav-tabs .nav-link.active .fas,
.nav-tabs .nav-link.active .oe-icon {
  color: var(--oe-accent);
}

.nav-pills {
  gap: 8px;
}

.nav-pills .nav-link {
  margin: 0;
  padding: 7px 14px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-pill);
  background: var(--oe-surface);
  color: var(--oe-text);
  font-size: 13px;
  font-weight: 600;
}

.nav-pills .nav-link:hover {
  border-color: var(--oe-control-border);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  border-color: var(--oe-ink);
  background: var(--oe-ink);
  color: #fff;
}

.oe-section-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
}

.oe-section-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--oe-radius-control);
  color: var(--oe-text);
  font-size: 13.5px;
  text-decoration: none;
}

.oe-section-nav a:hover {
  background: var(--oe-surface-alt);
}

.oe-section-nav a.active,
.oe-section-nav a[aria-current] {
  background: var(--oe-ground);
  box-shadow: inset 3px 0 0 var(--oe-accent);
  font-weight: 600;
}

.oe-section-nav .oe-eyebrow {
  padding: 10px 10px 4px;
}

/* ------------------------------------------------------------------------------------------
 * Alerts (inline callouts; the one-time messages are the toasts above)
 * ------------------------------------------------------------------------------------------ */

.alert {
  padding: 12px 16px;
  border: 1px solid var(--oe-border);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.alert-danger { background-color: var(--oe-red-bg); border-color: #F0C9C4; color: var(--oe-red-fg); }
.alert-warning { background-color: var(--oe-amber-bg); border-color: #F2DDB0; color: var(--oe-amber-fg); }
.alert-success { background-color: var(--oe-green-bg); border-color: #C5E2CF; color: var(--oe-green-fg); }
.alert-info,
.alert-primary { background-color: var(--oe-blue-bg); border-color: #C9D7F5; color: var(--oe-blue-fg); }
.alert-light,
.alert-secondary { background-color: var(--oe-surface-alt); border-color: var(--oe-border); color: var(--oe-text-2); }
.alert-dark { background-color: var(--oe-ink); border-color: var(--oe-ink); color: #fff; }

.alert-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.alert-heading {
  font-size: 15px;
}

/* ------------------------------------------------------------------------------------------
 * Modals, dropdowns, pagination, list groups
 * ------------------------------------------------------------------------------------------ */

.modal-backdrop.show {
  background-color: var(--oe-ink);
  opacity: .5;
}

.modal-content {
  border: 0;
  border-radius: var(--oe-radius-card);
  box-shadow: 0 24px 60px rgba(20, 22, 27, .28);
}

.modal-header {
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--oe-divider);
}

.modal-title {
  font-family: var(--oe-font-display);
  font-size: 18px;
  font-weight: 700;
}

.modal-header .close {
  margin: -8px -8px -8px auto;
  padding: 8px 12px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--oe-divider);
  background: var(--oe-surface-alt);
  border-radius: 0 0 var(--oe-radius-card) var(--oe-radius-card);
}

.modal-footer > * {
  margin: 0;
}

.dropdown-menu {
  padding: 6px;
  border: 1px solid var(--oe-border);
  border-radius: 10px;
  box-shadow: var(--oe-shadow-pop);
  color: var(--oe-text);
  font-size: 14px;
}

.dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--oe-text);
}

.dropdown-item .fas,
.dropdown-item .far {
  margin-right: 4px;
  color: var(--oe-faint);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--oe-ground);
  color: var(--oe-text);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--oe-ink-2);
  color: #fff;
}

.dropdown-item-text {
  padding: 6px 12px;
}

.dropdown-divider {
  margin: 6px 0;
  border-top-color: var(--oe-divider);
}

.pagination {
  gap: 4px;
}

.page-link {
  min-width: 34px;
  margin-left: 0;
  padding: 6px 11px;
  border: 1px solid var(--oe-control-border);
  border-radius: var(--oe-radius-control);
  color: var(--oe-text);
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.page-item:first-child .page-link,
.page-item:last-child .page-link,
.pagination-sm .page-item:first-child .page-link,
.pagination-sm .page-item:last-child .page-link {
  border-radius: var(--oe-radius-control);
}

.pagination-sm .page-link {
  padding: 5px 10px;
  font-size: 13px;
}

.page-link:hover {
  border-color: #BDB9AE;
  background-color: var(--oe-surface-alt);
  color: var(--oe-text);
}

.page-link:focus {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.page-item.active .page-link {
  border-color: var(--oe-ink);
  background-color: var(--oe-ink);
  color: #fff;
}

.page-item.disabled .page-link {
  border-color: var(--oe-divider);
  background-color: var(--oe-surface);
  color: var(--oe-faint);
}

.list-group-item {
  padding: 12px 20px;
  border-color: var(--oe-divider);
  color: var(--oe-text);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background-color: var(--oe-surface-alt);
  color: var(--oe-text);
}

.list-group-item.active {
  border-color: var(--oe-divider);
  background: var(--oe-ground) !important;
  box-shadow: inset 3px 0 0 var(--oe-accent);
  color: var(--oe-text);
  font-weight: 600;
}

.progress {
  height: 6px;
  border-radius: 3px;
  background-color: var(--oe-divider);
}

.progress-bar {
  background-color: var(--oe-accent);
}

/* bootstrap-datepicker */
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.active,
.datepicker table tr td span.active {
  background: var(--oe-accent) !important;
  border-color: var(--oe-accent) !important;
  color: #fff !important;
  text-shadow: none;
}

.datepicker table tr td.today {
  background: var(--oe-amber-bg) !important;
}

/* ------------------------------------------------------------------------------------------
 * Bootstrap text / background / border utilities in the palette
 * ------------------------------------------------------------------------------------------ */

.text-muted { color: var(--oe-muted) !important; }
.text-danger { color: var(--oe-accent-hover) !important; }
.text-success { color: var(--oe-green-fg) !important; }
.text-warning { color: var(--oe-amber-fg) !important; }
.text-info { color: var(--oe-blue-fg) !important; }
.text-primary { color: var(--oe-accent) !important; }
.text-dark,
.text-body { color: var(--oe-text) !important; }
.text-secondary { color: var(--oe-text-2) !important; }

a.text-danger:hover,
a.text-primary:hover {
  color: var(--oe-accent-hover) !important;
}

.bg-light { background-color: var(--oe-surface-alt) !important; }
.bg-white { background-color: var(--oe-surface) !important; }
.bg-dark { background-color: var(--oe-ink) !important; }
.bg-danger { background-color: var(--oe-accent) !important; }
.bg-success { background-color: var(--oe-green-fg) !important; }
.bg-warning { background-color: var(--oe-amber-bg) !important; }

.border,
.border-top,
.border-right,
.border-bottom,
.border-left {
  border-color: var(--oe-border) !important;
}

.rounded {
  border-radius: var(--oe-radius-control) !important;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(20, 22, 27, .06) !important;
}

/* ------------------------------------------------------------------------------------------
 * .oe-* utilities for page views (documented at the top)
 * ------------------------------------------------------------------------------------------ */

.oe-muted { color: var(--oe-muted); }
.oe-faint { color: var(--oe-faint); }

.oe-meta {
  color: var(--oe-muted);
  font-size: 12px;
}

.oe-num {
  font-variant-numeric: tabular-nums;
}

.oe-figure {
  font-family: var(--oe-font-display);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.oe-code {
  color: var(--oe-text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.oe-eyebrow {
  display: block;
  color: var(--oe-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.oe-link {
  color: var(--oe-accent);
  font-weight: 600;
}

.oe-link:hover {
  color: var(--oe-accent-hover);
}

.oe-icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}

.oe-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
  color: var(--oe-text);
}

a.oe-kpi:hover {
  border-color: var(--oe-control-border);
  color: var(--oe-text);
  text-decoration: none;
}

.oe-kpi-label {
  color: var(--oe-muted);
  font-size: 13px;
  font-weight: 500;
}

.oe-kpi-value {
  font-family: var(--oe-font-display);
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.oe-kpi-value.is-accent {
  color: var(--oe-accent);
}

.oe-kpi-note {
  color: var(--oe-muted);
  font-size: 12px;
}

.oe-kpis,
.oe-grid-2,
.oe-grid-3,
.oe-grid-4,
.oe-grid-split {
  display: grid;
  gap: 20px;
  align-items: start;
}

.oe-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.oe-kpis.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* the dashboard without money: 3 tiles */
.oe-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.oe-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.oe-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.oe-grid-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

@media (max-width: 1199.98px) {
  .oe-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .oe-kpis,
  .oe-kpis.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oe-kpis.is-3 > :last-child { grid-column: 1 / -1; }   /* 3 tiles in 2 columns: no empty half row */
  .oe-grid-2,
  .oe-grid-3,
  .oe-grid-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
  .oe-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .oe-kpis { gap: 12px; }
  .oe-kpi { padding: 14px 16px; }
  .oe-kpi-value { font-size: 28px; }
}

.oe-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.oe-stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.oe-stack-lg { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.oe-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--oe-divider);
  color: var(--oe-text);
}

.oe-list-row:last-child {
  border-bottom: 0;
}

a.oe-list-row:hover {
  background: var(--oe-surface-alt);
  color: var(--oe-text);
  text-decoration: none;
}

.oe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
}

.oe-toolbar > *,
.oe-toolbar .form-group {
  flex: 1 1 160px;
  min-width: 0;
  margin-bottom: 0;
}

.oe-toolbar > .btn,
.oe-toolbar > .oe-toolbar-actions {
  flex: 0 0 auto;
}

.oe-toolbar-actions {
  display: flex;
  gap: 8px;
}

.oe-toolbar label,
.oe-toolbar .form-group > label:not(.form-check-label) {
  color: var(--oe-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.oe-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--oe-muted);
  text-align: center;
}

.oe-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--oe-ground);
  color: var(--oe-faint);
}

.oe-empty-title {
  margin: 0;
  color: var(--oe-text);
  font-family: var(--oe-font-display);
  font-size: 16px;
  font-weight: 700;
}

.oe-empty p {
  max-width: 420px;
  margin: 0;
}

.oe-empty .btn {
  margin-top: 8px;
}

.oe-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
  overflow: hidden;
}

.oe-strip-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 20px;
  border-right: 1px solid var(--oe-divider);
  margin-right: -1px;
}

.oe-strip-label {
  color: var(--oe-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}

@media (max-width: 767.98px) {
  .oe-strip {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .oe-strip-cell {
    padding: 12px 14px;
    border-bottom: 1px solid var(--oe-divider);
    margin-bottom: -1px;
  }

  .oe-strip .oe-figure {
    font-size: 18px;
  }
}

.oe-progress {
  display: flex;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--oe-divider);
}

.oe-progress-bar {
  border-radius: 3px;
  background: var(--oe-accent);
}

.oe-dropzone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 2px dashed var(--oe-control-border);
  border-radius: 10px;
  background: var(--oe-surface-alt);
}

/* ------------------------------------------------------------------------------------------
 * Shared page patterns (documented at the top): segmented switch, filter bar with the labels
 * inside the controls, filter pills with counts, checkbox pills, label/value list, aside grids,
 * group header rows, compact report table, callouts, gap utilities
 * ------------------------------------------------------------------------------------------ */

/* Segmented switch: links (.active or aria-current) or labels around radio inputs */
.oe-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--oe-radius-control);
  background: var(--oe-chip);
}

.oe-seg > a,
.oe-seg > label,
.oe-seg > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--oe-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.oe-seg > a:hover,
.oe-seg > label:hover,
.oe-seg > button:hover {
  color: var(--oe-text);
  text-decoration: none;
}

.oe-seg > .active,
.oe-seg > [aria-current],
.oe-seg > [aria-pressed="true"],
.oe-seg > label:has(input:checked) {
  background: var(--oe-surface);
  box-shadow: 0 1px 2px rgba(20, 22, 27, .10);
  color: var(--oe-text);
  font-weight: 600;
}

.oe-seg > label:focus-within {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.oe-seg input {
  margin: 0;
  accent-color: var(--oe-accent);
}

.oe-seg-count {
  font-variant-numeric: tabular-nums;
}

.oe-seg > .active .oe-seg-count,
.oe-seg > [aria-current] .oe-seg-count {
  color: var(--oe-accent);
}

/* full-width, equal segments */
.oe-seg-block {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
}

.oe-seg-block > label {
  min-height: 34px;
  padding: 0 8px;
}

/* Filter bar (Staff, Users): search box and selects with their label inside the box */
.oe-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
}

.oe-filter-search,
.oe-filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--oe-control-h);
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--oe-control-border);
  border-radius: var(--oe-radius-control);
  background: var(--oe-surface);
  color: var(--oe-muted);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.oe-filter-search {
  flex: 0 1 300px;
  min-width: 200px;
}

.oe-filter-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--oe-text);
  font-size: 14px;
}

.oe-filter-field {
  padding-right: 8px;
}

.oe-filter-field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 0;
  padding: 0 22px 0 0;
  border: 0;
  outline: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2317181C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 16px 16px;
  color: var(--oe-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.oe-filter-search:focus-within,
.oe-filter-field:focus-within {
  border-color: var(--oe-accent);
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.oe-filterbar .btn {
  height: var(--oe-control-h);
  padding-top: 0;
  padding-bottom: 0;
}

.oe-filterbar .oe-seg {
  height: var(--oe-control-h);
}

.oe-filterbar .oe-seg > * {
  min-height: 34px;
}

.oe-filter-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--oe-muted);
  font-size: 12px;
}

/* Filter pills with counts (Expenses status filter): links, .active = accent */
.oe-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.oe-filter-pills a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-control);
  background: var(--oe-surface);
  color: var(--oe-text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.oe-filter-pills a:hover {
  border-color: var(--oe-control-border);
  color: var(--oe-text);
  text-decoration: none;
}

.oe-filter-pills a.active {
  border-color: var(--oe-accent);
  background: var(--oe-accent);
  color: #fff;
}

/* a count chip next to a label (filter pills, segmented filters, group headers) */
.oe-count {
  padding: 0 7px;
  border-radius: var(--oe-radius-pill);
  background: var(--oe-chip);
  color: var(--oe-text-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.oe-count.is-amber { background: var(--oe-amber-bg); color: var(--oe-amber-fg); }
.oe-count.is-red { background: var(--oe-red-bg); color: var(--oe-red-fg); }

.oe-filter-pills a.active .oe-count {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

/* Checkbox pills (Reports status filter): labels around checkboxes */
.oe-check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.oe-check-pills label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--oe-control-h);
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-pill);
  background: var(--oe-surface-alt);
  color: var(--oe-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.oe-check-pills label:has(input:checked) {
  border-color: #BDB9AE;
  background: var(--oe-surface);
  color: var(--oe-text);
  font-weight: 600;
}

.oe-check-pills label:focus-within {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.oe-check-pills input {
  margin: 0;
  accent-color: var(--oe-accent);
}

/* white pill with a border ("No login") */
.oe-pill-outline {
  background: var(--oe-surface);
  box-shadow: inset 0 0 0 1px var(--oe-control-border);
  color: var(--oe-muted);
}

/* label / value list (dl.oe-dl > dt + dd) */
.oe-dl {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  font-size: 13px;
}

.oe-dl dt {
  color: var(--oe-muted);
  font-weight: 400;
}

.oe-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* an icon before a card title */
.oe-card-head h2 > .oe-icon:first-child,
.oe-card-head h3 > .oe-icon:first-child {
  margin-right: 10px;
  color: var(--oe-muted);
  vertical-align: -3px;
}

/* main column + fixed side column (--oe-aside-w, default 440px); one column below 1200px */
.oe-grid-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--oe-aside-w, 440px));
  gap: 20px;
  align-items: start;
}

/* the side column first (a section list, --oe-aside-w default 216px) */
.oe-grid-aside-start {
  display: grid;
  grid-template-columns: minmax(0, var(--oe-aside-w, 216px)) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1199.98px) {
  .oe-grid-aside,
  .oe-grid-aside-start {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* a header row that starts a group inside a table body (Travel types, Expense categories, report groups) */
.oe-group-row > th,
.oe-group-row > td {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border-top: 1px solid var(--oe-border) !important;
  background: var(--oe-surface-alt);
}

/* compact report table; .oe-zero = a faint zero */
.oe-table-compact {
  font-size: 13px;
}

.oe-table-compact tfoot td,
.oe-table-compact tfoot th {
  background: var(--oe-surface-alt);
}

.oe-zero {
  color: #A3A6AD;
}

/* callouts: the sandbox notes (Settings), a failed / problem row in a list */
.oe-callout-sandbox {
  border-color: #F8D9BC;
  border-radius: 10px;
  background: #FFF8F1;
  color: var(--oe-text-2);
}

.oe-callout-sandbox > :first-child {
  color: #7A3A00;
}

.table tbody tr.oe-row-alert > td,
.table tbody tr.oe-row-alert > th {
  background: #FFFBFA;
}

.table tbody tr.oe-row-alert > :first-child {
  box-shadow: inset 3px 0 0 var(--oe-red-fg);
}

/* flex / grid gaps (like Bootstrap 5): 4 / 8 / 12 / 16 / 20px */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 20px !important; }

.oe-min-0 { min-width: 0; }

/* a solid line icon (the dashboard's event-manager star) */
.oe-icon.oe-icon-fill { fill: currentColor; }

@media (max-width: 767.98px) {
  .oe-seg > a,
  .oe-seg > label,
  .oe-seg > button {
    min-height: 38px;
  }

  .oe-filterbar {
    gap: 8px;
    padding: 12px;
  }

  .oe-filter-search,
  .oe-filter-field,
  .oe-filterbar .oe-seg,
  .oe-filterbar .btn {
    height: var(--oe-touch);
  }

  .oe-filter-search { flex: 1 1 100%; }
  .oe-filter-field { flex: 1 1 auto; }
  .oe-filter-field select { flex: 1 1 auto; font-size: 16px; }
  .oe-filter-search input { font-size: 16px; }
  .oe-filter-note { margin-left: 0; }
  .oe-check-pills label { height: var(--oe-touch); }
}

/* ------------------------------------------------------------------------------------------
 * Files (view/partials/_attachments.php; "Event files" in Event.dc.html): a card with a header,
 * one row per file (type chip, name + Delete, meta + "Visible to staff" switch) and the upload
 * form; .oe-att-compact = a plain list of links inside another card (booking confirmations)
 * ------------------------------------------------------------------------------------------ */

.oe-att-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--oe-divider);
}

.oe-att-head > .oe-icon {
  flex: none;
  color: var(--oe-muted);
}

.oe-att-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--oe-font-display);
  font-size: 17px;
  font-weight: 700;
}

.oe-att-count {
  color: var(--oe-muted);
  font-size: 12px;
  white-space: nowrap;
}

.oe-att-empty {
  margin: 0;
  padding: 14px 18px;
  color: var(--oe-muted);
  font-size: 14px;
}

.oe-att-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.oe-att-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--oe-divider);
}

.oe-att-item:last-child {
  border-bottom: 0;
}

.oe-att-kind {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--oe-grey-bg);
  color: var(--oe-grey-fg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
}

.oe-att-kind-red { background: var(--oe-red-bg); color: var(--oe-red-fg); }
.oe-att-kind-blue { background: var(--oe-blue-bg); color: var(--oe-blue-fg); }
.oe-att-kind-green { background: var(--oe-green-bg); color: var(--oe-green-fg); }

.oe-att-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.oe-att-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.oe-att-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--oe-text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oe-att-name:hover {
  color: var(--oe-accent-hover);
}

.oe-att-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--oe-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.oe-att-line .post-button {
  flex: none;
}

.btn.oe-att-delete {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--oe-faint);
}

.btn.oe-att-delete:hover,
.btn.oe-att-delete:focus {
  background: var(--oe-red-bg);
  color: var(--oe-red-fg);
}

.oe-att-switch {
  flex: none;
  min-height: 0;
  font-size: 12px;
  font-weight: 600;
}

.oe-att-switch .custom-control-label {
  padding-top: 1px;
  white-space: nowrap;
}

/* upload form */
.oe-att-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--oe-divider);
}

.oe-att-upload .form-group {
  margin: 0;
}

.oe-att-upload label {
  margin-bottom: 4px;
  color: var(--oe-text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.oe-att-drop > label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.oe-att-drop > label > .oe-icon {
  flex: none;
  margin-top: 1px;
  color: var(--oe-muted);
}

.oe-att-hint {
  color: var(--oe-muted);
  font-weight: 400;
}

.oe-att-drop input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1.5px dashed var(--oe-control-border);
  border-radius: 10px;
  background: var(--oe-surface-alt);
  color: var(--oe-muted);
  font-size: 13px;
}

.oe-att-drop input[type="file"]:hover,
.oe-att-drop input[type="file"]:focus {
  border-color: #BDB9AE;
  outline: 0;
}

.oe-att-drop input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--oe-control-border);
  border-radius: var(--oe-radius-control);
  background: var(--oe-surface);
  color: var(--oe-text);
  font: 600 13px var(--oe-font-body);
  cursor: pointer;
}

/* Type | Description | Expires on one row where they fit (a narrow side column wraps Expires) */
.oe-att-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.oe-att-fields > .form-group {
  flex: 1 1 140px;
  min-width: 0;
}

.oe-att-fields > .oe-att-desc {
  flex: 2 1 190px;
}

.oe-att-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
}

.oe-att-actions > .custom-control {
  margin-right: auto;
}

.oe-att-actions .custom-control-label {
  color: var(--oe-text);
  font-size: 13px;
  font-weight: 400;
}

/* inside another card: just the links */
.oe-att-compact .oe-att-item {
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
}

.oe-att-compact .oe-att-kind {
  width: 28px;
  height: 22px;
  border-radius: 5px;
  font-size: 9px;
}

.oe-att-compact .oe-att-line + .oe-att-line,
.oe-att-compact .oe-att-empty {
  display: none;
}

@media (max-width: 767.98px) {
  .oe-att-head,
  .oe-att-empty,
  .oe-att-item,
  .oe-att-upload {
    padding-right: 16px;
    padding-left: 16px;
  }

  .oe-att-upload .btn {
    min-height: var(--oe-touch);
  }

  .btn.oe-att-delete {
    width: var(--oe-touch);
    height: var(--oe-touch);
    margin: -8px -10px -8px 0;
  }
}

/* ------------------------------------------------------------------------------------------
 * Error pages (view/errors/403.php, 404.php)
 * ------------------------------------------------------------------------------------------ */

.oe-error-card {
  align-items: center;
  max-width: 520px;
  padding: 36px 32px 32px;
  text-align: center;
}

.oe-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--oe-ground);
  color: var(--oe-muted);
}

.oe-error-icon-danger {
  background: var(--oe-red-bg);
  color: var(--oe-accent-hover);
}

.oe-error-title {
  margin: 0 0 8px;
  font-family: var(--oe-font-display);
  font-size: 24px;
  font-weight: 800;
}

.oe-error-text {
  max-width: 400px;
  margin: 0 0 20px;
  color: var(--oe-muted);
  font-size: 15px;
}

.oe-auth .oe-error-card {
  align-items: flex-start;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

/* ------------------------------------------------------------------------------------------
 * Sign-in pages (view/_auth_top.php; SignIn.dc.html)
 * ------------------------------------------------------------------------------------------ */

.oe-auth-page {
  min-height: 100vh;
  margin: 0;
  background: var(--oe-surface);
}

.oe-auth {
  display: flex;
  min-height: 100vh;
}

.oe-auth-aside {
  display: flex;
  flex-direction: column;
  flex: 0 0 43%;
  max-width: 620px;
  padding: 48px 64px;
  background: var(--oe-ink);
  color: var(--oe-ink-text);
}

.oe-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.oe-auth-brand .oe-brand-wordmark {
  height: 30px;
}

.oe-auth-brand .oe-brand-name {
  font-size: 24px;
}

.oe-auth-pitch {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
  gap: 20px;
  padding: 40px 0;
}

.oe-auth-pitch .oe-eyebrow {
  color: var(--oe-ink-muted);
  font-size: 12px;
  letter-spacing: 1.4px;
}

.oe-auth-headline {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: #fff;
  font-family: var(--oe-font-display);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.1;
}

.oe-auth-lead {
  margin: 0;
  color: var(--oe-ink-text);
  font-size: 17px;
  line-height: 1.5;
}

.oe-auth-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--oe-ink-3);
  list-style: none;
}

.oe-auth-features li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px 0;
  font-size: 13px;
  line-height: 1.4;
}

.oe-auth-features li:first-child {
  padding-left: 0;
}

.oe-auth-features li:last-child {
  padding-right: 0;
}

.oe-auth-features li + li {
  border-left: 1px solid var(--oe-ink-3);
}

.oe-auth-features .oe-icon {
  color: var(--oe-ink-muted);
}

.oe-auth-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.oe-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 0 auto;
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  padding: 48px 24px;
}

.oe-auth-mobile-brand {
  display: none;
}

.oe-auth-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.oe-auth-title {
  margin: 0;
  font-family: var(--oe-font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.15;
}

.oe-auth-text {
  margin: 0;
  color: var(--oe-muted);
  font-size: 15px;
  line-height: 1.5;
}

.oe-auth .form-group {
  margin-bottom: 16px;
}

.oe-auth .alert {
  margin-bottom: 16px;
  /* the Google refusals quote an address of any length; break it rather than overflow at 390px */
  overflow-wrap: anywhere;
}

.oe-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  margin-top: 8px;
}

.oe-auth-links {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.oe-auth-links .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--oe-touch);
}

.oe-auth-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--oe-border);
  border-radius: 10px;
  background: var(--oe-ground);
  color: var(--oe-text-2);
  font-size: 13px;
  line-height: 1.45;
}

.oe-auth-note .oe-icon {
  margin-top: 1px;
  color: var(--oe-muted);
}

/* Sign in with Google (view/login.php, Google sign-in spec §6): the "or" divider under the password
 * form, then Google's light button as its branding guidelines draw it — white, 1px #747775 border,
 * 4px corners, the four-colour G (20px), "Sign in with Google" in Roboto Medium 14px #1F1F1F, a
 * grey state layer on hover / press. Google's own colours on purpose, not the theme tokens. Full
 * width and 44px tall (a touch target), focus ring from :focus-visible. */
.oe-auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
  color: var(--oe-faint);
  font-size: 13px;
  line-height: 20px;
}

.oe-auth-or::before,
.oe-auth-or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--oe-border);
}

.oe-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #747775;
  border-radius: 4px;
  background-color: #FFFFFF;
  color: #1F1F1F;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: .25px;
  text-align: center;
  white-space: nowrap;
  transition: background-color .218s, border-color .218s, box-shadow .218s;
}

.oe-google-btn:hover,
.oe-google-btn:focus {
  color: #1F1F1F;
  text-decoration: none;
}

.oe-google-btn:hover {
  background-color: #EEEEEE;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.oe-google-btn:focus-visible,
.oe-google-btn:active {
  background-color: #E6E6E6;
}

.oe-google-g {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.oe-google-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.oe-auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 24px 28px;
  color: var(--oe-faint);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1199.98px) {
  .oe-auth-aside {
    padding: 40px 44px;
  }

  .oe-auth-headline {
    font-size: 38px;
  }
}

@media (max-width: 991.98px) {
  .oe-auth-aside {
    display: none;
  }

  .oe-auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
  }

  .oe-auth-mobile-brand .oe-brand-wordmark {
    height: 24px;
  }

  .oe-auth-mobile-brand .oe-brand-name {
    border-left-color: var(--oe-border);
    color: var(--oe-text);
  }

  .oe-auth-panel {
    justify-content: flex-start;
    padding-top: 40px;
  }
}

@media (max-width: 575.98px) {
  .oe-auth-panel {
    padding: 28px 20px 32px;
  }

  .oe-auth-title {
    font-size: 28px;
  }
}

/* ------------------------------------------------------------------------------------------
 * Install sheet (inc/app.js, PWA install + update spec §1): "Get the Canect Events app" — full
 * screen on a phone's first visit (any page, the sign-in pages too), and from the user menu's
 * "Install app" on any screen. The ink hero of the sign-in panel (the Canect C mark, eyebrow,
 * Archivo headline), then the three benefits, the one-tap Install button (Android / Chrome /
 * Edge) or the numbered iPhone guide (Share → Add to Home Screen → Add), and "Not now" /
 * "Don't ask again". From 768px a centred 440px card over a dimmed page. Targets are at least 44px.
 * The "Canect Events was updated." note after an update is an App.flash() toast (Messages above).
 * ------------------------------------------------------------------------------------------ */

html.oe-install-open,
html.oe-install-open body {
  overflow: hidden;
}

.oe-install-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 22, 27, .55);
  color: var(--oe-text);
  font-family: var(--oe-font-body);
}

.oe-install-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  background: var(--oe-surface);
  box-shadow: var(--oe-shadow-pop);
  animation: oe-install-in .24s ease-out;
}

.oe-install-panel:focus {
  outline: none;
}

.oe-install-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 26px;
  background: var(--oe-ink);
  color: var(--oe-ink-text);
}

.oe-install-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.oe-install-brand .oe-brand-mark {
  height: 34px;
}

.oe-install-brand .oe-brand-name {
  font-size: 20px;
}

.oe-install-hero .oe-eyebrow {
  color: var(--oe-ink-muted);
  letter-spacing: 1.4px;
}

.oe-install-title {
  margin: 0;
  color: #fff;
  font-family: var(--oe-font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.1;
  text-wrap: balance;   /* "Get the Canect / Events app", not a lone "app" on the second line */
}

.oe-install-lead {
  margin: 0;
  color: var(--oe-ink-text);
  font-size: 15px;
  line-height: 1.5;
}

.oe-install-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 24px 18px;
}

.oe-install-benefits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.oe-install-benefit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.oe-install-benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--oe-accent-soft);
  color: var(--oe-accent);
}

.oe-install-benefit-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--oe-muted);
  font-size: 14px;
  line-height: 1.4;
}

.oe-install-benefit-text strong {
  color: var(--oe-text);
  font-size: 15px;
  font-weight: 600;
}

.oe-install-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.oe-install-actions .btn-lg {
  min-height: 52px;
}

.oe-install-steps {
  margin: 0;
  padding: 2px 16px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface-alt);
  list-style: none;
}

.oe-install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  color: var(--oe-text-2);
  font-size: 15px;
  line-height: 1.45;
}

.oe-install-step + .oe-install-step {
  border-top: 1px solid var(--oe-divider);
}

.oe-install-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--oe-ink);
  color: #fff;
  font-family: var(--oe-font-display);
  font-size: 13px;
  font-weight: 700;
}

.oe-install-step-text b {
  color: var(--oe-text);
  font-weight: 600;
}

/* the Share and Add to Home Screen symbols, blue as on the iPhone */
.oe-install-inline {
  display: inline-flex;
  margin: 0 3px;
  color: var(--oe-blue-fg);
  vertical-align: -3px;
}

.oe-install-later {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
}

.oe-install-later .btn-link {
  min-height: var(--oe-touch);
  padding: 10px 14px;
  color: var(--oe-muted);
}

.oe-install-later .btn-link:hover,
.oe-install-later .btn-link:focus {
  color: var(--oe-text);
}

.oe-install-later .btn-link:focus {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

.oe-install-done {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--oe-green-line);
  border-radius: var(--oe-radius-card);
  background: var(--oe-green-bg);
  color: var(--oe-green-fg);
}

.oe-install-done p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

@keyframes oe-install-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .oe-install-panel {
    animation: none;
  }
}

/* Phones: the whole screen, the actions at the bottom within thumb reach */
@media (max-width: 767.98px) {
  .oe-install-sheet {
    align-items: stretch;
    padding: 0;
    background: var(--oe-surface);
  }

  .oe-install-panel {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .oe-install-hero {
    padding: calc(20px + env(safe-area-inset-top, 0px)) 22px 24px;
  }

  .oe-install-body {
    flex: 1 0 auto;
    padding: 22px 22px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .oe-install-actions {
    margin-top: auto;
  }
}

@media (max-width: 359.98px) {
  .oe-install-title {
    font-size: 26px;
  }
}

/* ------------------------------------------------------------------------------------------
 * Odds and ends from inc/style.css in the palette
 * ------------------------------------------------------------------------------------------ */

.file-picker-item {
  border-top-color: var(--oe-divider);
}

.file-picker-remove {
  color: var(--oe-accent-hover);
}

.file-picker-input:focus + .file-picker-btn {
  box-shadow: 0 0 0 3px var(--oe-focus);
}

/* Help page (inc/style.css .help-*): palette accents; the sticky contents and the anchors clear
   the 72px top bar */
.help-accent-start { --help-accent: var(--oe-blue-fg); }
.help-accent-staff { --help-accent: var(--oe-green-fg); }
.help-accent-planner { --help-accent: #5B3FA8; }
.help-accent-admin { --help-accent: var(--oe-ink); }

.help-hero {
  border-color: var(--oe-border);
  border-top-color: var(--oe-accent);
  border-radius: var(--oe-radius-card);
  background: var(--oe-surface);
}

.help-hero-icon {
  background: var(--oe-accent);
}

/* the guide chips and section bands use the line icons (ui_icon()) */
.help-chip .oe-icon {
  margin-top: -2px;
}

.help-title {
  font-family: var(--oe-font-display);
  font-weight: 800;
}

.help-toc,
.help-topic {
  border-color: var(--oe-border);
  border-radius: var(--oe-radius-card);
}

.help-section,
.help-topic {
  scroll-margin-top: calc(var(--oe-topbar-h) + var(--oe-viewas-h) + 12px);
}

@media (min-width: 992px) {
  .help-toc {
    top: calc(var(--oe-topbar-h) + 12px);
    max-height: calc(100vh - var(--oe-topbar-h) - 12px - 2.5rem);
  }
}

/* Phones: the top bar scrolls away; only the View-as bar (0px when not viewing) stays on top. */
@media (max-width: 767.98px) {
  .help-section,
  .help-topic {
    scroll-margin-top: calc(var(--oe-viewas-h) + 12px);
  }
}

/* ------------------------------------------------------------------------------------------
 * Event page (view/event.php and view/event/*.php; Event*.dc.html)
 * The event page shell (top-bar status form, budget strip) and its tabs: .oe-ev-* plus the tab
 * hooks the tests and inc/app.js use (.task-table, .inv-table, .es-blockers, .expense-table).
 * ------------------------------------------------------------------------------------------ */

.oe-ev-page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.oe-ev-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.oe-ev-body > .card, .oe-ev-body > .attachments, .oe-ev-body > .alert, .oe-ev-body > p { margin-bottom: 0; }

/* top bar: status change control, "more" menu */
.oe-ev-status { display: flex; align-items: center; height: 40px; margin: 0; border: 1px solid var(--oe-control-border); border-radius: 8px; background: var(--oe-surface); }
.oe-ev-status-label { margin: 0; padding: 0 2px 0 12px; color: var(--oe-muted); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.oe-ev-status-pick { position: relative; display: flex; align-items: center; }
.oe-ev-status-pick::before { content: ""; position: absolute; left: 10px; width: 8px; height: 8px; border-radius: 4px; background: currentColor; pointer-events: none; }
.oe-ev-status-select { height: 38px; padding: 0 30px 0 24px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; }
.oe-ev-status-select:focus { outline: 2px solid var(--oe-focus); outline-offset: -2px; }
.oe-ev-status-select option { color: var(--oe-text); }
.oe-ev-status-caret { position: absolute; right: 8px; color: var(--oe-muted); pointer-events: none; }
.oe-ev-status-btn { align-self: stretch; padding: 0 14px; border: 0; border-left: 1px solid var(--oe-control-border); border-radius: 0 7px 7px 0; background: var(--oe-surface-alt); color: var(--oe-text); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.oe-ev-status-btn:hover { background: var(--oe-ground); }
/* read-only status (not the event manager or an Admin): the value and a lock, the reason in title + sr-only */
.oe-ev-status.is-locked { cursor: help; }
.oe-ev-status-value { display: flex; align-items: center; height: 38px; padding: 0 30px 0 24px; font-size: 14px; font-weight: 600; }
.oe-ev-status-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; }
.oe-ev-status-note .oe-icon { flex: none; margin-top: 2px; }
.oe-ev-locked-value { display: flex; align-items: center; gap: 8px; min-height: 31px; font-weight: 600; }
.oe-ev-locked-icon { color: var(--oe-muted); }
.oe-ev-tone-green { color: var(--oe-green-fg); }
.oe-ev-tone-amber { color: var(--oe-amber-fg); }
.oe-ev-tone-grey { color: var(--oe-grey-fg); }
.oe-ev-tone-red { color: var(--oe-red-fg); }
.oe-ev-more .dropdown-menu { min-width: 260px; padding: 6px; }
.oe-ev-more .post-button { display: block !important; }
.oe-ev-more-note { margin: 4px 0 2px; padding: 0 12px 4px; color: var(--oe-muted); font-size: 12px; white-space: normal; }

/* budget strip */
.oe-ev-strip .oe-strip-cell { gap: 4px; }
/* .budget-label / .budget-value: the strip's hooks (tests read the figures by them) */
.oe-ev-strip .budget-label { display: block; color: var(--oe-muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.oe-ev-strip .budget-value { font-family: var(--oe-font-display); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.oe-ev-strip .is-accent .budget-value { color: var(--oe-accent); }
.oe-ev-strip .is-negative .budget-value { color: var(--oe-accent-hover); }
.oe-ev-strip .oe-meta { display: flex; align-items: center; gap: 5px; min-width: 0; }
.oe-ev-strip .oe-progress { flex: 1 1 auto; }
.oe-ev-strip .oe-strip-cell:last-child { border-right: 0; }

/* section header rows above a card: title + count left, buttons right */
.oe-ev-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.oe-ev-bar-title { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.oe-ev-bar-title h2 { margin: 0; font-family: var(--oe-font-display); font-size: 18px; font-weight: 700; }
.oe-ev-bar-title .oe-muted { font-size: 14px; }
.oe-ev-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.oe-ev-bar-actions > form { margin: 0; }
.oe-ev-bar-actions label { margin: 0; color: var(--oe-muted); font-size: 13px; font-weight: 500; }
.oe-ev-bar-actions select.form-control { width: auto; min-width: 170px; }

/* list tables in a card */
.oe-ev-card { overflow: hidden; }
.oe-ev-card > .table-responsive { margin: 0; }
.oe-ev-table { margin: 0; }
.oe-ev-table td { font-size: 14px; }
.oe-ev-table thead th { background: var(--oe-surface); }
.oe-ev-table tfoot td { padding-top: 14px; padding-bottom: 14px; background: var(--oe-surface-alt); }
.oe-ev-table .oe-ev-total { font-family: var(--oe-font-display); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.oe-ev-table .oe-ev-actions { width: 1%; white-space: nowrap; text-align: right; }
.oe-ev-actions > * { vertical-align: middle; }
.oe-ev-actions > * + * { margin-left: 6px; }
.oe-ev-actions .btn.oe-btn-icon { width: 32px; height: 32px; }
/* From 768px the row actions stay pinned to the right edge of the card when a list is wider than
   it (the table scrolls under them), so Edit / Delete / Remove are never cut off. The pinned cell
   gets the row's background (white here; the row rules — edited, overdue, pending — are more
   specific and win) and, while columns are hidden under it, a divider and a soft shadow on its
   left (a scroll-driven animation where supported: none once scrolled to the end or when the
   list fits; elsewhere the divider stays). */
@media (min-width: 768px) {
  .oe-ev-table td.oe-ev-actions,
  .oe-ev-table:has(td.oe-ev-actions) thead th:last-child { position: sticky; right: 0; z-index: 1; box-shadow: inset 1px 0 0 var(--oe-divider); }
  :where(.oe-ev-table td.oe-ev-actions) { background-color: var(--oe-surface); }
  /* an open "can't remove" list sits above the pinned cells of the rows below */
  .oe-ev-table td.oe-ev-actions:has(.es-blockers[open]) { z-index: 2; }
}
@supports (animation-timeline: scroll()) {
  @media (min-width: 768px) {
    .oe-ev-table td.oe-ev-actions,
    .oe-ev-table:has(td.oe-ev-actions) thead th:last-child { box-shadow: none; animation: oe-pinned-edge linear both; animation-timeline: scroll(nearest x); }
  }
}
@keyframes oe-pinned-edge {
  0%, 90% { box-shadow: inset 1px 0 0 var(--oe-divider), -8px 0 8px -8px rgba(20, 22, 27, .18); }
  100% { box-shadow: inset 1px 0 0 transparent, 0 0 0 0 transparent; }
}
.oe-ev-table .oe-ev-name { font-weight: 600; }
.oe-ev-sub { display: block; margin-top: 2px; color: var(--oe-muted); font-size: 12px; line-height: 1.4; }
.oe-ev-note { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; color: var(--oe-text-2); font-size: 12px; white-space: pre-line; }
.oe-ev-note .oe-icon { margin-top: 1px; }
.oe-ev-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--oe-chip); color: var(--oe-text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.oe-ev-tag { display: inline-block; padding: 1px 6px; border: 1px solid var(--oe-border); border-radius: 4px; background: var(--oe-surface); color: var(--oe-muted); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.oe-ev-mono { padding: 0 5px; border: 1px solid var(--oe-divider); border-radius: 4px; background: var(--oe-ground); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.oe-ev-group-title { display: inline-flex; align-items: center; gap: 10px; }
.oe-ev-group-title h3 { margin: 0; font-family: var(--oe-font-display); font-size: 15px; font-weight: 700; }
.oe-ev-add { display: inline-flex; align-items: center; gap: 3px; color: var(--oe-accent); font-size: 13px; font-weight: 600; }
.oe-ev-add:hover { color: var(--oe-accent-hover); }
.oe-ev-group-title .oe-icon { color: var(--oe-text-2); }
.oe-ev-bar-figures { flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.oe-ev-bar-sep { width: 1px; height: 32px; background: var(--oe-border); }
.oe-ev-mini { display: flex; flex-direction: column; gap: 2px; }
.oe-ev-mini-fig { font-family: var(--oe-font-display); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.oe-ev-pending, .oe-ev-table .oe-ev-pending { color: var(--oe-blue-fg); font-size: 12px; font-weight: 600; white-space: nowrap; }
.oe-ev-booking, .oe-ev-receipt { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.oe-ev-booking { border: 1px solid var(--oe-border); background: var(--oe-surface-alt); color: var(--oe-text-2); }
.oe-ev-booking:hover { border-color: var(--oe-control-border); color: var(--oe-text); text-decoration: none; }
.oe-ev-receipt { background: var(--oe-blue-bg); color: var(--oe-blue-fg); }
.expense-table tr.oe-ev-row-pending > td { background: #F7F9FE; }
.expense-table .oe-ev-actions .btn:not(.oe-btn-icon) { height: 32px; padding: 0 10px; line-height: 30px; }
/* laptops: Approve / Reject show their icons only (as on tablets; the title names them), so the
   pinned actions column stays narrow */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .expense-table .oe-ev-actions .btn > .d-lg-inline { display: none !important; }
}
.oe-ev-table tfoot .oe-ev-grand > td { font-size: 16px; }
.oe-ev-table tfoot .oe-ev-grand > td:first-child { font-family: var(--oe-font-display); font-weight: 700; }
.oe-ev-foot { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 0; }
.oe-ev-foot > * { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--oe-muted); font-size: 13px; }
.oe-ev-foot .oe-icon { margin-top: 2px; }
.oe-ev-foot .text-warning { color: var(--oe-amber-fg); }
.oe-ev-empty { padding: 20px; color: var(--oe-muted); }

/* segmented filter (Tasks): white box, ink active segment */
.oe-ev-seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 4px; border: 1px solid var(--oe-border); border-radius: 10px; background: var(--oe-surface); list-style: none; }
.oe-ev-seg a { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 7px; color: var(--oe-text-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.oe-ev-seg a:hover { background: var(--oe-ground); color: var(--oe-text); text-decoration: none; }
.oe-ev-seg a.active { background: var(--oe-ink); color: #fff; font-weight: 600; }
.oe-ev-seg a.active .oe-count { background: var(--oe-ink-3); color: #fff; }
.oe-ev-notice { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; margin: 0; padding: 4px 12px; border: 1px solid #F1DDB0; border-radius: 8px; background: #FFF6E3; color: var(--oe-amber-fg); font-size: 13px; }
.oe-ev-notice a { color: var(--oe-amber-fg); font-weight: 700; text-decoration: underline; }

/* card forms (add / edit) */
.oe-ev-form { max-width: 1040px; }
.oe-ev-form-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.oe-ev-form-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--oe-font-display); font-size: 17px; font-weight: 700; }
.oe-ev-form-head h2 .oe-icon { color: var(--oe-accent); }
.oe-ev-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.oe-ev-form-foot .post-button { margin-left: auto; }

/* Overview */
.oe-ev-overview { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.oe-ev-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.oe-ev-col > .card, .oe-ev-col > .attachments { margin-bottom: 0 !important; }
.oe-ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 20px; border-bottom: 1px solid var(--oe-divider); }
.oe-ev-head h2 { margin: 0; font-family: var(--oe-font-display); font-size: 17px; font-weight: 700; }
.oe-ev-head > .oe-icon { color: var(--oe-text-2); }
.oe-ev-head-meta { margin-left: auto; color: var(--oe-muted); font-size: 12px; }
.oe-ev-head-meta a { color: var(--oe-accent); font-weight: 600; }
.oe-ev-flag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--oe-divider); color: var(--oe-text-2); font-size: 12px; font-weight: 600; }
.oe-ev-text { padding: 14px 20px 16px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.oe-ev-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 20px; padding: 16px 20px 18px; font-size: 14px; }
.oe-ev-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.oe-ev-fact.is-wide { grid-column: span 2; }
.oe-ev-fact.is-full { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--oe-divider); }
.oe-ev-label { display: flex; align-items: center; gap: 8px; margin-bottom: 1px; color: var(--oe-muted); font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.oe-ev-label small { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.oe-ev-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.oe-ev-links a { display: inline-flex; align-items: center; gap: 6px; }
.oe-ev-links .oe-link { font-size: 13px; }
.oe-ev-notes { padding: 14px 20px 16px; border: 1px solid #F0DDB0; border-radius: 12px; background: #FFFDF6; }
.oe-ev-notes .oe-ev-notes-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.oe-ev-notes h2 { margin: 0; font-family: var(--oe-font-display); font-size: 15px; font-weight: 700; }
.oe-ev-notes .text-break { font-size: 14px; line-height: 1.55; }
.oe-ev-glance { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 14px 18px 16px; }
.oe-ev-tile { display: flex; flex-direction: column; gap: 2px; grid-column: span 2; min-width: 0; padding: 11px 13px; border: 1px solid var(--oe-divider); border-radius: 10px; background: var(--oe-surface-alt); color: var(--oe-text); }
.oe-ev-tile.is-half { grid-column: span 3; }
.oe-ev-tile.is-full { grid-column: 1 / -1; }   /* open tasks without the receipts tile (no access to money) */
.oe-ev-tile:hover { border-color: var(--oe-control-border); color: var(--oe-text); text-decoration: none; }
.oe-ev-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oe-ev-tile-top > span { display: flex; align-items: center; gap: 8px; }
.oe-ev-tile-top .oe-icon { color: var(--oe-faint); }
.oe-ev-tile-num { font-family: var(--oe-font-display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.oe-ev-tile-label { color: var(--oe-muted); font-size: 12.5px; }
.oe-ev-budget-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 20px 0; font-size: 13px; }
.oe-ev-budget-note { margin: 0; padding: 8px 20px 16px; color: var(--oe-muted); font-size: 12px; }

/* Staff: "can't remove" lock with the reasons */
.es-blockers { position: relative; display: inline-block; }
.es-blockers > summary { list-style: none; cursor: help; }
.es-blockers > summary::-webkit-details-marker { display: none; }
.es-blockers > summary.oe-btn-icon { border-color: var(--oe-border); background: var(--oe-ground); color: var(--oe-faint); }
.es-blockers[open] > ul { position: absolute; top: -6px; right: calc(100% + 8px); z-index: 5; width: 17rem; margin: 0; padding: 10px 12px 10px 28px; border: 1px solid var(--oe-border); border-radius: 8px; background: var(--oe-surface); box-shadow: var(--oe-shadow-pop); color: var(--oe-text); font-size: 12px; text-align: left; white-space: normal; }
.es-blockers-title { margin: 0 0 4px -16px; font-weight: 600; }

/* Tasks */
.task-table .task-check { min-height: 22px; padding-left: 22px; }
.task-table .task-check .custom-control-label::before,
.task-table .task-check .custom-control-label::after { top: 0; left: -22px; width: 22px; height: 22px; }
.task-table .task-check .custom-control-label::before { border: 1.5px solid #B9B5AA; border-radius: 6px; background: var(--oe-surface); }
.task-table .task-check .custom-control-input:checked ~ .custom-control-label::before { border-color: var(--oe-green-fg); background: var(--oe-green-fg); }
.task-table .task-done .task-title { color: var(--oe-muted); text-decoration: line-through; }
.task-table .task-done > td { color: var(--oe-faint); }
.task-table .task-done .oe-pill, .task-table .task-done .oe-avatar { opacity: .75; }
.task-table tr.table-danger > td { background: #FDF5F4; }
.task-table tr.table-danger > td:first-child { box-shadow: inset 3px 0 0 var(--oe-accent); }
.task-table .task-desc { display: block; max-width: 34rem; overflow: hidden; color: var(--oe-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.task-table tr.table-danger .task-due { color: var(--oe-red-fg); font-weight: 600; }
.oe-ev-owner { display: inline-flex; align-items: center; gap: 8px; }
.oe-ev-owner .oe-avatar { width: 26px; height: 26px; background: var(--oe-divider); color: var(--oe-text-2); font-size: 11px; }

/* Inventory */
.oe-ev-totals { display: inline-flex; flex-wrap: wrap; align-items: center; min-height: 44px; padding: 0 6px; border: 1px solid var(--oe-border); border-radius: 10px; background: var(--oe-surface); }
.oe-ev-totals > span { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; color: var(--oe-muted); font-size: 13px; }
.oe-ev-totals > span + span { border-left: 1px solid var(--oe-divider); }
.oe-ev-totals .inv-fig { color: var(--oe-text); font-family: var(--oe-font-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.oe-ev-totals .inv-fig.text-danger, .oe-ev-totals .inv-fig.text-primary { color: var(--oe-accent) !important; }
.inv-table .inv-qty { width: 72px; height: 34px; padding: 0 10px; text-align: right; font-variant-numeric: tabular-nums; }
.inv-table .inv-save { width: 34px; height: 34px; color: var(--oe-green-fg); }
.inv-table .js-inv-remainder { font-weight: 700; }
.inv-table .js-inv-remainder.is-zero { color: var(--oe-faint); font-weight: 400; }
.inv-transport { display: flex; align-items: flex-start; gap: 6px; }
.inv-transport .oe-icon { margin-top: 2px; color: var(--oe-muted); }

/* History timeline */
.oe-ev-timeline { margin: 0; padding: 14px 0 4px; list-style: none; }
.oe-ev-tl-item { display: grid; grid-template-columns: 96px 20px minmax(0, 1fr); gap: 0 14px; padding: 0 22px; }
.oe-ev-tl-when { display: flex; flex-direction: column; gap: 1px; padding: 12px 0; }
.oe-ev-tl-day { font-size: 13px; font-weight: 600; }
.oe-ev-tl-time { color: var(--oe-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.oe-ev-tl-rail { position: relative; display: flex; justify-content: center; }
.oe-ev-tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 9px; width: 2px; background: var(--oe-divider); }
.oe-ev-tl-dot { position: relative; width: 12px; height: 12px; margin-top: 16px; border: 3px solid var(--oe-faint); border-radius: 6px; background: var(--oe-surface); }
.oe-ev-tl-dot.is-badge-success { border-color: var(--oe-green-fg); }
.oe-ev-tl-dot.is-badge-info { border-color: var(--oe-blue-fg); }
.oe-ev-tl-dot.is-badge-danger { border-color: var(--oe-red-fg); }
.oe-ev-tl-dot.is-badge-warning { border-color: var(--oe-amber-fg); }
.oe-ev-tl-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 11px 0; border-bottom: 1px solid var(--oe-divider); }
.oe-ev-tl-item.is-last-of-day .oe-ev-tl-body { border-bottom: 0; }
.oe-ev-tl-item.is-day-start { border-top: 1px solid var(--oe-divider); }
.oe-ev-tl-item.is-day-start:first-child { border-top: 0; }
.oe-ev-tl-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.oe-ev-tl-line .oe-avatar { width: 24px; height: 24px; background: var(--oe-divider); color: var(--oe-text-2); font-size: 10px; }
.oe-ev-tl-line .badge { font-size: 12px; }
.oe-ev-tl-entity { font-weight: 600; }
.oe-ev-tl-changes { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0 0 0 32px; list-style: none; font-size: 13px; }
.oe-ev-tl-changes > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.oe-ev-tl-field { flex: 0 0 160px; color: var(--oe-muted); }
.oe-ev-tl-old { color: var(--oe-muted); }
.oe-ev-tl-changes .oe-icon { align-self: center; color: var(--oe-faint); }
.oe-ev-tl-summary { padding-left: 32px; color: var(--oe-muted); font-size: 13px; }
.oe-ev-tl-summary .text-dark { color: var(--oe-text) !important; }
.oe-ev-tl-changes details { flex: 1 1 100%; }
.oe-ev-tl-changes summary { display: inline; color: var(--oe-blue-fg); font-weight: 600; cursor: pointer; }
.oe-ev-pages { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.oe-ev-pages .page-link { min-width: 32px; height: 32px; padding: 0 10px; line-height: 30px; }

@media (max-width: 1199.98px) {
  .oe-ev-overview { grid-template-columns: minmax(0, 1fr); }
}
/* tablets: the top bar keeps one row, so the Overview actions drop their visible labels (still read out) */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .oe-ev-hide-md, .oe-ev-status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .oe-topbar-actions .btn .oe-icon:first-child { margin-right: 0; }
}
@media (max-width: 767.98px) {
  .oe-ev-page { gap: 16px; }
  .oe-ev-strip .budget-value { font-size: 18px; }
  .oe-ev-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 16px; }
  .oe-ev-fact.is-wide { grid-column: 1 / -1; }
  .oe-ev-head, .oe-ev-text { padding-right: 16px; padding-left: 16px; }
  .oe-ev-glance { padding: 12px 14px 14px; }
  .oe-ev-tile, .oe-ev-tile.is-half { grid-column: span 3; }
  .oe-ev-tile.is-full { grid-column: span 3; }   /* open tasks shares the row with item lines */
  .oe-ev-bar-actions { margin-left: 0; }
  .oe-ev-notice { flex: 1 1 100%; }
  .oe-ev-seg { display: flex; flex-wrap: nowrap; width: 100%; }
  .oe-ev-seg > li { flex: 1 1 auto; }
  .oe-ev-seg a { justify-content: center; gap: 6px; width: 100%; padding: 0 6px; }
  .oe-ev-tl-item { grid-template-columns: 64px 16px minmax(0, 1fr); gap: 0 10px; padding: 0 14px; }
  .oe-ev-tl-rail::before { left: 7px; }
  .oe-ev-tl-changes, .oe-ev-tl-summary { padding-left: 0; }
  .oe-ev-tl-field { flex-basis: 100%; }
  .oe-ev-status { flex: 1 1 auto; }
  .oe-ev-status-pick { flex: 1 1 auto; }
  .oe-ev-status-select { width: 100%; }
}

/* ------------------------------------------------------------------------------------------
 * Events list (view/events.php; Events.dc.html)
 * Upcoming events first, then a "Past events" label row, then past events.
 * ------------------------------------------------------------------------------------------ */

.ev-page { display: flex; flex-direction: column; gap: 20px; }
.ev-page .oe-toolbar { margin: 0; }
.ev-page .oe-toolbar > .form-group { flex: 1 1 118px; }
.ev-search { position: relative; flex: 1.6 1 200px !important; }
.ev-search .oe-icon { position: absolute; bottom: 11px; left: 12px; color: var(--oe-faint); pointer-events: none; }
.ev-search input { padding-left: 36px; }
.ev-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.ev-card { overflow: hidden; }
.ev-table { margin: 0; }
.ev-table thead th { background: var(--oe-surface); }
.ev-table tbody td { padding-top: 13px; padding-bottom: 13px; }
.ev-name { color: var(--oe-text); font-weight: 600; }
.ev-sub { display: block; margin-top: 2px; color: var(--oe-muted); font-size: 12px; }
.ev-suggested { display: flex; align-items: center; gap: 4px; }
.ev-table tr.text-muted .ev-name, .ev-table tr.text-muted td { color: var(--oe-muted); }
.ev-team { color: var(--oe-text); font-weight: 700; }
.ev-actual { min-width: 9.5rem; }
.ev-actual-amt { font-weight: 700; }
.ev-bar { width: 135px; height: 4px; margin: 6px 0 0 auto; }
.ev-bar.is-over .oe-progress-bar { background: var(--oe-red-fg); }
.ev-over { display: block; color: var(--oe-red-fg); font-size: 12px; font-weight: 600; }
.ev-table tbody + tbody { border-top: 0; }
.ev-past > th { padding-top: 8px !important; padding-bottom: 8px !important; border-top: 1px solid var(--oe-border); border-bottom: 1px solid var(--oe-divider); background: var(--oe-surface-alt); color: var(--oe-muted); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.ev-table tfoot td { padding-top: 16px; padding-bottom: 16px; background: var(--oe-surface-alt); font-size: 15px; }
.ev-table tfoot .ev-total-label { font-family: var(--oe-font-display); font-size: 16px; font-weight: 700; }
.ev-foot { display: flex; align-items: flex-start; gap: 6px; margin: -8px 0 0; color: var(--oe-muted); font-size: 12px; }
.ev-foot .oe-icon { margin-top: 1px; }

/* ------------------------------------------------------------------------------------------
 * People: Staff, Staff profile, Users (view/staff.php, staff_profile.php, users.php)
 * Staff.dc.html, StaffProfile.dc.html, Users.dc.html. The filter bar, segmented switch,
 * outline pill and label/value list are the shared patterns above.
 * ------------------------------------------------------------------------------------------ */

/* Staff list */
.staff-list td { padding-top: 11px; padding-bottom: 11px; }
.staff-list .oe-meta { display: block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-list .oe-meta a { color: inherit; }
.staff-waiver { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.staff-waiver.is-expired { color: var(--oe-red-fg); font-weight: 600; }

/* Staff profile */
.profile-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.staff-profile-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1.15fr); gap: 20px; margin-bottom: 20px; }
.staff-profile-aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.staff-profile-aside > .attachments { margin-bottom: 0 !important; }
.staff-details > .oe-card-body { flex: 1 1 auto; padding: 20px 22px 6px; }
.staff-details > .oe-card-head, .staff-details > .oe-card-foot, #assignments > .oe-card-head { padding-left: 22px; padding-right: 22px; }
.staff-details-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.staff-status { display: flex; flex: 1 1 200px; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 340px; margin-left: auto; text-align: right; }
.staff-status-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.staff-status-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--oe-green-fg); }
.staff-status-dot.is-off { background: var(--oe-faint); }
.staff-status-actions { display: flex; flex: none; flex-direction: column; gap: 6px; }
.staff-assignments th, .staff-assignments td { padding-right: 8px; padding-left: 8px; }
.staff-assignments td { padding-top: 12px; padding-bottom: 12px; }
.staff-assignments td:first-child { min-width: 200px; }
.staff-assignments tfoot td { background: var(--oe-surface-alt); }
.staff-assignments .oe-total { font-family: var(--oe-font-display); font-size: 16px; font-weight: 700; }
.staff-assignments-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; padding: 12px 22px 14px; border-top: 1px solid var(--oe-divider); color: var(--oe-muted); font-size: 12px; }
@media (max-width: 1199.98px) {
  .staff-profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .staff-details > .oe-card-body { padding: 16px 16px 4px; }
  .staff-details > .oe-card-head, .staff-details > .oe-card-foot, #assignments > .oe-card-head { padding-left: 16px; padding-right: 16px; }
  .staff-status { align-items: flex-start; max-width: none; margin-left: 0; text-align: left; flex: 1 1 100%; }
  .staff-status-actions { flex-direction: row; flex-wrap: wrap; }
  .staff-assignments-notes { padding: 12px 16px 14px; }
}

/* Users */
.users-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.users-list td { padding-top: 10px; padding-bottom: 10px; }
.users-list .oe-meta { display: block; max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users-list .users-staff-link { color: var(--oe-text); font-size: 13px; text-decoration: underline; text-decoration-color: var(--oe-control-border); text-underline-offset: 3px; }
.users-list .users-staff-link:hover { color: var(--oe-accent-hover); }
.users-detail-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.users-section { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 18px; border-bottom: 1px solid var(--oe-divider); }
.users-section:last-child { border-bottom: 0; }
.users-section > h2 { margin: 0; color: var(--oe-muted); font-family: var(--oe-font-body); font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.users-section .form-group { margin-bottom: 10px; }
.users-access-row .post-button { display: block; flex: 1 1 0; min-width: 0; }
.users-access-row .post-button .btn { width: 100%; }
.users-access-row { display: flex; flex-wrap: wrap; gap: 8px; }
.users-inline-form { display: flex; align-items: flex-end; gap: 8px; margin: 0; }
.users-inline-form .form-group { flex: 1 1 auto; min-width: 0; margin: 0; }
.users-history td:last-child { min-width: 200px; }
@media (max-width: 1199.98px) {
  .users-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .users-section { padding: 14px 16px 16px; }
}

/* ------------------------------------------------------------------------------------------
 * Ops: Dashboard, Inventory, Venues, Reports (view/dashboard.php, inventory.php, reports.php)
 * Main.dc.html, Inventory.dc.html, Reports.dc.html. The segmented switch, checkbox pills,
 * aside grid and compact table are the shared patterns above.
 * ------------------------------------------------------------------------------------------ */

/* Dashboard: events beside receipts + tasks from 1280px; below that the two panels sit side by side under the events */
@media (max-width: 1279.98px) {
  .dash-split { grid-template-columns: minmax(0, 1fr); }
  .dash-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 767.98px) { .dash-aside { grid-template-columns: minmax(0, 1fr); } }

/* Inventory */
.inv-list td:nth-child(5) { font-weight: 600; }
.inv-list tfoot td { background: var(--oe-surface-alt); font-size: 13px; }
.inv-type { display: inline-flex; align-items: center; gap: 5px; color: var(--oe-text-2); font-size: 12.5px; white-space: nowrap; }
.inv-loc { color: var(--oe-text-2); font-size: 12.5px; }
.inv-figures { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 14px 20px; border-bottom: 1px solid var(--oe-divider); }
@media (max-width: 1199.98px) { .inv-item-aside { order: -1; } }
.inv-stock-figure { font-family: var(--oe-font-display); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.inv-moves td { vertical-align: top; }

/* Reports */
/* Filter card */
.rep-filters .rep-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
.rep-filters .form-group { flex: 0 1 165px; min-width: 140px; margin: 0; }
.rep-filters .rep-company { flex-basis: 210px; }
.rep-filters label, .rep-filters legend { margin-bottom: 6px; color: var(--oe-text-2); font-size: 12.5px; font-weight: 600; }
.rep-filters fieldset { flex: 1 1 auto; min-width: 0; margin: 0; }
.rep-filters .oe-check-pills label { margin: 0; color: var(--oe-muted); font-size: 13px; font-weight: 500; }
.rep-filters .oe-check-pills label:has(input:checked) { color: var(--oe-text); font-weight: 600; }
.rep-ranges .nav-link { padding: 5px 12px; font-size: 12.5px; font-weight: 500; }
.rep-ranges .nav-link.active { font-weight: 600; }
/* Report tables (.oe-table-compact): group rows on the ground colour, nested tables smaller */
.rep-table .oe-group-row th { background: var(--oe-ground); font-size: 13px; }
.rep-table .table { font-size: 12.5px; }
@media (max-width: 767.98px) {
  .rep-filters .form-group { flex: 1 1 130px; }
  .rep-filters .rep-company { flex-basis: 100%; }
}

/* ------------------------------------------------------------------------------------------
 * Staff portal: My Events, My Event, My Receipts, My Profile (view/my_*.php; PhoneMyEvents,
 * PhoneEvent, PhoneReceipt, PhoneProfile .dc.html). One centred 680px column (.pt-wrap) on
 * every screen size; .pt-* classes.
 * ------------------------------------------------------------------------------------------ */

/* column, buttons, card parts shared by the four pages */
.pt-wrap { display: flex; flex-direction: column; gap: 14px; max-width: 680px; margin: 0 auto; }
.pt-wrap > .alert { margin: 0; }
.pt-wrap > .push-card.mb-3, .pt-wrap .attachments.mb-3 { margin-bottom: 0 !important; }
.pt-wrap .oe-card-head { padding: 14px 16px; }
.pt-btn { min-height: var(--oe-touch); }
.pt-submit { width: 100%; min-height: 50px; border-radius: 10px; font-size: 16px; }
.pt-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-h .oe-icon { color: var(--oe-muted); }
.pt-h .oe-icon.is-accent { color: var(--oe-accent); }
.pt-count { color: var(--oe-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-body { padding: 14px 16px; font-size: 14px; line-height: 1.45; }
.pt-body + .pt-body { border-top: 1px solid var(--oe-divider); }
.pt-text { word-break: break-word; }
.pt-label { display: block; color: var(--oe-muted); font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.pt-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pt-2col-wide-end { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.pt-section { scroll-margin-top: calc(var(--oe-viewas-h) + 12px); }   /* below the View-as bar (0px when not viewing) */
@media (min-width: 768px) { .pt-section { scroll-margin-top: calc(var(--oe-topbar-h) + var(--oe-viewas-h) + 12px); } }

/* My Events: rejected-receipt notice, date tiles, Next up card, event rows, push card */
.pt-group-label { margin: 6px 0 -2px; }
.pt-notice { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: var(--oe-red-bg); color: var(--oe-red-fg); font-size: 14px; }
.pt-notice:hover, .pt-notice:focus { color: var(--oe-red-fg); text-decoration: none; filter: brightness(.98); }
.pt-notice-text { flex: 1 1 auto; min-width: 0; }
.pt-notice-link { font-weight: 600; text-decoration: underline; }
.pt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chip { gap: 5px; }
.pt-chip .oe-icon { flex: none; }
.pt-tile { display: flex; flex-direction: column; align-items: center; flex: none; gap: 1px; width: 48px; padding: 6px 0 7px; border: 1px solid var(--oe-border); border-radius: 9px; background: var(--oe-ground); color: var(--oe-text); line-height: 1.2; }
.pt-tile-mon { color: var(--oe-muted); font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.pt-tile-day { font-family: var(--oe-font-display); font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pt-tile-lg { width: 56px; padding: 8px 0 9px; border: 0; border-radius: 10px; background: var(--oe-ink); color: #fff; }
.pt-tile-lg .pt-tile-mon { color: var(--oe-ink-muted); font-size: 11px; letter-spacing: 1.2px; }
.pt-tile-lg .pt-tile-day { font-size: 26px; }
.pt-tile-to { color: var(--oe-ink-text); font-size: 11px; font-variant-numeric: tabular-nums; }
.pt-next-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 16px; border-bottom: 1px solid var(--oe-divider); }
.pt-next-when { display: flex; align-items: baseline; gap: 5px; color: var(--oe-text-2); font-size: 13px; font-weight: 600; }
.pt-next-days { color: var(--oe-accent); font-family: var(--oe-font-display); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pt-next-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; }
.pt-next-top { display: flex; align-items: flex-start; gap: 14px; }
.pt-next-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pt-next-name { margin: 0; font-family: var(--oe-font-display); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.2px; word-break: break-word; }
.pt-next-name a { color: var(--oe-text); }
.pt-next-name a:hover { color: var(--oe-accent-hover); text-decoration: none; }
.pt-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-facts { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.pt-facts li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; word-break: break-word; }
.pt-facts .oe-icon { margin-top: 1px; color: var(--oe-muted); }
.pt-actions { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; }
.pt-actions > :only-child { grid-column: 1 / -1; }
.pt-actions .btn { min-height: 46px; }
.pt-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-card); background: var(--oe-surface); color: var(--oe-text); }
.pt-row:hover, .pt-row:focus { border-color: var(--oe-control-border); color: var(--oe-text); text-decoration: none; }
.pt-row:hover .pt-row-name { color: var(--oe-accent-hover); }
.pt-row-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 3px; min-width: 0; }
.pt-row-name { font-size: 15px; font-weight: 600; word-break: break-word; }
.pt-row-sub { color: var(--oe-muted); font-size: 13px; }
.pt-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; color: var(--oe-muted); font-size: 12px; }
.pt-row-when { color: var(--oe-text-2); font-weight: 600; }
.pt-row-when.is-now { color: var(--oe-green-fg); }
/* "Suggest an event" (staff suggest a prospect): a dashed row in the page on phones; desktop has the top-bar button */
.pt-suggest { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px dashed var(--oe-control-border); border-radius: var(--oe-radius-card); background: var(--oe-surface); color: var(--oe-text); }
.pt-suggest:hover, .pt-suggest:focus { border-color: var(--oe-ink); color: var(--oe-text); text-decoration: none; }
.pt-suggest:hover .pt-row-name { color: var(--oe-accent-hover); }
.pt-suggest-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--oe-chip); color: var(--oe-text); }
@media (min-width: 768px) { .pt-suggest { display: none; } }
.pt-row .pt-chips { margin-top: 3px; }
.pt-row .pt-chip { padding: 2px 8px; }
.pt-row-go { flex: none; color: var(--oe-faint); }
.pt-row.is-muted { background: var(--oe-surface-alt); color: var(--oe-muted); }
.pt-row.is-muted .pt-row-name { color: var(--oe-text-2); }
.pt-row.is-muted .pt-tile { border-color: transparent; background: var(--oe-divider); color: var(--oe-muted); }
.pt-row.is-muted .pt-tile-mon { color: inherit; }
.pt-row > .status-badge { flex: none; }
.pt-push { display: flex; align-items: flex-start; gap: 12px; padding: 14px 6px 14px 16px; }
.pt-push-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--oe-chip); color: var(--oe-text); }
.pt-push-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 6px; min-width: 0; font-size: 14px; }
.pt-push-main p { margin: 0; }
.pt-push-title { margin: 0; font-family: var(--oe-font-display); font-size: 17px; font-weight: 700; }
.pt-push-main .btn { align-self: flex-start; margin-top: 4px; }
.pt-push .close { display: flex; align-items: center; justify-content: center; flex: none; width: var(--oe-touch); height: var(--oe-touch); margin-top: -10px; padding: 0; }
@media (max-width: 767.98px) {
  /* Staff phones: "Submit a receipt" is the Receipts tab (PhoneMyEvents.dc.html) */
  .page-my_events.oe-staff-app .oe-topbar-actions { display: none; }
}

/* My Event: section buttons, where & when, team, bookings, tasks, items, receipts */
.pt-alert { display: flex; align-items: center; gap: 10px; }
.pt-jump { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 -16px 0 0; padding-right: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pt-jump::-webkit-scrollbar { display: none; }
.pt-jump a { display: inline-flex; align-items: center; flex: none; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-pill); background: var(--oe-surface); color: var(--oe-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pt-jump a:hover { border-color: var(--oe-control-border); color: var(--oe-text); text-decoration: none; }
.pt-jump a.is-active { border-color: var(--oe-ink); background: var(--oe-ink); color: #fff; }
.pt-jump .oe-pill { padding: 1px 7px; font-size: 11px; font-weight: 700; }
@media (min-width: 768px) { .pt-jump { flex-wrap: wrap; margin-right: 0; padding-right: 0; } }
.pt-where { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; font-size: 14px; }
.pt-where > .oe-icon { margin-top: 2px; color: var(--oe-muted); }
.pt-where-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
.pt-where-name { font-size: 15px; font-weight: 600; }
.pt-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--oe-divider); border-bottom: 1px solid var(--oe-divider); }
.pt-cells:last-child { border-bottom: 0; }
.pt-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-cell:first-child { padding-left: 16px; }
.pt-cell + .pt-cell { border-left: 1px solid var(--oe-divider); }
.pt-cell .oe-muted { font-weight: 400; }
.pt-2btn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 14px; }
.pt-2btn > :only-child { grid-column: 1 / -1; }
.pt-2btn .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-list { margin: 0; padding: 0; list-style: none; }
.pt-list > li { border-bottom: 1px solid var(--oe-divider); }
.pt-list > li:last-child { border-bottom: 0; }
.pt-person { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.pt-person.is-me { background: var(--oe-surface-alt); }
.pt-person .oe-avatar { width: 36px; height: 36px; font-size: 12px; }
.pt-person .oe-avatar.is-light { background: var(--oe-grey-bg); color: var(--oe-grey-fg); }
.pt-person-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 1px; min-width: 0; word-break: break-word; }
.pt-person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.pt-person-name .oe-pill { padding: 1px 8px; font-size: 11px; }
.pt-person-meta { color: var(--oe-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-round { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 8px; width: var(--oe-touch); height: var(--oe-touch); border: 1px solid var(--oe-control-border); border-radius: 22px; background: var(--oe-surface); color: var(--oe-text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-round:hover, .pt-round:focus { background: var(--oe-surface-alt); color: var(--oe-text); text-decoration: none; }
.pt-round-num { display: none; }
@media (min-width: 576px) {
  .pt-round.has-num { width: auto; padding: 0 16px; }
  .pt-round.has-num .pt-round-num { display: inline; }
}
.pt-manager { display: flex; align-items: center; gap: 12px; padding: 12px 16px 14px; border-top: 1px solid var(--oe-divider); }
.pt-manager-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; min-width: 0; }
.pt-manager-name { font-size: 15px; font-weight: 600; }
.pt-manager-line { overflow: hidden; color: var(--oe-muted); font-size: 13px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.pt-sec-label { margin: 6px 0 10px; }
.pt-stack { display: flex; flex-direction: column; gap: 14px; }
.pt-booking-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 10px; font-size: 15px; font-weight: 600; word-break: break-word; }
.pt-booking-head .oe-muted { font-weight: 400; }
.pt-booking-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--oe-chip); color: var(--oe-accent); }
.pt-conf { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-top: 1px dashed var(--oe-control-border); border-bottom: 1px dashed var(--oe-control-border); background: var(--oe-surface-alt); }
.pt-conf-no { font-family: var(--oe-font-display); font-size: 30px; font-weight: 800; letter-spacing: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-all; }
.pt-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 16px 0; }
.pt-times > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-booking-more { display: flex; flex-direction: column; gap: 4px; padding: 8px 16px 12px; font-size: 13px; word-break: break-word; }
.pt-booking-more:empty { padding: 0 0 4px; }
.pt-task { display: flex; align-items: flex-start; gap: 8px; padding: 8px 16px 8px 8px; }
.pt-task-form { flex: none; margin: 0; }
.pt-check { display: flex; align-items: center; justify-content: center; width: var(--oe-touch); height: var(--oe-touch); padding: 0; border: 0; border-radius: 22px; background: transparent; color: var(--oe-control-border); cursor: pointer; }
.pt-check:focus { outline: 0; box-shadow: 0 0 0 3px var(--oe-focus); }
.pt-check-box { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 2px solid #B9B6AD; border-radius: 11px; color: transparent; }
.pt-check:hover .pt-check-box { border-color: var(--oe-green-fg); color: var(--oe-green-fg); }
.pt-check:disabled { cursor: progress; opacity: .6; }
.pt-task.is-done .pt-check-box { border-color: var(--oe-green-fg); background: var(--oe-green-fg); color: #fff; }
.pt-task-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 4px; min-width: 0; padding-top: 10px; word-break: break-word; }
.pt-task-title { font-size: 15px; font-weight: 600; }
.pt-task.is-done .pt-task-title { color: var(--oe-muted); font-weight: 500; text-decoration: line-through; }
.pt-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--oe-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pt-task-meta .oe-pill { padding: 1px 8px; }
.pt-task-late { color: var(--oe-accent-hover); font-weight: 700; }
.pt-task-done { color: var(--oe-green-fg); }
.pt-task-done:empty { display: none; }
.pt-task-desc { color: var(--oe-text-2); font-size: 13px; }
.pt-task.is-done .pt-task-desc { color: var(--oe-muted); }
/* My Events → My tasks (anybody can own a task): the event line, overdue rows, a Planner's internal notes. */
.pt-task-event { font-size: 13px; font-weight: 600; }
.pt-task-event .oe-muted { font-weight: 400; font-variant-numeric: tabular-nums; }
.pt-mytasks { overflow: hidden; }   /* an overdue last row keeps inside the card's rounded corners (nothing here pops out) */
.pt-mytasks .pt-task.is-late { background: #FDF3F2; box-shadow: inset 3px 0 0 var(--oe-accent-hover); }   /* lighter than --oe-red-bg: an Urgent pill keeps its colour */
.pt-task-notes .pt-label { margin-bottom: 2px; }
.pt-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; }
.pt-item-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; min-width: 0; word-break: break-word; }
.pt-item-name { font-size: 15px; font-weight: 600; }
.pt-qty { flex: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-qty-dot { color: var(--oe-faint); }
.pt-mono { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.pt-receipt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.pt-receipt-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; min-width: 0; word-break: break-word; }
.pt-receipt-main > a { color: var(--oe-text); font-size: 15px; font-weight: 600; }
.pt-receipt-main > a:hover { color: var(--oe-accent-hover); }
.pt-receipt-meta { color: var(--oe-muted); font-size: 13px; }
.pt-receipt-note { color: var(--oe-red-fg); font-size: 13px; }
.pt-receipt-side { display: flex; flex-direction: column; align-items: flex-end; flex: none; gap: 5px; }
.pt-amount { font-family: var(--oe-font-display); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-cta { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 16px; border-top: 1px solid var(--oe-divider); }
.pt-cta .btn { min-height: 50px; border-radius: 10px; font-size: 16px; }
.pt-cta-note { color: var(--oe-muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }

/* My Receipts: the receipt form (file picker) and the receipt cards by status */
.pt-form-card { padding: 16px; }
.pt-form-card .form-group { margin-bottom: 12px; }
.pt-form-card .alert { margin-bottom: 12px; }
.pt-note { margin: 0 0 12px; color: var(--oe-muted); font-size: 13px; }
.pt-files { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pt-file { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 4px 0 12px; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-control); background: var(--oe-surface); }
.pt-file > a { display: inline-flex; align-items: center; flex: 1 1 auto; gap: 10px; min-width: 0; color: var(--oe-text); font-size: 14px; font-weight: 600; word-break: break-word; }
.pt-file > a .oe-icon { color: var(--oe-blue-fg); }
.pt-file .custom-control { flex: none; margin-right: 8px; }
.pt-drop.is-invalid { border-color: var(--oe-accent); }
.pt-drop > label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--oe-text-2); font-size: 13px; font-weight: 600; }
.pt-drop > label .oe-icon { color: var(--oe-muted); }
.pt-drop .form-text { margin: 0; line-height: 1.4; }
.pt-picker.file-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pt-picker .file-picker-btn { min-height: 46px; margin: 0; }
.pt-picker .file-picker-list { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.pt-picker .file-picker-item { gap: 10px; padding: 0 0 0 12px; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-control); background: var(--oe-surface); font-size: 14px; font-weight: 600; }
.pt-picker .file-picker-item > .fas { color: var(--oe-blue-fg); }
.pt-picker .file-picker-name { margin-left: 0; }
.pt-picker .file-picker-remove { flex: none; width: var(--oe-touch); padding: 0; color: var(--oe-muted); font-size: 22px; font-weight: 400; }
.pt-edit-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
/* Suggest an event: "Send to the planners" gets the room, Cancel its own width */
.pt-edit-actions.pt-suggest-actions { grid-template-columns: minmax(0, 1fr) auto; }
.pt-suggest-actions .btn-secondary { padding-right: 20px; padding-left: 20px; }
.pt-form-foot { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--oe-divider); }
.pt-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.pt-fields > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
.pt-fields > .is-wide { grid-column: 1 / -1; }
.pt-amount-lg { font-family: var(--oe-font-display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-list-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px; }
.pt-list-title { flex: 1 1 auto; margin: 0; font-family: var(--oe-font-display); font-size: 17px; font-weight: 700; }
.pt-totals { color: var(--oe-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-totals strong { color: var(--oe-text); font-weight: 600; }
.pt-group { display: flex; flex-direction: column; gap: 8px; }
.pt-group-title { margin: 4px 0 0; }
.pt-group-title.is-red { color: var(--oe-red-fg); }
.pt-group-note { font-weight: 400; letter-spacing: 0; text-transform: none; }
.pt-rc { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 10px 12px 14px; border: 1px solid var(--oe-border); border-left: 4px solid var(--oe-grey-fg); border-radius: var(--oe-radius-card); background: var(--oe-surface); }
.pt-rc.st-rejected { gap: 10px; padding: 14px; border-left-color: var(--oe-red-fg); }
.pt-rc.st-submitted { border-left-color: var(--oe-blue-fg); }
.pt-rc.st-approved { border-left-color: var(--oe-green-fg); }
.pt-rc.is-open { box-shadow: 0 0 0 3px var(--oe-focus); }
.pt-rc:hover { border-top-color: var(--oe-control-border); border-right-color: var(--oe-control-border); border-bottom-color: var(--oe-control-border); }
.pt-rc-top { display: flex; align-items: center; gap: 10px; }
.pt-rc.st-rejected .pt-rc-top { align-items: flex-start; }
.pt-rc-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 3px; min-width: 0; word-break: break-word; }
.pt-rc-title { color: var(--oe-text); font-size: 15px; font-weight: 600; }
.pt-rc-title:hover { color: var(--oe-accent-hover); text-decoration: none; }
.pt-rc-meta { color: var(--oe-muted); font-size: 13px; }
.pt-rc-files { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; }
.pt-rc-files a { display: inline-flex; align-items: center; gap: 6px; color: var(--oe-text-2); word-break: break-word; }
.pt-rc-files a:hover { color: var(--oe-accent-hover); }
.pt-rc-nofile { display: inline-flex; align-items: center; gap: 6px; color: var(--oe-amber-fg); font-size: 12px; font-weight: 600; }
.pt-rc-side { display: flex; flex-direction: column; align-items: flex-end; flex: none; gap: 5px; }
.pt-rc-amount { font-family: var(--oe-font-display); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-rc-go { flex: none; color: var(--oe-faint); }
.pt-rc-review { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: var(--oe-radius-control); background: var(--oe-red-bg); color: var(--oe-red-fg); font-size: 13px; line-height: 1.4; word-break: break-word; }
.pt-rc-review .oe-icon { flex: none; margin-top: 1px; }
.pt-rc-foot { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; }
.pt-rc-foot .pt-rc-files,
.pt-rc-foot .pt-rc-nofile { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.pt-rc-foot .btn { flex: none; }

/* My Profile: who am I, details form, emergency contact, phone notifications, password */
.pt-who { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.pt-who-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pt-who-id { min-width: 0; }
.pt-who-name { display: block; font-family: var(--oe-font-display); font-size: 19px; font-weight: 700; word-break: break-word; }
.pt-who-mail { display: flex; align-items: center; gap: 6px; color: var(--oe-text-2); font-size: 14px; word-break: break-all; }
.pt-who-mail .oe-icon { flex: none; color: var(--oe-muted); }
.pt-who p { margin: 0; color: var(--oe-muted); font-size: 13px; line-height: 1.45; }
.pt-form .form-group { margin-bottom: 14px; }
.pt-fieldset { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.pt-fieldset > legend { margin-bottom: 6px; padding: 0; }
.pt-fieldset .pt-sub { color: var(--oe-muted); font-size: 12px; font-weight: 400; }
.pt-fieldset .form-group { margin-bottom: 0; }
.pt-help { display: flex; align-items: flex-start; gap: 6px; margin: -8px 0 14px; color: var(--oe-muted); font-size: 12px; line-height: 1.4; }
.pt-help .oe-icon { flex: none; margin-top: 1px; }
.pt-att-note { margin: -8px 0 0; padding: 0 2px; color: var(--oe-muted); font-size: 12px; line-height: 1.4; }
.pt-device { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 12px 0; padding: 10px 12px; border-radius: var(--oe-radius-control); background: var(--oe-ground); }
.pt-device-state { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: var(--oe-radius-pill); background: var(--oe-chip); color: var(--oe-text-2); font-size: 13px; font-weight: 600; }
.pt-device-state::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
[data-push-state="on"] .pt-device-state { background: var(--oe-green-bg); color: var(--oe-green-fg); }
[data-push-state="blocked"] .pt-device-state { background: var(--oe-red-bg); color: var(--oe-red-fg); }
[data-push-state="off"] .pt-device-state,
[data-push-state="ios-install"] .pt-device-state { background: var(--oe-amber-bg); color: var(--oe-amber-fg); }
.pt-push-hint { margin: -4px 0 12px; }
.pt-push-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pt-push-actions .btn { flex: 1 1 140px; }
.pt-push-actions [data-push-action="test"] { flex-grow: 1.4; }
.pt-push-actions [data-push-action="off"] { color: var(--oe-muted); }
.pt-pw { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.pt-pw > .oe-icon { flex: none; color: var(--oe-muted); }
.pt-pw-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; min-width: 0; }
.pt-pw-title { font-size: 15px; font-weight: 600; }
.pt-pw .btn { flex: none; }

/* ------------------------------------------------------------------------------------------
 * Task templates (view/templates.php) and "Apply template" on the Tasks tab
 * (view/event/tasks.php). The template's details card spans the page like its Tasks card; the
 * "Add task" form opens inside the Tasks card; below 768px the task rows fold Due / Priority
 * into a line under the title (.tpl-item-meta) so the row actions stay on screen.
 * ------------------------------------------------------------------------------------------ */

.tpl-details.form-card { max-width: none; }
.tpl-add { border-bottom: 1px solid var(--oe-border); background: var(--oe-surface-alt); }
.tpl-add-title { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.tpl-add-title .oe-icon { color: var(--oe-accent); }
.tpl-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; color: var(--oe-muted); font-size: 12px; }
.tpl-apply-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 10px; max-width: 520px; }
.tpl-apply-pick .form-group { flex: 1 1 260px; margin-bottom: 10px; }
.tpl-apply-note { margin: 0 0 12px; }
.tpl-apply .table-responsive { margin-bottom: 14px; border: 1px solid var(--oe-border); border-radius: 10px; }
.tpl-apply-foot .oe-meta { flex: 1 1 220px; }
@media (min-width: 768px) {
  .tpl-item-main, .tpl-apply-main { min-width: 15rem; }
}
@media (max-width: 767.98px) {
  .tpl-item-actions .tpl-item-remove { display: none; }
}

/* ------------------------------------------------------------------------------------------
 * Help (view/help.php)
 * White titles on the coloured section heads (every h2 gets the text colour above), and room
 * between the contents column and the guides (Bootstrap's .no-gutters zeroes the column
 * padding).
 * ------------------------------------------------------------------------------------------ */

.help-section-head h2 { color: inherit; }
@media (min-width: 992px) {
  .help-page .no-gutters > .help-toc-col { padding-right: 20px; }
}

/* ------------------------------------------------------------------------------------------
 * Team chat (event chat spec §5): view/chat.php (inbox + thread page), view/event/chat.php (the
 * event page's Chat tab), view/partials/_chat_thread.php (one thread, filled by inc/chat.js) and
 * the "Team chat" link on My Event (.pt-chat).
 * A thread is a card: the message list scrolls on the page ground (inc/chat.js sizes it to fill
 * the screen down to the composer); others' messages are white bubbles on the left with a 28px
 * initials avatar and the name over each group, mine are ink bubbles on the right; day
 * separators are small caps chips, the "New messages" divider is an accent rule, the "New
 * messages" pill floats over the bottom of the list. Composer: 44px round tools (attach —
 * phones: a menu with Take photo / Choose file), a pill textarea that grows to 160px and a round
 * accent Send. Phones: the thread runs edge to edge under the ink app bar (.oe-bar-dark) and the
 * staff tab bar steps aside while typing (body.oe-chat-typing).
 * ------------------------------------------------------------------------------------------ */

.oe-chat { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-card); background: var(--oe-surface); }
.oe-chat-viewport { position: relative; min-height: 0; }
.oe-chat-scroll { height: min(62vh, 640px); min-height: 260px; padding: 16px 20px 10px; overflow-y: auto; overscroll-behavior: contain; background: var(--oe-ground); -webkit-overflow-scrolling: touch; }
.oe-chat-scroll:focus { outline: none; }
.oe-chat-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--oe-focus); }
.oe-chat-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.oe-chat-status { margin: 0; padding: 56px 16px; color: var(--oe-muted); font-size: 14px; text-align: center; }
.oe-chat-older { display: flex; justify-content: center; margin: 0 0 8px; }
.oe-chat-older-btn { display: inline-flex; align-items: center; gap: 6px; }

/* one message */
.oe-chat-msg { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding-right: 12%; }
.oe-chat-msg.is-cont { margin-top: 3px; padding-left: 38px; }
.oe-chat-msg.is-mine { justify-content: flex-end; padding-right: 0; padding-left: 16%; }
.oe-chat-avatar { flex: none; width: 28px; height: 28px; margin-top: 19px; font-size: 11px; }
.oe-chat-stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; }
.oe-chat-msg.is-mine .oe-chat-stack { align-items: flex-end; }
.oe-chat-author { padding: 0 4px; color: var(--oe-text-2); font-size: 12px; font-weight: 600; line-height: 16px; }
.oe-chat-line { display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.oe-chat-msg.is-mine .oe-chat-line { flex-direction: row-reverse; }
.oe-chat-bubble { min-width: 0; max-width: 100%; padding: 8px 12px 5px; border: 1px solid var(--oe-border); border-radius: 14px 14px 14px 4px; background: var(--oe-surface); color: var(--oe-text); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.oe-chat-msg.is-cont .oe-chat-bubble { border-radius: 4px 14px 14px 4px; }
.oe-chat-msg.is-mine .oe-chat-bubble { border-color: var(--oe-ink); border-radius: 14px 14px 4px 14px; background: var(--oe-ink); color: #fff; }
.oe-chat-msg.is-mine.is-cont .oe-chat-bubble { border-radius: 14px 4px 4px 14px; }
.oe-chat-text { margin: 0; white-space: pre-wrap; }
.oe-chat-time { display: block; margin-top: 2px; color: var(--oe-faint); font-size: 11px; font-variant-numeric: tabular-nums; line-height: 14px; text-align: right; }
.oe-chat-msg.is-mine .oe-chat-time { color: var(--oe-ink-muted); }
.oe-chat-msg.is-deleted .oe-chat-bubble { border: 1px dashed var(--oe-control-border); background: transparent; color: var(--oe-muted); }
.oe-chat-msg.is-deleted .oe-chat-time { color: var(--oe-faint); }
.oe-chat-deleted { font-style: italic; }

/* files: image thumbnails (open full size) and file chips */
.oe-chat-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.oe-chat-text + .oe-chat-files { margin-top: 8px; }
.oe-chat-thumb { display: block; overflow: hidden; border-radius: 8px; background: var(--oe-chip); line-height: 0; }
/* a fixed 4:3 box, so a picture that loads never moves the list (it may be cropped; tap = full size) */
.oe-chat-thumb img { display: block; width: 220px; max-width: 100%; height: 165px; object-fit: cover; }
.oe-chat-thumb:focus-visible { outline: 2px solid var(--oe-accent); outline-offset: 2px; }
.oe-chat-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 6px 12px; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-control); background: var(--oe-surface-alt); color: var(--oe-text); font-size: 13px; font-weight: 600; text-decoration: none; }
.oe-chat-file:hover, .oe-chat-file:focus { border-color: var(--oe-control-border); color: var(--oe-text); text-decoration: none; }
.oe-chat-file .oe-icon { flex: none; color: var(--oe-blue-fg); }
.oe-chat-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-chat-file-size { flex: none; color: var(--oe-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.oe-chat-msg.is-mine .oe-chat-file { border-color: var(--oe-ink-3); background: var(--oe-ink-2); color: #fff; }
.oe-chat-msg.is-mine .oe-chat-file .oe-icon { color: var(--oe-ink-text); }
.oe-chat-msg.is-mine .oe-chat-file-size { color: var(--oe-ink-muted); }

/* delete (own messages; Planners/Admins on every message) */
.oe-chat-del { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--oe-faint); opacity: 0; transition: opacity .15s; }
.oe-chat-msg:hover .oe-chat-del, .oe-chat-del:focus { opacity: 1; }
.oe-chat-del:hover, .oe-chat-del:focus { background: var(--oe-red-bg); color: var(--oe-accent); outline: none; }
.oe-chat-del:disabled { opacity: .4; }
@media (hover: none) { .oe-chat-del { opacity: .75; } }

/* day separators, the "New messages" divider, the pill */
.oe-chat-day { display: flex; justify-content: center; margin: 18px 0 2px; }
.oe-chat-day:first-child { margin-top: 2px; }
.oe-chat-day-label { padding: 3px 10px; border-radius: var(--oe-radius-pill); background: var(--oe-chip); color: var(--oe-muted); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.oe-chat-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--oe-accent); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.oe-chat-divider::before, .oe-chat-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--oe-accent); opacity: .45; }
.oe-chat-divider + .oe-chat-day { margin-top: 8px; }
.oe-chat-newpill { position: absolute; bottom: 12px; left: 50%; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: var(--oe-radius-pill); background: var(--oe-ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--oe-shadow-pop); transform: translateX(-50%); }
.oe-chat-newpill:hover, .oe-chat-newpill:focus { background: var(--oe-ink-2); outline: none; }

/* lines under the list: offline, read-only, stopped, no JavaScript */
.oe-chat-offline, .oe-chat-readonly, .oe-chat-stopped, .oe-chat-noscript { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; border-top: 1px solid var(--oe-border); font-size: 13px; }
.oe-chat-offline { background: var(--oe-amber-bg); color: var(--oe-amber-fg); }
.oe-chat-stopped { background: var(--oe-red-bg); color: var(--oe-red-fg); font-weight: 600; }
.oe-chat-readonly, .oe-chat-noscript { background: var(--oe-surface-alt); color: var(--oe-muted); }

/* composer */
.oe-chat-composer { margin: 0; padding: 10px 12px; border-top: 1px solid var(--oe-border); background: var(--oe-surface); }
.oe-chat-bar { display: flex; align-items: flex-end; gap: 6px; }
.oe-chat-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.oe-chat-tool { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--oe-touch); height: var(--oe-touch); margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--oe-muted); cursor: pointer; }
.oe-chat-tool:hover, .oe-chat-tool:focus, .oe-chat-attach-phone.show .oe-chat-tool { background: var(--oe-ground); color: var(--oe-text); outline: none; }
.oe-chat-tool:focus-visible { box-shadow: 0 0 0 3px var(--oe-focus); }
.oe-chat-attach-phone { display: none; }
.oe-chat-attach-menu .dropdown-item { display: flex; align-items: center; gap: 10px; min-height: var(--oe-touch); margin: 0; font-weight: 500; cursor: pointer; }
.oe-chat-attach-menu .oe-icon { color: var(--oe-muted); }
.oe-chat-input { flex: 1 1 auto; min-width: 0; height: var(--oe-touch); min-height: var(--oe-touch); max-height: 160px; padding: 10px 16px; border: 1px solid var(--oe-control-border); border-radius: 22px; background: var(--oe-surface-alt); color: var(--oe-text); font: inherit; font-size: 15px; line-height: 1.4; resize: none; }
.oe-chat-input::placeholder { color: var(--oe-faint); }
.oe-chat-input:focus { border-color: var(--oe-accent); background: var(--oe-surface); outline: none; box-shadow: 0 0 0 3px var(--oe-focus); }
.oe-chat-input[readonly] { color: var(--oe-muted); }
.oe-chat-send { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--oe-touch); height: var(--oe-touch); padding: 0 2px 0 0; border: 0; border-radius: 50%; background: var(--oe-accent); color: #fff; }
.oe-chat-send:hover, .oe-chat-send:focus { background: var(--oe-accent-hover); outline: none; }
.oe-chat-send:focus-visible { box-shadow: 0 0 0 3px var(--oe-focus); }
.oe-chat-send:disabled { opacity: .55; cursor: progress; }
.oe-chat-hint { margin: 6px 0 0 50px; color: var(--oe-faint); font-size: 12px; }
.oe-chat-error { margin: 0 0 8px; padding: 8px 12px; border-radius: var(--oe-radius-control); background: var(--oe-red-bg); color: var(--oe-red-fg); font-size: 13px; }
.oe-chat-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.oe-chat-pick { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 36px; padding: 0 2px 0 10px; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-pill); background: var(--oe-surface-alt); font-size: 13px; }
.oe-chat-pick .oe-icon { flex: none; color: var(--oe-blue-fg); }
.oe-chat-pick-name { min-width: 0; max-width: 220px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.oe-chat-pick-size { flex: none; color: var(--oe-muted); font-variant-numeric: tabular-nums; }
.oe-chat-pick-remove { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--oe-muted); }
.oe-chat-pick-remove:hover, .oe-chat-pick-remove:focus { background: var(--oe-chip); color: var(--oe-text); outline: none; }

/* the thread page, the event tab's note */
.oe-chat-page { max-width: 880px; margin: 0 auto; }
.oe-chat-subtitle { display: inline-flex; align-items: center; gap: 5px; }
.oe-chat-tab-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--oe-muted); font-size: 13px; }
.oe-chat-tab-note .oe-icon { flex: none; margin-top: 2px; }

/* the inbox */
.oe-chat-inbox { max-width: 820px; margin: 0 auto; }
.oe-chat-rows { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--oe-border); border-radius: var(--oe-radius-card); background: var(--oe-surface); list-style: none; }
.oe-chat-rows > li + li { border-top: 1px solid var(--oe-divider); }
.oe-chat-row { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 12px 12px 18px; color: var(--oe-text); text-decoration: none; }
.oe-chat-row:hover, .oe-chat-row:focus { background: var(--oe-surface-alt); color: var(--oe-text); text-decoration: none; }
.oe-chat-row-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--oe-chip); color: var(--oe-text-2); }
.oe-chat-row.is-unread .oe-chat-row-icon { background: var(--oe-ink); color: #fff; }
.oe-chat-row-main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 3px; min-width: 0; }
.oe-chat-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.oe-chat-row-top > .oe-code, .oe-chat-row-top > .status-badge, .oe-chat-row-top > .oe-pill { flex: none; }
.oe-chat-row-name { min-width: 0; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.oe-chat-row.is-unread .oe-chat-row-name { font-weight: 700; }
.oe-chat-row-when { flex: none; margin-left: auto; color: var(--oe-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oe-chat-row.is-unread .oe-chat-row-when { color: var(--oe-accent); font-weight: 600; }
.oe-chat-row-preview { overflow: hidden; color: var(--oe-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.oe-chat-row.is-unread .oe-chat-row-preview { color: var(--oe-text-2); }
.oe-chat-row-preview.is-empty { color: var(--oe-faint); }
.oe-chat-row-author { color: var(--oe-text-2); font-weight: 600; }
.oe-chat-row-count { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--oe-radius-pill); background: var(--oe-accent); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.oe-chat-row-go { flex: none; color: var(--oe-faint); }

/* My Event: "Team chat (N unread)" */
.pt-chat-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--oe-chip); color: var(--oe-text); }
.pt-chat.is-unread .pt-chat-icon { background: var(--oe-accent); color: #fff; }
.pt-chat-unread { color: var(--oe-accent); font-weight: 700; }

@media (max-width: 767.98px) {
  .oe-chat-attach-desk, .oe-chat-hint { display: none; }
  .oe-chat-attach-phone { display: block; }
  .oe-chat-scroll { padding: 12px 12px 8px; }
  .oe-chat-msg { padding-right: 8%; }
  .oe-chat-msg.is-mine { padding-left: 10%; }
  .oe-chat-composer { padding: 8px; }
  .oe-chat-input { font-size: 16px; }   /* 16px: iOS does not zoom into the field */
  .oe-chat-row { gap: 12px; padding-left: 14px; }
  .oe-chat-row-top { align-items: flex-start; }
  .oe-chat-row-name { display: -webkit-box; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .oe-chat-row-top > .oe-code, .oe-chat-row-top > .status-badge { margin-top: 1px; }
  .oe-chat-row-go { display: none; }

  /* the thread page: a compact heading and no action row (the event is one tap away on My Events /
     Events), so the messages get the screen */
  .page-chat .oe-topbar-actions { display: none; }
  .oe-staff-app.page-chat .oe-has-back .oe-topbar-titles { padding-top: 12px; }
  .page-chat .oe-has-back .oe-topbar-title { font-size: 20px; }

  /* the thread page runs edge to edge under the bar */
  .oe-chat-main.page-body,
  .oe-chat-main.page-body.container-fluid { padding: 12px 0 0; }
  .oe-staff-app .oe-chat-main.page-body,
  .oe-staff-app .oe-chat-main.page-body.container-fluid { padding: 12px 0 calc(var(--oe-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .oe-chat-main .oe-chat { border-right: 0; border-left: 0; border-radius: 0; }

  /* Staff: the ink app bar also on the thread ("‹ Chat" in white) */
  .oe-staff-app .oe-has-back.oe-bar-dark::before { background: var(--oe-ink); border-bottom: 0; }
  .oe-staff-app .oe-bar-dark .oe-topbar-back,
  .oe-staff-app .oe-has-back.oe-bar-dark .oe-user-btn { color: #fff; }
  .oe-staff-app .oe-bar-dark .oe-topbar-back:hover,
  .oe-staff-app .oe-has-back.oe-bar-dark .oe-user-btn:hover,
  .oe-staff-app .oe-has-back.oe-bar-dark .oe-user.show .oe-user-btn { background: var(--oe-ink-2); color: #fff; }

  /* typing: the tab bar steps aside so the composer sits on the keyboard */
  .oe-chat-typing .oe-tabbar { display: none; }
  .oe-staff-app.oe-chat-typing .oe-chat-main.page-body,
  .oe-staff-app.oe-chat-typing .oe-chat-main.page-body.container-fluid { padding-bottom: 0; }
}

/* ------------------------------------------------------------------------------------------
 * Print: the page content only
 * ------------------------------------------------------------------------------------------ */

@media print {
  body,
  body.oe-app {
    background: #fff;
  }

  .oe-sidebar,
  .oe-sidebar-backdrop,
  .oe-tabbar,
  #popup_container,
  .oe-install-sheet,
  .oe-topbar-btn,
  .oe-topbar-end,
  .oe-skip-link,
  .email-sandbox-btn {
    display: none !important;
  }

  .oe-topbar,
  .oe-topbar.oe-has-sandbox {
    position: static;
    height: auto;
    min-height: 0;
    padding: 0 0 12px;
  }

  .page-body,
  .page-body.container-fluid {
    padding: 12px 0 0;
  }
}
