/**
 * Stay Smart — i18n layout protection (FR / EN).
 * French labels are often longer; English is shorter. Chrome must grow/wrap,
 * never clip or overlap translated text.
 */

/* --- Buttons & actions: auto width, min-height only, wrap if needed --- */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-outline-danger,
.ss-chrome-btn {
  max-width: 100%;
  height: auto;
  white-space: normal;
  text-align: center;
  overflow: visible;
}

.btn-primary span,
.btn-secondary span,
.btn-ghost span,
.btn-danger span,
.btn-outline-danger span,
.ss-chrome-btn span {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.ss-toolbar,
.ss-form-actions,
.ss-card-head__actions,
.ss-page-header + .ss-toolbar,
.ss-cash-status__aside {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* --- Navigation: parent wraps; items size to content --- */
.ss-cash-subnav,
.ss-pagination,
.ss-pagination__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ss-station-nav-link,
.ss-cash-subnav-link,
.ss-station-console-link {
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 2.5rem;
  line-height: 1.25;
}

/* --- Badges / pills / chips: padding + auto width, no clip --- */
.ss-badge,
.ss-room-pill,
.ss-cash-chip,
.ss-priority-pill,
.ss-app-header__badge:not(:empty) {
  width: auto;
  max-width: none;
  height: auto;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
}

/* --- Card / page headers --- */
.ss-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
}

.ss-card-head__title,
.ss-page-title,
.ss-section-label,
.ss-page-subtitle,
.ss-card-head__subtitle,
.ss-empty__title,
.ss-empty__text {
  overflow-wrap: break-word;
  word-break: break-word;
}

.ss-card-head__actions {
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* --- Tables: wrap translated headers/cells --- */
.ss-table th,
.ss-table td,
.ss-cash-activity__table th,
.ss-cash-activity__table td {
  white-space: normal;
  overflow-wrap: break-word;
}

/* --- Forms --- */
.ss-label,
.ss-switch-label,
.ss-switch-copy,
.ss-form-field-hint,
.ss-field-error {
  white-space: normal;
  overflow-wrap: break-word;
}

/* --- App header chrome --- */
.ss-app-header__left,
.ss-app-header__right {
  flex-wrap: wrap;
  min-width: 0;
}
.surface-shell .ss-app-header__actions {
  flex-wrap: wrap;
  min-width: 0;
}
.ss-station-shell .ss-app-header__left,
.ss-station-shell .ss-app-header__right,
.ss-station-shell .ss-app-header__actions {
  flex-wrap: nowrap;
}

.ss-app-header__badge:not(:empty) {
  max-width: none;
}

/* --- Modals / dialogs --- */
.ss-modal__title,
.ss-modal__body,
[role="dialog"] h1,
[role="dialog"] h2,
[role="dialog"] p {
  overflow-wrap: break-word;
}

/* Sidebar rail is fixed-width: ellipsis + title tooltip (set in markup). */
.ss-nav-label,
.ss-nav-summary__main {
  min-width: 0;
}

/* Header currency select: keep native chrome, never clip. */
.ss-fx-switcher,
.ss-station-fx,
.ss-app-header [data-ss-fx-switcher] {
  flex: none;
  overflow: visible;
}
.ss-app-header [data-ss-fx-switcher] select,
.ss-fx-switcher__select,
.ss-station-fx__select {
  color: inherit !important;
  opacity: 1 !important;
}
