/* Additions of the portal UI to the AVERTIVE One theme (prefix app-). Colors and sizes come from the theme tokens. */
.app-toast-bad { background: var(--bad); }
.app-stack-page { display: flex; flex-direction: column; gap: 20px; }
.app-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.app-toolbar .one-field { flex: 1 1 280px; max-width: 420px; }
.app-linkbox { display: flex; gap: 8px; align-items: center; }
.app-linkbox .one-input { font-family: var(--mono); font-size: 12.5px; }
.app-checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.app-checkline input { width: 16px; height: 16px; }
.app-details { max-width: 340px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.app-form .one-field .one-input[readonly] { background: var(--sunken); }
.one-textarea.app-mono { font-family: var(--mono); font-size: 12.5px; height: 84px; padding: 8px 12px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.app-inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.app-inline-form .one-field { flex: 1 1 200px; }
.app-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.one-menu .app-signout { width: 100%; }
.app-inline-form .app-field-btn { flex: 0 0 auto; }
.app-field-btn .one-btn { align-self: flex-start; }
.app-back { margin: 0 0 -8px; }
.app-booking + .app-booking { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line, currentColor); }
.app-booking .app-subhead { margin-top: 0; }
.app-fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.app-fieldset legend { padding: 0; }
.app-choice-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }
.app-choice-row .app-checkline { min-width: 140px; }
.app-choice-row .one-select { flex: 1 1 160px; }

