/* ===========================================================================
   OnSite reports — component styles

   Reads values from tokens.css. Classes are `os-` prefixed to stay out of the
   way of a host application's stylesheet. If your codebase prefers Blazor CSS
   isolation, these lift cleanly into per-component .razor.css files.

   YardMGR port (copied from OnSiteReports wwwroot/css/app.css):
     - Global element resets (*, html, body, input, button) are scoped to
       .reports-app so they do not affect the host application.
     - #blazor-error-ui is removed; the host app owns it.
     - All --os-* colour variables are emitted by MainLayout.razor from
       AppTheme/ThemeState so they follow the light/dark theme.
     - Hard-coded colours used by the Run a report section are replaced with
       theme tokens (--os-focus-ring-inner, --os-control-hover,
       --os-control-border-hover, --os-card-hover).
   =========================================================================== */

/* Landing page host: fills the content area below the app bar (MudContainer has mt-4 = 16px). */
.reports-landing-host {
    width: 100%;
    min-height: calc(100vh - var(--mud-appbar-height, 64px));
    background: var(--reports-background);
}

/* Location snapshot page host: same full-height background as the landing page. */
.reports-location-snapshot-host {
    width: 100%;
    min-height: calc(100vh - var(--mud-appbar-height, 64px));
    background: var(--reports-background);
}

.reports-app {
    color-scheme: var(--os-color-scheme);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    padding: 3.2rem;
    margin: 0 auto;
    /* Fluid up to the prototype's 1024px; never forces a minimum width. */
    width: 100%;
    max-width: 102.4rem;
}

.reports-app,
.reports-app *,
.reports-app *::before,
.reports-app *::after { box-sizing: border-box; }

/* :where() keeps these resets at class-level specificity so .os-* component rules (e.g. .os-btn--primary color) win. */
.reports-app :where(input, select, button, textarea) { font-family: inherit; color: inherit; }

.reports-app :where(button) { cursor: pointer; }

.os-boot {
  padding: 32px;
  font-size: 15px;
  color: var(--os-secondary);
}

/* --- Focus ---------------------------------------------------------------- */

.os-focusable:focus { outline: none; }

.os-focusable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--os-focus-ring-inner), 0 0 0 4px var(--os-primary);
}

.os-menu:focus, .os-modal:focus { outline: none; }

/* --- Layout --------------------------------------------------------------- */

.os-page { min-height: 100vh; background: red; }

.os-page-inner {
  width: var(--os-content-width);
  margin: 0 auto;
  padding: var(--os-page-padding);
}

.os-card {
  background: var(--os-surface);
  border-radius: var(--os-radius-card);
  padding: var(--os-card-padding);
}
.os-location-snapshot {
    background: var(--reports-background);
}
.os-stack > * + * {
    margin-top: var(--os-card-gap);
}

.os-mb-12 { margin-bottom: var(--os-card-gap); }

.os-grow { flex: 1; }

.os-hr { height: 1px; background: var(--os-row-divider); margin: 20px 0; }

/* Widget columns inside a card, separated by vertical rules. */
.os-cols { display: flex; align-items: stretch; }

.os-col-divider {
  width: 1px;
  background: var(--os-border);
  align-self: stretch;
  margin: 0 18px;
}

.os-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

.os-section-title--spaced { margin-bottom: 12px; }
.os-section-title {
    font-size: 1.5rem;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}
.os-section-subtitle {
    color: var(--reports-surface-2) !important;
    font-size: 1.3rem;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

.os-icon { flex: none; }

/* --- Text helpers --------------------------------------------------------- */

.os-secondary { color: var(--os-secondary); }
.os-muted     { color: var(--os-muted); }
.os-error     { color: var(--os-error); }
.os-success   { color: var(--os-success); }
.os-strong    { font-weight: 500; }

.os-link {
  color: var(--os-primary);
  font-weight: 500;
  text-decoration: none;
}
.os-link:hover { text-decoration: underline; }

.os-footnote {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--os-border);
  font-size: 13px;
  color: var(--os-secondary);
}

/* --- Buttons -------------------------------------------------------------- */

.os-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--os-radius-control);
    white-space: nowrap;
    background: none;
    transition: background-color .12s ease;
    line-height: normal;
    color: var(--on-primary);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}



.os-btn:disabled { opacity: .45; pointer-events: none; }

.os-btn--block { width: 100%; }

