/* =========================================================================
   12cloudservices Management Tool
   Farbwelt aus dem Firmenlogo: Tuerkis #2CABD6, Blau #1D4E9B, Anthrazit.
   Die Diagrammfarben stammen aus einer auf Farbfehlsichtigkeit geprueften
   Referenzpalette (Blau/Orange) und werden fuer den Dunkelmodus eigens
   gesetzt, nicht einfach invertiert.
   ========================================================================= */

:root {
  color-scheme: light;

  --brand-cyan: #2CABD6;
  --brand-blue: #1D4E9B;

  --bg:            #f3f5f9;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --sidebar-bg:    #ffffff;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --text:    #16202e;
  --text-2:  #4a5568;
  --muted:   #7b8794;

  --accent:        #1D4E9B;
  --accent-text:   #ffffff;
  --accent-soft:   #eaf1fb;
  --accent-hover:  #17407f;

  --good:     #0f7a3d;
  --good-bg:  #e7f6ed;
  --bad:      #c0322f;
  --bad-bg:   #fdecec;
  --warn:     #9a6300;
  --warn-bg:  #fdf3e0;
  --neutral-bg: #eef1f6;

  /* Diagramm-Rollen */
  --viz-surface:  #ffffff;
  --viz-grid:     #e7ebf1;
  --viz-axis:     #c3cbd6;
  --viz-muted:    #7b8794;
  --series-1:     #2a78d6;   /* Einnahmen */
  --series-2:     #eb6834;   /* Kosten */
  --seq-400:      #3987e5;
  --seq-200:      #9ec5f4;

  /* Dichte nach dem Vorbild von SAP Business One: schmale Zeilen, kleine
     Schrift, moeglichst viele Datensaetze auf einen Blick. Ueber
     Einstellungen > Darstellung auf "Normal" umschaltbar. */
  --row-py:    1px;
  --row-px:    6px;
  --grid-font: 11px;
  --ui-font:   12px;
  --sticky1-w: 104px;   /* Kunde */
  --sticky2-w: 52px;    /* Inv-Nr. */
  --sticky3-w: 164px;   /* Geraet */
  --kpi-py:    7px;
  --page-py:   12px;
  --control-py: 3px;
  --control-px: 7px;

  --radius:    10px;
  --radius-sm: 7px;
  --shadow:    0 1px 2px rgba(15, 30, 55, .06), 0 4px 16px rgba(15, 30, 55, .06);
  --shadow-lg: 0 10px 40px rgba(15, 30, 55, .18);

  --sidebar-w: 186px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-density="normal"] {
  --row-py:    8px;
  --row-px:    11px;
  --grid-font: 13px;
  --ui-font:   14px;
  --sticky1-w: 150px;
  --sticky2-w: 80px;
  --sticky3-w: 226px;
  --kpi-py:    13px;
  --page-py:   22px;
  --control-py: 8px;
  --control-px: 10px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #10161f;
  --surface:       #18202c;
  --surface-2:     #1e2734;
  --sidebar-bg:    #141b25;
  --border:        #2a3547;
  --border-strong: #3a4759;

  --text:    #e8eef7;
  --text-2:  #b3c0d1;
  --muted:   #8595a8;

  --accent:       #3987e5;
  --accent-text:  #0b1220;
  --accent-soft:  #1d2c40;
  --accent-hover: #4e97ee;

  --good:     #3fbb6b;
  --good-bg:  #17301f;
  --bad:      #f07070;
  --bad-bg:   #331a1a;
  --warn:     #e0a53a;
  --warn-bg:  #332813;
  --neutral-bg: #222c3a;

  --viz-surface:  #18202c;
  --viz-grid:     #263145;
  --viz-axis:     #3a4759;
  --viz-muted:    #8595a8;
  --series-1:     #3987e5;
  --series-2:     #d95926;
  --seq-400:      #3987e5;
  --seq-200:      #1c5cab;

  --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--ui-font);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ Grundgeruest */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
}
/* Waehrend der Anmeldung gilt das Spaltenraster nicht. */
body.is-login .app { display: block; height: auto; }

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.sidebar__brand {
  display: block;
  padding: 11px 12px 9px;
  color: var(--text);
}
.logo { display: block; width: 100%; height: auto; font-family: var(--font); }

.sidebar__nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 10px; }