/* Tabs of the customer page: links, the open one marked by aria-current */
.app-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.app-tab { padding: 9px 14px; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.app-tab:hover { color: var(--text); text-decoration: none; }
.app-tab[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* Menu "Weitere Aktionen": a disclosure with buttons */
.app-menu-wrap { position: relative; display: inline-block; }
.app-menu.one-menu { right: 0; top: 40px; width: 320px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.app-menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; text-decoration: none; }
.app-menu-item:hover { background: var(--hover); text-decoration: none; }
.app-menu-item[aria-disabled="true"] { color: var(--text-3); cursor: not-allowed; }
.app-menu-item[aria-disabled="true"]:hover { background: transparent; }
.app-menu-item.is-danger { color: var(--bad); }
.app-menu-hint { font-size: 12px; color: var(--text-3); }
.app-menu-group { padding: 6px 10px 2px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.app-menu-sep { height: 1px; margin: 4px 0; background: var(--line-soft); }

/* Overview tiles */
.app-tile .one-stat__label a { color: inherit; text-decoration: none; }
.app-tile .one-stat__label a:hover { text-decoration: underline; }
.app-tile.is-soon { background: var(--sunken); }
.app-tile.is-soon .one-stat__value { color: var(--text-3); }

/* Product monograms, ID with copy button */
.app-monos { display: inline-flex; gap: 4px; align-items: center; }
.app-mono-tile { display: inline-flex; }
.app-id { display: inline-flex; align-items: center; gap: 8px; }
.app-subline { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.app-copy { font-size: 12.5px; min-height: 24px; min-width: 24px; }

/* Sortable column headers */
.app-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; }
.app-sort:hover { text-decoration: underline; }

/* Links that look like buttons but are disabled */
a.one-btn.is-disabled, a.one-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Assistant */
ol.app-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 4px; }
.app-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; }
.app-option:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.app-option.is-disabled { cursor: not-allowed; color: var(--text-3); background: var(--sunken); }
.app-option input { width: 16px; height: 16px; margin-top: 2px; }
.app-option__body { display: flex; flex-direction: column; gap: 2px; }
.app-dl .one-dl__row { grid-template-columns: 180px minmax(0, 1fr); }
.app-error-list ul { margin: 6px 0 0; padding-left: 18px; }
.app-error-list a { color: inherit; }

/* Placeholder pages */
.app-soon { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.app-soon .one-card__title { margin: 0; }

/* Navigation entries may wrap (long names such as "Freigaben und geplante Aktionen") */
.one-nav__item { height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; white-space: normal; line-height: 1.25; overflow: visible; }

/* Licences: contingent against usage (progress bars with text), plain lists in dialogs, the customer view frame */
.app-licence-bar { display: flex; flex-direction: column; gap: 4px; }
.app-licence-bar__text { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.app-plain-list { margin: 0; padding-left: 18px; font-size: 13.5px; }
.app-booking-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.app-option__body .one-help { display: block; }
.app-customer-switch { padding: 0 16px 12px; }
.app-note-box { padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); font-size: 13.5px; }
.app-external { display: inline-flex; gap: 6px; align-items: center; }
.app-booking > .app-actions, .app-booking > .app-stack, .app-booking > .app-note-text { margin-top: 12px; }

/* ---- UI review 2026-11 ---- */

/* Filter rows: the search takes the space that is left, the segments stay in one line while they fit, phones get full-width fields */
.app-filter .one-field:first-child { flex: 1 1 280px; }
.app-filter .one-field:has(.one-seg) { flex: 0 0 auto; min-width: 0; max-width: 100%; }
.app-filter .one-field .one-input, .app-filter .one-field .one-select, .app-filter .one-field select { width: 100%; }
@media (max-width: 639px) {
  .app-filter .one-field, .app-filter .one-field:first-child, .app-filter .one-field:has(.one-seg) { flex: 1 1 100%; }
  .app-toolbar .one-field { max-width: none; }
}

/* Tables on phones: the columns that can be read on the detail page step aside, the rest stays readable without sideways scrolling */
@media (max-width: 639px) { .app-col-optional { display: none; } }

/* Tabs of the customer page: one line, scrollable, instead of three wrapped rows on a phone */
.app-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.app-tab { white-space: nowrap; }

/* Key figures: a date is text, not a number; the instance links read as links */
.app-stat--text { font-size: 17px; line-height: 1.35; font-weight: 600; }
.app-link-row { margin: 0; }
.app-link-row + .app-link-row { margin-top: 10px; }
.app-link-row a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.app-link-row a:hover { color: var(--accent-hover); }
.app-usage-pair { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.app-usage-pair > span { white-space: nowrap; }

/* Overview: what does not exist before the pilot is visibly quieter than the live figures; the list sits in the card without a second frame */
.app-tile.is-soon { background: transparent; border-style: dashed; box-shadow: none; }
.app-tile.is-soon .one-stat__value { font-size: 20px; }
#attention-card .one-table-wrap { border: 0; border-radius: 0; margin: 0 -4px; }

/* Touch: targets of at least 24 px everywhere (WCAG 2.2 2.5.8), 44 px on touch screens */
.app-link-btn, .app-sort { min-height: 24px; }
@media (pointer: coarse) {
  .one-btn--sm, .app-tab, .app-link-btn, .app-sort, .app-copy, .one-nav__item { min-height: 44px; }
  .one-btn--sm, .app-link-btn { display: inline-flex; align-items: center; }
}

/* ---- App rail of the customer view (the operator console has none): the home of the apps, permanently visible at the left (not collapsible). The theme styles the pieces; here it is always open,
   keyboard focus is visible on the dark ground, and on phones it becomes a compact bar above the page. ---- */
.one-rail.app-rail { transition: none; }
html[data-rail] #rail[hidden] { display: block !important; visibility: hidden; }
.app-rail .one-rail__item { width: 64px; }
.app-rail .app-rail__label { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-rail a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.app-rail .one-rail__help { text-decoration: none; }
.app-rail .one-rail__help:hover { color: #fff; border-color: #9aa1ad; }
@media (max-width: 639px) {
  .one-app { flex-direction: column; }
  .one-rail.app-rail { width: 100%; height: auto; position: static; flex: none; }
  html[data-rail] #rail[hidden] { min-height: 64px; }
  .app-rail .one-rail__inner { width: 100%; height: auto; flex-direction: row; justify-content: flex-start; padding: 6px 10px; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #1d2026; }
  .app-rail .one-rail__item--portal { margin-bottom: 0; }
  .app-rail .one-rail__item.is-active::before { left: 22px; top: auto; bottom: -6px; width: 20px; height: 3px; border-radius: 3px 3px 0 0; }
  .app-rail .one-rail__help { margin: 0 0 0 auto; flex: none; }
  .one-main { height: auto; flex: 1 1 0; min-height: 0; }
}
