/* Visual language inspired by beschaffungsassistent.de (light, Inter, brand blues).
   Bootstrap-Layout (erp/Johanniter), Farben bewusst k14g – nicht Folkwang-Blau. */
html {
  color-scheme: light;
  height: -webkit-fill-available;
}
:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #6b7280;
  --brand: #175189;
  --brand-ink: #0a3855;
  --accent: #12d9d5;
  --accent-2: #0077b6;
  --border: #e2eaf5;
  --radius: 16px;
  --radius-pill: 999px;
  --shadow: 0 6px 20px rgba(2, 18, 46, 0.08);
  --focus: 0 0 0 3px rgba(23, 81, 137, 0.25);
  --danger: #b32626;
  --success: #1b7c2c;
  --header-h: 72px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bs-body-font-family: var(--font);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-primary: #0077b6;
  --bs-primary-rgb: 0, 119, 182;
  --bs-link-color: #0077b6;
  --bs-link-hover-color: #0a3855;
  --bs-border-color: #e2eaf5;
  --bs-secondary: #4988b4;
  --bs-secondary-rgb: 73, 136, 180;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn:hover,
a.btn:focus-visible,
a.btn-icon-only:hover,
a.btn-icon-only:focus-visible {
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.app-header .brand {
  min-width: 0;
}
.app-nav-toggle {
  flex-shrink: 0;
  margin-left: auto;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-ink);
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-icon:hover,
.btn-icon:focus-visible {
  background: rgba(18, 217, 213, 0.12);
  border-color: rgba(0, 119, 182, 0.25);
  color: var(--brand-ink);
  text-decoration: none;
}
.btn-icon-sm {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
}
.app-offcanvas {
  --bs-offcanvas-width: 18rem;
  --bs-offcanvas-zindex: 1055;
  width: 18rem;
  max-width: 88vw;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(2, 18, 46, 0.12);
  background-color: #fff;
}
.app-offcanvas.offcanvas.show,
.app-offcanvas.offcanvas.showing {
  visibility: visible;
}
.app-offcanvas .offcanvas-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.app-offcanvas .offcanvas-title {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--brand-ink);
}
.app-offcanvas .offcanvas-body {
  padding: 0.75rem 0.65rem 1.25rem;
  gap: 0.75rem;
}
.app-nav-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.app-nav-logout {
  margin: 0;
}
.app-nav-link-btn {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.app-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  color: var(--brand-ink);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.app-nav-link:hover {
  background: rgba(18, 217, 213, 0.12);
  text-decoration: none;
  color: var(--brand-ink);
}
.app-nav-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(18, 217, 213, 0.25), rgba(0, 119, 182, 0.18));
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-size: 0.95rem;
  flex-shrink: 0;
}
.app-nav-label {
  line-height: 1.3;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--brand-ink);
  line-height: 0;
}
.brand-logo {
  display: block;
  height: 1.55rem;
  width: auto;
  max-width: min(240px, 55vw);
  color: var(--brand-ink);
}
.brand-logo-lg {
  height: 2.6rem;
  max-width: min(360px, 85vw);
}
.auth-brand {
  margin: 0 0 0.75rem;
}
.header-nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.user-chip {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}
a.user-chip:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}
.profile .stack,
.auth-card .stack {
  display: grid;
  gap: 0.75rem;
}
.profile .stack label,
.auth-card .stack label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--brand-ink);
}
.profile .stack input,
.auth-card .stack input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
}
.profile .hint,
.auth-card .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}
.inline-form { display: inline; margin: 0; }

.app-main {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}
.app-main.app-main-wide {
  width: min(1280px, calc(100% - 1.5rem));
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-2);
  margin: 0 0 0.35rem;
}
h1 {
  margin: 0 0 0.5rem;
  color: var(--brand-ink);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}
