/* /core/erp/erp.css deprecated, moves to /erp/shared/css/erp.css */



/* ---------- erp/erp.css global corporate design io erp ---------------*/
/* ---------- FONTS & RESETS ---------- */
/* ---------- CUSTOM PROPERTIES (:root) ---------- */
/* ---------- TAG DEFAULTS ---------- */
/* ---------- UTILITY CLASSES ---------- */
/* ---------- BUTTONS .btn ---------- */
/* ---------- CARDS .card ---------- */
/* ------------ TABLES table ---------- */



/* /erp/css/global.css */

/* Core System Rule: Guarantee absolute native visibility constraints across all micro-SPAs */
[hidden] {
  display: none !important;
}


/* ---------- FONTS & RESETS ---------- */

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3VF-Upright.ttf.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3VF-Italic.ttf.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}



/* ---------- CUSTOM PROPERTIES (:root) ---------- */

:root {
  /* Font Weights */
  --font-weight--light: 300;
  --font-weight--normal: 350;
  --font-weight--bold: 500;

  /* Font Sizes */
  --font-size--xs: 0.75rem;
  --font-size--s: 0.875rem;
  --font-size--m: 1rem;
  --font-size--ml: 1.25rem;
  --font-size--l: 1.5rem;
  --font-size--xl: 2rem;
  --font-size--xxl: 4rem;

  /* Line Heights */
  --line-height--xs: 1;
  --line-height--s: 1.25;
  --line-height--m: 1.5;
  --line-height--l: 1.75;
  --line-height--xl: 2;

  /* Base Colors */
  --white: #ffffff;
  --black: #000000;

  --red: hsl(360 100% 40%);
  --orange: hsl(30 100% 50%);
  --yellow: hsl(50 100% 50%);
  --green: hsl(120 100% 30%);
  --cyan: hsl(180 100% 40%);
  --blue: hsl(220 100% 40%);
  --purple: hsl(280 100% 40%);

  /* Grey Palette */
  --c20: #333333;
  --c40: #666666;
  --c60: #999999;
  --c80: #cccccc;
  --c95: #f3f3f3;
  --c97: #f6f6f6;
  --c99: #f9f9f9;

  --darkgrey: var(--c20);
  --grey: var(--c40);
  --lightgrey: var(--c60);
  --canvas-c: var(--c99);

  /* Corporate Colors */
  --io-red: #993366;
  --io-green: #339966;
  --io-blue: #336699;
  --io-plum: #663399;
  --io-apple: #669933;
  --io-nut: #996633;

  /* context color, default grey */
  --c: var(--grey);

  /* Lengths / Spacings */
  --xxs: 0.125rem;
  --xs: 0.25rem;
  --s: 0.5rem;
  --m: 1rem;
  --l: 2rem;
  --xl: 4rem;
  --xxl: 8rem;

  /* Animation Durations */
  --s--xs: 0.25s;
  --s--s: 0.5s;
  --s--m: 1s;
  --s--l: 2s;
  --s--xl: 4s;

  /* btn sizing */
  --btn--xs-min-width: 0;
  --btn--s-min-width: 0;
  --btn-min-width: 96px;
  --btn--l-min-width: var(--xxl);
  /* 128px */
  --btn--xl-min-width: var(--xxl);
  --btn--xs-border-radius: var(--xs);
  --btn--s-border-radius: var(--xs);
  --btn-border-radius: var(--s);
  --btn--l-border-radius: var(--s);
  --btn--xl-border-radius: var(--s);
  --btn--xs-border-width: 0.5px;
  --btn--s-border-width: 0.5px;
  --btn-border-width: 1px;
  --btn--l-border-width: 1px;
  --btn--xl-border-width: 2px;
  --btn--xs-padding: 0 var(--xs);
  --btn--s-padding: 0 var(--s);
  --btn-padding: var(--xs) var(--m);
  --btn--l-padding: var(--s) var(--l);
  --btn--xl-padding: var(--m) var(--xl);
  --btn--xs-line-height: var(--line-height--xs);
  --btn--s-line-height: var(--line-height--s);
  --btn-line-height: var(--line-height--m);
  ;
  --btn--l-line-height: var(--line-height--m);
  ;
  --btn--xl-line-height: var(--line-height--m);
  ;
  --btn--xs-font-size: var(--font-size--s);
  --btn--s-font-size: var(--font-size--m);
  --btn-font-size: var(--font-size--m);
  --btn--l-font-size: var(--font-size--l);
  --btn--xl-font-size: var(--font-size--xl);
  --btn--xs-font-weight: var(--font-weight--normal);
  --btn--s-font-weight: var(--font-weight--normal);
  --btn-font-weight: var(--font-weight--bold);
  --btn--l-font-weight: var(--font-weight--bold);
  --btn--xl-font-weight: var(--font-weight--bold);
  --btn--xs-text-transform: none;
  --btn--s-text-transform: none;
  --btn-text-transform: none;
  --btn--l-text-transform: none;
  --btn--xl-text-transform: none;

  /* Links */
  --a-decoration: underline;
}