.os-btn--default {
  background: var(--os-surface);
  border-color: var(--os-border);
  color: var(--os-ink);
}
.os-btn--default:hover  { background: var(--os-control-hover); }
.os-btn--default:active { background: var(--os-pressed); }

.os-btn--primary {
  background: var(--reports-primary);
  color: var(--os-on-primary);
}
    .os-btn--primary:hover {
    }
.os-btn--primary:active { background: var(--os-primary-active); }

.os-btn--ghost { color: var(--os-secondary); }
.os-btn--ghost:hover { background: #E7EAED; }

.os-btn--quiet {
  background: var(--os-surface);
  border-color: var(--os-border);
  color: var(--os-secondary);
}

.os-btn-app {
    background: var(--reports-surface);
    border: 0.5px solid var(--reports-surface-4);
    border-radius: 8px;
    padding: 8px 13px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    color: var(--reports-on-surface);
    line-height:normal;
}

.os-btn-app:disabled { opacity: .45; pointer-events: none; }

.os-btn-app svg,
.os-btn-app svg [stroke] { stroke: var(--reports-surface-2); }

.os-btn-app--block { width: 100%; }

.os-btn-app--default {
    background: var(--os-surface);
    border-color: var(--reports-surface-4);
    color: var(--reports-on-surface);
}
.os-btn-app--default:hover  { background: var(--os-control-hover); }
    .os-btn-app--default:active,
    .os-btn-app--default[aria-expanded="true"] {
        border-color: var(--reports-surface-2);
    }

.os-btn-app--primary {
  background: var(--reports-primary);
  color: var(--os-on-primary);
}
.os-btn-app--primary:active { background: var(--os-primary-active); }

.os-btn-app--ghost { color: var(--os-secondary); }
.os-btn-app--ghost:hover { background: #E7EAED; }

.os-btn-app--quiet {
  background: var(--os-surface);
  border-color: var(--os-border);
  color: var(--os-secondary);
}

.os-badge {
  background: var(--reports-background);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 12px;
    color: var(--reports-surface-2);
}

.os-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--os-touch-target);
  height: var(--os-touch-target);
  border: 0;
  border-radius: var(--os-radius-control);
  background: none;
  color: var(--os-secondary);
}
.os-icon-btn:hover { background: var(--os-page); color: var(--os-ink); }

/* --- Chips ---------------------------------------------------------------- */

.os-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: normal;
  padding: 0.8rem 1.3rem;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-size: 13px;
  font-weight: 400;
}

.os-yard-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.os-yard-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--os-touch-target);
  padding: 0 14px;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--os-ink);
}
.os-yard-chip:hover { background: var(--os-control-hover); }
    .os-yard-chip.is-on {
        background: color-mix( in srgb, var(--reports-secondary2) calc(10 * 1%), transparent );
        border-color: var(--reports-secondary2);
        color: var(--reports-secondary2);
    }

/* --- Toolbar -------------------------------------------------------------- */
/* Sits above the menu backdrop so clicking a different trigger switches menus
   rather than merely closing the open one. */

.os-toolbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.4rem;
}

.os-toolbar__spacer { flex: 1; }

/* Keep triggers above the open menu's backdrop (z-index 30) so one click switches menus. */
.os-toolbar .os-menu-anchor > button { position: relative; z-index: 31; }

/* --- Report header -------------------------------------------------------- */

.os-report-header { margin-bottom: 1.6rem; }

.os-breadcrumb {
    font-size: 1.3rem;
    color: var(--reports-surface-2);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    height: 2rem;
}
    .os-breadcrumb:hover {
        color: var(--reports-on-surface);
    }

.os-report-header__title { margin: 2px 0 0; }

/* --- Card title ----------------------------------------------------------- */

.os-card-title { margin-bottom: 14px; }
.os-card-title__sub { margin-top: 2px; }

/* --- Fields --------------------------------------------------------------- */

.os-field + .os-field { margin-top: 18px; }

.os-field-label {
    display: block;
    line-height:normal !important;
    color: var(--reports-surface-2) !important;
    font-size: 1.3rem;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.7rem;
}

.os-field__note { margin-top: 8px; }

.os-input {
  width: 100%;
  height: var(--os-touch-target);
  padding: 0 12px;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-size: 14px;
  font-weight: 400;
  color: var(--os-ink);
}
.os-input:hover { border-color: var(--os-control-border-hover); }

