/*
 * Digitana Accounting: zentrale Mobile-Basis.
 * Wie im finalen Digitana Core wird diese Datei nach allen Fach-Mobile-Dateien geladen.
 * Sie enthaelt nur gemeinsame Shell-, Formular- und Datentabellen-Vertraege.
 */

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scrollbar-gutter: auto;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.site-shell.accounting-shell,
.accounting-workspace,
.accounting-workspace > * {
  min-width: 0;
  max-width: 100%;
}

.accounting-workspace {
  overflow-x: clip;
}

.accounting-workspace form,
.accounting-workspace fieldset,
.accounting-workspace label,
.accounting-workspace [class*="__grid"],
.accounting-workspace [class*="__grid"] > * {
  min-width: 0;
  max-width: 100%;
}

/* Gemeinsamer Mobile-Formvertrag. */
.accounting-workspace .accounting-form [class*="__grid"] {
  grid-template-columns: minmax(0, 1fr);
}

.accounting-workspace .accounting-form,
.accounting-workspace .accounting-form > *,
.accounting-workspace .accounting-form-field {
  min-width: 0;
  max-width: 100%;
}

.accounting-workspace .accounting-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.accounting-workspace .accounting-form select,
.accounting-workspace .accounting-form textarea {
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  box-sizing: border-box;
}

/*
 * Native Datums-/Zeitfelder bleiben browserneutral. Temporal Controls verwenden
 * bewusst keine Prozentbreite: iOS WebKit berechnet gepaddete Temporal-Inputs bei
 * width: 100% breiter als ihren Container. Der vorhandene Flex-Feldcontainer
 * streckt sie stattdessen sauber auf die verfuegbare Breite.
 */
.accounting-workspace .accounting-form-field > input:is(
  [type="date"],
  [type="time"],
  [type="datetime-local"],
  [type="month"],
  [type="week"]
) {
  width: auto;
  inline-size: auto;
  min-width: 0;
  min-inline-size: 0;
  max-width: none;
  max-inline-size: none;
  align-self: stretch;
  box-sizing: border-box;
}

.accounting-workspace .accounting-form-field > span,
.accounting-workspace .accounting-form-field__hint {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/*
 * Gemeinsamer Mobile-Datentabellenvertrag:
 * Die Seite selbst bleibt fest. Breite Listen bleiben echte Tabellen und scrollen
 * ausschliesslich in ihrem eigenen, fokussierbaren Tabellencontainer.
 */
.accounting-workspace :is(
  .products-table-wrap,
  .customers-table-wrap,
  .suppliers-table-wrap,
  .business-assets-table-wrap,
  .fleet-table-wrap,
  .employees-table-wrap,
  .company-establishments-table-wrap,
  .stock-table-wrap,
  .incoming-table-wrap
) {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) {
  display: table;
  width: 100%;
}

.accounting-workspace .products-table {
  min-width: 760px;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) thead {
  position: static;
  display: table-header-group;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) tbody {
  display: table-row-group;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) tr {
  display: table-row;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) :is(th, td) {
  display: table-cell !important;
  width: auto;
  min-width: 0;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) td::before {
  display: none !important;
  content: none !important;
}

.accounting-workspace :is(
  .products-table,
  .customers-table,
  .suppliers-table,
  .business-assets-table,
  .fleet-table,
  .employees-table,
  .company-establishments-table,
  .stock-table,
  .incoming-table
) tr[hidden] {
  display: none !important;
}