/* ---------- TAG DEFAULTS ---------- */

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: var(--font-weight--normal);
  font-size: var(--font-size--m);
  line-height: var(--line-height--l);
  background-color: var(--canvas-c);
  min-height: 100vh;
  margin: 0;
}

main {
  padding: var(--m);
}

h1 {
  font-size: var(--font-size--xxl);
}

h2 {
  font-size: var(--font-size--xl);
}

h3 {
  font-size: var(--font-size--l);
}

h4 {
  font-size: var(--font-size--ml);
}

h5 {
  font-size: var(--font-size--m);
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: var(--font-weight--bold);
}

strong,
b {
  font-weight: var(--font-weight--bold);
}

button {
  all: unset;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
  line-height: inherit;
}

/* Barrierefreiheit: Sichtbarer Fokus-Rahmen für Tastatur-Nutzer */
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--c);
  outline-offset: 2px;
}

a {
  text-decoration: var(--a-decoration);
}

q {
  display: block;
  border: .5px solid currentcolor;
  border-radius: 1rem 1rem 1rem 0;
  padding: var(--s) var(--m);
}

q::before,
q::after {
  content: "";
}

fieldset {
  border: 0.5px solid var(--grey);
}

/* list */
ul {
  padding: 0 0 0 var(--l);
  /* left indentation */
}

/* ---------- UTILITY CLASSES ---------- */

.display-none {
  display: none;
}

.display-none-important {
  display: none !important;
}

.inactive {
  opacity: 0.5;
}

.display-none:not(:has(input:checked)) {
  display: none;
}

.text-align-right {
  text-align: right;
}

.text-align-center {
  text-align: center;
}

.text-muted {
  color: var(--grey);
}



/* ---------- BUTTONS .btn ---------- */

/* Corporate Color Mapping (Überschreibt die Kontext-Variable) */
.io-red {
  --c: var(--io-red);
}

.io-green {
  --c: var(--io-green);
}

.io-blue {
  --c: var(--io-blue);
}

.io-plum {
  --c: var(--io-plum);
}

.io-apple {
  --c: var(--io-apple);
}

.io-nut {
  --c: var(--io-nut);
}

/* Semantische Funktions-Klassen für Buttons */
.btn-add,
.btn-new,
.btn-edit,
.btn-apply {
  --c: var(--blue);
}

.btn-save,
.btn-approve,
.btn-won {
  --c: var(--green);
}

.btn-yellow {
  --c: var(--yellow);
}

.btn-delete,
.io-decline,
.btn-lost {
  --c: var(--red);
}

.btn-cancel,
.btn-more {
  --c: var(--grey);
}

/* btns: group of buttons */
.btns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: var(--l);
  flex-wrap: nowrap;
  margin: var(--l) 0;
  margin: 0 0;
}

.btns--start {
  justify-content: flex-start;
}

.btns--center {
  justify-content: center;
}

.btns--end {
  justify-content: flex-end;
}

.btns--column {
  flex-direction: column;
}

.btns--xs,
.btns--s {
  gap: var(--s);
  margin: 0;
}

.btns:has(+.btns) {
  margin-bottom: var(--s);
}

