/* Auftragsbuch: baut auf style.css auf */
.admin-main { min-height: calc(100vh - 156px); }
.admin-topbar { grid-template-columns: 1fr auto; }
.admin-topbar nav { gap: 22px; }
.nav-button { padding: 7px 14px; border: 1px solid #a786606b; border-radius: 99px; background: transparent; color: #e0cfb8; font-size: 13px; }
.nav-button:hover { color: #ffe1ab; border-color: var(--gold); }
code, pre { font: 13px/1.5 ui-monospace, Consolas, monospace; }
pre { margin: 10px 0 0; padding: 9px 12px; border-radius: 6px; background: var(--night); color: #f2c98d; overflow-x: auto; }

.admin-gate { display: grid; place-items: center; padding-block: 70px; }
.gate-card { display: grid; gap: 14px; width: min(440px, 100%); text-align: left; }
.gate-card h1 { font-size: 42px; letter-spacing: -.03em; }
.gate-card .button { justify-self: start; }
.empty-mark {
  display: grid; place-items: center; width: 52px; height: 52px;
  border: 1px dashed #c9ab7f; border-radius: 50%; color: var(--bronze); font-size: 20px;
}

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  display: grid; gap: 4px; align-content: start;
  padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream);
  box-shadow: 0 6px 16px #4b2c1109;
}
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-value { font: 600 22px/1.2 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.kpi-critical { border-color: #e2b4a8; box-shadow: inset 3px 0 0 #b23a2a; }
.kpi-critical .kpi-sub::before { content: "⚠ "; color: #b23a2a; }
.kpi-good { box-shadow: inset 3px 0 0 #3f7a4a; }
.kpi-good .kpi-sub::before { content: "✓ "; color: #3f7a4a; }

/* Säulendiagramm */
.chart-card { position: relative; margin-bottom: 22px; }
.chart-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 14px; }
.chart-head h3 { font-size: 26px; letter-spacing: -.02em; }
#chart-table-toggle { white-space: nowrap; }
.chart { position: relative; height: 220px; padding-left: 64px; }
.chart-empty { padding: 30px 0; }
.chart-grid { position: absolute; inset: 0 0 26px 64px; display: flex; flex-direction: column; justify-content: space-between; }
.gridline { position: relative; height: 0; border-top: 1px solid #e7dccb; }
.gridline:last-child { border-top-color: #b9a589; }
.gridline span { position: absolute; left: -64px; top: -8px; width: 56px; color: var(--muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.chart-bars { position: absolute; inset: 0 0 0 64px; display: flex; gap: 6px; }
.bar-col {
  position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 0 26px; border: 0; background: none; border-radius: 4px;
}
.bar-col:hover, .bar-col.is-active { background: #9a5a2c0d; }
.bar { display: block; width: min(34px, 70%); margin-inline: auto; background: #9a5a2c; border-radius: 4px 4px 0 0; transition: background .15s; }
.bar.is-zero { height: 0 !important; }
.bar-col.is-active .bar { background: #7a4320; }
.bar-label { position: absolute; left: 0; right: 0; bottom: 4px; color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; }
.chart-tip {
  position: absolute; z-index: 2; translate: -50% -100%; display: grid; gap: 1px;
  padding: 7px 10px; border-radius: 6px; background: var(--night); color: #fbecd2; font-size: 12px; pointer-events: none;
  box-shadow: 0 8px 20px #0003; white-space: nowrap;
}
.chart-tip small { color: #cdb796; }
.chart-table, .book-table, .kartei { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th, .chart-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* Liste */
.admin-filters { grid-template-columns: 1.6fr 1fr 1fr; }
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); }
.book-table th, .kartei th {
  position: sticky; top: 0; padding: 10px 12px; background: #f1e5cf; color: #4a3424; text-align: left;
  font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.book-table td, .kartei td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.book-table tbody tr, .kartei:not(.customer-sales) tbody tr { cursor: pointer; transition: background .12s; }
.book-table tbody tr:hover, .kartei:not(.customer-sales) tbody tr:hover { background: #f6ecda; }
.book-table tbody tr.is-selected { background: #efe0c4; box-shadow: inset 3px 0 0 var(--bronze); }
.book-table .num, .kartei .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.book-table td small, .kartei td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.row-open { padding: 0; border: 0; background: none; font: 600 14px/1.3 var(--sans); color: var(--ink); text-align: left; }
.row-open:hover { color: var(--bronze); text-decoration: underline; }
.kind-estimate { color: #4f6b45 !important; }
.kind-invoice { color: #8b4b25 !important; }
.row-note { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-empty { padding: 26px 18px; color: var(--muted); }

/* Status: Farbe plus Text */
.status {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-offen { background: #fbefd5; color: #8a5a00; border-color: #efd9a8; }
.status-in_arbeit { background: #e9eef6; color: #2f527e; border-color: #cbd8ea; }
.status-geliefert { background: #eee8f4; color: #5b4380; border-color: #dad0e8; }
.status-bezahlt, .status-angenommen { background: #e5f1e6; color: #2f6b3b; border-color: #c4dfc8; }
.status-ueberfaellig { background: #fbe4df; color: #9e2a1c; border-color: #efbfb5; }
.status-ueberfaellig::before { content: "!"; width: auto; height: auto; background: none; font-weight: 900; }
.document-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.status-storniert, .status-abgelehnt { background: #efebe6; color: #6b625a; border-color: #ddd5cb; text-decoration: line-through; text-decoration-thickness: 1px; }

/* Einzelansicht */
.detail-form { display: grid; gap: 12px; padding-top: 12px; border-top: 1px dashed #d2b98f; }
.status-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.status-switch legend { width: 100%; margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 680; }
.status-switch label { position: relative; cursor: pointer; }
.status-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.status-switch .status { padding: 6px 12px; font-size: 12.5px; opacity: .55; transition: opacity .15s, box-shadow .15s; }
.status-switch label:hover .status { opacity: .85; }
.status-switch input:checked + .status { opacity: 1; box-shadow: 0 0 0 2px currentColor; }
.status-switch input:focus-visible + .status { outline: 2px solid #a55f24; outline-offset: 3px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { margin-left: auto; background: transparent; border-color: #d9a99d; color: #9e2a1c; }
.danger:hover { background: #fbe4df; }
.danger.is-armed { background: #9e2a1c; border-color: #9e2a1c; color: #fff; }
#detail-status:empty { display: none; }

/* Werkstatt: Mitarbeiter, Stunden und die daraus folgende Auftragslage */
.workshop-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 28px; margin-bottom: 16px; }
.workshop-load h3 { font: 500 22px/1.2 var(--serif); }
.workshop-load > p { margin-top: 2px; font-size: 13px; }
.workshop-state { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 12px; }
.workshop-state div { display: grid; gap: 1px; }
.workshop-state dt, .workshop-state span { color: var(--muted); font-size: 12px; font-weight: 650; }
.workshop-state strong { font: 600 20px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.workshop-state .load { display: inline-block; justify-self: start; margin-top: 2px; padding: 2px 10px; border-radius: 999px; background: #efe3cc; color: #6b4a1c; font-size: 13px; font-weight: 700; }
.workshop-state .load-voll { background: #fbe4df; color: #9e2a1c; }
.workshop-state .load-frei, .workshop-state .load-ruhig { background: #e5f1e6; color: #2f6b3b; }
.workshop-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: end; }
.workshop-form .button { justify-self: start; }
.workshop-form .hint { grid-column: 1 / -1; margin: 0; }
.workshop-form .hint:empty { display: none; }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workshop-card { grid-template-columns: 1fr; }
}
@media (max-width: 690px) {
  .admin-filters { grid-template-columns: 1fr 1fr; }
  .admin-filters .field:first-child { grid-column: 1 / -1; }
  .chart { padding-left: 54px; }
  .chart-bars { left: 54px; gap: 3px; }
  .chart-grid { left: 54px; }
  .gridline span { left: -54px; width: 46px; }
  .bar-label { font-size: 9.5px; }
  .book-table th:nth-child(4), .book-table td:nth-child(4) { display: none; }
  .book-table th:nth-child(3), .book-table td:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 18px; }
  .book-table thead { display: none; }
  .book-table, .book-table tbody { display: block; }
  .book-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 13px; border-top: 1px solid var(--line); }
  .book-table tr:first-child { border-top: 0; }
  .book-table td { display: block; padding: 0; border: 0; }
  .book-table td:nth-child(1) { grid-area: 1 / 1; }
  .book-table td:nth-child(7) { grid-area: 1 / 2; text-align: right; }
  .book-table td:nth-child(2) { grid-area: 2 / 1; }
  .book-table td:nth-child(6) { grid-area: 2 / 2; }
  .book-table td:nth-child(5) { display: block; grid-area: 3 / 1 / 4 / 3; color: var(--muted); font-size: 12px; }
  .book-table td:nth-child(5)::before { content: "Termin: "; }
  .book-table td:nth-child(5):empty, .book-table td:nth-child(5).is-none { display: none; }
  .book-table td:nth-child(3), .book-table td:nth-child(4) { display: none; }
}
@media (max-width: 360px) { .kpis { grid-template-columns: 1fr; } }

.link-button { padding: 0; border: 0; background: transparent; color: #75411f; text-decoration: underline; text-decoration-color: #75411f66; text-underline-offset: 3px; font-size: 13px; font-weight: 680; }
.link-button:hover { color: var(--deep); text-decoration-color: currentColor; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kpi-value.is-zero { color: var(--muted); }

.doc-page { padding-block: 26px 60px; animation: fade .3s ease-out; }
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.doc-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-toolbar .danger { margin-left: 0; }
.doc-page-status:empty { display: none; }
.doc-page-status { margin: 0 0 10px; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; margin-top: 8px; }
.doc-view {
  --document-line: #e2d6c4;
  --document-band: #f6eee1;
  --document-tint: #fcf8f1;
  --document-inset: clamp(8px, 2.2vw, 14px);
  --doc-accent: #8b4b25;
  --doc-accent-soft: #f3e3cc;
  min-width: 0;
}
.doc-view:has([data-kind=estimate]), .doc-side[data-kind=estimate] { --doc-accent: #4f6b45; --doc-accent-soft: #e5ebd9; }
.doc-view .invoice-paper { width: 100%; }
.invoice-identity .doc-title { font-size: clamp(32px, 5vw, 52px); letter-spacing: -.03em; }
.doc-side { position: sticky; top: 92px; display: grid; gap: 16px; border-top: 4px solid #8b4b25; }
.doc-side[data-kind=estimate] { border-top-color: #4f6b45; }
.doc-side-head h2 { margin: 8px 0 8px; font-size: 32px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.doc-side-head h2:focus { outline: none; }
#detail-badge { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.side-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-facts { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 12px 13px; border-radius: 7px; background: #f6ecda; font-size: 13px; }
.detail-facts > div { display: flex; justify-content: space-between; gap: 10px; }
.detail-facts dt { color: var(--muted); font-size: 12px; }
.detail-facts dd { font-weight: 650; text-align: right; }
.detail-form .field small { font-weight: 450; font-size: 11.5px; }
.detail-form .button { justify-self: start; }
.receipt-fields { display: grid; gap: 4px; margin: 0; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); }
.receipt-fields legend { padding-right: 8px; font-size: 13px; font-weight: 680; }
@media (max-width: 1080px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-side { position: static; order: -1; }
}
.invoice-identity .doc-title { overflow-wrap: normal; hyphens: manual; }
@media (max-width: 600px) {
  .doc-view { --document-inset: 8px; }
  .invoice-identity { flex-wrap: wrap; }
  .invoice-identity .doc-title { font-size: clamp(26px, 8vw, 36px); }
  .doc-view .invoice-totals > div { flex-wrap: wrap; }
  .doc-toolbar .button { padding-inline: 12px; }
}

/* ---------- Werkstattleitung: Reiter für den Inhaber ---------- */
.admin-tabs { border-bottom: 1px solid var(--line); background: #f1e5cf; }
.admin-tabs-inner { display: flex; align-items: center; gap: 4px 26px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs a {
  position: relative; flex: none; padding: 13px 2px 11px; color: #5a4230; font-size: 14px; font-weight: 680; text-decoration: none;
  border-bottom: 3px solid transparent;
}
.admin-tabs a:hover { color: var(--ink); border-bottom-color: #c9ab7f; }
.admin-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--bronze); }
.admin-tabs a:focus-visible { outline: 2px solid #a55f24; outline-offset: -2px; }
.admin-tabs-note { margin-left: auto; flex: none; color: var(--muted); font-size: 12px; }
.admin-tab .card + .card, .admin-tab .card-head + .staff-notice { margin-top: 0; }
.hint.error, .count.error { color: #9e2a1c; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.form-actions .hint { margin: 0; }
.form-actions .hint:empty { display: none; }
.form-actions .danger { margin-left: 0; }
.chip-warn { background: #fbefd5; color: #8a5a00; }
.workshop-team { display: grid; gap: 2px; align-content: start; }
.workshop-team > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.workshop-team strong { font: 600 20px/1.2 var(--serif); }
.workshop-team p { margin: 4px 0 0; }
.workshop-team .hint:empty { display: none; }
.workshop-team a { color: var(--bronze); font-weight: 680; font-size: 13px; }

/* Einstellungen */
.staff-card .card-head { align-items: start; }
.staff-card .card-head h3 { font-size: 26px; }
.staff-card .card-head p { margin-top: 4px; max-width: 62ch; }
.staff-notice { margin: 0 0 14px; padding: 10px 13px; border: 1px solid #efd9a8; border-radius: 7px; background: #fbefd5; color: #6b4a1c; font-size: 13px; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.staff-table th {
  padding: 9px 12px; background: #f1e5cf; color: #4a3424; text-align: left;
  font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.staff-table td, .staff-table tfoot th { padding: 7px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.staff-table tfoot th, .staff-table tfoot td { background: #f6ecda; font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.staff-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.staff-table input:not([type=checkbox]) { min-height: 38px; padding: 6px 9px; }
.staff-table .rank-name { min-width: 150px; }
.staff-table .rank-wage { width: 96px; text-align: right; }
.staff-table .rank-count { width: 82px; text-align: right; }
.staff-table input[aria-invalid] { border-color: #c4553f; box-shadow: 0 0 0 3px #c4553f22; }
.unit-input { display: inline-flex; align-items: center; gap: 6px; }
.unit-input .unit { color: var(--muted); font-weight: 650; }
.rank-remove { width: 44px; text-align: center; }
.icon-button {
  width: 32px; height: 32px; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #8a6a50;
  font-size: 18px; line-height: 1;
}
.icon-button:hover { border-color: #d9a99d; background: #fbe4df; color: #9e2a1c; }
.staff-add { margin-top: 12px; }
.staff-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px 16px; margin-top: 18px; }
.staff-fields small { font-weight: 450; font-size: 11.5px; }
.staff-summary { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 18px 0 0; padding: 13px 15px; border-radius: 8px; background: #f6ecda; }
.staff-summary div { display: grid; gap: 1px; }
.staff-summary dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.staff-summary dd { margin: 0; font: 600 19px/1.2 var(--serif); font-variant-numeric: tabular-nums; }

/* Verträge */
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contract-filters { grid-template-columns: 1.6fr 1fr 1fr auto; align-items: end; }
.contract-editor { margin-bottom: 18px; border-top: 4px solid var(--bronze); scroll-margin-top: 16px; }
.contract-editor .card-head { align-items: start; }
.contract-editor .card-head h3 { font-size: 26px; }
.contract-editor .card-head p { margin-top: 4px; }
.contract-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.contract-fields .field-wide { grid-column: 1 / -1; }
.contract-fields small { font-weight: 450; font-size: 11.5px; }
.contract-hours > label { font-size: 13px; font-weight: 680; }
.contract-hours .link-button { justify-self: start; text-align: left; }
.contract-hours[hidden] { display: none; }
.contract-preview { margin: 14px 0 0; padding: 10px 13px; border-radius: 7px; background: #f6ecda; font-size: 13px; font-weight: 600; }
.contract-preview:empty { display: none; }
.contract-table td strong { display: block; font-weight: 650; }
.contract-kind { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.contract-kind.kind-einnahme { background: #e5f1e6; color: #2f6b3b; }
.contract-kind.kind-ausgabe { background: #f3e3cc; color: #7a4320; }
.contract-table small.contract-state { font-weight: 700; }
.contract-table .state-laeuft { color: #2f6b3b; }
.contract-table .state-beginnt { color: #2f527e; }
.contract-table .state-beendet { color: #6b625a; }
.contract-table td.is-none { color: var(--muted); }
.contract-table tr.is-flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #f3dcae; } to { background: transparent; } }

/* Finanzen */
.month-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.month-switch h3 { min-width: 9ch; font-size: 32px; letter-spacing: -.02em; text-align: center; }
.month-switch .button { min-height: 38px; padding: 6px 13px; font-size: 16px; }
.finance-note { margin: 0 0 14px; padding: 9px 13px; border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; background: #fbf3e4; color: #5b4636; font-size: 13px; }
.finance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.finance-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #b9a589; }
.finance-card-head h3 { font-size: 26px; letter-spacing: -.02em; }
.finance-card-head strong { font: 600 20px/1.2 var(--serif); font-variant-numeric: tabular-nums; text-align: right; }
.money-group { margin-top: 16px; }
.money-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.money-group-head h4 { font: 700 13px/1.3 var(--sans); color: #4a3424; }
.money-group-head strong { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-lines { margin: 6px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.money-lines li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #e7dccb; font-size: 13px; }
.money-lines li.money-empty { display: block; color: var(--muted); }
.money-lines li.money-empty a { color: var(--bronze); font-weight: 680; }
.money-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.money-text { min-width: 0; overflow-wrap: anywhere; }
.money-text a { color: var(--bronze); font-weight: 700; }
.money-text strong { font-weight: 650; }
.money-amount { text-align: right; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.money-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 10px; background: #e9eef6; color: #2f527e; font-size: 11px; font-weight: 700; }
.money-lines li.is-upcoming .money-amount { color: var(--muted); }
.finance-history-card h3 { margin-bottom: 12px; font-size: 26px; letter-spacing: -.02em; }
.chart-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.finance-history tr[aria-current] td { background: #f6ecda; font-weight: 700; }
.finance-history .is-negative { color: #9e2a1c; }
.finance-history .is-positive { color: #2f6b3b; }
.finance-foot { margin-top: 14px; max-width: 86ch; }

/* Darlehenskasse: Geld aus Darlehen, das bereitliegt, bis es entnommen wird */
.loan-fund { margin-bottom: 16px; border-left: 3px solid #2f527e; }
.loan-fund .finance-card-head strong { color: #2f527e; }
.loan-fund-note { margin: 10px 0 12px; max-width: 90ch; font-size: 13px; }
.loan-table td { vertical-align: top; }
.loan-table .loan-available { font-weight: 750; color: #2f527e; }
.loan-table .is-negative { color: #9e2a1c; }
.loan-draw { margin-top: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #f3f6fa; }
.loan-draw h4 { margin-bottom: 8px; font: 700 13px/1.3 var(--sans); color: #2f527e; }
.loan-draw-fields { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, .8fr) minmax(0, 1.4fr) auto; gap: 10px 12px; align-items: start; }
.loan-draw-fields .field small { min-height: 1.2em; font-size: 11.5px; font-weight: 450; }
.loan-draw-fields.is-single { grid-template-columns: minmax(0, .9fr) minmax(0, .7fr) minmax(0, 1.8fr) auto; }
.loan-draw-submit { padding-top: 25px; }
.loan-draw-submit .button { white-space: nowrap; }
.money-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.money-remove { margin-left: 8px; font-size: 12px; }
.money-remove.is-armed { color: #9e2a1c; font-weight: 750; }
@media (max-width: 980px) {
  .loan-draw-fields, .loan-draw-fields.is-single { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loan-draw-purpose { grid-column: 1 / -1; }
  .loan-draw-submit { grid-column: 1 / -1; padding-top: 0; }
}
@media (max-width: 600px) {
  /* Darlehen untereinander: Name oben, darunter die Beträge mit Beschriftung */
  .loan-table thead { display: none; }
  .loan-table, .loan-table tbody, .loan-table tr { display: block; }
  .loan-table tr { padding: 10px 12px; border-top: 1px solid var(--line); }
  .loan-table tr:first-child { border-top: 0; }
  .loan-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .loan-table td:first-child { display: block; padding-bottom: 6px; text-align: left; }
  .loan-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
}
@media (max-width: 560px) {
  .loan-draw-fields, .loan-draw-fields.is-single { grid-template-columns: 1fr; }
  .loan-draw-submit .button { width: 100%; justify-content: center; }
}

@media (max-width: 980px) {
  .finance-grid { grid-template-columns: 1fr; }
  .contract-filters { grid-template-columns: 1fr 1fr 1fr; }
  .contract-filters .field:first-child { grid-column: 1 / -1; }
  .contract-filters .button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 690px) {
  .admin-tabs-note { display: none; }
  .kpis-3 { grid-template-columns: 1fr; }
  .contract-filters { grid-template-columns: 1fr 1fr; }
  .contract-filters .button { justify-self: stretch; }
  .contract-fields, .staff-fields { grid-template-columns: 1fr; }
  .book-table.contract-table th:nth-child(3), .book-table.contract-table td:nth-child(3),
  .book-table.contract-table th:nth-child(4), .book-table.contract-table td:nth-child(4) { display: table-cell; }
  .month-switch h3 { font-size: 26px; }
}
@media (max-width: 600px) {
  .book-table.contract-table td:nth-child(1) { grid-area: 1 / 1; }
  .book-table.contract-table td:nth-child(6) { grid-area: 1 / 2; text-align: right; }
  .book-table.contract-table td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; }
  .book-table.contract-table td:nth-child(3) { display: block; grid-area: 3 / 1; }
  .book-table.contract-table td:nth-child(5) { display: block; grid-area: 3 / 2; text-align: right; color: var(--ink); font-size: inherit; }
  .book-table.contract-table td:nth-child(5)::before { content: "nächste "; color: var(--muted); font-size: 11px; }
  .book-table.contract-table td:nth-child(4) { display: block; grid-area: 4 / 1 / 5 / 3; color: var(--muted); font-size: 12px; }
  .book-table.contract-table td:nth-child(4) small { display: inline; margin-left: 6px; }
  .money-lines li { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; }
}
/* Absolut gesetzte Inhalte (versteckte Beschriftungen) bleiben im scrollbaren Bereich */
.table-wrap { position: relative; }
.money-lines li.no-date { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 600px) {
  .staff-table thead { display: none; }
  .staff-table, .staff-table tbody, .staff-table tfoot { display: block; }
  .staff-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; border-top: 1px solid var(--line); }
  .staff-table tbody tr:first-child { border-top: 0; }
  .staff-table tbody td { display: grid; gap: 3px; align-content: start; padding: 0; border: 0; text-align: left; }
  .staff-table tbody td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 650; }
  .staff-table td:nth-child(1) { grid-column: 1 / 3; }
  .staff-table td:nth-child(1)::before { display: none; }
  .staff-table td.rank-remove { grid-area: 1 / 3; width: auto; justify-self: end; }
  .staff-table .rank-name { min-width: 0; }
  .staff-table .rank-wage, .staff-table .rank-count { width: 100%; text-align: left; }
  .staff-table .unit-input { display: flex; }
  .staff-table td.rank-month { white-space: normal; font-size: 12.5px; }
  .staff-table tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 12px; background: #f6ecda; border-top: 1px solid var(--line); }
  .staff-table tfoot th, .staff-table tfoot td { padding: 0; border: 0; }
  .staff-table tfoot td:empty { display: none; }
  #staff-workers::after { content: " Mitarbeiter"; }
}
.contract-table .row-open, .money-text a { white-space: nowrap; }
@media (max-width: 600px) {
  .money-lines li { grid-template-columns: 54px minmax(0, 1fr); gap: 2px 8px; }
  .money-lines li .money-amount { grid-column: 2; text-align: right; }
  .money-lines li.no-date { grid-template-columns: minmax(0, 1fr) auto; }
  .money-lines li.no-date .money-amount { grid-column: auto; }
}

/* Verträge mit mehreren Zahlungen */
.payments { min-width: 0; margin: 4px 0 0; padding: 14px 0 0; border: 0; border-top: 1px dashed #d2b98f; }
.payments legend { padding: 0 8px 0 0; font-size: 14px; font-weight: 700; }
.payments-help { margin: 0 0 10px; }
.payment-head, .payment-row {
  display: grid; grid-template-columns: 128px minmax(110px, 1fr) 158px 118px minmax(120px, 1.2fr) 32px; gap: 8px; align-items: start;
}
.payment-head { padding: 0 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.payment-row { margin-bottom: 8px; padding: 9px 10px; border: 1px solid var(--line); border-left: 3px solid #3f7a4a; border-radius: 8px; background: #fffdf7; }
.payment-row.is-expense { border-left-color: #8a3a22; }
.payment-field { display: grid; gap: 3px; min-width: 0; }
.payment-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.payment-row input:not([type=checkbox]), .payment-row select { min-height: 38px; padding: 6px 9px; }
.payment-row input[aria-invalid] { border-color: #c4553f; box-shadow: 0 0 0 3px #c4553f22; }
.payment-coins { color: var(--muted); font-size: 11.5px; font-weight: 450; }
.payment-coins:empty { display: none; }
.payment-remove { align-self: center; }
.money-einnahme { color: #2f6b3b; }
.money-ausgabe { color: #8a3a22; }
.contract-payments .payment-line { display: block; }
.contract-payments .payment-line + .payment-line { margin-top: 6px; }
.contract-payments strong { display: inline; font-weight: 700; }
.contract-payments .payment-total { margin-top: 6px; color: var(--ink); font-weight: 650; }
.contract-kind.kind-wartung { background: #e5f1e6; color: #2f6b3b; }
.contract-kind.kind-eigener { background: #efe4d0; color: #634522; }
.contract-kind.kind-darlehen { background: #e9eef6; color: #2f527e; }
.contract-table .state-erfuellt { color: #5b4380; }
@media (max-width: 980px) {
  .payment-head { display: none; }
  .payment-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 32px; }
  .payment-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; color: var(--muted); font-size: 11.5px; font-weight: 650; }
  .payment-row .payment-field:nth-child(5) { grid-column: 1 / 3; }
  .payment-remove { grid-area: 1 / 3; align-self: start; }
}
@media (max-width: 600px) {
  .book-table.contract-table td:nth-child(6) { grid-area: 5 / 1 / 6 / 3; text-align: left; }
  .contract-payments small { display: inline; margin-left: 6px; }
  .contract-payments .payment-total { display: block; margin-left: 0; }
}

/* Arbeitszeiten */
.week-fieldset { margin: 20px 0 0; padding: 14px 0 0; border: 0; border-top: 1px dashed #d2b98f; min-width: 0; }
.week-fieldset legend { padding: 0 8px 0 0; font-size: 14px; font-weight: 700; }
.week-help { margin: 0 0 10px; max-width: 80ch; }
.week-grid { display: grid; gap: 6px; max-width: 560px; }
.week-day { display: grid; grid-template-columns: 150px 108px 24px 108px minmax(0, 1fr); gap: 8px; align-items: center; }
.week-name { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.week-day input[type=time] { min-height: 36px; padding: 5px 8px; }
.week-day input[type=time]:disabled { opacity: .45; }
.week-sep { color: var(--muted); font-size: 12px; text-align: center; }
.week-hours { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.week-day.is-closed .week-name span { color: var(--muted); }
.week-total { margin: 10px 0 0; font-size: 13px; font-weight: 650; }
.rank-contracts { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }

/* Guthaben */
.balance-card { margin-top: 16px; }
.balance-card .card-head { align-items: start; }
.balance-card .card-head h3 { font-size: 26px; }
.balance-card .card-head p { margin-top: 4px; max-width: 70ch; }
.balance-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px 16px; }
.balance-fields small { font-weight: 450; font-size: 11.5px; }
.balance-strip { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: end; gap: 8px 36px; margin-bottom: 12px; padding: 16px 20px; border-left: 4px solid var(--bronze); }
.balance-main, .balance-side { display: grid; gap: 2px; }
.balance-value { font: 600 34px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.balance-side strong { font: 600 22px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.balance-value.is-negative { color: #9e2a1c; }
.balance-note { margin: 0; justify-self: end; text-align: right; }
.balance-note a { color: var(--bronze); font-weight: 680; }

/* Mitarbeitervertrag und PDF */
.staff-only[hidden] { display: none; }
.contract-kind.kind-mitarbeiter { background: #eee8f4; color: #5b4380; }
#payment-rows:empty::before { content: attr(data-empty); display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.contract-pdf-cell { width: 52px; text-align: right; }
.pdf-link { display: inline-block; padding: 3px 9px; border: 1px solid #bca688; border-radius: 6px; color: #4c3522; font-size: 12px; font-weight: 700; text-decoration: none; }
.pdf-link:hover { background: #fff8ea; border-color: #a98b64; }
@media (max-width: 690px) {
  .week-day { grid-template-columns: minmax(0, 1fr) 96px 18px 96px; }
  .week-hours { grid-column: 1 / -1; padding-left: 26px; margin-top: -4px; }
  .balance-fields { grid-template-columns: 1fr; }
  .balance-strip { grid-template-columns: 1fr; }
  .balance-note { justify-self: start; text-align: left; }
}
@media (max-width: 600px) {
  .book-table.contract-table td:nth-child(7) { display: block; grid-area: 6 / 1 / 7 / 3; text-align: left; }
}
.week-day { grid-template-columns: 150px 120px 24px 120px minmax(0, 1fr); }
#contract-payments:has(#payment-rows:empty) .payment-head { display: none; }
@media (max-width: 690px) { .week-day { grid-template-columns: minmax(0, 1fr) 104px 18px 104px; } }
.week-name .narrow { display: none; }
@media (max-width: 690px) {
  .week-name .wide { display: none; }
  .week-name .narrow { display: inline; }
  .week-day { grid-template-columns: 64px minmax(0, 1fr) 18px minmax(0, 1fr); }
  .week-hours { grid-column: 2 / -1; padding-left: 0; }
}

/* Vertragstext und Vorlagen */
.contract-buttons { display: flex; gap: 8px; align-items: end; }
.contract-text { min-width: 0; margin: 4px 0 0; padding: 14px 0 0; border: 0; border-top: 1px dashed #d2b98f; }
.contract-text legend { padding: 0 8px 0 0; font-size: 14px; font-weight: 700; }
.text-help { margin: 0 0 12px; max-width: 90ch; }
.text-help code, .placeholder-chip { font: 12px/1.4 ui-monospace, Consolas, monospace; }
.text-editor { display: grid; gap: 10px; }
.text-frame textarea { font-style: italic; }
.clause-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.clause { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid #5a3e2b; border-radius: 8px; background: #fffdf7; }
.clause-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) 32px 32px 32px; gap: 6px; align-items: center; }
.clause-number { font: 600 16px/1 var(--serif); color: #5a3e2b; }
.clause-head .clause-title { min-height: 36px; padding: 5px 9px; font-weight: 650; }
.clause-text { min-height: 60px; resize: vertical; line-height: 1.5; }
.clause-head .icon-button:disabled { opacity: .3; cursor: default; }
.clause-head .clause-up:not(:disabled):hover, .clause-head .clause-down:not(:disabled):hover { border-color: #bca688; background: #f6ecda; color: var(--ink); }
.text-editor > .link-button { justify-self: start; }
.placeholder-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 11px; border-radius: 8px; background: #f6ecda; }
.chips-label { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.placeholder-chip { padding: 2px 8px; border: 1px solid #d6c3a3; border-radius: 6px; background: #fffaf0; color: #5a3e2b; }
.placeholder-chip:hover { border-color: #a98b64; background: #fff; }
.placeholder-chips[data-hint]::after { content: attr(data-hint); flex-basis: 100%; color: #9e2a1c; font-size: 12px; }
.text-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.template-editor { margin-bottom: 18px; border-top: 4px solid #5a3e2b; scroll-margin-top: 16px; }
.template-editor .card-head h3 { font-size: 26px; }
.template-editor .card-head p { margin-top: 4px; }
.template-kind { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 14px; }
.template-kind .field { min-width: 260px; }
.template-kind .chip { margin-bottom: 12px; }
@media (max-width: 980px) {
  .contract-filters .contract-buttons { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .clause-head { grid-template-columns: 30px minmax(0, 1fr) 28px 28px 28px; gap: 4px; }
  .contract-buttons { flex-wrap: wrap; }
  .contract-buttons .button { flex: 1; }
}
/* Platzhalter bleiben beim Schreiben in Reichweite */
.placeholder-chips { position: sticky; bottom: 10px; z-index: 2; box-shadow: 0 6px 18px #4b2c1126; border: 1px solid #e2cfae; }
@media (max-width: 600px) {
  .clause-head { grid-template-columns: minmax(0, 1fr) 28px 28px 28px; }
  .clause-head .clause-title { order: 5; grid-column: 1 / -1; }
}

/* Kostenvoranschlag annehmen und Verbindung zur Rechnung */
.accept-box { margin: 14px 0 4px; padding: 13px 14px; border: 1px solid #cfdcc8; border-left: 4px solid #3f7a4a; border-radius: 8px; background: #f3f8f0; }
.accept-box h3 { font-size: 20px; letter-spacing: -.01em; }
.accept-box > p { margin: 4px 0 8px; font-size: 12.5px; }
.accept-payment { display: grid; gap: 5px; margin: 6px 0 4px; padding: 0; border: 0; }
.accept-payment legend { margin-bottom: 4px; font-size: 13px; font-weight: 680; }
.accept-payment label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.accept-form .field { margin-top: 8px; }
.accept-form .button { width: 100%; margin-top: 10px; }
.accept-form .button:disabled { opacity: .5; cursor: not-allowed; }
.accept-form .hint:empty { display: none; }
.related-link { margin: 12px 0 0; padding: 9px 12px; border-radius: 7px; background: #f6ecda; font-size: 13px; }
.related-link a { color: var(--bronze); font-weight: 700; }
.related-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.accept-payment input[type=radio] { flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: #3f7a4a; }

/* Verkäufe an der Ladentheke */
.sale-form { margin-bottom: 18px; }
.sale-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.sale-submit { justify-self: start; }
.sale-submit .button { white-space: nowrap; }
.sales-filters { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
.sales-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sales-table thead th { padding: 10px 12px; background: #f1e5cf; color: #4a3424; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.sales-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.sales-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sales-table tfoot th, .sales-table tfoot td { padding: 11px 12px; border-top: 2px solid #c9b18b; background: #f6eedf; color: var(--ink); font-size: 13px; font-weight: 750; letter-spacing: 0; text-transform: none; }
.sales-table tfoot th { text-align: right; }
.sale-remove { width: 1%; white-space: nowrap; text-align: right; }
.sale-remove .link-button { font-size: 12px; }
.sale-remove .is-armed { color: #9e2a1c; text-decoration-color: #9e2a1c; font-weight: 750; }
.sales-table tbody:empty + tfoot { display: none; }
@media (max-width: 1100px) {
  .sale-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sale-item { grid-column: span 2; }
}
@media (max-width: 690px) {
  .sale-fields { grid-template-columns: 1fr 1fr; }
  .sale-item, .sale-submit { grid-column: 1 / -1; }
  .sale-submit { justify-self: stretch; }
  .sale-submit .button { width: 100%; justify-content: center; }
  .sales-table thead { display: none; }
  .sales-table, .sales-table tbody, .sales-table tfoot { display: block; }
  .sales-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 13px; border-top: 1px solid var(--line); }
  .sales-table tbody tr:first-child { border-top: 0; }
  .sales-table td { display: block; padding: 0; border: 0; }
  .sales-table td:nth-child(2) { grid-area: 1 / 1; }
  .sales-table td:nth-child(5) { grid-area: 1 / 2; font-weight: 700; }
  .sales-table td:nth-child(1) { grid-area: 2 / 1; color: var(--muted); font-size: 12px; }
  .sales-table td:nth-child(3) { grid-area: 3 / 1; color: var(--muted); font-size: 12px; }
  .sales-table td:nth-child(3)::before { content: "Kundschaft: "; }
  .sales-table td:nth-child(4) { grid-area: 4 / 1; font-size: 12px; }
  .sales-table td:nth-child(4)::before { content: "eingetragen von "; }
  .sales-table .sale-tip { grid-area: 2 / 2; font-size: 12px; }
  .sales-table .sale-tip::before, #sales-tip-sum::before { content: "Trinkgeld: "; }
  .sales-table .sale-remove { grid-area: 3 / 2 / 5 / 3; width: auto; align-self: end; }
  .sales-table tfoot tr { background: #f6eedf; border-top: 2px solid #c9b18b; }
  .sales-table tfoot th, .sales-table tfoot td { padding: 0; border: 0; background: none; }
  .sales-table tfoot th { grid-area: 1 / 1; text-align: left; }
  .sales-table tfoot td:nth-of-type(1) { grid-area: 1 / 2; }
  .sales-table tfoot td:nth-of-type(2) { grid-area: 2 / 2; font-size: 12px; }
  .sales-table tfoot td:last-child { display: none; }
}

/* Sicherungen in den Einstellungen */
.backup-card { margin-top: 16px; }
.backup-card code { padding: 0 4px; border-radius: 4px; background: #f1e5cf; font-size: .92em; }
.backup-warning { margin: 10px 0 0; padding: 9px 13px; border-left: 3px solid #b23a2a; border-radius: 0 6px 6px 0; background: #fbe4df; color: #7d2216; font-size: 13px; }
.backup-wrap { margin-top: 12px; max-height: 360px; overflow-y: auto; }
.backup-card .card-head .chip { white-space: nowrap; }
.backup-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.backup-actions .link-button { font-size: 12.5px; }
.backup-actions .is-armed { color: #9e2a1c; font-weight: 750; }
.backup-foot { margin-top: 10px; font-size: 12.5px; }
@media (max-width: 600px) {
  .backup-table thead { display: none; }
  .backup-table, .backup-table tbody, .backup-table tr { display: block; }
  .backup-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 10px; border-top: 1px solid var(--line); }
  .backup-table td { padding: 0; border: 0; }
  .backup-table td:nth-child(2) { grid-row: 2; color: var(--muted); font-size: 12px; }
  .backup-table td:nth-child(3) { grid-row: 1; grid-column: 2; }
  .backup-table td:nth-child(4) { grid-row: 3; grid-column: 1 / -1; padding-top: 4px; }
  .backup-actions > div { justify-content: flex-start; }
  .backup-card .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Benachrichtigungen in Discord */
.notify-card { margin-top: 16px; }
.notify-card code { padding: 0 4px; border-radius: 4px; background: #f1e5cf; font-size: .92em; }
.notify-setup { margin-top: 10px; padding: 11px 14px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; line-height: 1.5; }
.notify-setup p { margin: 0 0 6px; }
.notify-setup p:last-child { margin-bottom: 0; }
.notify-setup pre { margin: 4px 0 8px; padding: 7px 10px; border-radius: 6px; background: #f1e5cf; color: #3b2a1d; font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.notify-options { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; border: 0; }
.notify-options .check { align-items: flex-start; line-height: 1.45; }
.notify-options .check input { margin-top: 2px; }
.notify-options:disabled { opacity: .55; }
.notify-actions { flex-wrap: wrap; }
.chip.chip-good { background: #e3efd9; color: #355a26; }
.notify-card .card-head .chip { white-space: nowrap; }
@media (max-width: 600px) {
  .notify-card .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .notify-actions .button { flex: 1 1 100%; }
}

/* Kundenkartei */
.customers-filters { grid-template-columns: 1.6fr 1fr auto; align-items: end; }
.customers-only-open { min-height: 42px; white-space: nowrap; }
a.row-open { display: inline-block; text-decoration: none; }
.kartei td.is-none { color: var(--muted); }
.kartei td.is-overdue { color: #9e2a1c; font-weight: 650; }
.kartei td.is-overdue small { color: #9e2a1c; font-weight: 500; }
.customer-back { margin-bottom: 16px; }
.customer-heading h2 { overflow-wrap: anywhere; }
.customer-address { margin: 4px 0 0; color: var(--muted); white-space: pre-line; }
.customer-note { margin-bottom: 20px; }
.customer-note textarea { min-height: 54px; resize: vertical; }
.customer-note .form-actions { margin-top: 10px; }
.customer-subhead { margin: 24px 0 10px; font-size: 23px; }
.fact-link { margin-left: 6px; font-size: 12px; font-weight: 650; color: var(--bronze); white-space: nowrap; }
@media (max-width: 690px) {
  .customers-filters { grid-template-columns: 1fr 1fr; }
  .customers-filters .field:first-child, .customers-only-open { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .kartei thead { display: none; }
  .kartei, .kartei tbody { display: block; }
  .kartei tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 13px; border-top: 1px solid var(--line); }
  .kartei tr:first-child { border-top: 0; }
  .kartei td { display: block; padding: 0; border: 0; }
  /* Liste: Name | Offen, darunter Aufträge | Umsatz, Datum ausgeblendet */
  .customer-table td:nth-child(1) { grid-area: 1 / 1; }
  .customer-table td:nth-child(5) { grid-area: 1 / 2; }
  .customer-table td:nth-child(3) { grid-area: 2 / 1; color: var(--muted); font-size: 12px; }
  .customer-table td:nth-child(4) { grid-area: 2 / 2; color: var(--muted); font-size: 12px; }
  .customer-table td:nth-child(2) { display: none; }
  /* Dokumente: Nummer | Betrag, darunter Status | Datum */
  .customer-docs td:nth-child(1) { grid-area: 1 / 1; }
  .customer-docs td:nth-child(3) { grid-area: 1 / 2; }
  .customer-docs td:nth-child(4) { grid-area: 2 / 1; }
  .customer-docs td:nth-child(2) { grid-area: 2 / 2; text-align: right; color: var(--muted); font-size: 12px; }
  /* Verkäufe: Ware | Preis, darunter Datum | Trinkgeld */
  .customer-sales td:nth-child(2) { grid-area: 1 / 1; }
  .customer-sales td:nth-child(3) { grid-area: 1 / 2; }
  .customer-sales td:nth-child(1) { grid-area: 2 / 1; color: var(--muted); font-size: 12px; }
  .customer-sales td:nth-child(4) { grid-area: 2 / 2; font-size: 12px; }
  .customer-sales td:nth-child(4).is-none { visibility: hidden; }
}

/* Zahlungserinnerungen */
.status-gemahnt { background: #fdf0dc; color: #8a4a12; border-color: #ecc994; }
.status-gemahnt::before { content: "✉"; width: auto; height: auto; background: none; font-size: 10px; }
.reminder-box { margin: 0 0 18px; padding: 14px 15px; border: 1px solid #efbfb5; border-radius: 10px; background: #fdf5f1; }
.reminder-box h3 { margin: 0 0 4px; font-size: 19px; }
.reminder-box > .muted { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; }
.reminder-list { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.reminder-list:empty { display: none; }
.reminder-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffaf3; font-size: 13px; }
.reminder-list strong { font-weight: 700; }
.reminder-list small { grid-column: 1; color: var(--muted); font-size: 11.5px; }
.reminder-list .reminder-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.reminder-list .link-button { font-size: 12px; }
.reminder-list .is-armed { color: #9e2a1c; font-weight: 750; }
.reminder-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reminder-form .button { width: 100%; margin-top: 10px; }
.reminder-form .hint { margin: 8px 0 0; }
.notify-channels { display: grid; gap: 4px; margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; background: #f6ecda; list-style: none; font-size: 13px; }
.notify-channels li { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.notify-channels .is-off { color: var(--muted); }
.notify-where { display: inline-block; margin-left: 4px; color: var(--muted); font-size: 12px; font-style: normal; white-space: nowrap; }