/* Einstellungen sind unten am Bildschirmrand angeheftet. */
.sidebar__foot {
  flex: 0 0 auto;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--grid-font);
  font-weight: 500;
  line-height: 1.5;
  transition: background .12s, color .12s;
}
.nav__item:hover { background: var(--accent-soft); color: var(--accent); }
.nav__item.is-active { background: var(--accent); color: var(--accent-text); }
.nav__item svg { width: 14px; height: 14px; flex: none; }
.nav__badge {
  margin-left: auto;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--muted);
}
.nav__item.is-active .nav__badge { background: rgba(255,255,255,.22); color: inherit; }

.main { min-width: 0; overflow: auto; outline: none; }

/* ----------------------------------------------------------------- Seiten */

.page { padding: var(--page-py) 22px 48px; }

.page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.page__title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.1px; }
.page__sub { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.page__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------- Bausteine */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--border);
}
.card__title { margin: 0; font-size: 12px; font-weight: 650; }
.card__body { padding: 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--control-py) calc(var(--control-px) + 3px);
  font-size: var(--grid-font);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn svg { width: 13px; height: 13px; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn--danger:hover { background: var(--bad-bg); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn--sm { padding: 5px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%;
  padding: var(--control-py) var(--control-px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--grid-font);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.textarea { resize: vertical; min-height: 66px; }
.input[type="number"] { font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field__label { font-size: 10.5px; font-weight: 600; color: var(--text-2); }
.field__hint { font-size: 10px; color: var(--muted); line-height: 1.35; }
.field__hint.neg { color: var(--bad); }
.field__hint.pos { color: var(--good); }
.field--wide { grid-column: 1 / -1; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 7px 10px;
}
.form-section { margin-bottom: 13px; }
.form-section__title {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.toolbar__search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar__search .input { padding-left: 32px; }
.toolbar__search svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}

/* ---------------------------------------------------------------- Kennzahl */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--kpi-py) 14px;
  box-shadow: var(--shadow);
}
.kpi__label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted);
}
.kpi__value {
  margin-top: 1px; font-size: 15px; font-weight: 660; letter-spacing: -.3px;
}
.kpi__note { margin-top: 1px; font-size: 10px; color: var(--muted); line-height: 1.3; }
.kpi--good .kpi__value { color: var(--good); }
.kpi--bad  .kpi__value { color: var(--bad); }

/* ---------------------------------------------------------------- Tabellen */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: calc(100vh - 186px);
}
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--grid-font);
  line-height: 1.35;
}
table.grid th, table.grid td {
  padding: var(--row-py) var(--row-px);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
table.grid thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface-2);
  font-size: calc(var(--grid-font) - 1px); font-weight: 650;
  letter-spacing: .2px; color: var(--text-2);
  border-bottom: 1px solid var(--border-strong);
  cursor: pointer; user-select: none;
  white-space: nowrap;
}
table.grid thead th.no-sort { cursor: default; }
table.grid thead th .sort-mark { color: var(--accent); margin-left: 3px; }
table.grid tbody tr:hover td { background: var(--accent-soft); }
table.grid tbody tr { cursor: pointer; }

table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .pos { color: var(--good); }
table.grid .neg { color: var(--bad); }

/* Kunde, Inv-Nr. und Geraet bleiben beim seitlichen Scrollen stehen. */
table.grid .sticky-1, table.grid .sticky-2, table.grid .sticky-3 {
  position: sticky; z-index: 2; background: var(--surface);
}
table.grid .sticky-1 {
  left: 0; width: var(--sticky1-w); min-width: var(--sticky1-w);
  white-space: normal;
}
table.grid .sticky-2 {
  left: var(--sticky1-w); width: var(--sticky2-w); min-width: var(--sticky2-w);
}
table.grid .sticky-3 {
  left: calc(var(--sticky1-w) + var(--sticky2-w));
  width: var(--sticky3-w); min-width: var(--sticky3-w);
  white-space: normal;
}
table.grid .sticky-3::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: var(--border-strong);
}
table.grid thead .sticky-1, table.grid thead .sticky-2, table.grid thead .sticky-3 {
  z-index: 4; background: var(--surface-2);
}
table.grid tbody tr:hover .sticky-1,
table.grid tbody tr:hover .sticky-2,
table.grid tbody tr:hover .sticky-3 { background: var(--accent-soft); }
table.grid tfoot td {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--surface-2);
  border-top: 1px solid var(--border-strong);
  font-weight: 650;
}
table.grid tfoot .sticky-1,
table.grid tfoot .sticky-2,
table.grid tfoot .sticky-3 { z-index: 4; background: var(--surface-2); }