.reports-app input[type="date"], .reports-app input[type="time"] { -webkit-appearance: none; appearance: none; }
.reports-app input[type="date"]::-webkit-calendar-picker-indicator,
.reports-app input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  width: 16px;
  height: 16px;
  /* Recolor the native glyph: replace it with a themed fill clipped by an icon mask (Chromium/Edge). */
  background: var(--reports-surface-4);
  -webkit-mask: var(--reports-picker-icon) center / 16px 16px no-repeat;
  mask: var(--reports-picker-icon) center / 16px 16px no-repeat;
}
.reports-app input[type="date"] {
  --reports-picker-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}
.reports-app input[type="time"] {
  --reports-picker-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.os-select-wrap { position: relative; }

.os-select {
  width: 100%;
  height: 3.84rem;
  padding: 0 36px 0 12px;
  border: 1px solid var(--reports-surface-4);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-size: 14px;
  font-weight: 400;
  color: var(--os-ink);
  appearance: none;
}
.os-select:hover { border-color: var(--reports-surface-4); }

/* YardMGR: Yard MudSelect styled like the other report controls (3.84rem tall, surface-4 border). */
.reports-app .os-yard-select { height: 3.84rem; }
.reports-app .os-yard-select .os-yard-select__control,
.reports-app .os-yard-select .mud-select,
.reports-app .os-yard-select .mud-input-control,
.reports-app .os-yard-select .mud-input-control-input-container,
.reports-app .os-yard-select .mud-input.mud-input-outlined { width: 100%; min-width: 0; height: 100%; margin: 0; }
.reports-app .os-yard-select .mud-input.mud-input-outlined {
  padding: 0 12px;
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--os-ink);
  align-items: center;
}
.reports-app .os-yard-select .mud-input.mud-input-outlined .mud-input-outlined-border,
.reports-app .os-yard-select .mud-input.mud-input-outlined:hover .mud-input-outlined-border,
.reports-app .os-yard-select .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
  border: 1px solid var(--reports-surface-4);
  border-radius: var(--os-radius-control);
}
.reports-app .os-yard-select .mud-input.mud-input-outlined:focus-within {
  box-shadow: 0 0 0 2px var(--os-focus-ring-inner), 0 0 0 4px var(--os-primary);
}
.reports-app .os-yard-select .mud-input .mud-input-slot {
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: normal;
}
.reports-app .os-yard-select .mud-input-adornment-end { margin: 0 0 0 4px; }
.reports-app .os-yard-select .mud-input-adornment .mud-icon-root { color: var(--os-muted); }

/* The dropdown list renders in Mud's popover provider (outside .reports-app), so it is not scoped. */
.mud-popover.os-yard-select-popover {
  /* Ring via box-shadow, not border: a border steals 2px from the popover, so the inner list
     (max-height: inherit) overflows it and both get a scrollbar. */
  border: 0;
  box-shadow: 0 0 0 1px var(--reports-surface-4), 0 4px 12px rgba(0, 0, 0, .16);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
}
.os-yard-select-popover .mud-list-item { font-size: 14px; color: var(--os-ink); }
.mud-popover.os-yard-select-popover .mud-list-item.mud-list-item-clickable:hover,
.mud-popover.os-yard-select-popover .mud-list-item.mud-list-item-clickable:focus-visible { background-color: var(--reports-surface-hover); }

.os-select-wrap__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--os-muted);
  pointer-events: none;
}

/* YardMGR: grid (not flex) so date and time columns are exactly equal — flex-basis 0 still adds each
   item's padding/border on top of its share, which made the padded time input wider. */
.os-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.os-field-row--labelled { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
/* Range (From/To): rows share the parent's columns via subgrid, so the prefix column is as wide as the
   longest label (e.g. "Desde"/"Hasta") and both rows line up. */
.os-field--range { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px; }
.os-field--range > * { grid-column: 1 / -1; }
.os-field--range > .os-field-row--labelled { grid-template-columns: subgrid; }
.os-field-row + .os-field-row { margin-top: 10px; }
.reports-app .os-field-row > .os-field-row__grow,
.reports-app .os-field-row > .os-field-row__time { width: 100%; min-width: 0; max-width: none; height: 38.6px; }

/* Date and time boxes: same border, no hover color change. */
.reports-app .os-field-row__time,
.reports-app .os-field-row__time:hover { border: 1px solid var(--reports-surface-4); }

/* Date box border = Mud's own outline element (recolored), so there is only one border. */
.reports-app .os-date-picker .mud-input.mud-input-outlined .mud-input-outlined-border,
.reports-app .os-date-picker .mud-input.mud-input-outlined:hover .mud-input-outlined-border,
.reports-app .os-date-picker .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
  border: 1px solid var(--reports-surface-4);
  border-radius: var(--os-radius-control);
}

