/* Compact work tables; detailed fields stay in the same workflow. */
.costs-table th, .costs-table td, .providers-table th, .providers-table td { padding: 6px; }
.costs-table input, .providers-table input, .providers-table select { min-width: 0 !important; width: 100%; }
.costs-table th, .providers-table th { font-size: 12px; white-space: normal; overflow-wrap: anywhere; text-transform: none; }
.costs-table td input, .providers-table td input, .providers-table td select { min-height: 34px; padding: 5px 6px; font-size: 13px; }
/* Istkosten wie in der Excel: alle Felder in einer Zeile, feste schmale Zahlenspalten. */
.costs-table { table-layout: fixed; min-width: 1080px; }
.costs-table th, .costs-table td { padding: 4px 3px; vertical-align: top; }
.costs-table th { font-size: 11px; line-height: 1.25; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.costs-table td input { min-height: 30px; padding: 4px 4px; font-size: 12px; }
.costs-table th small { display: block; font-weight: 400; opacity: 0.8; }
.costs-table th:first-child, .costs-table td:first-child { width: 38px; min-width: 38px; max-width: 38px; position: static; }
.costs-table th:nth-child(2), .costs-table td:nth-child(2) { width: 62px; min-width: 62px; max-width: 62px; position: static; }
.costs-table th:nth-child(3) { width: 14%; }
.costs-table th:nth-child(4), .costs-table th:nth-child(5) { width: 9%; }
.costs-table th:nth-child(6) { width: 58px; }
.costs-table th:nth-child(7) { width: 50px; }
.costs-table th:nth-child(8), .costs-table th:nth-child(9) { width: 48px; }
.costs-table th:nth-child(n+10):nth-child(-n+15) { width: 62px; }
.costs-table th:nth-child(16) { width: 64px; }
.costs-table th:nth-child(17) { width: 80px; }
.costs-table th:last-child { width: 34px; }
.costs-table td[data-label="Abfallart / Bezeichnung"] input + input { margin-top: 3px; min-height: 26px; font-size: 12px; }
.costs-table .pending-column input { border-style: dashed; }
.costs-table input:disabled { background: var(--gray-50); }
.costs-table .money-cell { white-space: nowrap; font-size: 12.5px; padding-top: 10px; }
.table-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.costs-table input[data-key="position"], input[inputmode="decimal"], .money-cell { text-align: right; font-variant-numeric: tabular-nums; }
.providers-table th:first-child, .providers-table td:first-child { width: 15%; min-width: 140px; max-width: none; position: static; }
.providers-table th:nth-child(2) { width: 12%; }
.providers-table th:nth-child(3) { width: 18%; }
.providers-table th:nth-child(4), .providers-table th:nth-child(5) { width: 115px; }
.providers-table th:nth-child(6) { width: 70px; }
.providers-table th:nth-child(7) { width: 105px; }
.providers-table th:last-child { width: 54px; }
.providers-table input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--primary); }
.cost-details-row > td, .provider-details-row > td { background: var(--gray-50); }
.cost-details-layout, .provider-details-layout { padding: 12px; display: grid; gap: 12px; }
.cost-details-layout .form-grid, .provider-details-layout .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.cost-details-layout fieldset, .provider-details-layout fieldset { border: 0; padding: 0; min-width: 0; }
.cost-details-layout legend, .provider-details-layout legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.cost-details-layout label, .condition-field > span, .provider-details-layout label { font-size: 12px; }
.condition-field { display: flex; flex-wrap: wrap; gap: 4px; align-content: start; }
.condition-field > span { flex-basis: 100%; }
.condition-field .price-component { flex: 1 1 120px; min-width: 0; }
.cost-details-layout .price-component input, .cost-details-layout .price-component select { width: 100%; min-width: 0; }
.condition-field button { padding: 4px; min-width: 30px; min-height: 30px; align-self: end; }
.cost-details-layout .row-action, .provider-details-layout .row-action { justify-self: start; }
.costs-table .icon-button, .providers-table .icon-button { width: 32px; height: 32px; padding: 0; }
[hidden] { display: none !important; }
input[aria-invalid="true"] { border-color: var(--bad); background: #fff3f0; }
.legacy-adjustment { margin: 0; font-size: 13px; }
.file-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.file-filters label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.attachment-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file-preview-dialog { width: min(1100px, 94vw); max-height: 92dvh; border: 1px solid var(--line); border-radius: 6px; padding: 16px; color: var(--ink); background: var(--surface); }
.file-preview-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.file-preview-dialog .panel-header { margin-bottom: 12px; }
.file-preview-dialog h2 { overflow-wrap: anywhere; font-size: 18px; }
.file-preview-dialog iframe { display: block; width: 100%; height: 70dvh; border: 1px solid var(--line); }
.file-preview-dialog img { display: block; max-width: 100%; max-height: 70dvh; margin: auto; object-fit: contain; }
.file-preview-dialog td { max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.file-preview-dialog details { margin-bottom: 12px; }
.file-preview-dialog summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.file-preview-dialog .table-wrap { max-height: 65dvh; }
.import-failure { color: var(--bad); border-left: 3px solid var(--bad); padding: 8px 12px; margin-top: 8px; }
.offer-files { border-top: 1px solid var(--line); padding-top: 16px; }
@media (max-width: 700px) {
  #costs .data-grid-wrap { max-height: none; }
  .costs-table, .costs-table tbody { display: block; min-width: 0; width: 100%; }
  .costs-table thead { display: none; }
  .costs-table tr[data-cost-row] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 6px; border-top: 1px solid var(--line); }
  .costs-table td { display: block; width: auto !important; min-width: 0 !important; max-width: none !important; }
  .costs-table tr[data-cost-row] td:nth-child(3), .costs-table tr[data-cost-row] td:nth-child(4), .costs-table tr[data-cost-row] td:nth-child(5) { grid-column: 1 / -1; }
  .costs-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--muted); text-align: left; }
  .costs-table .money-cell { padding-top: 4px; }
  .cost-details-layout .form-grid, .provider-details-layout .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-filters { align-items: stretch; flex-direction: column; }
  .file-preview-dialog { padding: 10px; }
  .costs-table .icon-button, .providers-table .icon-button { min-height: 44px; }
}