.cell-main { font-weight: 570; }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }

.empty {
  padding: 46px 20px; text-align: center; color: var(--muted);
}
.empty__title { font-weight: 600; color: var(--text-2); margin-bottom: 5px; }

/* ------------------------------------------------------------------ Badges */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 620; white-space: nowrap;
  background: var(--neutral-bg); color: var(--text-2);
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--aktiv        { background: var(--good-bg); color: var(--good); }
.badge--verfuegbar   { background: var(--accent-soft); color: var(--accent); }
.badge--geplant      { background: var(--warn-bg); color: var(--warn); }
.badge--pausiert     { background: var(--warn-bg); color: var(--warn); }
.badge--verkauft     { background: var(--neutral-bg); color: var(--muted); }
.badge--ausgemustert { background: var(--neutral-bg); color: var(--muted); }
.badge--offen        { background: var(--accent-soft); color: var(--accent); }
.badge--beauftragt   { background: var(--warn-bg); color: var(--warn); }
.badge--uebernommen  { background: var(--good-bg); color: var(--good); }
.badge--verworfen    { background: var(--neutral-bg); color: var(--muted); }

.warn-dot {
  display: inline-block; margin-left: 5px; color: var(--warn);
  font-weight: 700; cursor: help;
}

/* Amortisations-Balken in der Tabelle */
.meter { display: flex; align-items: center; gap: 7px; min-width: 104px; }
.meter__track {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--neutral-bg); overflow: hidden;
}
.meter__fill { height: 100%; border-radius: 999px; background: var(--seq-400); }
.meter__fill--done { background: var(--good); }
.meter__value {
  font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--text-2);
  min-width: 38px; text-align: right;
}

/* ------------------------------------------------------------------ Dialog */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 18, 32, .5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 14px; overflow-y: auto;
}
/* Das Fenster passt immer ganz auf den Schirm -- auch auf 1366x768.
   Kopf und Fußleiste bleiben stehen, nur der Inhalt scrollt. */
