/* Gemeinsamer Feinschliff. Keine Änderungen an Daten oder Geschäftsabläufen. */
.app-shell { color-scheme: dark; --ui-gap: 14px; }
.app-shell [hidden] { display:none !important; }
.customer-view-toggle { margin-left:auto; margin-right:12px; flex:0 0 auto; }
.customer-view-toggle button { display:flex; align-items:center; gap:7px; padding:8px 11px; min-height:38px; border:1px solid #3b4653; border-radius:8px; background:#1a2028; color:#dce4ec; font:inherit; font-size:.7rem; cursor:pointer; }
.customer-view-indicator { width:7px; height:7px; border-radius:50%; background:#717d8b; }
.customer-view-toggle button[aria-pressed=true] { border-color:#397760; background:#102b22; color:#8ce1b8; }
.customer-view-toggle button[aria-pressed=true] .customer-view-indicator { background:#58d99c; }
.customer-view .internal-cost-toggle,
.customer-view .internal-cost-column,
.customer-view .pricing-internal-field,
.customer-view .notification-center,
.customer-view .maintenance-admin-chip,
.customer-view .header-user small,
.customer-view .sidebar .user-box,
.customer-view [data-order-section="order-internal"],
.customer-view #order-internal,
.customer-view [data-company-internal] { display:none !important; }
.customer-view .field:has([name="internal_note"]),
.customer-view .field:has([name="assigned_to"]),
.customer-view .field:has([name="staff_role_ids[]"]),
.customer-view .role-text,
.customer-view .custom-role-badge,
.customer-view .customer-role-assignment,
.customer-view .mini-metrics,
.customer-view .hierarchy-notice,
.customer-view a[href*="billing-settings.php"],
.customer-view a[href*="workshop_templates"] { display:none !important; }
.customer-view .location-switcher-form option { font-size:inherit; }
@media(max-width:820px) {
  .customer-view-toggle { margin-right:8px; }
  .customer-view-toggle button { min-height:40px; padding:7px 8px; font-size:.64rem; gap:5px; }
  .app-shell .nav-wrap { gap:8px; padding-inline:12px; }
  .app-shell .brand { flex:1; min-width:0; }
  .app-shell .brand-copy { min-width:0; }
  .app-shell .brand-copy strong { max-width:100%; }
}
.app-shell .portal-main { padding: 22px 24px 36px; }
.app-shell .portal-main > * { max-width: 1480px; }
.app-shell .portal-main > .section,
.app-shell .order-workspace > .section,
.app-shell .document-workspace > .section { padding: 0; }
.app-shell .order-editor,
.app-shell .document-editor,
.app-shell .billing-settings,
.app-shell .message-detail { width: 100%; max-width: none; margin: 0; min-width: 0; }
.app-shell .portal-head,
.app-shell .dashboard-toolbar { gap: 14px; }
.app-shell .portal-head > div,
.app-shell .dashboard-toolbar > div { min-width: 0; }
.app-shell .portal-head h1 { overflow-wrap: anywhere; }
.app-shell .portal-main .panel .portal-head { min-height: 0; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--app-border-soft); border-radius: 0; background: none; box-shadow: none; }
.app-shell .portal-main .panel .portal-head::before { display: none; }
.app-shell .panel h2,
.app-shell .work-panel h2 { font-size: 1rem; line-height: 1.35; }
.app-shell .panel h3 { font-size: .86rem; margin: 20px 0 12px; }
.app-shell .panel p.muted { max-width: 85ch; line-height: 1.6; }
.app-shell .portal-main > .location-switcher { min-height: 64px; margin-bottom: var(--ui-gap); padding: 11px 15px; }
.app-shell .location-switcher-form { max-width: 510px; }
.app-shell .location-switcher-copy strong { overflow-wrap: anywhere; }
.app-shell .location-switcher select { text-overflow: ellipsis; }

/* Gleiche Filter und Formulare auf Übersichts- und Bearbeitungsseiten. */
.app-shell .search-panel { flex-wrap: wrap; align-items: center; margin-bottom: var(--ui-gap); }
.app-shell .search-panel input:not([type=hidden]) { flex: 1 1 240px; min-width: 0; }
.app-shell .search-panel select { flex: 0 1 205px; min-width: 135px; padding: 8px 30px 8px 10px; border: 1px solid #303844; border-radius: 7px; color: var(--app-text); font: inherit; font-size: .76rem; }
.app-shell .search-panel input,
.app-shell .search-panel select { min-height: 40px; }
.app-shell .search-panel .btn { flex: 0 0 auto; }
.app-shell .form-grid { gap: 12px 16px; }
.app-shell .field { min-width: 0; margin-bottom: 13px; }
.app-shell .field > label { display: block; margin-bottom: 6px; line-height: 1.45; font-size: .75rem; }
.app-shell .field input:not([type=checkbox]):not([type=radio]),
.app-shell .field select,
.app-shell .field textarea { width: 100%; min-width: 0; font-size: .82rem; }
.app-shell .field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.app-shell .field input[type=checkbox],
.app-shell .field input[type=radio] { width: 17px; min-height: 17px; flex: 0 0 17px; accent-color: var(--tp-red); }
.app-shell .field .switch input { width: 0; min-height: 0; }
.app-shell .form-note { display: block; margin-top: 5px; color: #99a5b2; font-size: .69rem; line-height: 1.5; overflow-wrap: anywhere; }
.app-shell input::placeholder,
.app-shell textarea::placeholder { color: #788594; opacity: 1; }
.app-shell .field input:disabled,
.app-shell .field select:disabled { opacity: .65; cursor: not-allowed; }
.app-shell .field input[readonly] { background: #191e25; color: #abb7c4; }
.app-shell .actions { gap: 7px; flex-wrap: wrap; align-items: center; }
.app-shell .actions > form { margin: 0; }
.app-shell .btn { line-height: 1.3; text-align: center; }
.app-shell .btn-small { min-height: 32px; padding: 6px 10px; }
.app-shell .btn-danger { border: 1px solid #72303b; background: #30191f; color: #ffa2a8; box-shadow: none; }
.app-shell .btn-danger:hover { border-color: #b54b5b; background: #47212a; box-shadow: none; }
.app-shell .switch input:focus-visible + span { outline: 2px solid #ff626a; outline-offset: 4px; }
.app-shell .maintenance-box { gap: 14px; padding: 13px 15px; margin-bottom: var(--ui-gap); }
.app-shell .maintenance-box > div { min-width: 0; }
.app-shell .maintenance-box p { font-size: .73rem; line-height: 1.55; }

/* Lesbare Listen: Geldbeträge bleiben zusammen, Beschreibungen umbrechen. */
.app-shell .table-wrap { max-width: 100%; scrollbar-width: thin; scrollbar-color: #495562 #11161c; }
.app-shell table { width: 100%; }
.app-shell th { white-space: nowrap; }
.app-shell td { vertical-align: top; line-height: 1.5; overflow-wrap: anywhere; }
.app-shell td > strong { line-height: 1.45; }
.app-shell .number-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.app-shell .table-subline { display: block; margin-top: 4px; color: #929eac; font-size: .68rem; line-height: 1.45; }
.app-shell td .actions { min-width: 100px; }
.app-shell td .btn { white-space: nowrap; }
.app-shell .status-pill,
.app-shell .badge,
.app-shell .custom-role-badge { max-width: 100%; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.app-shell .empty { padding: 28px 15px; color: #9aa6b3; line-height: 1.6; }
.app-shell .pagination { margin: 16px 0 4px; justify-content: flex-end; }
.app-shell .pagination a { min-width: 34px; min-height: 34px; text-align: center; }
.app-shell .template-categories { display: flex; flex-wrap: wrap; margin-bottom: 14px; }
.app-shell .template-categories a { padding: 9px 12px; }
.app-shell .template-result-count { margin: 0 0 14px; font-size: .73rem; line-height: 1.6; }
.app-shell .inventory-add-form { margin-top:16px; }
.app-shell .inventory-booking > form { width:min(340px,100%); min-width:210px; padding:14px 0 0; }
.app-shell .inventory-negative-confirm { display:flex; align-items:center; gap:8px; margin:12px 0; font-size:.71rem; white-space:normal; color:#edbd75; }
.app-shell .inventory-negative-confirm input { width:17px; height:17px; accent-color:#e21c25; }
.app-shell .inventory-stock-warning { padding:9px; border:1px solid #94504b; border-radius:7px; background:#321a1f; color:#ffb4ae; font-weight:700; }
.app-shell .inventory-history { margin-top:16px; }
.app-shell .inventory-history .table-wrap { margin-top:14px; }
.app-shell strong.cash-amount-negative { color:#ff7d83; }
.app-shell strong.cash-amount-positive { color:#60d399; }
/* Auftragsakte: getrennte Arbeitsbereiche mit einem gemeinsamen Speicherformular. */
.app-shell .order-workspace { overflow:visible; }
.app-shell .order-workspace .detail-strip strong { white-space:normal; overflow-wrap:anywhere; }
.app-shell .order-section-tabs { display:flex; flex-wrap:wrap; gap:5px; padding:5px; margin-bottom:16px; border:1px solid #303844; border-radius:10px; background:#101419; }
.app-shell .order-section-tabs button { display:flex; align-items:center; gap:7px; min-height:39px; padding:8px 12px; border:0; border-radius:7px; background:transparent; color:#a7b3c0; font:inherit; font-size:.75rem; cursor:pointer; }
.app-shell .order-section-tabs button:hover { background:#202630; color:white; }
.app-shell .order-section-tabs button.active { background:#2a303a; color:white; box-shadow:inset 0 -2px #e21c25; }
.app-shell .order-section-tabs button span { display:inline-grid; min-width:20px; height:20px; place-items:center; border-radius:6px; background:#343d48; color:#c7d1dc; font-size:.61rem; }
.app-shell .order-tabs-ready .order-section-panel { display:none; }
.app-shell .order-tabs-ready .order-section-panel.is-active { display:block; }
.app-shell .order-appointment-summary { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px 15px; margin-bottom:14px; border:1px solid #2c3540; border-radius:9px; background:#13181e; }
.app-shell .order-appointment-summary strong { font-size:.76rem; }
.app-shell .order-savebar { position:sticky; bottom:12px; z-index:5; width:100%; justify-content:flex-end; margin:14px 0 0; padding:11px 13px; border:1px solid #3b4653; background:rgba(20,25,31,.98); }
.app-shell .order-approval-create { min-width:0; align-self:start; border:1px solid #303844; border-radius:9px; background:#101419; }
.app-shell .order-approval-create summary { padding:13px; cursor:pointer; color:#e8edf3; font-size:.8rem; font-weight:700; }
.app-shell .order-approval-create > form { padding:0 13px 13px; }
.app-shell .approval-admin-history h3 { margin-top:0; }
.app-shell .order-document-list { display:grid; gap:10px; }
.app-shell .order-document-card { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid #303844; border-radius:9px; background:#11161c; }
.app-shell .order-document-card h3 { margin:4px 0 7px; }
.app-shell .order-document-card > strong { font-variant-numeric:tabular-nums; }
.app-shell .order-document-card .actions { margin:0; }
@media(max-width:820px) {
  .app-shell .order-savebar { display:flex; flex-wrap:wrap; position:sticky; bottom:8px; }
  .app-shell .order-savebar .btn { flex:1 1 160px; }
  .app-shell .order-section-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; }
  .app-shell .order-section-tabs button { flex:0 0 auto; min-height:44px; }
  .app-shell .approval-admin-grid { grid-template-columns:1fr; }
  .app-shell .order-workspace .approval-history-list article { grid-template-columns:minmax(0,1fr) auto; }
  .app-shell .order-workspace .approval-history-list article > b { grid-column:1; }
}
.app-shell .expense-table { table-layout: fixed; }
.app-shell .expense-table th:nth-child(1) { width: 9%; }
.app-shell .expense-table th:nth-child(2) { width: 23%; }
.app-shell .expense-table th:nth-child(3) { width: 11%; }
.app-shell .expense-table th:nth-child(4) { width: 17%; }
.app-shell .expense-table th:nth-child(5) { width: 8%; }
.app-shell .expense-table th:nth-child(6) { width: 12%; }
.app-shell .expense-table th:nth-child(7) { width: 10%; }
.app-shell .expense-table th:nth-child(8) { width: 10%; }
.app-shell .expense-table td { white-space: normal; }
.app-shell .expense-table .expense-amounts-cell { white-space: nowrap; }
.app-shell .expense-table .expense-amounts > span { flex-direction: column; align-items: flex-end; gap: 1px; }
.app-shell .expense-description,
.app-shell .expense-supplier { overflow-wrap: anywhere; }
.app-shell .expense-row-actions .actions { min-width: 0; flex-direction: column; align-items: stretch; }
.app-shell .expense-row-actions .btn { width: 100%; }

/* Tagesübersicht und Bearbeitung: keine großen leeren Flächen. */
.app-shell .dashboard-primary,
.app-shell .dashboard-side { align-content: start; }
.app-shell .metric-card { gap: 10px; }
.app-shell .metric-card > span:nth-child(2) { min-width: 0; }
.app-shell .metric-card small { display: block; line-height: 1.45; overflow-wrap: anywhere; }
.app-shell .focus-panel dl { margin: 0; }
.app-shell .dashboard-empty { padding: 20px 14px; }
.app-shell .dashboard-empty > strong { font-weight: 600; }
.app-shell .schedule-main,
.app-shell .order-main { min-width: 0; }
.app-shell .schedule-main small,
.app-shell .order-main small { overflow-wrap: anywhere; }
.app-shell .document-savebar,
.app-shell .order-position-footer { gap: 12px; padding: 14px; border: 1px solid #303844; border-radius: 10px; background: #14191f; }
.app-shell .totals-panel strong,
.app-shell .order-position-totals strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell .report-command-bar { flex-wrap: wrap; gap: 16px; }
.app-shell .report-command-facts { flex-wrap: wrap; gap: 18px; }
.app-shell .cash-metric { grid-column: 1 / -1; min-height: 85px; }
.app-shell .cashbook-table { width: auto; }
.app-shell .cash-entry-form { grid-template-columns: repeat(4,minmax(0,1fr)); }
.app-shell .cash-entry-form .cash-description { grid-column: span 2; }
.app-shell .cash-entry-form .btn { min-height: 41px; }
.app-shell .detailing-package-head { flex-wrap: wrap; gap: 8px; }
.app-shell .detailing-package-head > strong { padding: 4px 8px; border: 1px solid #303844; border-radius: 6px; }
.app-shell .detailing-package-card ul { line-height: 1.6; }
.app-shell .accounting-note { margin-top: 14px; padding: 13px 15px; color: #9aa6b3; font-size: .71rem; line-height: 1.65; }
.app-shell .site-footer { padding: 18px 24px; }
.app-shell .site-footer .footer-grid { display: none; }
.app-shell .footer-bottom { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; width: 100%; margin: 0; padding: 0; border: 0; font-size: .68rem; }
.portal-footer-links { display: flex; gap: 16px; }
.app-shell .footer-bottom a { color: #aab5c2; font-size: .68rem; }

@media (min-width:1101px) and (max-width:1400px) {
  .app-shell .portal { grid-template-columns: 230px minmax(0,1fr); }
  .app-shell .portal-main { padding-inline: 18px; }
  .app-shell .portal-main::before { left: 230px; }
  .app-shell .dashboard-layout { grid-template-columns: minmax(0,1fr) 280px; }
}
@media (max-width:1100px) {
  .app-shell .portal-main { padding: 18px 16px 28px; }
  .app-shell .cash-entry-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:820px) {
  .app-shell .portal-main { padding: 14px 12px 26px; }
  .app-shell .portal-main .table-wrap.responsive-table-wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
  .app-shell .field input:not([type=checkbox]):not([type=radio]),
  .app-shell .field select,
  .app-shell .field textarea,
  .app-shell .search-panel input,
  .app-shell .search-panel select,
  .app-shell .inline-form input,
  .app-shell .inline-form select,
  .app-shell .location-switcher-form select,
  .public-shell .field input,
  .public-shell .field select,
  .public-shell .field textarea { font-size: 16px; min-height: 44px; }
  .app-shell .search-panel input,
  .app-shell .search-panel select { flex: none; width: 100%; }
  .app-shell .btn { min-height: 42px; }
  .app-shell .report-period { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
  .app-shell .report-period input { flex: 1 1 130px; width: auto; min-width: 0; }
  .app-shell .report-period .btn { flex: 0 0 auto; }
  .app-shell .responsive-table .number-cell { white-space: normal; }
  .app-shell .expense-table { table-layout: auto; }
  .app-shell .expense-row-actions .actions { flex-direction: row; }
  .app-shell .cashbook-table { margin-inline: 10px; }
  .app-shell .document-item-row input,
  .app-shell .document-item-row select,
  .app-shell .document-item-row textarea { font-size: 16px; min-height: 44px; }
}
@media (max-width:620px) {
  .app-shell .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .app-shell .metric-card { grid-template-columns: 28px minmax(0,1fr); min-height: 100px; padding: 12px; gap: 7px; }
  .app-shell .metric-card .metric-icon { width: 28px; height: 28px; flex: 0 0 28px; }
  .app-shell .metric-card .metric-arrow { display: none; }
  .app-shell .metric-card strong { font-size: 1.3rem; }
  .app-shell .metric-card small { font-size: .66rem; }
  .app-shell .location-switcher-form { flex-direction: row; }
  .app-shell .location-switcher-form button { width: auto; }
  .app-shell .cash-entry-form { grid-template-columns: 1fr; }
  .app-shell .cash-entry-form .cash-description { grid-column: auto; }
  .app-shell .cash-entry-form .btn { width: 100%; }
  .app-shell .package-insert-bar { grid-template-columns: 1fr; }
  .app-shell .package-insert-bar > div { grid-column: auto; }
  .app-shell .order-position-totals { width: 100%; }
  .app-shell .pagination { justify-content: center; }
  .app-shell .site-footer { padding: 16px 12px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.invoice-review{border:1px solid #b88836!important;background:linear-gradient(135deg,rgba(184,136,54,.12),rgba(184,136,54,.03))!important;scroll-margin-top:110px}
.invoice-review ul{padding-left:1.3rem;margin:16px 0;display:grid;gap:10px}
.invoice-review-ack{display:flex;align-items:flex-start;gap:10px;margin:20px 0;line-height:1.5}
.invoice-review-ack input{width:18px;min-width:18px;height:18px;margin-top:3px;accent-color:var(--primary,#e21b2d)}
.invoice-review .btn{white-space:normal}
