@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-body: 'Inter', sans-serif;
  --app-bg: #ebedf1;
  --surface: #ffffff;
  --surface-soft: #f6f7fa;
  --text: #2f3542;
  --muted: #8b93a3;
  --line: #e4e7ee;
  --teal: #367c83;
  --teal-strong: #2f6d73;
  --sidebar-text: #d8f0ee;
  --sidebar-muted: #a9d0cc;
  --danger: #d94a4a;
  --good: #0f9a67;
  --shadow: 0 1px 0 rgba(16, 24, 40, 0.02), 0 8px 20px rgba(16, 24, 40, 0.04);
}

html[data-accent="orange"],
body[data-accent="orange"] {
  --teal: #ff7300;
  --teal-strong: #e16400;
}

body[data-theme="dark"] {
  --app-bg: #141922;
  --surface: #1e2532;
  --surface-soft: #181e2a;
  --text: #ecf1fb;
  --muted: #9ca8ba;
  --line: #2d3648;
  --teal: #367c83;
  --teal-strong: #2f6d73;
  --sidebar-text: #dff4f2;
  --sidebar-muted: #9fc4c0;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    --app-bg: #141922;
    --surface: #1e2532;
    --surface-soft: #181e2a;
    --text: #ecf1fb;
    --muted: #9ca8ba;
    --line: #2d3648;
    --teal: #367c83;
    --teal-strong: #2f6d73;
    --sidebar-text: #dff4f2;
    --sidebar-muted: #9fc4c0;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { font-size: 121%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--app-bg);
  color: var(--text);
  min-height: 100vh;
}

body.app-auth {
  overflow: hidden;
}

.bg-orb { display: none; }

.layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--teal), var(--teal-strong));
  color: var(--sidebar-text);
  padding: 14px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-auth .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 8px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-eye {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-eye svg {
  width: 100%;
  height: 100%;
}

.brand-eye svg path:first-of-type {
  fill: #c8f4ef;
  opacity: 0.95;
}

.brand-eye svg circle:first-of-type {
  fill: #7fd8cd;
}

.brand-eye svg circle:last-of-type {
  fill: #1d4f53;
}

.brand strong {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: block;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--sidebar-muted);
  font-size: 0.63rem;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 2px;
}

.main-nav a,
.main-nav .nav-parent {
  text-decoration: none;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.94;
}

.main-nav a .nav-ico,
.main-nav .nav-parent .nav-ico {
  width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  opacity: 1;
}

.main-nav .nav-parent {
  margin-top: 2px;
}

.main-nav .nav-sub {
  margin-left: 0;
  padding-left: 26px;
}

.accent-switch {
  margin-top: 12px;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.accent-title {
  color: var(--sidebar-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.accent-options {
  display: flex;
  gap: 8px;
}

.accent-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
  cursor: pointer;
}

.accent-btn span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.accent-btn.is-active {
  border-color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.content {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 10px 12px 18px;
}

.app-auth .content {
  padding: 0 12px 18px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-header {
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: var(--shadow);
}

.header-search {
  width: min(560px, 70%);
}

.header-search input {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.74rem;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  color: var(--muted);
}

.user-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--teal) 76%, white);
}

.topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.topbar-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
}

.topbar-actions {
  display: inline-flex;
  gap: 7px;
}

h1, h2, h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.card,
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.app-auth .content > section:first-of-type {
  margin: 0 -12px 0 -12px;
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.cards {
  display: grid;
  gap: 10px;
}

.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wealth-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.metric p {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.metric p.pos { color: var(--good); }
.metric p.neg { color: var(--danger); }

.metric-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.metric-link:visited,
.metric-link:hover {
  text-decoration: none;
  color: inherit;
  border-color: color-mix(in oklab, var(--teal) 35%, var(--line));
}

.metric-link:active {
  text-decoration: none;
  color: inherit;
}

.metric-link:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--teal) 42%, transparent);
  outline-offset: 1px;
}

.metric-link h2,
.metric-link p,
.metric-link .badge {
  text-decoration: none;
}

.metric-link h2 {
  color: var(--text);
}

.metric-link .badge {
  color: var(--muted);
}

.inline-link {
  color: var(--teal-strong);
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.product-browser-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.product-browser-card {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
}

.product-browser-card:hover {
  border-color: color-mix(in oklab, var(--teal) 55%, var(--line));
  box-shadow: var(--shadow);
}

.product-browser-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: #edf2f8;
  border: 1px solid var(--line);
}

.product-browser-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-browser-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.product-browser-sub {
  font-size: 0.66rem;
  color: var(--muted);
  line-height: 1.3;
}

.product-browser-sub.is-empty {
  visibility: hidden;
}