.modal {
  width: 100%; max-width: 720px;
  max-height: calc(100vh - 28px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-size: var(--grid-font);
}
/* Zwischen Kopf und Inhalt liegt ein Hüllelement (Inhalt + Fußleiste) --
   es muss den Platz weiterreichen, damit der Inhalt scrollen kann. */
.modal > :not(.modal__head) {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.modal__head, .modal__foot { flex: 0 0 auto; }
.modal__body { flex: 1 1 auto; min-height: 0; }
.modal--narrow { max-width: 400px; }
.modal--wide { max-width: 1040px; }
.modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.modal__title { margin: 0; font-size: 13px; font-weight: 650; }
.modal__sub { margin: 1px 0 0; font-size: 10.5px; color: var(--muted); }
.modal__body { padding: 11px 12px; overflow-y: auto; }
.modal__foot {
  display: flex; gap: 6px; justify-content: flex-end; align-items: center;
  padding: 8px 12px; border-top: 1px solid var(--border);
  background: var(--surface); border-radius: 0 0 8px 8px;
}
.modal__close { margin-left: auto; }

.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 7px 10px;
}
.detail__label { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.detail__value { font-size: var(--grid-font); margin-top: 1px; font-variant-numeric: tabular-nums; }

.notice {
  display: flex; gap: 9px; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--warn-bg); color: var(--warn); font-size: 12.5px;
  margin-bottom: 14px;
}
.notice--info { background: var(--accent-soft); color: var(--accent); }
.notice ul { margin: 0; padding-left: 16px; }

/* ----------------------------------------------------------------- Spalten */

.colpick {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 6px);
  width: 260px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px;
}
.colpick label {
  display: flex; align-items: center; gap: 8px; padding: 5px 7px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.colpick label:hover { background: var(--accent-soft); }
.dropdown { position: relative; }

/* --------------------------------------------------------------- Diagramme */

.chart { width: 100%; display: block; font-family: var(--font); overflow: visible; }
.chart text { fill: var(--viz-muted); font-size: 11px; }
.chart .grid-line { stroke: var(--viz-grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--viz-axis); stroke-width: 1; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .s1 { stroke: var(--series-1); }
.chart .s2 { stroke: var(--series-2); }
.chart .end-label { font-size: 11.5px; font-weight: 650; }
.chart .end-label.s1 { fill: var(--series-1); stroke: none; }
.chart .end-label.s2 { fill: var(--series-2); stroke: none; }
.chart .hover-line { stroke: var(--viz-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { stroke: var(--viz-surface); stroke-width: 2; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.legend__item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.legend__swatch { width: 11px; height: 11px; border-radius: 3px; }

.chart-tip {
  position: absolute; z-index: 20; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 8px 11px; font-size: 12.5px; min-width: 150px;
}
.chart-tip__title { font-weight: 650; margin-bottom: 4px; }
.chart-tip__row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.chart-tip__row b { font-variant-numeric: tabular-nums; }
.chart-holder { position: relative; }

/* --------------------------------------------------------------- Anmeldung */

.login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login__card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.login__logo { width: 168px; margin: 0 auto 22px; display: block; color: var(--text); }
.login__title { margin: 0 0 3px; font-size: 16px; font-weight: 650; }
.login__sub { margin: 0 0 20px; font-size: 12.5px; color: var(--muted); }
.login .field { margin-bottom: 13px; }
.login__error {
  background: var(--bad-bg); color: var(--bad);
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 12.5px; margin-bottom: 13px;
}
.login .btn { width: 100%; justify-content: center; }

/* Benutzerkachel unten in der Seitenleiste */
.whoami {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 7px 6px; margin-bottom: 3px;
}
.whoami__avatar {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.whoami__text { min-width: 0; flex: 1; }
.whoami__name {
  font-size: 11px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.whoami__role { font-size: 9.5px; color: var(--muted); }

/* ----------------------------------------------------------------- Reiter */

.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.tab {
  padding: 5px 10px;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2); font-family: inherit;
  font-size: var(--grid-font); font-weight: 550;
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.tab:hover { color: var(--accent); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab svg { width: 13px; height: 13px; }

/* -------------------------------------------------------- Rechte-Matrix ---- */

.rights { width: 100%; border-collapse: collapse; font-size: 13px; }
.rights th, .rights td {
  padding: 7px 9px; border-bottom: 1px solid var(--border); text-align: left;
}
.rights th { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .3px; }
.rights td:first-child { font-weight: 550; }
.rights .seg { display: flex; gap: 0; }
.rights .seg button {
  padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-right-width: 0;
}
.rights .seg button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.rights .seg button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right-width: 1px; }
.rights .seg button:hover { background: var(--accent-soft); }
.rights .seg button.is-on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}
.rights .seg button.is-on + button { border-left-color: var(--accent); }

.readonly-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  padding: 5px 10px; border-radius: 999px; background: var(--neutral-bg);
}

/* --------------------------------------------------------- Ablagefläche --- */

.dropzone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; margin-bottom: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--grid-font);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.dropzone:hover { border-color: var(--accent); color: var(--accent); }
.dropzone.is-over {
  border-color: var(--accent); border-style: solid;
  background: var(--accent-soft); color: var(--accent);
}

/* ------------------------------------------------------------------ Toasts */

.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 10px 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 13px; max-width: 380px;
}
.toast--ok  { border-left: 3px solid var(--good); }
.toast--err { border-left: 3px solid var(--bad); }

/* ------------------------------------------------------- Inline-Bearbeitung */

.grid--edit td { padding: 4px 6px; }
.grid--edit .input, .grid--edit .select {
  padding: 5px 7px; font-size: 12.5px; border-color: transparent; background: transparent;
}
.grid--edit .input:hover, .grid--edit .select:hover { border-color: var(--border-strong); }
.grid--edit .input:focus, .grid--edit .select:focus { background: var(--surface); }
.grid--edit tbody tr { cursor: default; }
.grid--edit tbody tr:hover td { background: transparent; }
.w-70  { width: 70px; }
.w-90  { width: 90px; }
.w-110 { width: 110px; }
.w-130 { width: 130px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }

.row-actions { display: flex; gap: 4px; }

/* ------------------------------------------------------------------ Kleines */

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

.skeleton { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar__brand { padding: 10px 14px; flex: none; width: 130px; }
  .sidebar__nav { display: flex; gap: 4px; padding: 8px; }
  .sidebar__foot { border-top: none; border-left: 1px solid var(--border); }
  .nav__item { margin-bottom: 0; }
  .table-wrap { max-height: none; }
  .page { padding: 16px; }
}