/* the btn (default filled, size m) */
.btn {
  --_btn-a: var(--c);
  --_btn-b: var(--c);
  --_btn-c: var(--white);

  margin: 0;
  box-sizing: border-box;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;

  border-style: solid;
  border-color: var(--_btn-a);
  background-color: var(--_btn-b);
  color: var(--_btn-c);

  transition: transform var(--s--xs) ease, opacity var(--s--xs) ease;

  /* size dependent (default m) */
  min-width: var(--btn-min-width);
  border-radius: var(--btn-border-radius);
  border-width: var(--btn-border-width);
  padding: var(--btn-padding);
  line-height: var(--btn-line-height);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  text-transform: var(--btn-text-transform);
}

a.btn {
  text-decoration: none;
}

/* btn types (outline vs default filled) */
.btn--outline,
.btns--outline .btn {
  --_btn-a: var(--c);
  --_btn-b: var(--white);
  --_btn-c: var(--c);
}

/* btn states */
.btn:hover {
  opacity: 0.9;
}

.btn:focus {}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* --- btn sizes xs, s, m, l, xl --- */
/* tiny btn (eg copy btn) */
.btn--xs,
.btns--xs .btn {
  --btn-min-width: var(--btn--xs-min-width);
  --btn-border-radius: var(--btn--xs-border-radius);
  --btn-border-width: var(--btn--xs-border-width);
  --btn-padding: var(--btn--xs-padding);
  --btn-line-height: var(--btn--xs-line-height);
  --btn-font-size: var(--btn--xs-font-size);
  --btn-font-weight: var(--btn--xs-font-weight);
  --btn-text-transform: var(--btn--xs-text-transform);
}

/* small btn (eg form options) */
.btn--s,
.btns--s .btn {
  --btn-min-width: var(--btn--s-min-width);
  --btn-border-radius: var(--btn--s-border-radius);
  --btn-border-width: var(--btn--s-border-width);
  --btn-padding: var(--btn--s-padding);
  --btn-line-height: var(--btn--s-line-height);
  --btn-font-size: var(--btn--s-font-size);
  --btn-font-weight: var(--btn--s-font-weight);
  --btn-text-transform: var(--btn--s-text-transform);
}

/* medium btn (default btn) */
/* large btn (eg call-to-action) */
.btn--l,
.btns--l .btn {
  --btn-min-width: var(--btn--l-min-width);
  --btn-border-radius: var(--btn--l-border-radius);
  --btn-border-width: var(--btn--l-border-width);
  --btn-padding: var(--btn--l-padding);
  --btn-line-height: var(--btn--l-line-height);
  --btn-font-size: var(--btn--l-font-size);
  --btn-font-weight: var(--btn--l-font-weight);
  --btn-text-transform: var(--btn--l-text-transform);
}

/* extra large btn */
.btn--xl,
.btns--xl .btn {
  --btn-min-width: var(--btn--xl-pamin-min-width);
  --btn-border-radius: var(--btn--xl-border-radius);
  --btn-border-width: var(--btn--xl-border-width);
  --btn-padding: var(--btn--xl-padding);
  --btn-line-height: var(--btn--xl-line-height);
  --btn-font-size: var(--btn--xl-font-size);
  --btn-font-weight: var(--btn--xl-font-weight);
  --btn-text-transform: var(--btn--xl-text-transform);
}


/* --- input --- */

input[type="text"],
input[type="password"] {
  outline: none;
  border: none;
  box-sizing: border-box;
  width: 100%;
  border-style: solid;
  border-radius: var(--btn-border-radius);
  border-width: .5px;
  padding: var(--btn-padding);
  line-height: var(--btn-line-height);
  font-size: var(--btn-font-size);
  font-size: var(--font-size--m);
  /* !!! */
  font-weight: var(--btn-font-weight);
  text-transform: var(--btn-text-transform);
  border-color: var(--grey90);
  margin: 0 0 var(--m) 0;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"].btn--l,
input[type="password"].btn--l {
  border-width: .5px;
}

input:focus {
  border-color: var(--c);
  box-shadow: 0 0 0 2px hsl(330, 50%, 60%, .1);
  outline: none;
}

/* ---------- CARDS .card ---------- */

.card {
  --_card-c: var(--c, var(--grey));

  box-sizing: border-box;
  width: 100%;
  background-color: var(--white);
  border-radius: var(--m);

  /* Organischer Schatten, der die Kontextfarbe dezent mitnutzt */
  /*    box-shadow: 0 2px 4px rgba(0,0,0,0.06);*/
  /*    box-shadow: 2px 4px 16px color-mix(in srgb, var(--_card-c) 15%, transparent); */
  box-shadow: 0px 2px 4px color-mix(in srgb, var(--_card-c) 5%, transparent);

  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: var(--m);
}

.card-header {
  width: 100%;
  padding-bottom: var(--s);
  margin-bottom: var(--m);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid var(--_card-c);
}

.card-title {
  margin: 0;
  color: var(--c20);
}

.card-body {
  padding: var(--m) 0;
  overflow: auto;
  /* FIX: Verhindert permanente, leere Scrollbalken */
}

.card-footer {
  margin-top: var(--m);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--m);
}