/* YardMGR: MudDatePicker (MM/dd/yyyy) styled to match the native time input (.os-input) next to it.
   .os-date-cell is the flex cell; every Mud element inside it fills the cell. */
.reports-app .os-date-cell { display: flex; }
.reports-app .os-date-cell > *,
.reports-app .os-date-picker,
.reports-app .os-date-picker .mud-picker-input-container,
.reports-app .os-date-picker .mud-input-control,
.reports-app .os-date-picker .mud-input-control-input-container,
.reports-app .os-date-picker .mud-input.mud-input-outlined { flex: 1 1 auto; width: 100%; min-width: 0; max-width: none; height: 100%; margin: 0; }
.reports-app .os-date-picker .mud-input.mud-input-outlined {
  height: 100%;
  margin: 0;
  padding: 0 12px;
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: var(--os-ink);
  align-items: center;
}
.reports-app .os-date-picker .mud-input.mud-input-outlined:focus-within {
  box-shadow: 0 0 0 2px var(--os-focus-ring-inner), 0 0 0 4px var(--os-primary);
}
.reports-app .os-date-picker .mud-input .mud-input-slot {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: normal;
}
.reports-app .os-date-picker .mud-input-adornment-end { margin: 0 0 0 4px; }
/* Mud pulls end-edge icon buttons outward with a negative margin; reset so the icon sits inside the 12px padding. */
.reports-app .os-date-picker .mud-input-adornment .mud-icon-button {
  margin: 0;
  padding: 0;
  color: var(--reports-surface-4);
}
.reports-app .os-date-picker .mud-input-adornment .mud-icon-root {
  width: 16px;
  height: 16px;
  font-size: 16px;
  color: var(--reports-surface-4);
}
/* Validation message ("Not a valid date") floats below the box so the box height never changes;
   the row reserves space for it only while it is shown. */
.reports-app .os-date-picker .mud-input-control { position: relative; }
.reports-app .os-date-picker .mud-input-control-input-container { flex: none; height: 100%; }
/* MudBlazor's inline "Not a valid date time" text is hidden; Generate report shows the validation dialog instead. */
.reports-app .os-date-picker .mud-input-control-helper-container { display: none; }
/* YardMGR: min-width (not fixed width) + nowrap so localized labels such as "Desde" never wrap. */
.os-field-row__prefix { min-width: 36px; flex: none; white-space: nowrap; }

/* --- Checkbox and radio --------------------------------------------------- */

.os-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--os-touch-target);
  padding: 0 14px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--os-ink);
}
.os-check-row:hover { background: var(--reports-background); }
.os-check-row__label { flex: 1; }

.os-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 17px;
  height: 17px;
  border: 1px solid #B9BFC6;
  border-radius: var(--os-radius-check);
  background: var(--os-surface);
  color: #fff;
}
.os-check.is-on { background: var(--reports-primary); border-color: var(--reports-primary); }

.os-radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--os-touch-target);
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--os-ink);
}
.os-radio-row__label { flex: 1; }

.os-radio {
  flex: none;
  width: 17px;
  height: 17px;
  border: 1px solid #B9BFC6;
  border-radius: 50%;
  background: var(--os-surface);
}
.os-radio.is-on { border: 5px solid var(--os-primary); }

/* --- Table ---------------------------------------------------------------- */

.os-table { width: 100%; border-collapse: collapse; }

.os-table th {
  padding: 0 var(--os-col-gutter) 10px 0;
  vertical-align: bottom;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--os-secondary);
}

.os-table td {
  padding: var(--os-row-padding-y) var(--os-col-gutter) var(--os-row-padding-y) 0;
  vertical-align: middle;
  white-space: nowrap;
  border-top: 1px solid var(--os-row-divider);
  font-size: 14px;
  font-weight: 400;
  color: var(--os-ink);
}

.os-table th:last-child, .os-table td:last-child { padding-right: 0; }