.finanzverwaltung-main {
  margin-left: 12px;
  margin-right: 12px;
}

.finanzverwaltung-main .tabview {
  margin-top: 0 !important;
}

.product-detail-wrap {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  align-items: start;
}

.product-detail-media {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.product-detail-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-detail-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.product-detail-top-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "title barcode"
    "gruppe kategorie"
    "massen stueck";
}

.product-detail-title-block {
  grid-area: title;
  padding: 2px 0;
}

.product-detail-title-block h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.product-detail-title-block p {
  margin: 4px 0 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.product-detail-top-card--barcode { grid-area: barcode; }
.product-detail-top-card--gruppe { grid-area: gruppe; }
.product-detail-top-card--kategorie { grid-area: kategorie; }
.product-detail-top-card--stueck { grid-area: stueck; }

.product-detail-top-measure-row {
  grid-area: massen;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-detail-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-detail-grid > div,
.product-detail-top-card {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.product-detail-grid strong,
.product-detail-top-card strong {
  font-size: 0.64rem;
  color: var(--muted);
  font-weight: 600;
}

.product-detail-grid span,
.product-detail-top-card span {
  font-size: 0.72rem;
  color: var(--text);
}

.product-detail-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.product-detail-heading {
  margin: 0;
}

.product-detail-heading--preise,
.product-detail-heading--hersteller {
  margin-top: 24px;
}

.product-url-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  background: var(--surface);
  color: var(--teal);
  font-size: 0.78rem;
  line-height: 1;
}

.product-url-icon:hover {
  color: var(--teal-strong);
  border-color: color-mix(in oklab, var(--teal) 32%, var(--line));
}

.product-url-icon.is-disabled {
  color: #98a2b3;
  background: var(--surface-soft);
  cursor: not-allowed;
  pointer-events: none;
}

.form-grid { display: grid; gap: 8px; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.booking-submit-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.cc-settlement-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cc-open-transfer-form {
  margin: 0;
}

.cc-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 2.2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.cc-filter-actions {
  display: flex;
  align-items: flex-end;
}

.cc-filter-actions .btn {
  white-space: nowrap;
}

.cc-settlement-table th:first-child,
.cc-settlement-table td:first-child {
  text-align: center;
}

.cc-settlement-table input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0 auto;
  padding: 0;
  display: block;
}

.cc-settlement-table > thead > tr > th:nth-child(6),
.cc-settlement-table > tbody > tr > td:nth-child(6) {
  text-align: right;
  padding-right: 8vw;
}

.booking-amount-field {
  flex: 1 1 320px;
  max-width: 360px;
}

.tabview {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.tablink {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

.tablink:hover {
  color: var(--text);
}

.tablink.active {
  background: var(--surface);
  color: var(--text);
}

.tab-panel {
  border-top: 1px solid var(--line);
  margin-top: -1px;
  padding-top: 10px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

input, select, button { font: inherit; }

input, select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  padding: 0 9px;
  font-size: 0.74rem;
}

select[multiple] {
  min-height: 140px;
  height: auto;
  padding: 8px;
}

small {
  color: var(--muted);
  font-size: 0.65rem;
}

.media-dropzone {
  border: 1px dashed color-mix(in oklab, var(--teal) 45%, var(--line));
  border-radius: 8px;
  background: var(--surface-soft);
  min-height: 170px;
  position: relative;
  display: grid;
  place-items: stretch;
  padding: 10px;
  overflow: hidden;
  contain: layout paint;
}

.product-form-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.product-form-top-image {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  width: 420px;
  min-width: 330px;
}

.product-form-top-image .media-dropzone {
  width: 100%;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
}

.product-form-top-fields {
  display: grid;
  gap: 8px;
}

.product-form-measures {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.product-grundpreis-input {
  display: grid;
  grid-template-columns: minmax(76px, 0.75fr) auto;
  gap: 8px;
  align-items: center;
}

.product-grundpreis-unit {
  font-size: 0.72rem;
  color: var(--text);
  white-space: nowrap;
}

.product-nutrition-block {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.product-nutrition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-nutrition-head strong {
  font-size: 0.78rem;
  color: var(--text);
}

.product-nutrition-rows {
  display: grid;
  gap: 8px;
}

.product-nutrition-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(90px, 0.6fr) minmax(120px, 0.8fr) minmax(140px, 1fr) 30px;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.product-nutrition-operator-label {
  align-content: end;
}

.product-nutrition-remove {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
}

.media-dropzone.is-drag-over {
  border-color: var(--teal);
  background: color-mix(in oklab, var(--teal) 8%, var(--surface-soft));
}

#product-image-placeholder {
  position: absolute;
  inset: 10px;
  display: grid;
  gap: 6px;
  place-content: center;
  text-align: center;
}

#product-image-placeholder strong {
  font-size: 0.8rem;
}

#product-image-placeholder span {
  color: var(--muted);
  font-size: 0.68rem;
}

#product-image-preview {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  border-radius: 6px;
  object-fit: contain;
  pointer-events: none;
}

.media-remove-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
}

.barcode-box {
  display: grid;
  gap: 4px;
  align-content: start;
}

.barcode-svg {
  width: 100%;
  height: 96px;
  min-height: 96px;
  max-height: 96px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  display: block;
  overflow: hidden;
}

.product-detail-barcode-box {
  width: 100%;
}

input:focus, select:focus {
  outline: 2px solid color-mix(in oklab, var(--teal) 42%, transparent);
  outline-offset: 1px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-size: 0.73rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

.btn:hover { background: var(--teal-strong); }

.btn.secondary {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto auto;
  gap: 6px;
  margin-top: 6px;
}

.inline-form.konto-form {
  grid-template-columns: 1.1fr 0.9fr 1fr 0.8fr auto auto auto auto;
}

.inline-form.autosparen-form {
  grid-template-columns: 1fr 1fr 1fr 0.8fr auto auto;
}

.inline-form .check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.inline-form .check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-header-row {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.product-header-search-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.product-header-search-label {
  flex: 1 1 auto;
  width: min(440px, 52vw);
  min-width: 240px;
}

.product-header-search-label input[type="text"] {
  width: 100%;
  min-width: 0;
}

.product-header-search-label input[type="text"]::placeholder {
  color: var(--muted);
}

.product-header-search-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.fixkosten-head {
  align-items: flex-start;
}

.fixkosten-head h2 {
  margin: 0;
}

.fixkosten-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fixkosten-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fixkosten-filter-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.fixkosten-edit-toggle {
  min-width: 32px;
  width: 32px;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
}

.fixkosten-edit-form {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.fixkosten-detail-toggle {
  min-width: 28px;
  width: 28px;
  height: 28px;
}

.fixkosten-detail-edit-row td {
  background: var(--surface-soft);
}

.fixkosten-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fixkosten-row-actions form {
  margin: 0;
}

.hersteller-create-form,
.hersteller-edit-form {
  margin-top: 8px;
}

.hersteller-edit-row td {
  background: var(--surface-soft);
}

.marke-create-form,
.marke-edit-form,
.markt-create-form,
.markt-edit-form {
  margin-top: 8px;
}

.marke-edit-row td,
.markt-edit-row td {
  background: var(--surface-soft);
}

.pv-action-cell {
  width: 110px;
}

.pv-action-wrap {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.pv-action-label {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.67rem;
  color: var(--muted);
}

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.tx-list-table {
  table-layout: fixed;
}

.tx-list-table .tx-col-date { width: 14%; }
.tx-list-table .tx-col-type { width: 9%; }
.tx-list-table .tx-col-konto { width: 12%; }
.tx-list-table .tx-col-partner { width: 12%; }
.tx-list-table .tx-col-bk1 { width: 10%; }
.tx-list-table .tx-col-bk2 { width: 10%; }
.tx-list-table .tx-col-purpose { width: 15%; }
.tx-list-table .tx-col-amount { width: 14%; }
.tx-list-table .tx-col-action { width: 4%; }

.dashboard-tx-table .tx-col-purpose { width: 19%; }
.dashboard-tx-table .tx-col-amount { width: 14%; }
.dashboard-tx-table > thead > tr > th:nth-child(8),
.dashboard-tx-table > tbody > tr:not(.tx-detail-row) > td:nth-child(8) {
  text-align: right;
  padding-right: 15vw;
}

.tx-list-table thead th,
.tx-list-table tbody tr:not(.tx-detail-row) > td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-list-table > thead > tr > th:nth-child(8),
.tx-list-table > tbody > tr:not(.tx-detail-row) > td:nth-child(8) {
  text-align: right;
  padding-right: 18px;
}

.fixkosten-table {
  table-layout: fixed;
}

.fixkosten-table th,
.fixkosten-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixkosten-table td:nth-child(3) {
  text-align: left;
}

th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  font-size: 0.73rem;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.67rem;
}

.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }
.transfer { color: #ff7300; font-weight: 600; }

.tx-amount-cell {
  white-space: nowrap;
  text-align: right;
}

.tx-amount-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tx-action-cell {
  text-align: right;
  overflow: visible !important;
  text-overflow: clip !important;
}

.tx-transfer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.tx-transfer-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.tx-dashboard-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tx-detail-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--teal);
  border-radius: 4px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 24px;
}

.tx-detail-toggle.is-disabled,
.tx-detail-toggle:disabled {
  color: #98a2b3;
  border-color: var(--line);
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: 1;
}

.tx-detail-toggle-icon {
  display: inline-block;
  transition: transform 0.16s ease;
}

.tx-detail-toggle.is-open .tx-detail-toggle-icon {
  transform: rotate(90deg);
}

.tx-detail-row > td {
  padding: 0;
  background: color-mix(in oklab, var(--teal) 5%, var(--surface));
}

.tx-detail-inner {
  padding: 8px 10px;
}

.tx-detail-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.tx-detail-table th,
.tx-detail-table td {
  font-size: 0.69rem;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0;
}

.tx-detail-table th {
  color: var(--muted);
}

.tx-offer-star {
  color: #c18a00;
  font-size: 0.78rem;
  line-height: 1;
}

.tx-offer-star--off {
  color: #98a2b3;
}

.future-valuta td {
  font-style: italic;
  color: #747d8c;
}

.future-valuta td.pos {
  color: var(--good);
}

.future-valuta td.neg {
  color: var(--danger);
}

.future-valuta td.transfer {
  color: #ff7300;
}

.type-row td {
  font-weight: 700;
  background: color-mix(in oklab, var(--teal) 8%, var(--surface));
}

.konto-row td:first-child {
  padding-left: 22px;
}

.flash {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 4px;
  padding: 8px 9px;
  font-size: 0.73rem;
  background: var(--surface);
}

.flash-success { border-left-color: var(--good); }
.flash-error { border-left-color: var(--danger); }

.auth-card {
  width: min(430px, 92vw);
  margin: 64px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.auth-card .check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-group {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
}

.booking-detail-rows {
  display: grid;
  gap: 8px;
}

.booking-detail-row {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.booking-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
  gap: 8px;
  align-items: end;
}

.booking-detail-pricing {
  display: grid;
  width: calc(100% - 40px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.5fr);
  gap: 8px;
  align-items: end;
}

.booking-detail-pricing-market {
  grid-column: 1;
}

.booking-detail-pricing-values {
  grid-column: 2 / span 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.booking-detail-pricing-total {
  grid-column: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.5fr);
  gap: 8px;
  align-items: end;
}

.booking-detail-row label {
  margin: 0;
}

#booking-detail-add {
  justify-self: start;
}

.booking-detail-offer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.booking-detail-offer input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.booking-detail-remove {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
}

.booking-price-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.45);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: 16px;
}