.import-warnings { margin-top: 8px; }
.import-warnings ul { max-height: 16rem; overflow: auto; margin: 6px 0 0; padding-left: 1.2rem; overflow-wrap: anywhere; }

/* Stammdaten für alle Projekte */
.master-table th, .master-table td { padding: 6px; }
.master-table td input { min-width: 0; width: 100%; min-height: 34px; padding: 5px 6px; font-size: 13px; }
.master-table td:last-child, .master-table th:last-child { width: 44px; }
.master-table .icon-button { width: 32px; height: 32px; padding: 0; }
.master-catalog-wrap { max-height: 22rem; }
.master-import { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; display: grid; gap: 12px; }
.master-pick-dialog { width: min(720px, 94vw); }
.master-pick-list { max-height: 55dvh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-m); margin: 12px 0; }
.master-pick-list label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.master-pick-list label:first-child { border-top: 0; }
.master-pick-list input { margin-top: 3px; accent-color: var(--primary); }
.master-pick-list small { display: block; color: var(--muted); }
.master-pick-list .empty { padding: 12px; color: var(--muted); font-size: 13.5px; }
.master-link { margin: 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.master-link .badge { min-height: 24px; }
#masterProviderRows td { min-width: 96px; }
#masterProviderRows td:first-child { min-width: 190px; }

/* Diagramme je Entsorger */
.provider-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.provider-charts h3 { font-size: 13px; margin: 0 0 8px; }
.chart-group { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.chart-group:last-child { border-bottom: 0; }
.chart-group-title { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.chart-group .chart-row { grid-template-columns: minmax(96px, 150px) minmax(120px, 1fr) 110px; }
.chart-group .chart-track { height: 16px; }

/* Navigation: Projektkarte, Ablauf mit Status, Projektunterlagen, Bereiche für alle Projekte */
.sidebar { overflow-y: auto; }
.sidebar-panel { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; }
.nav-toggle { display: none; }
.nav-group { margin: 12px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.nav-group-global { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav-group[hidden] { display: none; }
.nav-step { display: flex; align-items: center; gap: 10px; }
.step-badge { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--line); }
.nav-step.step-done .step-badge { background: var(--ebd-green-soft); color: var(--ebd-green); border-color: transparent; }
.nav-step.step-open .step-badge { background: #f5e9d3; color: var(--warn); border-color: transparent; }
.nav-step.step-blocked { color: var(--gray-500); }
.nav-step.step-blocked .step-badge { background: transparent; border-style: dashed; color: var(--gray-500); }
.nav-step.active .step-badge { border: 1px solid var(--ebd-purple); }
.project-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: stretch; }
.project-current { position: relative; display: grid; gap: 2px; text-align: left; min-width: 0; padding: 10px 28px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.project-current:hover, .project-current[aria-expanded="true"] { border-color: var(--ebd-purple); }
.project-current .project-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.project-current strong { font-size: 14px; overflow-wrap: anywhere; }
.project-current::after { content: "▾"; position: absolute; top: 10px; right: 10px; color: var(--muted); }
.project-current small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.project-menu-button { width: 36px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1; color: var(--gray-800); }
.project-menu-button:hover, .project-menu-button[aria-expanded="true"] { border-color: var(--ebd-purple); color: var(--ebd-purple); }
.project-picker, .project-menu { grid-column: 1 / -1; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.project-picker[hidden], .project-menu[hidden] { display: none; }
.project-picker input[type="search"] { width: 100%; min-height: 36px; }
.project-list { display: grid; gap: 2px; max-height: 18rem; overflow-y: auto; }
.project-option { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer; font: inherit; color: var(--ink); }
.project-option:hover { background: var(--gray-100); }
.project-option.current { background: var(--ebd-purple-soft); color: var(--ebd-purple); }
.project-option strong { font-size: 13.5px; overflow-wrap: anywhere; }
.project-option small, .project-empty { font-size: 12px; color: var(--muted); margin: 0; }
.project-empty { padding: 8px 10px; }
.project-archived { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 2px 0; }
.project-archived input { flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--primary); }
.project-menu button { text-align: left; padding: 9px 10px; border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); }
.project-menu button:hover { background: var(--gray-100); color: var(--ebd-purple); }
#archiveProject { color: var(--bad); border-top: 1px solid var(--line); border-radius: 0; }
.global-view #saveButton { display: none; }
.topbar .global-scope-note { grid-column: 1 / -1; grid-row: 2; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--ebd-green); border-radius: var(--radius-l); background: var(--ebd-green-soft); color: var(--ink); font-size: 13.5px; max-width: none; }
@media (max-width: 980px) {
  .sidebar { overflow: visible; }
  .nav-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); text-align: left; }
  .nav-toggle span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
  .nav-toggle strong { font-size: 14px; }
  .nav-toggle::after { content: "▾"; margin-left: auto; color: var(--muted); }
  .sidebar.open .nav-toggle::after { content: "▴"; }
  .sidebar-panel { display: none; }
  .sidebar.open .sidebar-panel { display: flex; }
  .nav { display: grid; max-width: none; overflow: visible; padding-bottom: 0; }
  .nav-item { white-space: normal; }
  .nav-item.active { box-shadow: inset 4px 0 0 var(--ebd-purple); }
  .side-note { display: block; }
}
.providers-rounds { margin-top: 18px; }

/* Kopfleiste: aktives Projekt und Bereiche für alle Projekte; links nur der Projektablauf */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.appbar-brand .brand-logo { width: 150px; }
.appbar-brand span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.appbar .project-card { display: flex; gap: 6px; flex: 1 1 auto; max-width: 560px; min-width: 220px; }
.appbar .project-current { flex: 1 1 auto; padding: 6px 30px 6px 12px; }
.appbar .project-current .project-label { display: none; }
.appbar .project-current strong, .appbar .project-current small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .project-current::after { top: 50%; transform: translateY(-50%); }
.appbar .project-menu-button { flex: 0 0 38px; }
.appbar .project-picker, .appbar .project-menu, .account-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(380px, calc(100vw - 32px)); }
.appbar .project-menu { left: auto; right: 0; width: 280px; }
.appbar-global { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.appbar-global .nav-item { min-height: 38px; padding: 8px 12px; font-size: 13.5px; }
.appbar-global .nav-item.active { box-shadow: inset 0 -3px 0 var(--ebd-purple); }
.appbar-link { min-height: 38px; padding: 8px 12px; border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--gray-800); }
.appbar-link:hover, .appbar-link[aria-expanded="true"] { background: var(--gray-100); color: var(--ebd-purple); }
.account { position: relative; }
.account-button { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line); border-radius: 0; margin-left: 4px; }
.account-button::after { content: " ▾"; color: var(--muted); font-weight: 400; }
.account-menu { left: auto; right: 0; width: 260px; display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.account-menu[hidden] { display: none; }
.account-menu p { margin: 0 0 4px; padding: 6px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.account-menu a, .account-menu button { display: block; text-align: left; padding: 9px 10px; border: 0; border-radius: var(--radius-s); background: transparent; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.account-menu a:hover, .account-menu button:hover { background: var(--gray-100); color: var(--ebd-purple); }
.app-shell { min-height: calc(100dvh - 64px); }
.sidebar { top: 64px; height: calc(100dvh - 64px); }
.global-view .project-card { opacity: 0.55; }
.global-view .project-card:hover, .global-view .project-card:focus-within { opacity: 1; }
@media (max-width: 1240px) {
  .appbar { gap: 12px; padding: 8px 16px; }
  .appbar-brand span { display: none; }
  .appbar-brand .brand-logo { width: 130px; }
}
@media (max-width: 980px) {
  .appbar { position: static; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .appbar-brand .brand-logo { width: 120px; }
  .appbar-brand span { display: none; }
  .appbar-global { gap: 0; }
  .appbar-global .nav-item, .appbar-link { padding: 8px 8px; font-size: 13px; }
  .account-button { max-width: 120px; margin-left: 0; border-left: 0; }
  .account-button #accountLabel { display: none; }
  .account-button::before { content: "Konto"; }
  .appbar .project-card { order: 3; flex: 1 1 100%; }
  .app-shell { min-height: 0; }
  .sidebar { top: auto; height: auto; }
}

/* 2.6.0-rc5: steps 3 to 5 in the order of the Excel (select, send, receive, compare) */
.round-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.round-bar .muted { font-size: 13px; }
.send-steps { list-style: none; counter-reset: send; margin: 0; padding: 0; display: grid; gap: 0; }
.send-steps > li { counter-increment: send; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 0 12px 40px; border-top: 1px solid var(--line); position: relative; }
.send-steps > li:first-child { border-top: 0; }
.send-steps > li::before { content: counter(send); position: absolute; left: 0; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ebd-purple-soft); color: var(--ebd-purple); font-weight: 700; font-size: 13px; }
.send-steps > li > div:first-child { display: grid; gap: 2px; min-width: 220px; flex: 1 1 260px; }
.send-steps small { color: var(--muted); }
.send-draft { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.send-draft label { min-width: 220px; }
.warning-text { color: var(--bad) !important; font-weight: 600; }
.subhead { margin: 18px 0 8px; font-size: 14px; }
.receipt-actions { margin-top: 10px; align-items: center; }
.round-close .panel-header { flex-wrap: wrap; gap: 12px; }
.inline-check { display: flex; align-items: center; gap: 8px; }
.inline-check input { width: auto; }
.analysis-documents { flex-wrap: wrap; }
.more-documents > summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.more-documents[open] > summary { margin-bottom: 14px; }
.file-button.disabled { opacity: 0.5; pointer-events: none; }
.error-notice { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 10px 12px 10px 14px; border: 1px solid var(--bad); border-left-width: 4px; border-radius: var(--radius-m); background: #fbefec; color: var(--ink); font-size: 14px; }
.error-notice[hidden] { display: none; }
.error-notice .icon-button { flex: none; }
#tender > * + *, #offers > * + *, #comparison > * + *, #exports > * + * { margin-top: 18px; }
#comparison > .comparison-panel { margin-top: 18px; }