.os-table th.is-right, .os-table td.is-right { text-align: right; }

/* Groups a Dwell column with its service rather than the next one. */
.os-table th.has-wide-gap, .os-table td.has-wide-gap { padding-right: 42px; }

.os-th-inner { display: inline-flex; align-items: center; gap: 6px; }
.os-th-inner--right { flex-direction: row-reverse; }

.os-table tbody tr.is-clickable { cursor: pointer; }

.os-table tbody tr.is-selected { background: var(--os-row-selected); }
.os-table tbody tr.is-selected td:first-child { position: relative; }
.os-table tbody tr.is-selected td:first-child::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--os-card-padding));
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--os-primary);
}

.os-table__empty {
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--os-muted);
}

.os-table--compact td { padding-top: 9px; padding-bottom: 9px; }

/* --- Dropdown menu -------------------------------------------------------- */

.os-menu-anchor { position: relative; }

.os-menu-backdrop { position: fixed; inset: 0; z-index: 30; }

.os-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 41;
  padding: 6px 0;
  border-radius: var(--os-radius-menu);
  background: var(--os-surface);
  box-shadow: var(--os-shadow-menu);
  animation: os-pop .12s ease-out both;
}

.os-menu--left { right: auto; left: 0; }

@keyframes os-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.os-menu-group-label {
    font-size: 1.2rem;
    color: var(--reports-surface-2);
    padding: 0.6rem 1.6rem 0.8rem;
}

.os-menu-divider {     border-top: 0.5px solid var(--reports-surface-4);
    margin: 8px 0; }

.os-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--os-touch-target);
  padding: 0 14px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--os-ink);
}
.os-menu-item:hover { background: var(--reports-background); }
.os-menu-item__label { flex: 1; }
.os-menu-item__check { flex: none; width: 16px; color: var(--os-primary); }

.os-menu-link {
  width: 100%;
  min-height: var(--os-touch-target);
  padding: 0 14px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--os-primary);
}
.os-menu-link:hover { background: var(--os-hover); }

/* --- Modal ---------------------------------------------------------------- */

.os-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--os-scrim);
  animation: os-fade .14s ease-out both;
}

@keyframes os-fade { from { opacity: 0; } to { opacity: 1; } }

.os-modal {
  padding: 28px 32px;
  border-radius: var(--os-radius-modal);
  background: var(--os-surface);
  box-shadow: var(--os-shadow-modal);
}

.os-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.os-modal__subtitle { margin-top: 3px; }

.os-modal__close { margin: -10px -12px 0 0; }

.os-modal__body { margin-top: 22px; }

.os-modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

/* Segmented control and day toggles */

.os-segmented { display: flex; gap: 8px; }

.os-seg {
  flex: 1;
  height: var(--os-touch-target);
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--os-ink);
}
.os-seg:hover { background: #F7F8F9; }
.os-seg.is-on {
  background: var(--os-primary-tint);
  border-color: var(--os-primary);
  color: var(--os-primary);
}

.os-days { display: flex; gap: 8px; }

.os-day {
  width: 60px;
  flex: none;
  height: var(--os-touch-target);
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--os-secondary);
}
.os-day:hover { background: #F7F8F9; }
.os-day.is-on {
  background: var(--os-primary-tint);
  border-color: var(--os-primary);
  color: var(--os-primary);
}

/* Email chip input */

.os-chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: var(--os-touch-target);
  padding: 8px;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-control);
  background: var(--os-surface);
}

.os-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 5px 0 11px;
  border-radius: 16px;
  background: #EEF1F3;
  font-size: 13px;
}

.os-email-chip__x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--os-secondary);
}
.os-email-chip__x:hover { background: #DFE3E7; color: var(--os-ink); }

.os-chip-input__input {
  flex: 1;
  min-width: 120px;
  height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  font-size: 14px;
}
.os-chip-input__input::placeholder { color: var(--os-muted); }

/* Grey inset block */

.os-inset {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--os-radius-menu);
  background: #F4F6F7;
}
.os-inset__options { margin-top: 8px; }
.os-inset__note { margin-top: 8px; }

/* --- Live status widgets -------------------------------------------------- */

.os-widget {
  display: block;
  flex: 1;
  min-height: var(--os-touch-target);
  margin: -6px;
  padding: 6px;
  border: 0;
  border-radius: var(--os-radius-control);
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background-color .12s ease;
}
.os-widget:hover  { background: var(--os-hover); }
.os-widget:active { background: var(--os-pressed); }