.lead { color: var(--muted); margin: 0 0 1.25rem; max-width: 40rem; }
.hint, .muted { color: var(--muted); font-size: 0.9rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.mono.small { font-size: 0.75rem; }
.secret {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.qr-wrap {
  display: grid;
  place-items: center;
  margin: 0.75rem 0 0.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.qr-wrap img {
  width: min(220px, 70vw);
  height: auto;
  display: block;
}

/* Auth / Dashboard: markenstarke Buttons; Modulseiten nutzen Bootstrap-Klassen. */
.auth-card .btn,
.dashboard-intro + .tile-grid ~ .btn,
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth-card .btn:hover { text-decoration: none; transform: translateY(-1px); }
.auth-card .btn-primary,
.app-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #1aa8d8 0%, var(--accent-2) 100%);
  box-shadow: 0 8px 18px rgba(0, 119, 182, 0.28);
}
.auth-card .btn-secondary {
  color: #fff;
  background: linear-gradient(180deg, #6eb6dd 0%, #4988b4 100%);
}
.btn-ghost {
  background: #e7eef6;
  color: var(--brand);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-primary {
  --bs-btn-bg: #0077b6;
  --bs-btn-border-color: #0077b6;
  --bs-btn-hover-bg: #0a3855;
  --bs-btn-hover-border-color: #0a3855;
  --bs-btn-active-bg: #0a3855;
  --bs-btn-active-border-color: #0a3855;
}

/* Jelle / beschaffungsassistent: helles Card, Gradient-Akzent, Pill-Primary */
.gp-cockpit .card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.gp-cockpit .card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent-2) 45%, var(--accent) 100%);
}
.gp-cockpit .card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  color: var(--brand-ink);
}
.gp-cockpit .card-body {
  background: #fff;
}
.gp-cockpit .form-label {
  font-weight: 600;
  color: var(--brand-ink);
}
/* Inputs + Selects: gleiche Höhe, helles Dropdown (kein Darkly/System-Dark) */
.form-control,
.gp-cockpit .form-control {
  border-color: #d5e0ec;
  border-radius: 8px;
  background-color: #fff !important;
  color: var(--text) !important;
  color-scheme: light;
  min-height: 31px;
  height: 31px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  line-height: 1.5;
  box-sizing: border-box;
}
.form-select,
.gp-cockpit .form-select {
  border-color: #d5e0ec;
  border-radius: 8px;
  background-color: #fff !important;
  color: var(--text) !important;
  color-scheme: light;
  min-height: 31px;
  height: 31px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  line-height: 1.5;
  box-sizing: border-box;
  /* Nur eigener Pfeil – sonst doppelt mit Browser-Native */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230a3855' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 14px 10px;
  padding-right: 2rem;
}
textarea.form-control,
.gp-cockpit textarea.form-control {
  height: auto;
  min-height: 6rem;
}

textarea.form-control.form-control-sm.textarea-resizable-sm {
  min-height: 0;
  height: calc(1.5em + 0.5rem + 2px);
  max-height: 50vh;
  resize: vertical;
  overflow-y: auto;
  field-sizing: fixed;
}

.re-sums-hint {
  color: #94a3b8;
  font-size: 0.8125rem;
  margin: 0;
}
.re-sums-panel {
  max-width: 22rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #475569;
}
.re-sums-panel[hidden] {
  display: none !important;
}
.re-sums-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.2rem 0;
}
.re-sums-row-total {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
  color: #334155;
}
.re-sums-label {
  flex: 1 1 auto;
  min-width: 0;
}
.re-sums-amount {
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.re-sums-toggle.active,
.gp-tab-search-toggle.active {
  background: rgba(0, 119, 182, 0.1);
  border-color: rgba(0, 119, 182, 0.35);
  color: var(--brand-ink);
}
.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.btn-icon-only i {
  pointer-events: none;
  font-size: 1.0625rem;
  width: 1em;
  line-height: 1;
  text-align: center;
}
.re-list-table .re-sort-th {
  white-space: nowrap;
  font-weight: 600;
}
.re-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
}
.re-sort-link:hover {
  color: var(--accent-2);
  text-decoration: none;
}
.re-sort-link.is-active {
  color: var(--brand-ink);
}
.re-sort-indicator {
  font-size: 0.75rem;
  color: var(--accent-2);
  line-height: 1;
}
.re-list-table .re-list-summe-th,
.re-list-table td:has(.re-list-summe) {
  text-align: right;
  white-space: nowrap;
  padding-right: 1.1rem;
  min-width: 7.5rem;
}