.booking-price-modal-backdrop[hidden] {
  display: none;
}

.booking-price-modal {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.booking-price-modal h3 {
  margin: 0;
}

.booking-price-modal p {
  margin: 0;
  color: var(--muted);
}

.booking-price-modal-options {
  display: grid;
  gap: 8px;
}

.booking-price-modal-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.booking-price-modal-option input[type="radio"] {
  width: 16px;
  height: 16px;
}

.booking-price-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 980px) {
  body.app-auth {
    overflow: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    border-right: 0;
  }

  .app-auth .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .app-auth .content {
    height: auto;
    overflow: visible;
  }

  .header-search {
    width: 100%;
  }

  .header-user {
    display: none;
  }

  .cards-3,
  .cards-2,
  .form-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .product-header-search-form {
    width: 100%;
    margin-left: 0;
  }

  .product-header-search-label {
    flex: 1 1 auto;
    min-width: 0;
  }

  .cc-filter-form {
    grid-template-columns: 1fr 1fr;
  }

  .cc-filter-actions {
    grid-column: 1 / -1;
  }

  .product-detail-wrap,
  .product-detail-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-top-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "barcode"
      "gruppe"
      "kategorie"
      "massen"
      "stueck";
  }

  .product-detail-top-measure-row {
    grid-template-columns: 1fr;
  }

  .product-form-top {
    grid-template-columns: 1fr;
  }

  .product-form-measures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-nutrition-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-nutrition-remove {
    width: 100%;
    min-width: 0;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .booking-detail-row {
    grid-template-columns: 1fr;
  }

  .booking-detail-main,
  .booking-detail-pricing {
    grid-template-columns: 1fr;
  }

  .booking-detail-pricing {
    width: 100%;
  }

  .booking-detail-pricing-market,
  .booking-detail-pricing-values,
  .booking-detail-pricing-total {
    grid-column: auto;
  }

  .booking-detail-pricing-values,
  .booking-detail-pricing-total {
    grid-template-columns: 1fr;
  }

  .booking-detail-remove {
    width: auto;
    min-width: 0;
  }

  .app-auth .content > section:first-of-type {
    margin: -10px -12px 0 -12px;
    position: static;
  }

}