.os-widget--static { cursor: default; }
.os-widget--static:hover { background: none; }

.os-widget__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--os-secondary);
}

.os-widget__value { display: block; margin-top: 6px; line-height: 1; }

.os-widget__support {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--os-secondary);
}

.os-typeneed {
  flex: 1;
  margin: -6px;
  padding: 6px;
  border: 0;
  border-radius: var(--os-radius-control);
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
}
.os-typeneed--clickable:hover  { background: var(--os-hover); }
.os-typeneed--clickable:active { background: var(--os-pressed); }

/* --- Run a report --------------------------------------------------------- */

.os-run-head { margin: 32px 0 14px; }

/* Responsive split, from the prototype's .resp-split:
   wide   - cards fill the space, config panel fixed at 400px
   small  - cards and panel share the row equally
   smaller - stacked vertically, both full width (prototype breakpoint: 680px) */
.os-run-grid { display: flex; align-items: flex-start; gap: 20px; }
.os-run-grid__list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--os-card-gap); }
.os-run-grid__panel { width: 400px; flex: none; min-width: 0; }

@media (max-width: 1100px) {
  .resp-split > .os-run-grid__list,
  .resp-split > .os-run-grid__panel { flex: 1 1 0; width: auto; }
}

@media (max-width: 680px) {
  .reports-app { padding: 1.6rem; }
  .resp-split { flex-direction: column; align-items: stretch; }
  .resp-split > .os-run-grid__list,
  .resp-split > .os-run-grid__panel { flex: none; width: 100%; }
}

.os-report-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 1.6rem 1.8rem;
    border: 4px red;
    border-radius: 1.2rem;
    background: var(--os-surface);
    text-align: left;
    overflow: hidden;
}
    .os-report-card:hover {
        outline: 0.5px solid var(--reports-surface-4);
    }
    .os-report-card.is-selected:hover {
        outline: 0.5px solid var(--reports-surface-4);
    }

    .os-report-card.is-selected {
        border-left: 4px solid var(--reports-secondary);
    }

.os-report-card__row { display: flex; align-items: flex-start; gap: 13px; }

.os-report-card__icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: var(--os-radius-card);
    background: transparent;
    color: var(--reports-icon);
    transition: color .12s ease;
}
.os-report-card.is-selected .os-report-card__icon {
    background: transparent;
    color: var(--reports-secondary);
}

.os-report-card__icon svg { stroke-width: 1.8; }

.os-report-card__text {
    flex: 1;
    min-width: 0;
    line-height: normal !important;
}
.os-report-card__text > span { display: block; }
.os-report-card__text > span + span { margin-top: 0px;
                                      line-height:normal !important;
}

.os-report-card__check {
    flex: none;
    width: 1.7rem;
    color: var(--reports-secondary);
}

.os-config { padding: 2rem 2.4rem; }
.os-config__desc {
    margin-top: 0.3rem;
    margin-bottom: 2rem;
    color: var(--reports-surface-2) !important;
    font-size: 1.3rem;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}
.os-config__action { margin-top: 24px; }

/* --- Report parameters summary (YardMGR) --------------------------------- */

.os-report-params { margin: 4px 0 20px; }

.os-report-params__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 0;
}

.os-report-params__item dt { margin: 0 0 2px; }

.os-report-params__item dd { margin: 0; color: var(--os-ink); }

/* --- Map placeholder ------------------------------------------------------ */

.os-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 340px;
  border: 1px dashed #C8CDD3;
  border-radius: var(--os-radius-menu);
  background: #FAFBFC;
  text-align: center;
}
.os-map__icon { margin-bottom: 12px; }
.os-map__sub { margin-top: 4px; }

/* --- Availability footnote ------------------------------------------------ */

.os-calc {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--os-border);
}
.os-calc__body { margin-top: 5px; }

/* Blazor error UI intentionally omitted: owned by the host application. */

/* --- Location snapshot ---------------------------------------------------- */
/* Theme-managed overrides: colors come from the --reports-* variables set in MainLayout. */

.reports-app .os-toolbar { flex-wrap: wrap; }
.reports-app .os-toolbar__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.reports-app .os-toolbar__actions { display: flex; align-items: center; gap: 10px; }