/* Modifikator für dezent eingefärbte Karten über color-mix() */
.card--tinted {
  background-color: color-mix(in srgb, var(--_card-c) 8%, var(--white));
}

/* Behebt das Kontrast-Problem bei Gelb vollautomatisch */
.card--tinted:has(.io-yellow) {
  background-color: color-mix(in srgb, var(--_card-c) 15%, var(--white));
}

/* Bars / Sektionen innerhalb von Karten */
.nav-bar,
.card-bar {
  border: 1px solid var(--c);
  background-color: var(--c);
}

.nav-bar:has(.btn),
.card-bar:has(.btn) {
  min-height: 48px;
}

.nav-bar .btn,
.card-bar .btn {
  background-color: var(--c);
  color: var(--white);
}



/* ---------- BADGES .badge ---------- */

.badge {
  min-width: var(--xl);
  padding: var(--btn--s-padding);
  border-radius: 100px;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  font-size: var(--font-size--s);
  font-weight: var(--font-weight--normal);
  text-transform: uppercase;

  /*    border: 1px solid color-mix(in srgb, var(--c) 40%, var(--white)); */
  border: 1px solid var(--c);
  background-color: color-mix(in srgb, var(--c) 15%, var(--white));
  color: var(--c);
}



/* ---------- TABLES table ---------- */

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: transparent;
}

table {
  margin: var(--m) 0;
  width: 100%;
  border-collapse: collapse;
  line-height: var(--line-height--s);
  text-align: left;
}

.table--ellipsis th,
.table--ellipsis td {
  min-width: 0px;
  max-width: 64px;
  /*256px;*/
  /* default or optioinal tbd */
  white-space-collapse: collapse;
  text-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td--ellipsis,
.td-ellipsis {
  max-width: 256px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: nowrap;
}

thead {
  background-color: var(--c95);
}

tr {
  /*  border-bottom: 1px solid #e2e8f0;*/
  border-bottom: 0.5px solid var(--c80);
  transition: background-color var(--s--xs) ease;
}

tr:hover {
  background-color: var(--c99);
}

th,
td {
  display: table-cell;
  padding: var(--m) var(--xl);
  padding: var(--s) var(--m);
  padding: var(--xs) var(--xs);
  vertical-align: middle;
  /* default or optional tbd */
  /*
  min-width: 0px;
  max-width: 256px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: nowrap;
  */
}

th {
  font-weight: var(--font-weight--bold);
  min-width: 64px;
}

/* sticky header – disfunctional – to do !!! */
.th--sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background-color: #f8fafc !important;
  border-bottom-width: 2px;
}



/* asof date */
div:has(>#asofField) {
  /*    border: .1px solid blue; */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--s);
  color: var(--grey);
}

#asofField {
  all: unset;
  /*    border: .1px solid red; */
  display: block;
  height: 1rem;
  padding-bottom: .75rem;
}

div:has(#asofField) select {
  all: unset;
  color: var(--grey);
}

.col-width--xs {
  min-width: 32px;
  max-width: 64px;
}

.col-width--s {
  min-width: 64px;
  max-width: 128px;
}

.col-width--m {
  min-width: 128px;
  max-width: 256px;
}

.col-width--l {
  min-width: 256px;
  max-width: 512px;
}

.col-width--xl {
  min-width: 512px;
  max-width: 1024px;
}

/* right open column, eg for the last one */
.col-width--unset,
.col-width--unset {
  min-width: unset;
  max-width: unset;
}

/* colum breaking within word, eg for hashes */
.word-break {
  text-wrap: wrap;
  word-break: break-all;
}