:root {
  --brand: #315a9b;
  --brand-dark: #1e3f78;
  --brand-deep: #19345f;
  --brand-soft: #edf3fb;
  --brand-line: #c4d3e8;
  --ink: #172033;
  --muted: #64748b;
  --line: #dbe3ef;
  --paper: #ffffff;
  --canvas: #f3f6fa;
  --red: #b42318;
  --amber: #a16207;
  --green: #166534;
  --shadow: 0 8px 28px rgba(30, 63, 120, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.topbar {
  min-height: 78px;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 8px clamp(18px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 2px 14px rgba(30, 63, 120, .12);
}

.brand {
  color: var(--brand-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

.brand:hover { text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-logo {
  display: block;
  width: 184px;
  height: auto;
  object-fit: contain;
}

.brand-logo-neutral {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.brand.large {
  justify-content: center;
  margin: 0 auto 25px;
}

.brand.large .brand-logo { width: min(270px, 100%); }

.brand.large .brand-logo-neutral {
  width: 80px;
  height: 80px;
}

.brand-mark { display: none; }

.main-nav {
  display: flex;
  gap: 3px;
  align-items: center;
  flex: 1;
  overflow: auto;
}

.main-nav a {
  color: var(--brand-dark);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 7px;
  white-space: nowrap;
  font-weight: 650;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
}

.user-menu {
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
  color: var(--brand-dark);
}

.user-menu form { margin: 0; }

.link-button {
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px clamp(18px, 4vw, 56px) 58px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 20px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.page-heading h1 { margin: 0 0 3px; font-size: 30px; letter-spacing: -.02em; }
.eyebrow { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .11em; font-size: 11px; margin: 0 0 5px; }
.muted { color: var(--muted); }

a { color: var(--brand-dark); font-weight: 650; text-decoration: none; }
a:hover { color: var(--brand); text-decoration: underline; }

.card,
.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.card { padding: 22px; margin-bottom: 22px; }
.card h2 { font-size: 18px; margin: 0 0 16px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-heading h2 { margin: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { padding: 20px; border-top: 4px solid var(--brand); }
.kpi span { color: var(--muted); display: block; font-size: 13px; }
.kpi strong { font-size: 30px; display: block; margin: 8px 0 12px; }
.kpi a, .card-heading a { color: var(--brand-dark); font-weight: 700; }
.kpi-grid.compact .kpi { padding: 16px; }
.kpi-grid.compact .kpi strong { font-size: 22px; }
.kpi-grid.compact .kpi small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.order-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.button {
  border: 1px solid var(--brand-line);
  background: white;
  color: var(--brand-dark);
  border-radius: 7px;
  padding: 9px 13px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.button:hover { text-decoration: none; background: var(--brand-soft); }
.button.primary { background: var(--brand); border-color: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button.danger, .button.danger-outline { color: var(--red); }
.button.danger { background: #fff1f2; border-color: #fecdd3; }
.button.danger-outline { border-color: #fecaca; background: #fff; }
.button.small { font-size: 12px; padding: 6px 9px; }
.button.wide { width: 100%; }

.actions, .form-actions, .inline-form, .form-navigation { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.toolbar { display: flex; gap: 8px; margin-bottom: 17px; align-items: end; }
.toolbar label { display: flex; flex-direction: column; gap: 5px; color: #334155; font-weight: 650; }
.toolbar input { flex: 1; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pagination-summary { color: var(--muted); font-size: 14px; }
.pagination-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.form-grid fieldset { border: 0; padding: 0; margin: 0; }
.form-grid legend { font-weight: 800; font-size: 16px; margin: 0 0 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; color: #334155; font-weight: 650; }
.form-grid label.check-line { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.check-line input[type="checkbox"], .check-line input[type="radio"] { width: auto; flex: 0 0 auto; margin: 0; }
.remember-me { margin-top: 2px; }
.remember-me-warning { margin-top: -8px; color: var(--amber); font-size: 12px; line-height: 1.35; }
.radio-list { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.billing-choice .check-line { width: max-content; }
.form-grid label.full, .form-grid .full { grid-column: 1 / -1; }

input, select, textarea {
  width: 100%;
  border: 1px solid #c5d1e1;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

input:focus, select:focus, textarea:focus { outline: 3px solid rgba(49, 90, 155, .18); border-color: var(--brand); }
textarea { resize: vertical; }
.inline-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.trip-row { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, .85fr); gap: 14px; margin-bottom: 14px; }
.trip-meta { margin-top: 4px; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.form-actions { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 3px; }
.hint { font-size: 12px; color: var(--muted); background: var(--brand-soft); border-left: 3px solid var(--brand); padding: 9px 11px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: top; }
th { color: var(--brand-dark); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: var(--brand-soft); }
.trip-type-column { width: 3.1rem; min-width: 3.1rem; max-width: 3.1rem; padding-left: 6px; padding-right: 6px; text-align: center; }
.column-filter-row th { padding: 5px 6px; background: #f8fbff; text-transform: none; letter-spacing: 0; }
.column-filter-row .column-filter { min-width: 7rem; padding: 5px 7px; font-size: 12px; font-weight: 400; }
tbody tr:hover { background: #f8fbff; }
.empty { text-align: center; color: var(--muted); padding: 35px; }

.status, .role { border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 750; display: inline-block; background: #e2e8f0; color: #475569; }
.status.offen { background: #fef3c7; color: var(--amber); }
.status.aktiv { background: #dcfce7; color: var(--green); }
.status.kundenstatus-aktiv { background: #dcfce7; color: var(--green); }
.status.kundenstatus-inaktiv { background: #e5e7eb; color: #6b7280; }
.status.pausiert { background: #fef3c7; color: var(--amber); }
.status.abgeschlossen { background: #dbeafe; color: #1d4ed8; }
.status.abgerechnet { background: #e0e7ff; color: #3730a3; }
.status.überfällig { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.status.zeitstatus-offen { background: #fef3c7; color: var(--amber); }
.status.zeitstatus-keine_abrechnung { background: #e5e7eb; color: #6b7280; }
.status.zeitstatus-geschrieben { background: #dcfce7; color: #166534; }
.status.zeitstatus-abgerechnet { background: #e0e7ff; color: #3730a3; }
.batch-actions { display: flex; align-items: end; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.batch-actions label { display: flex; flex-direction: column; gap: 5px; color: #334155; font-weight: 650; }
.batch-actions select { min-width: 170px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.detail-grid > .card { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: minmax(130px, .8fr) 1.2fr; gap: 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { border-radius: 8px; padding: 11px 14px; border: 1px solid; }
.flash a { color: inherit; font-weight: 700; text-decoration: underline; }
.flash.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.feature-list { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-list span { background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 8px; padding: 8px 11px; color: var(--brand-dark); }
.auth-wrap { min-height: 65vh; display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); background: white; border: 1px solid var(--brand-line); border-radius: 15px; padding: 35px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0; font-size: 25px; }
.auth-card .muted { margin-top: 2px; margin-bottom: 24px; }
.error-card { text-align: center; max-width: 560px; margin: 70px auto; }
.error-code { font-size: 70px; font-weight: 900; color: var(--brand); }
.mono { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; }

.report-year-form {
  min-width: 260px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.report-year-form > label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.report-year-form .inline-form { flex-wrap: nowrap; }
.report-year-form input { min-width: 105px; }
.annual-report-card { padding-bottom: 16px; }
.report-card-heading { align-items: flex-start; flex-wrap: wrap; }
.report-subtitle { margin: -8px 0 0; font-size: 13px; }
.report-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; }
.report-filter .filter-label { color: var(--muted); font-weight: 800; }
.report-filter .check-line { color: var(--ink); font-weight: 650; }
.annual-report-table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.annual-report-table { min-width: 1220px; }
.annual-report-table th, .annual-report-table td { text-align: right; white-space: nowrap; }
.annual-report-table th:first-child, .annual-report-table td:first-child { text-align: left; position: sticky; left: 0; z-index: 2; background: var(--paper); }
.annual-report-table thead th { position: sticky; top: 0; z-index: 1; }
.annual-report-table thead th:first-child { z-index: 4; background: var(--brand-soft); }
.annual-report-table tbody th { background: var(--paper); text-transform: none; letter-spacing: 0; font-size: 14px; }
.annual-report-table tfoot th:first-child { z-index: 3; background: var(--brand-soft); }
.report-order-name, .report-customer-name { display: block; color: var(--ink); font-size: 14px; font-weight: 800; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.report-order-number { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.annual-report-table .report-total { font-weight: 800; background: #f8fbff; }
.annual-report-table tfoot th, .annual-report-table tfoot td { border-top: 2px solid var(--brand); font-weight: 850; background: var(--brand-soft); }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 16px; }

.document-upload {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.5fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  margin: 16px 0;
  background: #f8fbff;
  border: 1px solid var(--brand-line);
  border-radius: 9px;
}
.document-upload label { display: flex; flex-direction: column; gap: 5px; color: #334155; font-weight: 650; }
.document-upload input[type="file"] { padding: 7px; }
.document-list { display: grid; gap: 8px; }
.document-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.document-row:last-child { border-bottom: 0; }
.document-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.document-name { overflow-wrap: anywhere; }
.document-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.document-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: 0 0 auto; }
.document-actions form { margin: 0; }
.document-empty { margin: 12px 0 0; padding: 15px; background: var(--canvas); border-radius: 8px; }
.pdf-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #e8edf3; }
.pdf-preview iframe { display: block; width: 100%; height: 900px; border: 0; background: white; }
.uploaded-pdf-list { display: grid; gap: 18px; }
.uploaded-pdf-item { padding-top: 12px; border-top: 1px solid var(--line); }
.uploaded-pdf-item:first-child { padding-top: 0; border-top: 0; }
.document-row-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.pdf-document-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #e8edf3; }
.pdf-preview-page { display: block; width: 100%; height: auto; background: white; }
.pdf-preview-page + .pdf-preview-page { border-top: 12px solid #e8edf3; }
.invoice-document-card, .invoice-preview { max-width: 950px; margin-left: auto; margin-right: auto; }
.timesheet-document-card, .timesheet-preview-card { max-width: 1100px; margin-left: auto; margin-right: auto; }
.timesheet-preview { display: grid; gap: 22px; }
.timesheet-sheet { padding: 28px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 4px 16px rgba(31, 52, 84, .08); color: #111; font-size: 12px; }
.timesheet-head, .timesheet-meta, .timesheet-times, .timesheet-summary, .timesheet-signatures { width: 100%; border-collapse: collapse; table-layout: fixed; }
.timesheet-head td { height: 88px; border: 1px solid #111; vertical-align: middle; }
.timesheet-head .company { width: 31%; padding: 8px; line-height: 1.45; vertical-align: top; }
.timesheet-head .title { width: 37%; text-align: center; font-size: 22px; font-weight: 700; }
.timesheet-head .logo-cell { width: 32%; text-align: center; }
.timesheet-head img { width: 132px; height: auto; }
.timesheet-meta td { height: 25px; border: 1px solid #111; padding: 3px 7px; }
.timesheet-meta .label { width: 14%; font-weight: 700; white-space: nowrap; }
.timesheet-meta .value { width: 36%; }
.timesheet-times { margin-top: 8px; }
.timesheet-times th, .timesheet-times td, .timesheet-summary td { border: 1px solid #111; padding: 4px 5px; vertical-align: middle; overflow-wrap: anywhere; }
.timesheet-times th { height: 26px; text-align: center; }
.timesheet-times td { height: 29px; }
.timesheet-times .date, .timesheet-summary .date { width: 14%; }
.timesheet-times .place, .timesheet-summary .place { width: 14%; }
.timesheet-times .time, .timesheet-summary .time { width: 7%; text-align: center; }
.timesheet-times .pause, .timesheet-summary .pause { width: 7%; text-align: center; }
.timesheet-times .hours, .timesheet-summary .hours { width: 7%; text-align: center; }
.timesheet-times .drive, .timesheet-summary .drive { width: 8%; text-align: center; }
.timesheet-times .note, .timesheet-summary .note { width: 36%; }
.timesheet-times td.center, .timesheet-summary td.center { text-align: center; }
.timesheet-summary { margin-top: 0; }
.timesheet-summary td { height: 25px; font-weight: 700; }
.timesheet-summary .summary-label { text-align: right; }
.timesheet-remark { min-height: 72px; margin-top: 8px; padding: 7px; border: 1px solid #111; }
.timesheet-signatures { margin-top: 8px; }
.timesheet-signatures td { height: 82px; padding: 7px; border: 1px solid #111; vertical-align: top; }

.category-list { display: grid; gap: 14px; }
.category-row { min-width: 0; }
.category-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; color: var(--ink); }
.category-title strong { white-space: nowrap; }
.category-bar { height: 9px; overflow: hidden; background: #e7edf5; border-radius: 999px; }
.category-bar span { display: block; height: 100%; min-width: 0; background: var(--brand); border-radius: inherit; }
.category-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.compact-table th, .compact-table td { white-space: nowrap; }

.internal-invoice-table { min-width: 980px; table-layout: fixed; }
.internal-invoice-table th, .internal-invoice-table td { overflow-wrap: anywhere; }
.internal-invoice-table .internal-company-column,
.internal-invoice-table .internal-project-column,
.internal-invoice-table .internal-employee-column { text-align: left; }
.internal-invoice-table .internal-company-column { width: 6%; white-space: nowrap; }
.internal-invoice-table .internal-project-column { width: 19%; }
.internal-invoice-table .internal-employee-column { width: 13%; }
.internal-invoice-table .internal-quantity-column { width: 7%; }
.internal-invoice-table .internal-money-column { width: 9%; }
.internal-invoice-table .internal-rate-column { width: 17%; }
.internal-invoice-table .numeric-column { text-align: right; white-space: nowrap; }
.internal-invoice-preview-table .internal-company-column,
.internal-invoice-preview-table .internal-project-column,
.internal-invoice-preview-table .internal-employee-column,
.internal-invoice-preview-table .internal-quantity-column,
.internal-invoice-preview-table .internal-money-column { width: auto; }
.internal-invoice-preview-table .internal-preview-from-column { width: 8%; }
.internal-invoice-preview-table .internal-preview-to-column { width: 7%; }
.internal-invoice-preview-table .internal-preview-project-column { width: 23%; }
.internal-invoice-preview-table .internal-preview-employee-column { width: 16%; }
.internal-invoice-preview-table .internal-preview-quantity-column { width: 8%; }
.internal-invoice-preview-table .internal-preview-material-column { width: 10%; }
.internal-invoice-preview-table .internal-preview-net-column { width: 12%; }

.invoice-preview { max-width: 950px; margin: 0 auto; }
.invoice-head { display: flex; justify-content: space-between; border-bottom: 3px solid var(--brand); padding-bottom: 16px; margin-bottom: 28px; }
.invoice-head strong { font-size: 22px; color: var(--brand-dark); }
.invoice-logo { width: 190px; height: auto; }
.totals { width: min(360px, 100%); margin: 22px 0 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.totals dt, .totals dd { margin: 0; padding: 4px; border-bottom: 1px solid var(--line); }
.totals dd { text-align: right; }
.totals dt:last-of-type, .totals dd:last-of-type { border-top: 2px solid var(--brand); font-size: 16px; }
.summary-totals {
  width: 100%;              /* ← volle Breite nutzen */
  max-width: 800px;         /* ← aber nicht zu breit */
  margin: 22px 0 0 0;       /* ← nicht rechts angeheftet */
  display: flex;
  flex-direction: column;
  gap: 0;
}
.summary-row {
  display: grid;
  grid-template-columns: 2fr 1fr;     /* ← Firmennamen 2x so breit */
  gap: 30px;                          /* ← mehr Abstand */
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  white-space: nowrap;                /* ← keine Umbrüche */
}
.summary-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;            /* ← Falls noch zu lang, ellipsis */
}
.summary-row:last-child {
  border-bottom: 2px solid var(--brand);
  padding-top: 8px;
  padding-bottom: 8px;
}
.summary-total {
  font-size: 16px;
  font-weight: bold;
}

@media (max-width: 1100px) {
  .main-nav { gap: 0; }
  .main-nav a { padding: 8px 7px; font-size: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .time-entry-form { gap: 8px; }
}

@media (max-width: 760px) {
  .topbar { position: static; flex-wrap: wrap; padding: 10px 18px; gap: 12px; }
  .brand-logo { width: 160px; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .user-menu { margin-left: auto; font-size: 12px; }
  .page-shell { padding-top: 24px; }
  .page-heading { flex-direction: column; }
  .detail-grid, .form-grid.two, .form-grid.four, .trip-row { grid-template-columns: 1fr; }
  .time-entry-form { gap: 9px; }
  .card { padding: 17px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .facts { grid-template-columns: 1fr; gap: 3px; }
  .facts dd { margin-bottom: 10px; }
  .document-upload { grid-template-columns: 1fr; align-items: stretch; }
  .document-row { align-items: flex-start; flex-direction: column; }
  .document-actions { width: 100%; }
  .document-row-heading { align-items: flex-start; flex-direction: column; }
  .pdf-document-preview iframe { height: 620px; }
  .timesheet-sheet { padding: 14px; min-width: 760px; }
  .timesheet-preview { overflow-x: auto; }
  .auth-card { padding: 25px; }
  .inline-form { align-items: stretch; }
  .inline-form > * { flex: 1; }
}

.planning-input {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(120px, .85fr) auto minmax(125px, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}
.planning-input label { min-width: 0; }
.planning-operator { color: var(--brand-dark); font-size: 20px; font-weight: 800; padding-bottom: 8px; }
.calculated-value {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 9px 10px;
  border: 1px solid var(--brand-line);
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 800;
  white-space: nowrap;
}
.planning-progress { margin-top: 22px; }
.planning-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.planning-summary > div { padding: 13px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 9px; }
.planning-summary span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.planning-summary strong { display: block; color: var(--brand-dark); }
.progress-metrics { display: grid; gap: 14px; }
.progress-metric-row { display: grid; grid-template-columns: minmax(245px, 0.9fr) minmax(160px, 3fr) auto; align-items: center; gap: 14px; }
.progress-metric-label { color: var(--muted); }
.progress-metric-value { min-width: 64px; text-align: right; white-space: nowrap; }
.progress-bar { height: 12px; overflow: hidden; background: #e7edf5; border-radius: 999px; }
.progress-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.progress-metric-row:nth-child(2) .progress-bar span { background: var(--green); }
.progress-metric-row:nth-child(2) .progress-bar.over-limit span { background: var(--red); }
.progress-bar.over-limit span { background: var(--red); }
.progress-value { display: inline-block; padding: 4px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 750; white-space: nowrap; }
.progress-value.over-limit { background: #fee2e2; color: var(--red); }
@media (max-width: 760px) {
  .planning-input { grid-template-columns: 1fr auto 1fr; }
  .planning-input .planning-operator:nth-of-type(2), .planning-input .calculated-value { grid-column: 1 / -1; }
  .planning-summary { grid-template-columns: 1fr; }
  .progress-metric-row { grid-template-columns: minmax(0, 1fr) minmax(90px, 2fr) auto; gap: 8px; }
  .progress-metric-label { font-size: 13px; }
}
.checkbox-list { display: grid; gap: .45rem; margin: .5rem 0; }
.logo-preview { display: block; max-width: 260px; max-height: 110px; object-fit: contain; object-position: left center; margin: .5rem 0 1rem; border: 1px solid #dbe3ef; border-radius: 4px; padding: .35rem; background: #fff; }
.table-logo { display: block; width: 90px; height: 42px; object-fit: contain; object-position: left center; }

/* Auswahlfelder: Checkbox LINKS neben Firmennamen */
.checkbox-list {
  display: flex;
  flex-direction: column;        /* ← Eine pro Zeile! */
  gap: 0.5rem;
  margin: 0.5rem 0;
}

/* WICHTIG: Spezifischere Regel als .form-grid label */
.checkbox-list .checkbox-inline {
  display: flex !important;
  flex-direction: row !important;
  width: auto;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  color: #334155;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  text-align: left;
}

.checkbox-inline, .checkbox-list .checkbox {
  display: flex !important;      /* ← WICHTIG! */
  flex-direction: row !important;/* ← Horizontal! */
  width: auto;
  align-items: center;
  justify-content: flex-start;   /* ← Links! */
  gap: 0.8rem;                   /* ← Abstand zwischen Checkbox und Firma */
  color: #334155;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  text-align: left;
}

.checkbox-inline input[type="checkbox"], .checkbox-list .checkbox input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  cursor: pointer;
  flex-shrink: 0 !important;     /* ← Checkbox bleibt gleich groß */
  order: -1 !important;           /* ← Checkbox ZUERST (Links) */
}

.checkbox-inline span {
  overflow-wrap: nowrap;
  white-space: nowrap !important; /* ← Keine Umbrüche */
  flex-shrink: 0 !important;
  text-align: left;
  display: inline;                /* ← Inline! */
}

.checkbox-inline:hover:not(.locked), .checkbox-list .checkbox:hover {
  background-color: #f0f5fb;
}

.checkbox-inline.locked {
  cursor: default;
  background-color: #f5f9fd;
  opacity: 0.8;
}

.checkbox-inline.locked span small {
  color: var(--muted);
  font-weight: 500;
}
.mfa-setup-card { max-width: 980px; }
.mfa-setup-layout { display: grid; grid-template-columns: minmax(230px, 320px) 1fr; gap: 2rem; align-items: start; margin-top: 1.5rem; }
.mfa-qr-panel { text-align: center; }
.mfa-qr { display: block; width: min(100%, 280px); height: auto; margin: 0 auto 1rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.mfa-setup-details { min-width: 0; }
.mfa-secret { display: block; padding: .8rem 1rem; background: #f1f5f9; border: 1px solid var(--line); border-radius: 6px; font-size: 1.05rem; letter-spacing: .08em; overflow-wrap: anywhere; }
.mfa-parameters { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 1rem 0; }
.mfa-parameters dt { color: var(--muted); font-weight: 650; }
.mfa-parameters dd { margin: 0; }
.mfa-uri { display: block; width: 100%; min-height: 5.5rem; margin-top: .7rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; overflow-wrap: anywhere; }
.mfa-confirm-panel { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.mfa-confirm-form { max-width: 520px; margin-bottom: 1rem; }
.small-text { font-size: .85rem; }
@media (max-width: 720px) { .mfa-setup-layout { grid-template-columns: 1fr; } .mfa-qr { width: min(100%, 250px); } }

.dashboard-company-filter { margin-bottom: 1rem; }
.dashboard-company-filter .toolbar label { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.dashboard-company-filter select { min-width: 18rem; }
/* V4.5: zusammengesetzte Nummern und Dashboard-Firmenfilter */
.dashboard-company-filter { display:flex; align-items:center; gap:.45rem; }
.dashboard-company-filter label { font-weight:600; }
.dashboard-company-filter select { width:18rem; min-height:2.45rem;
.composite-number {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.composite-number output {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 0.62rem 0.72rem;
  border: 1px solid #cbd5e1;
  border-right: none;
  border-radius: 0.38rem 0 0 0.38rem;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.5;
}
.composite-number input {
  border-radius: 0 0.38rem 0.38rem 0;
  flex: 1;
  min-width: 8rem;
}
}