.reports-app .os-breadcrumb:hover { color: var(--reports-on-surface); }

.reports-app .os-chip,
.reports-app .os-menu {
  background: var(--reports-surface);
  color: var(--reports-on-surface);
}
.reports-app .os-chip { border-color: var(--reports-surface-4); }
.reports-app .os-menu { border: 1px solid var(--reports-surface-4); }
.reports-app .os-menu-item,
.reports-app .os-menu-link { color: var(--reports-on-surface); }
.reports-app .os-menu-item:hover,
.reports-app .os-menu-link:hover { background: var(--reports-background); }
.reports-app .os-menu-item__check { color: var(--reports-primary); }
/* The outer panel keeps the rounded corners; an inner element scrolls so the
   scrollbar is inset by the corner radius and never covers the corners. */
.reports-app .os-menu--filter { padding-block: var(--os-radius-menu); }
.reports-app .os-menu--filter .os-menu__scroll {
    max-height: calc(min(60vh, 28rem) - 2 * var(--os-radius-menu));
    overflow-y: auto;
}

.reports-app .os-menu-link--clear-filters {
    font-size: 1.4rem;
    padding: 1rem 1.6rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    white-space: nowrap;
    color: var(--reports-primary);
    font-weight: 400;
}

.reports-app .os-menu-link--clear-filters:hover {
    background: var(--reports-background);
}

.reports-app .os-table-card { overflow: hidden; }
.reports-app .os-map__row-hint { font-size: 13px; color: var(--reports-surface-2); margin-top: 12px; }
/* Column header icons (Bus, Location, Dwell). */
.reports-app.os-location-snapshot .os-th-inner svg { stroke: var(--reports-surface-4); }
.reports-app .os-table-scroll { overflow-x: auto; }
.reports-app .os-table tbody tr.is-selected { background: var(--reports-background); }
.reports-app .os-table tbody tr.is-clickable:focus-visible { outline: 2px solid var(--reports-primary); outline-offset: -2px; }
.reports-app .os-table tbody tr.is-selected td:first-child::before { background: var(--reports-primary); }

.reports-app .os-map {
  border-color: var(--reports-surface-4);
  background: var(--reports-background);
  color: var(--reports-on-surface);
}

.reports-app .os-pill {
    color: var(--reports-on-surface);
}
.reports-app .os-pill--parking { background: var(--reports-alt-blue-pill-bg); color: var(--reports-alt-blue-pill-text); }
.reports-app .os-pill--maintenance { background: var(--reports-alt-purple-pill-bg); color: var(--reports-alt-purple-pill-text); }
.reports-app .os-pill--charging { background: var(--reports-alt-green-pill-bg); color: var(--reports-alt-green-pill-text); }
.reports-app .os-pill--wash { background: var(--reports-alt-orange-pill-bg); color: var(--reports-alt-orange-pill-text); }
.reports-app .os-pill--fueling {
    background: var(--reports-alt-orange-pill-bg); color: var(--reports-alt-orange-pill-text);
}
.reports-app .os-pill--none {
    background: var(--reports-alt-gray-pill-bg);
    color: var(--reports-alt-gray-pill-text);
}

.reports-app .os-report-message {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--reports-surface-2);
}
.reports-app .os-report-message--error { color: var(--reports-red); }
.reports-app > .os-report-message { margin-bottom: var(--os-card-gap); padding: 12px 0; }

@media (max-width: 680px) {
  .reports-app .os-toolbar__spacer { display: none; }
  .reports-app .os-toolbar__actions { width: 100%; justify-content: flex-end; }
  .reports-app .os-map { height: 220px; }
}

/* --- Location snapshot table text ----------------------------------------- */

.reports-app .os-table th.os-location-table__th {
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    padding: 0 6px 12px;
    border-bottom: 0.5px solid var(--reports-surface-4);
    white-space: nowrap;
    color: var(--reports-on-surface);
}

.reports-app .os-table td.os-location-table__td {
    font-size: 1.4rem;
    padding: 1.2rem 0.6rem;
    border-bottom: 0.5px solid var(--reports-background);
    line-height: normal;
    font-weight: 400 !important;
}

/* --- Landing live status (os-live-*) ------------------------------------------
   Own classes for the landing header, LiveStatusWidget, BlockSummaryCard and
   YardSelector. Selectors here must only target os-live-* classes so existing
   Reports components are never restyled. Colours come from --reports-* tokens
   (--os-secondary is orange in dark mode; --os-error is not emitted). */