.ausw-chart-panel {
  padding: 1.25rem 1.35rem;
}
.ausw-chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}
.ausw-chart-wrap-tall {
  height: 360px;
}
@media (min-width: 992px) {
  .ausw-chart-wrap-tall {
    height: 400px;
  }
}
.ausw-pie-panel {
  padding: 1.25rem 1.35rem;
}
.ausw-pie-slide-title {
  font-weight: 600;
  color: var(--brand-ink);
  min-height: 1.35rem;
}
.ausw-pie-viewport {
  touch-action: pan-y;
  outline: none;
}
.ausw-pie-viewport:focus-visible {
  box-shadow: var(--focus);
  border-radius: 12px;
}
.ausw-pie-chart-wrap {
  position: relative;
  height: min(420px, 72vw);
  min-height: 320px;
  max-width: 560px;
  margin: 0 auto;
}
.ausw-blocks {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ausw-block {
  position: relative;
  cursor: default;
}
.ausw-block-floating {
  opacity: 0.96;
  box-shadow: 0 16px 40px rgba(2, 18, 46, 0.18);
  cursor: grabbing;
}
.ausw-block-placeholder {
  min-height: 5rem;
  margin-bottom: 1rem;
  border: 2px dashed #b8c9dc;
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.65);
  box-sizing: border-box;
  pointer-events: none;
}
.ausw-blocks .ausw-block:not(.ausw-block-floating) {
  transition: transform 0.22s ease;
}
body.ausw-sorting {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
body.ausw-sorting .app-main {
  touch-action: none;
}
body.ausw-sorting .ausw-block-handle {
  cursor: grabbing;
}
body.dashboard-sorting {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
body.dashboard-sorting .app-main {
  touch-action: none;
}
body.dashboard-sorting .tile-handle {
  cursor: grabbing;
}

/* Rechnung/Angebot: Positionen per Griff sortieren */
.re-pos-drag {
  cursor: grab;
  touch-action: none;
  line-height: 1;
}
.re-pos-drag:focus-visible {
  outline: 2px solid var(--bs-primary, #0d6efd);
  outline-offset: 2px;
}
.re-pos-floating {
  opacity: 0.97;
  box-shadow: 0 8px 24px rgba(2, 18, 46, 0.16);
  cursor: grabbing;
  z-index: 1050 !important;
}
.re-pos-placeholder {
  height: 2.75rem;
  border: 2px dashed #b8c9dc;
  border-radius: var(--radius, 0.375rem);
  background: rgba(248, 250, 252, 0.8);
  box-sizing: border-box;
  pointer-events: none;
}
.re-pos-row:not(.re-pos-floating) {
  transition: transform 0.22s ease;
}
body.re-pos-sorting {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
body.re-pos-sorting .app-main {
  touch-action: none;
}
body.re-pos-sorting .re-pos-drag {
  cursor: grabbing;
}
.ausw-block-handle {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  z-index: 5;
  color: #a8b4c4;
  letter-spacing: -0.15em;
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
  padding: 0.45rem 0.55rem;
  line-height: 1;
  border: 0;
  background: transparent;
  font: inherit;
}
.ausw-block-handle:hover {
  color: #64748b;
}
.ausw-block-handle:active {
  cursor: grabbing;
  color: var(--brand-ink);
}
.ausw-block-inner.ausw-chart-panel,
.ausw-block-inner.ausw-pie-panel,
.ausw-block-inner.ausw-customer-list {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.ausw-pie-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.ausw-pie-dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.ausw-pie-dots button[aria-selected="true"] {
  background: var(--accent-2);
  transform: scale(1.25);
}
.ausw-pie-dots button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.ausw-gp-filter {
  padding: 0.75rem 1.25rem;
}
.ausw-gp-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.ausw-gp-filter-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-ink, #0a3855);
  white-space: nowrap;
  flex: 0 0 auto;
}
.ausw-ms-with-filter {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.ausw-gp-filter .ausw-ms-prefilter {
  flex: 0 1 9rem;
  width: 9rem;
  min-width: 5.5rem;
}
.ausw-gp-filter .ausw-ms-with-filter > .erp-ms-wrapper {
  flex: 1 1 12rem;
  min-width: 10rem;
}
.ausw-gp-filter .erp-ms-wrapper {
  width: 100%;
}
.erp-ms-wrapper .erp-ms-toggle {
  width: 100%;
  min-height: calc(1.5em + 0.5rem + 2px);
  padding-right: 2rem;
}
.erp-ms-wrapper .erp-ms-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 1055;
  max-height: 260px;
  overflow-y: auto;
  min-width: 100%;
  width: max(100%, 20rem);
  max-width: min(90vw, 36rem);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.4rem 0.55rem;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.12);
}
.erp-ms-wrapper .erp-ms-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.erp-ms-wrapper .erp-ms-item:last-child {
  margin-bottom: 0;
}
.erp-ms-wrapper .erp-ms-item-alle {
  font-weight: 600;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  padding-bottom: 0.35rem;
  margin-bottom: 0.4rem;
}
.erp-ms-wrapper .erp-ms-item span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ausw-customer-list {
  padding: 1.25rem 1.35rem;
}
.ausw-customer-table .ausw-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ausw-sort-th {
  vertical-align: bottom;
  white-space: nowrap;
}
.ausw-sort-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--brand-ink, #0a3855);
  cursor: pointer;
  text-align: inherit;
}
th.text-end.ausw-sort-th {
  text-align: right;
}
.ausw-sort-btn:hover {
  color: var(--brand-primary, #0077b6);
}
.ausw-sort-btn.is-active {
  color: var(--brand-primary, #0077b6);
}
.ausw-sort-dir {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ausw-customer-total th,
.ausw-customer-total td {
  border-top-width: 2px;
  font-weight: 600;
  color: var(--brand-ink);
}
.ausw-customer-table tr.ausw-inactive-1 td {
  color: #64748b;
}
.ausw-customer-table tr.ausw-inactive-1 td a {
  color: #64748b;
}
.ausw-customer-table tr.ausw-inactive-2 td {
  color: #94a3b8;
}
.ausw-customer-table tr.ausw-inactive-2 td a {
  color: #94a3b8;
}

.re-th-bez {
  vertical-align: bottom;
}
.re-th-bez-label {
  display: inline-block;
  margin-right: 0.35rem;
}
.re-bez-toolbar {
  display: inline-flex;
  vertical-align: middle;
}
.re-bez-toolbar .btn {
  padding: 0 0.25rem;
  min-height: 1.15rem;
  height: 1.15rem;
  line-height: 1;
  font-size: 0.625rem;
  border-color: #e2e8f0;
  color: #64748b;
}
.re-bez-toolbar .btn i {
  font-size: 0.625rem;
}
.re-pos-bez {
  display: block;
  width: 100%;
  min-height: 31px;
  height: 31px;
  max-height: 14rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.5;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  box-sizing: border-box;
}
.re-pos-bez.form-control-sm {
  min-height: 31px;
  height: 31px;
}
.re-pos-bez:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted, #64748b);
}
.re-pos-bez-cell {
  vertical-align: middle;
  min-width: 12rem;
}
.re-form-locked .re-pos-bez[contenteditable="false"] {
  cursor: default;
  height: auto;
  min-height: 31px;
  max-height: none;
  overflow-y: visible;
}
.re-pos-bez div {
  margin: 0;
  padding: 0;
  line-height: 1.35;
}
.re-pos-bez[contenteditable="false"] div + div {
  margin-top: 0.2em;
}
.re-pos-bez[contenteditable="false"] div:empty {
  display: none;
}
.form-control-sm,
.form-select-sm {
  min-height: 31px;
  height: 31px;
  font-size: 0.875rem;
}
.issuer-logo-row .issuer-logo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 31px;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--bs-border-radius-sm, 0.25rem);
  background: #fff;
  padding: 2px 4px;
  box-sizing: border-box;
}
.issuer-logo-row .issuer-logo-preview {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.issuer-logo-thumb {
  object-fit: contain;
  border-radius: 2px;
  background: #fff;
}
.form-select option,
select option {
  background-color: #fff;
  color: #1e293b;
}
.form-control:focus,
.form-select:focus,
.gp-cockpit .form-control:focus,
.gp-cockpit .form-select:focus {
  border-color: #9cc3e0;
  box-shadow: var(--focus);
  background-color: #fff !important;
  color: var(--text) !important;
}
.gp-cockpit .nav-tabs {
  border-bottom-color: var(--border);
}
.gp-cockpit .nav-tabs .nav-link {
  color: var(--brand);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.gp-cockpit .nav-tabs .nav-link:hover {
  color: var(--brand-ink);
  border-color: transparent;
  isolation: isolate;
}
.gp-cockpit .nav-tabs .nav-link.active {
  color: var(--brand-ink);
  background: transparent;
  border-bottom-color: var(--accent-2);
  font-weight: 600;
}
.gp-cockpit .btn-primary:not(.btn-icon-only) {
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #1aa8d8 0%, var(--accent-2) 55%, #12d9d5 100%);
  box-shadow: 0 8px 18px rgba(0, 119, 182, 0.28);
  color: #fff;
  font-weight: 600;
}
.gp-cockpit .btn-primary:not(.btn-icon-only):hover,
.gp-cockpit .btn-primary:not(.btn-icon-only):focus {
  background: linear-gradient(90deg, #1596c2 0%, #0a5f8f 55%, #0fc4c0 100%);
  color: #fff;
}
.gp-cockpit .btn-outline-secondary {
  border-color: #c5d6e8;
  color: var(--brand);
  background: #fff;
}
.gp-cockpit .btn-outline-secondary:hover {
  background: #eef4fa;
  border-color: #9cc3e0;
  color: var(--brand-ink);
}
.gp-tab-toolbar .btn.btn-sm.btn-icon-only {
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  min-height: 2.15rem;
  padding: 0;
  box-shadow: none;
}
.gp-tab-toolbar .btn-primary.btn-icon-only {
  background: var(--bs-btn-bg, #0077b6);
  border: 1px solid var(--bs-btn-border-color, #0077b6);
}
.gp-tab-toolbar .btn-primary.btn-icon-only:hover,
.gp-tab-toolbar .btn-primary.btn-icon-only:focus {
  background: var(--bs-btn-hover-bg, #0a3855);
  border-color: var(--bs-btn-hover-border-color, #0a3855);
}
.gp-cockpit .modal-content {
  border-radius: 12px;
  border-color: var(--border);
}
.gp-cockpit .modal-header {
  border-bottom-color: var(--border);
  color: var(--brand-ink);
}
/* Rechnungstabelle (GP-Tab + /re): Spalten & Summe */
.gp-cockpit .gp-re-table,
.re-list .gp-re-table {
  table-layout: auto;
}
.gp-cockpit .gp-re-table .gp-re-col-nr,
.re-list .gp-re-table .gp-re-col-nr {
  width: 6.5rem;
}
.gp-cockpit .gp-re-table .gp-re-col-art,
.re-list .gp-re-table .gp-re-col-art {
  width: 7rem;
}
.gp-cockpit .gp-re-table .gp-re-col-summe,
.re-list .gp-re-table .gp-re-col-summe {
  width: 8.75rem;
}
.gp-cockpit .gp-re-table .gp-re-col-datum,
.re-list .gp-re-table .gp-re-col-datum {
  width: 6.25rem;
}
.gp-cockpit .gp-re-table .gp-re-col-status,
.re-list .gp-re-table .gp-re-col-status {
  width: 6rem;
}
.gp-cockpit .gp-re-table .gp-re-col-actions,
.re-list .gp-re-table .gp-re-col-actions {
  width: 3.25rem;
}
.beleg-status-select {
  max-width: 7.5rem;
}
.beleg-status-form .beleg-status-btn-icon {
  width: 1.5rem;
  height: 1.5rem;
  min-height: 1.5rem;
  font-size: 0.65rem;
}
.beleg-status-form .btn.btn-primary.beleg-status-btn-icon {
  width: 1.5rem;
  height: 1.5rem;
}
.gp-cockpit .gp-re-table th.gp-re-summe,
.gp-cockpit .gp-re-table td.gp-re-summe,
.re-list .gp-re-table th.gp-re-summe,
.re-list .gp-re-table td.gp-re-summe {
  text-align: right;
  white-space: nowrap;
  padding-right: 1.35rem;
}
.gp-cockpit .gp-re-table th.gp-re-date,
.gp-cockpit .gp-re-table td.gp-re-date,
.re-list .gp-re-table th.gp-re-date,
.re-list .gp-re-table td.gp-re-date {
  white-space: nowrap;
  padding-left: 0.35rem;
}
.gp-file-tree {
  max-height: 420px;
  overflow: auto;
  background: #f8fbfe !important;
}
.gp-tree-roots { margin: 0; padding: 0; }
.gp-tree-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 1.85rem;
}
.gp-tree-toggle,
.gp-tree-toggle-spacer {
  width: 1.25rem;
  flex: 0 0 1.25rem;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  line-height: 1;
}
.gp-tree-pick {
  flex: 1 1 auto;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--brand-ink);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
}
.gp-tree-pick:hover { background: #eef4fa; }
.gp-tree-pick.active {
  background: linear-gradient(90deg, rgba(0, 119, 182, 0.14), rgba(18, 217, 213, 0.12));
  font-weight: 600;
}
.gp-tree-children { margin: 0; padding: 0; }

/* Projektstandard: helle Drag&Drop-Zone */
.k14g-dropzone {
  border: 2px dashed #9cc3e0;
  border-radius: 12px;
  background: #f8fbfe;
  color: var(--brand-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.k14g-dropzone:hover,
.k14g-dropzone.is-dragover {
  border-color: var(--accent-2);
  background: #eef7fc;
  box-shadow: var(--focus);
}
.k14g-dropzone-inner {
  text-align: center;
  padding: 1.25rem 1rem;
}
.k14g-dropzone-icon {
  font-size: 1.75rem;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
  display: block;
}
.k14g-dropzone-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.k14g-dropzone-hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.gp-file-preview-frame {
  min-height: 240px;
  background: #fff;
}
.gp-file-preview-iframe {
  width: 100%;
  height: 420px;
  border: 0;
  background: #fff;
}

/* Login/Passwort: volle Viewport-Höhe, Karte mittig, kein Header (Logo in der Karte). */
body.auth-page {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
body.auth-page .app-header {
  display: none;
}
body.auth-page .app-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: max(0.75rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  min-height: 0;
  box-sizing: border-box;
}
body.auth-page .app-main > .alert {
  width: min(440px, 100%);
  flex-shrink: 0;
  margin: 0 0 0.75rem;
}
.auth-card {
  width: min(440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .auth-card {
    padding: 1.25rem 1.1rem;
    border-radius: 20px;
  }
  .auth-card .eyebrow {
    margin-bottom: 0.35rem;
  }
  .auth-brand {
    margin-bottom: 0.5rem;
  }
  .brand-logo-lg {
    height: 2.15rem;
  }
  .auth-card .lead {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
  .auth-card .stack {
    gap: 0.65rem;
  }
}
.stack { display: grid; gap: 0.9rem; }
label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
}
input:focus-visible { outline: none; box-shadow: var(--focus); border-color: #9cc3e0; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 140px;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(2, 18, 46, 0.12);
}
.tile-floating {
  opacity: 0.96;
  box-shadow: 0 16px 40px rgba(2, 18, 46, 0.2);
  cursor: grabbing;
}
.tile-placeholder {
  min-height: 140px;
  border: 2px dashed #b8c9dc;
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.65);
  box-sizing: border-box;
  pointer-events: none;
}
.tile-grid .tile {
  transition: transform 0.22s ease;
}
.tile-label {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-ink);
}
.tile-handle {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  color: #a8b4c4;
  letter-spacing: -0.15em;
  font-size: 0.85rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  padding: 0.45rem 0.55rem;
  line-height: 1;
  border: 0;
  background: transparent;
  font: inherit;
}
.tile-handle:hover {
  color: #64748b;
}
.tile-handle:active {
  cursor: grabbing;
  color: var(--brand-ink);
}
.tile-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(18, 217, 213, 0.28), rgba(0, 119, 182, 0.2));
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.tile-icon i {
  display: block;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.uam-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .uam-grid { grid-template-columns: 1fr 1fr; }
}
.uam-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}
.checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 400;
  font-size: 0.9rem;
}
.empty { color: var(--muted); }
.module, .dashboard, .gp-cockpit { animation: rise 0.35s ease; }
.form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.auth-card select,
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