/* Header */
.reports-app .os-live-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 24px;
}
.reports-app .os-live-header__title { margin: 0; color: var(--reports-on-surface); }
.reports-app .os-live-header__updated { color: var(--reports-surface-2); }

/* Yard selector: keep the trigger above the DropdownMenu backdrop so clicking it
   toggles the menu (same technique as .os-toolbar, scoped to this component). */
.reports-app .os-live-yard-selector > button { position: relative; z-index: 31; }

/* Menu shows 5 rows (5 touch targets + 6px padding top/bottom + 1px border) and scrolls beyond that. */
.reports-app .os-live-yard-menu {
    max-height: calc(5 * var(--os-touch-target) + 14px);
    overflow-y: auto;
    box-sizing: border-box;
}

/* Card D */
.reports-app .os-live-card { max-height: 12.8rem; }
/* Contrast-safe error text in the card only; other .os-report-message--error panels keep --reports-red. */
.reports-app .os-live-card .os-report-message--error { color: var(--reports-live-error); }
/* Per-card "couldn't refresh" notice above the widgets; the height cap is lifted so it never clips them. */
.reports-app .os-live-card--stale { max-height: none; }
.reports-app .os-live-card__refresh {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.reports-app .os-live-card__refresh-error { color: var(--reports-live-error); }
.reports-app .os-live-cols { display: flex; align-items: stretch; gap: 36px; }

/* Widget: the label stays at the top and the highlightable action is pushed to the
   bottom (margin-top: auto) of the full-height column, so the three buttons share a
   bottom edge. The action's -6px side/bottom margins let its hover background bleed
   past the text without shifting it; no top bleed so the label is never highlighted. */
.reports-app .os-live-widget {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.reports-app .os-live-widget__action {
    display: block;
    align-self: stretch;
    min-height: var(--os-touch-target);
    margin: auto -6px -6px;
    padding: 6px;
    border: 0;
    border-radius: var(--os-radius-control);
    background: none;
    text-align: left;
    font: inherit;
    color: var(--reports-on-surface);
    cursor: pointer;
    transition: background-color .12s ease;
}
.reports-app .os-live-widget__action:hover,
.reports-app .os-live-widget__action:active { background: var(--reports-background); }
.reports-app .os-live-widget__action:focus-visible {
    box-shadow: 0 0 0 2px var(--os-focus-ring-inner), 0 0 0 4px var(--reports-primary);
}
.reports-app .os-live-widget__action--static { cursor: default; }
.reports-app .os-live-widget__action--static:hover,
.reports-app .os-live-widget__action--static:active { background: none; }

.reports-app .os-live-widget__label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 1.3rem;
    font-weight: 500;
    /* Long localized labels wrap inside their column instead of overlapping the next one. */
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--reports-on-surface);
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}
.reports-app .os-live-widget__icon { flex: none; color: var(--reports-icon); }
.reports-app .os-live-widget__value { display: block; line-height: 1; }
.reports-app .os-live-widget__metric { color: var(--reports-on-surface); }
.reports-app .os-live-widget__metric--error { color: var(--reports-live-error); }
.reports-app .os-live-widget__tail { color: var(--reports-surface-2); }
/* "buses" after the figure. --reports-surface-2 is #5B727C in light mode and follows the theme. */
.reports-app .os-live-widget__unit {
    display: inline;
    margin-left: 6px;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    color: var(--reports-surface-2);
}
.reports-app .os-live-widget__support {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--reports-surface-2);
}

/* Three columns don't fit on narrow screens: stack them. The stacked card is taller
   than the desktop max-height, so the cap is lifted (prototype breakpoint 680px). */
@media (max-width: 680px) {
    .reports-app .os-live-card { max-height: none; }
    .reports-app .os-live-cols { flex-direction: column; gap: 24px; }
}

/* The viewport query above ignores the app's side drawer, so also stack based on the
   Live status section's own width. 780px keeps the longest (es/fr) labels on one line
   in the three-column layout, so the 12.8rem cap is not exceeded by wrapped labels. */
.reports-app .os-live-status { container: os-live-status / inline-size; }
@container os-live-status (max-width: 780px) {
    .reports-app .os-live-card { max-height: none; }
    .reports-app .os-live-cols { flex-direction: column; gap: 24px; }
}