/* 01 Design Tokens */
:root {
  --bg: #020713;
  --panel: #07192f;
  --panel-2: #09223f;
  --line: #294b69;
  --line-blue: #0b83ff;
  --text: #f2f7ff;
  --muted: #9eb1c7;
  --blue: #087cff;
  --cyan: #15b7ff;
  --green: #42de77;
  --red: #ff5a66;
  --yellow: #ffc247;
  --radius: 10px;
  --gap: clamp(6px, .75vw, 10px);
  --pad: clamp(8px, .9vw, 14px);
  --fs-xs: clamp(9px, .72vw, 11px);
  --fs-sm: clamp(10px, .82vw, 13px);
  --fs-md: clamp(12px, .96vw, 15px);
  --fs-lg: clamp(17px, 1.45vw, 24px);
}

/* 02 Base */
* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background:
    radial-gradient(circle at 58% 0%, rgba(0, 124, 255, .2), transparent 34%),
    linear-gradient(135deg, #020611, #07182f);
}

button,
input,
select,
textarea { font: inherit; }

button { cursor: pointer; }

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #2b4e70;
  border-radius: 7px;
  background: #061529;
  color: var(--text);
  outline: 0;
}

input,
select {
  height: clamp(28px, 4.5dvh, 36px);
  padding: 0 clamp(7px, .7vw, 10px);
}

textarea {
  min-height: 0;
  height: clamp(40px, 8dvh, 56px);
  padding: 9px;
  resize: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(21, 183, 255, .16);
}

.card,
.kpi-row article {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 34, 64, .95), rgba(5, 17, 33, .98));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

.good { color: var(--green) !important; }
.bad,
.danger-text { color: var(--red) !important; }

/* 03 App Shell */
.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(76px, 13vw, 190px) minmax(0, 1fr);
  overflow: hidden;
}

.module-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(76px, 13vw, 190px) minmax(0, 1fr);
  overflow: hidden;
}

.module-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: var(--gap);
  display: grid;
}

.module-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 34, 64, .95), rgba(5, 17, 33, .98));
  padding: clamp(14px, 2vw, 26px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

.module-card h1 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.4vw, 34px);
}

.module-card h2 {
  margin: 0 0 8px;
  font-size: var(--fs-md);
}

.module-card p {
  margin: 0 0 12px;
  color: #c3d5e9;
  font-size: var(--fs-sm);
}

.module-card code {
  color: #80bfff;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: #80bfff;
  font-size: var(--fs-sm);
  text-decoration: none;
}

.back-link:hover {
  color: #cfe3ff;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.module-grid > div {
  min-width: 0;
  border: 1px solid #254760;
  border-radius: 9px;
  background: #061526;
  padding: var(--pad);
}

.module-table-wrap {
  min-height: 0;
  max-height: 68dvh;
  overflow: hidden;
  border: 1px solid #254760;
  border-radius: 9px;
  background: #061526;
}

.module-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.module-table th,
.module-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #1e3b57;
  text-align: left;
}

.empty-state {
  border: 1px solid #254760;
  border-radius: 9px;
  background: #061526;
  padding: var(--pad);
}

.work-page {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: var(--gap);
}

.module-card.work-page {
  overflow: auto;
}

.module-card.work-page > p {
  margin: 0 0 clamp(10px, 1.1dvh, 16px);
  color: #c3d5e9;
  line-height: 1.45;
  overflow: visible;
}

.module-stack {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: clamp(12px, 1.35dvh, 18px);
  align-content: start;
  padding-bottom: clamp(12px, 2dvh, 22px);
}

.module-section {
  min-width: 0;
  overflow: visible;
  border: 1px solid #254760;
  border-radius: 9px;
  background: #061526;
  padding: var(--pad);
}

.module-section h2 {
  margin-bottom: clamp(8px, 1vw, 12px);
}


.master-admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.master-admin-nav a {
  padding: 8px 12px;
  border: 1px solid #294b68;
  border-radius: 10px;
  background: #0a2037;
  color: #dbeaff;
  text-decoration: none;
  font-weight: 800;
  font-size: var(--fs-xs);
}

.master-admin-nav a.active,
.master-admin-nav a:hover {
  background: #075fc4;
  border-color: #3c87df;
  color: #fff;
}

.master-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.master-kpi-card {
  min-width: 0;
  border: 1px solid #254760;
  border-radius: 12px;
  background: #081a2f;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.master-kpi-card span,
.master-kpi-card small {
  color: #9fb0c4;
  font-size: var(--fs-xs);
}

.master-kpi-card b {
  color: #fff;
  font-size: var(--fs-lg);
  overflow-wrap: anywhere;
}

.master-wide-card {
  grid-column: span 2;
}

.master-mini-chart {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #112d4a;
  display: flex;
}

.master-mini-chart i {
  display: block;
  background: #178342;
}

.master-mini-chart em {
  display: block;
  background: #7a520e;
}

.master-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.master-company-table,
.master-partner-table {
  min-width: 920px;
}

[hidden] {
  display: none !important;
}

.module-section .module-table-wrap {
  max-height: none;
  overflow: auto;
}

.module-section .module-table {
  min-width: 680px;
}

.work-page[data-module="offers"] .module-table,
.work-page[data-module="orders"] .module-table,
.work-page[data-module="invoices"] .module-table {
  min-width: 920px;
  table-layout: fixed;
}

.work-page[data-module="offers"] .live-table .module-table th:nth-child(1) { width: 118px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(2) { width: 88px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(3) { width: 130px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(4),
.work-page[data-module="offers"] .live-table .module-table th:nth-child(5) { width: 125px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(6) { width: 105px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(7) { width: 86px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(8) { width: 88px; }
.work-page[data-module="offers"] .live-table .module-table th:nth-child(9) { width: 230px; }

.work-page[data-module="orders"] .live-table .module-table th:nth-child(10) {
  width: 245px;
}

/* 1.5.2 Hotfix 2: Rechnungen kompakt halten.
   Ziel: keine horizontale Scroll-Leiste auf normalen Desktopbreiten,
   Aktionsspalte bleibt sichtbar und die Tabelle darf Text sauber umbrechen. */
.work-page[data-module="invoices"] .module-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.work-page[data-module="invoices"] .live-table {
  overflow-x: hidden;
}

.work-page[data-module="invoices"] .live-table .module-table th,
.work-page[data-module="invoices"] .live-table .module-table td {
  padding: 7px 7px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.work-page[data-module="invoices"] .live-table .module-table th:nth-child(1) { width: 11%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(2) { width: 13%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(3) { width: 9%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(4) { width: 12%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(5) { width: 8%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(6) { width: 8%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(7) { width: 10%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(8) { width: 8%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(9) { width: 10%; }
.work-page[data-module="invoices"] .live-table .module-table th:nth-child(10) { width: 11%; }

.work-page[data-module="offers"] .live-table .module-table th:last-child,
.work-page[data-module="offers"] .live-table .module-table td:last-child,
.work-page[data-module="orders"] .live-table .module-table th:last-child,
.work-page[data-module="orders"] .live-table .module-table td:last-child,
.work-page[data-module="invoices"] .live-table .module-table th:last-child,
.work-page[data-module="invoices"] .live-table .module-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #07182a;
  box-shadow: -6px 0 10px rgba(3, 10, 18, .32);
}

.work-page[data-module="offers"] .live-table .module-table th:last-child,
.work-page[data-module="orders"] .live-table .module-table th:last-child,
.work-page[data-module="invoices"] .live-table .module-table th:last-child {
  z-index: 3;
}

/* Rechnungen brauchen keine Sticky-Aktionsspalte mehr; sie passt in die sichtbare Breite. */
.work-page[data-module="invoices"] .live-table .module-table th:last-child,
.work-page[data-module="invoices"] .live-table .module-table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  box-shadow: none;
  background: transparent;
}

.module-form.full-width-form,
.full-width-form,
.module-inline-form.full-width-form,
.subgrid-form.full-width-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-group-title {
  grid-column: 1 / -1;
  margin: clamp(6px, .8vw, 10px) 0 0;
  color: #dbeaff;
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: var(--gap);
}

.summary-tile {
  min-width: 0;
  border: 1px solid #254760;
  border-radius: 8px;
  background: #07172b;
  padding: clamp(8px, .9vw, 12px);
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.summary-tile b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: clamp(14px, 1.1vw, 18px);
  line-height: 1.1;
}

.muted-action {
  opacity: .65;
  background: #17263a;
  color: #cfe3ff;
}

.module-work-grid {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(0, 1.35fr);
  gap: var(--gap);
}

.single-form-grid {
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1fr);
}

.vehicle-work-grid {
  grid-template-columns: minmax(330px, 1fr) minmax(0, 1.25fr);
}

.module-form,
.module-work-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid #254760;
  border-radius: 9px;
  background: #061526;
  padding: var(--pad);
}

.module-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: clamp(7px, .85vw, 11px);
}

.module-form h2,
.module-form .module-status {
  grid-column: 1 / -1;
}

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

.passive-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.subgrid-form,
.module-inline-form {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: clamp(7px, .85vw, 11px);
}

.subgrid-form + .subgrid-form {
  margin-top: clamp(10px, 1vw, 14px);
  padding-top: clamp(10px, 1vw, 14px);
  border-top: 1px solid #254760;
}

.subgrid-form h2,
.subgrid-form .module-actions,
.subgrid-form .module-status,
.module-inline-form h2,
.module-inline-form .module-actions,
.module-inline-form .module-status,
.span-all {
  grid-column: 1 / -1;
}

.module-work-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--gap);
}

.stacked-panel {
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
}

.stacked-panel > * {
  min-width: 0;
}

.live-table {
  max-height: none;
  overflow: auto;
}

.compact-live-table {
  max-height: clamp(145px, 28dvh, 260px);
}

.module-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}

.inline-action {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 0 5px 5px 0;
}

.inline-action select {
  min-width: 118px;
  max-width: 150px;
  padding: 4px 6px;
  border: 1px solid #24425f;
  border-radius: 7px;
  background: #07182a;
  color: var(--text);
  font-size: var(--fs-xs);
}

.inline-note {
  display: inline-block;
  margin: 0 5px 5px 0;
  color: #9fb0c4;
  font-size: var(--fs-xs);
}

.action-cell {
  white-space: normal;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.table-actions .state {
  min-height: 25px;
}

.work-page[data-module="invoices"] .table-actions {
  justify-content: flex-start;
  align-items: stretch;
  gap: 4px;
}

.work-page[data-module="invoices"] .table-actions .state {
  flex: 1 1 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 5px 6px;
  line-height: 1.1;
  text-align: center;
}

.work-page[data-module="invoices"] .invoice-actions-cell {
  min-width: 0;
}

.invoice-status-cell,
.invoice-note-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.invoice-note-cell {
  color: #c3d5e9;
}

.status-badge {
  display: inline-block;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #365b7b;
  border-radius: 999px;
  background: #0c2744;
  color: #dcecff;
  line-height: 1.15;
  white-space: normal;
}

.module-actions a.state,
.table-actions a.state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.main-state {
  background: #075fc4;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.print-state,
.open-state {
  background: #12385c;
  color: #eaf4ff;
  border: 1px solid #2c5c84;
}

.action-link {
  display: inline-grid;
  place-items: center;
  min-height: clamp(32px, 5dvh, 40px);
  text-decoration: none;
}

.readonly-results {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid #254760;
  border-radius: 8px;
  background: #07172b;
  padding: 7px;
}

.tall-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.readonly-results span {
  min-width: 0;
  color: #9fb0c4;
  font-size: var(--fs-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readonly-results b {
  color: var(--text);
}

.compact-primary,
.compact-secondary {
  width: auto;
  min-width: clamp(110px, 12vw, 180px);
}

.module-status {
  margin: 0;
  color: #9fb0c4;
  font-size: var(--fs-xs);
  line-height: 1.3;
}

.module-status.success { color: var(--green); }
.module-status.error { color: var(--red); }

.module-summary-list {
  min-height: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 6px;
}

.module-summary-list p {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid #254760;
}

.module-summary-list b {
  float: right;
  color: var(--text);
}

.invoice-logo-form {
  margin-top: clamp(12px, 1.3dvh, 18px);
}

.invoice-logo-preview {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9fb0c4;
  font-size: var(--fs-xs);
}

.invoice-logo-preview img {
  max-width: 140px;
  max-height: 70px;
  object-fit: contain;
  border: 1px solid #254760;
  border-radius: 6px;
  background: #081a2f;
  padding: 6px;
}

.invoice-editor-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr);
  gap: var(--gap);
  align-items: start;
}

.invoice-editor-grid .span-wide {
  grid-column: 1 / -1;
}


.invoice-side-preview {
  margin-top: 12px;
  border-top: 1px solid #254760;
  padding-top: 12px;
}

.invoice-mini-preview {
  margin-top: 8px;
}

.invoice-document-preview {
  width: 100%;
  min-height: 520px;
  margin-top: 8px;
  border: 1px solid #315370;
  border-radius: 10px;
  background: #fff;
}

.mini-invoice-paper {
  border: 1px solid #d7e2ee;
  border-radius: 10px;
  background: #f7fafc;
  color: #0b1728;
  padding: 12px;
  display: grid;
  gap: 5px;
  font-size: var(--fs-xs);
}

.mini-invoice-paper p {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mini-invoice-paper hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #d5e0ea;
}

.mini-invoice-title {
  font-weight: 900;
  color: #075fc4;
}

.invoice-quick-load-form {
  margin-top: 10px;
}

.invoice-editor-page .module-table {
  min-width: 760px;
}

.invoice-items-table th:last-child {
  width: 190px;
}

.invoice-items-table .table-actions { display:flex; flex-wrap:nowrap; gap:6px; }
.invoice-items-table .table-actions button { white-space:nowrap; min-width:max-content; }

.invoice-item-form {
  margin-top: clamp(12px, 1.3dvh, 18px);
}

.invoice-validation-list {
  min-height: 0;
  color: #c3d5e9;
  font-size: var(--fs-sm);
}

.invoice-validation-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.server-summary {
  min-height: 0;
  overflow: hidden;
  color: #c3d5e9;
  font-size: var(--fs-xs);
}

.server-summary summary {
  cursor: pointer;
  color: #80bfff;
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: clamp(26px, 4.8dvh, 40px) minmax(58px, 11dvh) minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap);
}

.topbar {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-info {
  display: flex;
  align-items: center;
  gap: clamp(5px, .7vw, 10px);
  color: #bfd3e8;
  font-size: var(--fs-xs);
  text-align: right;
}

.company-identity {
  max-width: clamp(120px, 18vw, 260px);
  overflow: hidden;
  color: #dbeaff;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-badge {
  align-self: center;
  color: #80bfff;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .2px;
}

.system-info button {
  width: clamp(26px, 3.1dvh, 34px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 9px;
  background: #07182d;
  color: var(--text);
}

.notification-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.notification { position: relative; }

.notification i {
  position: absolute;
  right: -5px;
  top: -5px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--red);
  font-style: normal;
  font-size: 10px;
}

.notification-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: clamp(210px, 18vw, 280px);
  border: 1px solid #2f577a;
  border-radius: 9px;
  background: linear-gradient(180deg, #0a223f, #061526);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .42);
  padding: 10px;
  text-align: left;
}

.notification-menu strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: var(--fs-sm);
}

.notification-menu p {
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid #254760;
  color: #c6d7ea;
  font-size: var(--fs-xs);
  line-height: 1.25;
}

/* 04 Sidebar */
.sidebar {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(100px, 25dvh);
  gap: var(--gap);
  padding: var(--pad);
  border-right: 1px solid #1f3957;
  background: linear-gradient(180deg, #071427, #030811);
}

.logo {
  min-width: 0;
  display: flex;
  align-items: center;
}

.logo-img {
  display: block;
  width: min(100%, 160px);
  height: clamp(34px, 5dvh, 44px);
  object-fit: contain;
  object-position: left center;
}

.menu {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-auto-rows: minmax(26px, 1fr);
  gap: clamp(4px, .65dvh, 7px);
}

.menu button,
.menu a {
  min-width: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(8px, .9vw, 13px);
  font-size: var(--fs-sm);
  text-align: left;
  text-decoration: none;
}

.menu button.active,
.menu a.active,
.menu button:hover,
.menu a:hover {
  background: linear-gradient(90deg, #0b5fc7, #073466);
  box-shadow: inset 0 0 0 1px #2672cc;
}

.vehicle-promo {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(8px, .8vw, 12px);
  background: linear-gradient(180deg, #09264d, #061426);
}

.transporter-img {
  display: block;
  width: 100%;
  height: clamp(58px, 13dvh, 132px);
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
  overflow: hidden;
}

.vehicle-promo p,
.vehicle-promo footer {
  margin: clamp(5px, .8dvh, 10px) 0 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.vehicle-promo strong {
  color: #53baff;
  font-size: var(--fs-md);
}

/* 05 KPI Cards */
.kpi-row {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
}

.kpi-row article {
  position: relative;
  padding: clamp(7px, .8vw, 12px);
  padding-right: clamp(22px, 2.2vw, 34px);
}

.kpi-row span,
.kpi-row em {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-row b {
  display: block;
  margin: clamp(3px, .7dvh, 8px) 0 clamp(2px, .45dvh, 4px);
  font-size: clamp(16px, 1.35vw, 23px);
  line-height: 1.05;
  white-space: nowrap;
}

.kpi-row i {
  position: absolute;
  right: 10px;
  top: 10px;
  color: #aac0d7;
  font-style: normal;
  opacity: .85;
}

.kpi-row article:last-child b {
  font-size: clamp(15px, 1.2vw, 21px);
}

.market-kpi b {
  white-space: normal;
  font-size: clamp(12px, 1vw, 17px) !important;
  line-height: 1.15;
}

.market-kpi span,
.market-kpi em {
  white-space: nowrap;
}

/* 06 Calculator */
.content-grid {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(250px, 27vw, 392px);
  gap: var(--gap);
}

.calculator {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: clamp(6px, .75dvh, 10px);
  padding: var(--pad);
  border-color: var(--line-blue);
  box-shadow: inset 0 0 0 1px rgba(0,124,255,.2), 0 0 24px rgba(0,95,180,.16);
}

.calculator h1,
.card h2 {
  margin: 0;
  font-size: var(--fs-md);
  letter-spacing: .5px;
}

.calculator-form {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, .85dvh, 10px) clamp(12px, 1.7vw, 26px);
  align-content: start;
  overflow: visible;
}

.field-start { grid-column: 1; grid-row: 1; }
.field-dest { grid-column: 1; grid-row: 2; }
.field-vehicle {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
}
.field-distance { grid-column: 2; grid-row: 1; }
.field-time { grid-column: 2; grid-row: 2; }
.field-factor { grid-column: 2; grid-row: 3; }
.field-return { grid-column: 3; grid-row: 1; }
.field-extras { grid-column: 3; grid-row: 2; }
.field-offer { grid-column: 3; grid-row: 3; }

label {
  min-width: 0;
  color: #c6d8ea;
  display: grid;
  gap: 4px;
  font-size: var(--fs-xs);
}

label small {
  min-height: 0;
  overflow: hidden;
  border: 1px solid #23425f;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: #07182c;
  color: #9fb2c5;
  padding: 4px 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calculator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  min-width: 0;
}

.calculator-actions .primary {
  width: min(34%, 300px);
  min-width: 190px;
}

.calculator-actions .secondary {
  width: min(24%, 200px);
  min-width: 150px;
}

.primary,
.secondary {
  width: min(40%, 360px);
  min-width: 220px;
  height: clamp(32px, 5dvh, 40px);
  border: 0;
  border-radius: 8px;
  color: white;
  font-weight: 900;
  font-size: var(--fs-sm);
}

.primary { background: linear-gradient(90deg, #0670ff, #0bb0ff); }

.secondary {
  min-width: 190px;
  width: min(28%, 240px);
  border: 1px solid #2b5f8a;
  background: #06192f;
  color: #cfe3ff;
  font-size: var(--fs-xs);
}

.calc-feedback {
  min-height: clamp(22px, 3.4dvh, 30px);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
  gap: clamp(6px, 1vw, 12px);
  align-items: center;
  border: 1px solid #164b77;
  border-radius: 8px;
  background: #06213d;
  padding: 0 clamp(7px, .8vw, 10px);
}

.save-message,
.last-calculation {
  margin: 0;
  overflow: hidden;
  color: #b9d5f0;
  font-size: var(--fs-xs);
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.save-message.success { color: var(--green); }
.save-message.error { color: var(--red); }

.result-bar {
  min-height: clamp(56px, 10dvh, 76px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #31536f;
  border-radius: 10px;
  background: #061526;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.result-bar.is-updated {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(21, 183, 255, .14), 0 0 22px rgba(21, 183, 255, .16);
}

.result-bar div {
  min-width: 0;
  padding: clamp(7px, .9vw, 13px);
  border-right: 1px solid #31536f;
}

.result-bar div:last-child { border-right: 0; }

.result-bar span,
.result-bar small {
  display: block;
  color: #b9cbe0;
  font-size: var(--fs-xs);
}

.result-bar b {
  display: block;
  margin-top: 4px;
  font-size: clamp(14px, 1.6vw, 23px);
  line-height: 1.1;
}

.result-bar em {
  font-style: normal;
  font-size: var(--fs-xs);
}

#statusBadge {
  width: max-content;
  max-width: 100%;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: var(--fs-sm);
}

.status-ok { background: #0c522d; color: var(--green); }
.status-warn { background: #564112; color: var(--yellow); }
.status-stop { background: #551a22; color: var(--red); }

.help-bar {
  min-height: clamp(34px, 6dvh, 46px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: var(--gap);
  padding: 0 8px;
  border: 1px solid #164b77;
  border-radius: 9px;
  background: #06213d;
  color: #b9d5f0;
  font-size: var(--fs-xs);
  overflow: hidden;
}

/* 07 Right Status Cards */
.right-column {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(104px, 1.08fr);
  gap: var(--gap);
}

.status-card,
.today-card { padding: var(--pad); }

.card h2 span {
  float: right;
  color: #a9b9ca;
}

.status-split {
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(60px, 6.3vw, 86px) minmax(0, 1fr);
  gap: clamp(9px, 1vw, 14px);
  align-items: center;
  overflow: hidden;
}

.circle {
  position: relative;
  width: clamp(56px, 7.5dvh, 82px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: conic-gradient(from -90deg, #5be07e 0 72%, rgba(48, 78, 102, .92) 72% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 0 0 1px rgba(83, 231, 120, .13),
    0 8px 18px rgba(0, 0, 0, .28);
  overflow: hidden;
}

.circle::before {
  content: "";
  position: absolute;
  inset: clamp(6px, 1dvh, 9px);
  border-radius: 50%;
  background: linear-gradient(180deg, #0a2038, #061426);
  border: 1px solid rgba(171, 217, 255, .08);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, .28);
}


.circle.circle-green {
  background: conic-gradient(from -90deg, #5be07e 0 78%, rgba(48, 78, 102, .92) 78% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 1px rgba(83, 231, 120, .13), 0 8px 18px rgba(0, 0, 0, .28);
}
.circle.circle-yellow {
  background: conic-gradient(from -90deg, #f0c94a 0 48%, rgba(48, 78, 102, .92) 48% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 1px rgba(240, 201, 74, .18), 0 8px 18px rgba(0, 0, 0, .28);
}
.circle.circle-red {
  background: conic-gradient(from -90deg, #ef5f6d 0 28%, rgba(48, 78, 102, .92) 28% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 1px rgba(239, 95, 109, .18), 0 8px 18px rgba(0, 0, 0, .28);
}

.circle b {
  position: relative;
  z-index: 1;
  font-size: clamp(19px, 1.75vw, 26px);
  line-height: 1;
}

.circle small {
  position: relative;
  z-index: 1;
  color: #c7d9ec;
  font-size: clamp(8px, .65vw, 10px);
  line-height: 1.05;
  text-align: center;
}

.status-list {
  min-width: 0;
  overflow: hidden;
}

.status-list p,
.today-card p {
  margin: 0;
  padding: clamp(2px, .45dvh, 4px) 0;
  border-bottom: 1px solid #254760;
  color: #c3d5e9;
  font-size: var(--fs-xs);
  line-height: 1.2;
}

.status-list p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.today-card {
  display: grid;
  grid-template-rows: auto repeat(5, minmax(0, auto));
  align-content: start;
}

.status-list b {
  float: none;
  white-space: nowrap;
}

.today-card b { float: right; }

/* 08 Bottom Modules */
.bottom-grid {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.12fr .82fr;
  gap: var(--gap);
}

.bottom-grid .card {
  padding: var(--pad);
  display: grid;
  gap: clamp(5px, .7dvh, 9px);
}

.invoice-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: stretch;
}

.invoice-stats {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid #254760;
}

.invoice-stats div {
  min-width: 0;
  border-right: 1px solid #254760;
}

.invoice-stats div:last-child { border-right: 0; }

.invoice-stats span,
.invoice-stats small {
  display: block;
  color: #9fb0c4;
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-stats b { font-size: var(--fs-md); }

.invoice-panel h3,
.offer-panel h3 {
  margin: 0;
  font-size: var(--fs-xs);
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.invoice-table-wrap {
  min-height: 0;
  overflow: hidden;
}

th,
td {
  padding: clamp(3px, .55dvh, 5px) 3px;
  border-bottom: 1px solid #1e3b57;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #9fb0c4;
  font-weight: 500;
}

.state,
.invoice-actions button,
.offer-panel button,
.diesel-panel button {
  border: 0;
  border-radius: 7px;
  color: white;
  font-weight: 700;
}

.state {
  padding: 4px 6px;
  background: #12385c;
  color: #eaf4ff;
  font-size: var(--fs-xs);
}

.danger-state { background: #4e1b22; border: 1px solid #7c3038; }
.paid-state,
.invoice-actions .paid { background: #178342; }
.clarify-state,
.invoice-actions button { background: #7a520e; }

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: clamp(28px, 4.7dvh, 36px);
  padding-top: 2px;
  overflow: hidden;
}

.invoice-actions button {
  min-width: 0;
  height: clamp(26px, 4.2dvh, 32px);
  padding: 0 10px;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.route-panel { grid-template-rows: auto minmax(0, 1fr) auto auto auto; }

.map-box {
  min-height: 0;
  border: 1px solid #254760;
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.05) 25%, transparent 25%),
    #0b2236;
  background-size: 24px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  padding: 12px;
  color: #dcecff;
  font-weight: 800;
  overflow: hidden;
}

.map-box span {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-box span:nth-child(2) {
  align-self: start;
  justify-self: end;
  text-align: right;
}

.map-box i {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  align-self: center;
  width: 74%;
  height: 6px;
  border-radius: 22px;
  background: linear-gradient(90deg, #38dc77, #087cff, #ff5260);
  transform: rotate(-12deg);
  box-shadow: 0 0 20px #087cff;
  opacity: .78;
}

.route-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #254760;
  border-radius: 8px;
  background: #07172b;
}

.route-data div {
  padding: 7px 8px;
  border-right: 1px solid #254760;
  color: #9fb0c4;
  font-size: var(--fs-xs);
}

.route-data div:last-child { border-right: 0; }

.route-data b {
  color: white;
  font-size: var(--fs-sm);
}

.route-panel a {
  display: block;
  padding: 9px;
  border-radius: 7px;
  background: #0750ad;
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: var(--fs-xs);
}

.route-notice {
  margin: 0;
  color: #9fb0c4;
  font-size: var(--fs-xs);
  line-height: 1.2;
  overflow: hidden;
}

.offer-panel {
  grid-template-rows: auto auto auto minmax(0, auto) auto minmax(0, 1fr);
  align-content: stretch;
}

.offer-panel textarea {
  height: clamp(36px, 6.6dvh, 52px);
}

.offer-panel button {
  justify-self: end;
  height: clamp(28px, 4.6dvh, 32px);
  padding: 0 18px;
  background: linear-gradient(90deg, #0770ff, #09adff);
  font-size: var(--fs-xs);
}

.parsed-summary {
  min-height: 0;
  margin: 0;
  color: #9fb0c4;
  font-size: var(--fs-xs);
  line-height: 1.25;
  overflow: hidden;
}

.offer-panel ul {
  min-height: 0;
  overflow: hidden;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.offer-panel li {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  padding-bottom: 6px;
  border-bottom: 1px solid #254760;
  font-size: var(--fs-xs);
  line-height: 1.22;
}

.offer-panel li span {
  min-width: 0;
  overflow: hidden;
  max-height: 2.45em;
}

.offer-panel li b {
  padding: 4px 7px;
  border-radius: 12px;
  background: #154b31;
  color: #79ee9d;
}

.green-dot,
.yellow-dot,
.red-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
}

.green-dot { background: var(--green); }
.yellow-dot { background: var(--yellow); }
.red-dot { background: var(--red); }

.diesel-panel {
  grid-template-rows: auto auto auto minmax(0, auto) auto;
  align-content: start;
  gap: clamp(5px, .7dvh, 8px);
}

.diesel-panel h2 span,
.diesel-panel p,
.diesel-panel footer { color: #9fb0c4; }

.diesel-panel strong {
  display: block;
  font-size: clamp(18px, 1.7vw, 25px);
  line-height: 1.05;
}

.diesel-panel p,
.diesel-panel footer {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.25;
}

.diesel-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(68px, .58fr);
  gap: clamp(5px, .65dvh, 8px);
  align-items: end;
}

.diesel-control label {
  min-height: 0;
}

.diesel-panel button {
  width: 100%;
  height: clamp(27px, 4dvh, 32px);
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0 6px;
  background: #06192f;
  border: 1px solid #254760;
  color: #cfe3ff;
  font-size: clamp(9px, .68vw, 11px);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diesel-panel footer {
  align-self: start;
  padding-top: 8px;
  border-top: 1px solid #254760;
  overflow-wrap: anywhere;
}

/* 1.0.13 Dashboard freeze: spacing and overflow fixes only */
.right-column {
  grid-template-rows: minmax(0, .9fr) minmax(0, .9fr) minmax(0, .74fr);
  gap: clamp(5px, .72dvh, 8px);
}

.status-card,
.today-card {
  padding: clamp(6px, .75vw, 10px);
}

.status-card h2,
.today-card h2 {
  line-height: 1.08;
}

.status-split {
  grid-template-columns: clamp(52px, 6.4dvh, 70px) minmax(0, 1fr);
  gap: clamp(6px, .8vw, 10px);
}

.circle {
  width: clamp(50px, 6.8dvh, 70px);
}

.circle b {
  font-size: clamp(18px, 1.55vw, 23px);
}

.status-list p,
.today-card p {
  padding: clamp(1px, .32dvh, 3px) 0;
  line-height: 1.12;
}

.bottom-grid {
  grid-template-columns: 1.28fr 1.07fr 1.12fr .72fr;
}

.route-panel,
.offer-panel,
.diesel-panel {
  padding: clamp(6px, .75vw, 10px);
  gap: clamp(3px, .45dvh, 6px);
}

.route-panel {
  grid-template-rows: auto minmax(54px, 1fr) auto minmax(0, auto) auto;
}

.map-box {
  min-height: clamp(58px, 12dvh, 94px);
  padding: clamp(6px, .7vw, 9px);
}

.route-data div {
  padding: clamp(4px, .55dvh, 6px);
}

.route-panel a {
  padding: clamp(5px, .75dvh, 7px);
}

.route-notice {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.offer-panel {
  grid-template-rows: auto minmax(30px, auto) minmax(27px, auto) minmax(16px, auto) auto minmax(18px, 1fr);
}

.offer-panel textarea {
  height: clamp(30px, 5.2dvh, 42px);
}

.offer-panel button {
  align-self: start;
  height: clamp(27px, 4dvh, 31px);
}

.offer-panel ul {
  gap: 0;
}

.offer-panel li {
  grid-template-columns: 9px minmax(0, 1fr) minmax(68px, auto);
  align-items: center;
  padding-bottom: 3px;
  line-height: 1.1;
}

.offer-panel li:nth-child(n+2) {
  display: none;
}

.offer-panel li span {
  max-height: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.market-kpi b {
  font-size: clamp(15px, 1.45vw, 23px);
}

.market-kpi em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 09 Responsive Rules */
@media (max-height: 700px) {
  :root {
    --gap: 6px;
    --pad: 8px;
  }

  .main {
    grid-template-rows: 28px minmax(50px, 8.5dvh) minmax(0, 1.68fr) minmax(0, .72fr);
  }

  .vehicle-promo footer { display: none; }
  .calculator { gap: 6px; }
  .result-bar { min-height: 50px; }
  .calculator input,
  .calculator select { height: 26px; }
  .help-bar { display: none; }
  .help-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #invoiceRows tr:nth-child(n+3),
  .offer-panel li:nth-child(n+3) { display: none; }

  .invoice-stats {
    padding-bottom: 4px;
  }

  .route-panel a,
  .offer-panel button,
  .diesel-panel button {
    padding-top: 0;
    padding-bottom: 0;
  }

  .offer-panel textarea {
    height: 34px;
  }

  .diesel-panel footer {
    padding-top: 5px;
  }
}

@media (max-height: 620px) {
  .topbar { display: none; }

  .main {
    grid-template-rows: minmax(46px, 8.5dvh) minmax(0, 1.75fr) minmax(0, .65fr);
  }

  .sidebar { grid-template-rows: auto minmax(0, 1fr); }
  .vehicle-promo { display: none; }
  .offer-panel li:nth-child(n+3) { display: none; }
}

@media (max-width: 1280px) {
  .module-form.full-width-form,
  .full-width-form,
  .module-inline-form.full-width-form,
  .subgrid-form.full-width-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 70px minmax(0, 1fr); }

  .logo-text,
  .menu span,
  .vehicle-promo p,
  .vehicle-promo strong,
  .vehicle-promo footer { display: none; }

  .menu button,
  .menu a {
    justify-content: center;
    padding: 0;
  }

  .bottom-grid { grid-template-columns: 1.15fr 1fr 1fr; }
  .diesel-panel { display: none; }
}

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .right-column { display: none; }
  .bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-work-grid,
  .single-form-grid,
  .invoice-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .module-form,
  .wide-form,
  .subgrid-form,
  .module-inline-form,
  .full-width-form,
  .readonly-results,
  .tall-results { grid-template-columns: minmax(0, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 1.2.2 Hotfix: Dashboard fine tuning after browser acceptance */
.invoice-action-message {
  margin: 0;
  color: #9fb0c4;
  font-size: var(--fs-xs);
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#invoiceRows tr[data-open="true"] {
  cursor: pointer;
}

#invoiceRows tr.selected-invoice td {
  background: rgba(8, 124, 255, .12);
}

.route-data.route-data-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diesel-panel {
  grid-template-rows: auto auto auto auto auto;
  align-content: stretch;
  overflow: hidden;
}

.diesel-panel h2 {
  font-size: clamp(11px, .88vw, 14px);
  line-height: 1.05;
}

.diesel-panel strong {
  font-size: clamp(16px, 1.35vw, 22px);
  line-height: 1;
}

.diesel-panel p,
.diesel-panel footer {
  font-size: clamp(9px, .68vw, 11px);
  line-height: 1.12;
}

.diesel-control {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
}

.diesel-control label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  font-size: clamp(9px, .68vw, 11px);
  line-height: 1.05;
}

.diesel-control input {
  width: 100%;
  min-width: 0;
  height: clamp(23px, 3.4dvh, 28px);
}

.diesel-panel button {
  height: clamp(23px, 3.4dvh, 28px);
}

.diesel-panel footer {
  padding-top: 4px;
}

@media (max-height: 700px) {
  .diesel-panel p { display: none; }
  .diesel-panel footer { font-size: clamp(8px, .62vw, 10px); }
}

/* 1.4.2 Modul-Feinschliff: Rechnungen, Kosten, Einstellungen, Master-Admin, Partner */
.invoice-table-wrap {
  overflow-x: auto;
}

.invoice-list-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.invoice-list-table th,
.invoice-list-table td {
  vertical-align: middle;
}

.invoice-list-table th:nth-child(1), .invoice-list-table td:nth-child(1) { width: 12%; }
.invoice-list-table th:nth-child(2), .invoice-list-table td:nth-child(2) { width: 15%; }
.invoice-list-table th:nth-child(3), .invoice-list-table td:nth-child(3) { width: 10%; }
.invoice-list-table th:nth-child(4), .invoice-list-table td:nth-child(4) { width: 18%; }
.invoice-list-table th:nth-child(5), .invoice-list-table td:nth-child(5) { width: 8%; }
.invoice-list-table th:nth-child(6), .invoice-list-table td:nth-child(6) { width: 8%; }
.invoice-list-table th:nth-child(7), .invoice-list-table td:nth-child(7) { width: 10%; }
.invoice-list-table th:nth-child(8), .invoice-list-table td:nth-child(8) { width: 9%; }
.invoice-list-table th:nth-child(9), .invoice-list-table td:nth-child(9) { width: 18%; }

.invoice-order-cell,
.invoice-route-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.invoice-actions-cell .table-actions,
.invoice-list-table .table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.invoice-list-table .table-actions button,
.invoice-list-table .table-actions a {
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.cost-breakdown-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.cost-breakdown-group,
.cost-breakdown-total {
  border: 1px solid rgba(125, 211, 252, .22);
  background: rgba(15, 23, 42, .72);
  border-radius: 16px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.cost-breakdown-group h4,
.cost-breakdown-total h4 {
  margin: 0 0 8px;
  color: #e0f2fe;
}

.cost-breakdown-group p,
.cost-breakdown-total p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
  color: #cbd5e1;
}

.cost-breakdown-total {
  border-color: rgba(52, 211, 153, .35);
  background: linear-gradient(135deg, rgba(20, 83, 45, .30), rgba(15, 23, 42, .78));
}

.settings-page .module-section,
.settings-page .form-card,
.settings-page .settings-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, .90), rgba(15, 23, 42, .74));
  border-color: rgba(148, 163, 184, .22);
}

.settings-page .module-form,
.settings-page form {
  row-gap: 18px;
}

.settings-page label,
.settings-page .form-label {
  color: #dbeafe;
}

.settings-page input,
.settings-page textarea,
.settings-page select {
  background: rgba(2, 6, 23, .58);
  border-color: rgba(148, 163, 184, .28);
}

.master-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.master-dashboard-card,
.master-chart-card,
.partner-preview-card,
.partner-offer-card {
  border: 1px solid rgba(125, 211, 252, .22);
  background: rgba(15, 23, 42, .72);
  border-radius: 16px;
  padding: 14px;
}

.master-dashboard-card strong,
.master-chart-card strong {
  display: block;
  font-size: 22px;
  color: #f8fafc;
  margin-top: 6px;
}

.master-mini-chart {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.master-mini-chart-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.master-mini-bar {
  min-height: 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .25);
  overflow: hidden;
}

.master-mini-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.partner-preview-card {
  margin-top: 10px;
}

.partner-preview-media,
.partner-offer-media {
  width: 100%;
  min-height: 72px;
  border-radius: 12px;
  background: rgba(2, 6, 23, .45);
  border: 1px dashed rgba(148, 163, 184, .30);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.partner-preview-media img,
.partner-offer-media img,
.partner-offer-logo img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.partner-offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.partner-offer-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.partner-offer-card:has(> .partner-offer-banner) { grid-template-rows:160px 1fr; }

.partner-offer-banner {
  display: block;
  width: 100%;
  height: 160px;
  max-width: 100%;
  max-height: 160px;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  border-radius: 10px;
  overflow: hidden;
}

.partner-offer-body { min-width:0; display:grid; align-content:start; gap:8px; }

img.partner-offer-logo {
  display: block;
  width: auto;
  height: 48px;
  max-width: 180px;
  max-height: 48px;
  aspect-ratio: auto;
  object-fit: contain;
}

.partner-offer-logo {
  min-height: 54px;
  display: flex;
  align-items: center;
}

.partner-offer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.partner-coupon {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(250, 204, 21, .12);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, .28);
  font-weight: 700;
}

@media (max-width: 1180px) {
  .invoice-list-table { min-width: 1040px; }
  .invoice-list-table .table-actions { grid-template-columns: 1fr; }
}
/* 1.5.0 Login und Firmen-Nutzerverwaltung */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(28, 116, 196, .22), transparent 34rem),
    linear-gradient(145deg, #06111e 0%, #0a1b2d 55%, #0c2841 100%);
  color: #eaf4ff;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: rgba(8, 24, 39, .96);
  border: 1px solid #28506f;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.login-logo {
  width: min(280px, 100%);
  max-height: 108px;
  object-fit: contain;
  object-position: left center;
  height: auto;
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
  color: #f4f9ff;
}

.login-card label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #cfe5f8;
}

.login-card input {
  min-height: 42px;
  border: 1px solid #37617f;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #0d2336;
  color: #f4f9ff;
}

.login-card input::placeholder { color: #88a7bf; }
.login-card input:focus { outline: 2px solid #2b9be8; outline-offset: 1px; border-color: #58b8f7; }

.login-card button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #147cc1;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.login-card .form-status { min-height: 1.4em; margin: 0; color: #b9d3e7; }

.access-denied-card {
  text-align: center;
}

.access-denied-action {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.access-denied-action.secondary {
  background: #0f172a;
}

.company-users-page {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow: auto;
  padding-right: 2px;
}

.company-users-page > .module-header,
.company-users-page > .module-card {
  flex: 0 0 auto;
}

.company-users-page > .module-card {
  overflow: visible;
}

.company-users-page .module-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: var(--gap);
  align-items: end;
}

.company-users-page .module-actions {
  margin-top: var(--gap);
}

.company-users-page .module-table-wrap {
  max-height: min(46dvh, 360px);
  overflow: auto;
}

.company-users-page .module-table {
  min-width: 760px;
}

@media (max-width: 980px) {
  .company-users-page .module-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .company-users-page .module-form-grid {
    grid-template-columns: 1fr;
  }
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

/* 1.5.1 Nutzerverwaltung: kompakte Aktionsbuttons */
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* 1.5.2 Workflow-/Rollenbereinigung */
.module-main {
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--gap);
}
.module-topbar {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-logout {
  min-height: clamp(26px, 3.1dvh, 34px);
  padding: 0 12px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(128, 191, 255, .3);
  border-radius: 9px;
  background: #07182d;
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.topbar-logout:hover {
  border-color: rgba(128, 191, 255, .75);
}
.module-form input[readonly] {
  opacity: .85;
  background: rgba(255, 255, 255, .04);
}

/* 1.5.2 Hotfix 1: Rechnungen, Belege, Master-Admin Layout */
.work-page[data-module="invoices"] .live-table {
  overflow-x: auto;
  overflow-y: auto;
}

.work-page[data-module="invoices"] .invoice-list-table {
  min-width: 1360px;
  table-layout: fixed;
}

.work-page[data-module="invoices"] .invoice-list-table th:nth-child(1),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(1) { width: 126px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(2),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(2) { width: 150px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(3),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(3) { width: 96px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(4),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(4) { width: 150px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(5),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(5),
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(6),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(6) { width: 96px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(7),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(7) { width: 116px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(8),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(8) { width: 118px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(9),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(9) { width: 110px; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(10),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(10) { width: 260px; }

.work-page[data-module="invoices"] .live-table .module-table th:last-child,
.work-page[data-module="invoices"] .live-table .module-table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  box-shadow: none;
  background: transparent;
}

.work-page[data-module="invoices"] .invoice-status-cell,
.work-page[data-module="invoices"] .invoice-actions-cell {
  overflow: visible;
}

.work-page[data-module="invoices"] .invoice-actions-cell .table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.work-page[data-module="invoices"] .invoice-actions-cell .table-actions .state {
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

.receipt-reference-badge,
.receipt-active-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}

.receipt-reference-badge {
  color: #dbeafe;
  background: rgba(148, 163, 184, .14);
  border: 1px solid rgba(148, 163, 184, .24);
}

.receipt-active-badge {
  color: #bbf7d0;
  background: rgba(34, 197, 94, .13);
  border: 1px solid rgba(34, 197, 94, .24);
}

.receipt-action-cell .state {
  min-width: 96px;
}

.master-admin-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow: auto;
}

.master-admin-page .master-admin-nav {
  flex: 0 0 auto;
  margin: 4px 0 10px;
  padding-bottom: 2px;
  position: relative;
  z-index: 1;
}

.master-admin-page .module-stack {
  flex: 0 0 auto;
  display: grid;
  gap: clamp(14px, 1.5dvh, 20px);
  overflow: visible;
}

.master-admin-page [data-master-section] {
  position: relative;
  z-index: 0;
  margin-top: 0;
}

.master-admin-page .module-form.full-width-form {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.master-admin-page .master-dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.master-admin-page .master-kpi-card {
  min-height: 88px;
}

.master-admin-page .master-company-table {
  min-width: 1120px;
}

.master-admin-page .master-company-table th:nth-child(7),
.master-admin-page .master-company-table td:nth-child(7) {
  width: 230px;
}

.master-admin-page .master-company-table .table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 6px;
}

@media (max-width: 1050px) {
  .master-admin-page .module-form.full-width-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .master-admin-page .module-form.full-width-form,
  .work-page[data-module="invoices"] .invoice-actions-cell .table-actions {
    grid-template-columns: 1fr;
  }
}

/* 1.5.2 Hotfix 2: responsive Rechnungsseite.
   Der Belegstatus bleibt fachlich unverändert; diese Regeln verhindern,
   dass die Aktionsspalte auf normalen Desktopbreiten nach rechts verschwindet. */
.module-card,
.module-section,
.module-table-wrap,
.live-table,
.table-actions {
  max-width: 100%;
}

.work-page[data-module="invoices"] .live-table {
  overflow-x: hidden !important;
  overflow-y: auto;
}

.work-page[data-module="invoices"] .invoice-list-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.work-page[data-module="invoices"] .invoice-list-table th,
.work-page[data-module="invoices"] .invoice-list-table td {
  padding: 6px 6px !important;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.work-page[data-module="invoices"] .invoice-list-table th:nth-child(1),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(1) { width: 11% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(2),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(2) { width: 13% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(3),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(3) { width: 9% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(4),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(4) { width: 12% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(5),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(5) { width: 8% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(6),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(6) { width: 8% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(7),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(7) { width: 9% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(8),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(8) { width: 8% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(9),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(9) { width: 10% !important; }
.work-page[data-module="invoices"] .invoice-list-table th:nth-child(10),
.work-page[data-module="invoices"] .invoice-list-table td:nth-child(10) { width: 12% !important; }

.work-page[data-module="invoices"] .invoice-actions-cell .table-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px !important;
  align-items: stretch;
}

.work-page[data-module="invoices"] .invoice-actions-cell .table-actions .state {
  min-width: 0 !important;
  width: 100% !important;
  padding: 5px 4px !important;
  white-space: nowrap;
  line-height: 1.05;
  font-size: var(--fs-xs);
}

@media (max-width: 1050px) {
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(4),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(4),
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(9),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(9) {
    display: none;
  }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(1),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(1) { width: 14% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(2),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(2) { width: 16% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(3),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(3) { width: 11% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(5),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(5) { width: 10% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(6),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(6) { width: 10% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(7),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(7) { width: 11% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(8),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(8) { width: 10% !important; }
  .work-page[data-module="invoices"] .invoice-list-table th:nth-child(10),
  .work-page[data-module="invoices"] .invoice-list-table td:nth-child(10) { width: 18% !important; }
}

/* 1.5.4 Hotfix: Auftragsübersicht wieder kompakt und ohne verschobene Sticky-Aktionsspalte. */
.work-page[data-module="orders"] .module-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.work-page[data-module="orders"] .live-table {
  overflow-x: hidden;
}

.work-page[data-module="orders"] .live-table .module-table th,
.work-page[data-module="orders"] .live-table .module-table td {
  padding: 7px 7px;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.work-page[data-module="orders"] .live-table .module-table th:nth-child(1) { width: 10%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(2) { width: 8%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(3) { width: 10%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(4) { width: 9%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(5) { width: 9%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(6) { width: 9%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(7) { width: 8%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(8) { width: 10%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(9) { width: 8%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(10) { width: 9%; }
.work-page[data-module="orders"] .live-table .module-table th:nth-child(11) { width: 10%; }

.work-page[data-module="orders"] .live-table .module-table th:last-child,
.work-page[data-module="orders"] .live-table .module-table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  box-shadow: none;
  background: transparent;
}

.order-number-cell a,
.driver-page a {
  color: #7dd3fc;
  font-weight: 700;
}

.order-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  justify-items: stretch;
}

.order-actions select,
.order-actions button {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 6px;
  font-size: 11px;
}

.muted-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
  color: #9fb0c4;
  font-weight: 700;
  font-size: 11px;
}

/* 1.5.4.2 Hotfix: Auftragsuebersicht nicht mehr sticky/verschoben darstellen. */
.work-page[data-module="orders"] .live-table {
  overflow-x: auto;
}
.work-page[data-module="orders"] .live-table .module-table th:last-child,
.work-page[data-module="orders"] .live-table .module-table td:last-child {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  background: transparent !important;
}
.work-page[data-module="orders"] .module-table th,
.work-page[data-module="orders"] .module-table td {
  padding: 7px 8px;
  vertical-align: middle;
}
.work-page[data-module="orders"] .order-number-cell {
  min-width: 108px;
}
.work-page[data-module="orders"] .action-cell {
  min-width: 145px;
  max-width: 165px;
}
.work-page[data-module="orders"] .order-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}
.work-page[data-module="orders"] .order-actions .state,
.work-page[data-module="orders"] .order-actions select {
  width: 100%;
  max-width: 150px;
  min-height: 28px;
  line-height: 1.1;
}

/* 1.5.5 Auftragsworkflow + Fahrer Mobile */
.orders-workflow-stack .module-section { overflow: visible; }
.order-edit-form { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.order-edit-form .wide-field { grid-column: 1 / -1; }
.form-actions-row { display:flex; gap: 10px; flex-wrap: wrap; align-items:center; }
.orders-table-wrap { overflow-x: auto; }
.compact-orders-table { min-width: 980px; table-layout: auto; }
.compact-orders-table td, .compact-orders-table th { vertical-align: top; }
.compact-orders-table .action-cell { min-width: 230px; }
.status-pill { display:inline-flex; align-items:center; border-radius:999px; padding:4px 8px; font-size:.82rem; font-weight:700; background:#e8edf5; color:#24324a; white-space:nowrap; }
.status-incomplete { background:#fff4d6; color:#7a4b00; }
.status-assigned, .status-accepted { background:#e7f0ff; color:#194a8d; }
.status-in_progress { background:#eaf7ef; color:#126334; }
.status-driver_completed, .status-completed { background:#e8fff2; color:#075e2b; }
.order-driver-select { max-width: 210px; min-width: 175px; }

.driver-mobile-page { max-width: 980px; margin-inline: auto; }
.driver-app-nav { display:grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; margin: 18px 0 22px; }
.driver-app-nav a, .driver-app-nav button, .driver-action-card { border:0; border-radius:18px; padding:18px 14px; background:#102a43; color:#fff; font-weight:800; text-align:center; text-decoration:none; box-shadow:0 10px 24px rgba(15, 23, 42, .16); cursor:pointer; }
.driver-app-nav a:hover, .driver-app-nav button:hover, .driver-action-card:hover { transform: translateY(-1px); }
.driver-card-list { display:grid; gap:14px; }
.driver-order-card { border:1px solid #dbe4ef; border-radius:18px; padding:16px; background:#fff; box-shadow:0 8px 18px rgba(15,23,42,.08); }
.driver-order-card header { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:8px; }
.driver-order-card header span { background:#e8edf5; border-radius:999px; padding:4px 8px; font-weight:700; font-size:.82rem; }
.driver-order-card p { margin:6px 0; }
.driver-order-actions, .driver-action-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap:10px; margin-top:12px; }
.driver-order-actions button { border:0; border-radius:14px; padding:12px 10px; background:#eef4ff; color:#102a43; font-weight:800; cursor:pointer; }
.driver-order-actions .paid-state { background:#dff7e9; color:#075e2b; }
.driver-time-form { margin-top:12px; }
.driver-gps-optin { display:flex; align-items:center; gap:9px; margin:-5px 0 16px; padding:11px 13px; border:1px solid #dbe4ef; border-radius:11px; color:#41566b; background:#f7fafc; font-size:12px; }
@media (max-width: 720px) {
  .driver-mobile-page { padding: 14px; }
  .driver-app-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .driver-order-actions, .driver-action-grid { grid-template-columns: 1fr 1fr; }
  .module-table-wrap { overflow-x:auto; }
}
/* 1.6.0-alpha Business OS design layer */
.nav-section { margin: 18px 14px 6px; color: #7f8b9c; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.command-center { padding: 30px; max-width: 1540px; margin: 0 auto; color: #172033; }
.module-main > .command-center { width:100%; min-height:0; overflow:auto; }
.module-shell .menu { overflow-y:auto; align-content:start; grid-auto-rows:minmax(34px,auto); }
.cc-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.cc-hero h1 { margin: 4px 0 5px; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.04em; color: #10243e; }
.cc-hero p { margin: 0; color: #667085; font-size: 15px; }
.eyebrow { color: #52708f; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.cc-hero-actions { display: flex; gap: 10px; }
.cc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 10px; text-decoration: none; font-weight: 750; }
.cc-btn.primary { background: #163f66; color: #fff; }
.cc-btn.secondary { background: #fff; color: #163f66; border: 1px solid #d7e0e9; }
.cc-decision-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: linear-gradient(115deg, #102e4c, #194e78); color: #fff; border-radius: 16px; box-shadow: 0 15px 35px rgba(16,46,76,.15); margin-bottom: 18px; overflow: hidden; }
.cc-decision-strip div { display: flex; align-items: baseline; gap: 12px; padding: 20px 24px; border-right: 1px solid rgba(255,255,255,.14); }
.cc-decision-strip div:last-child { border-right: 0; }
.cc-decision-strip strong { font-size: 27px; }
.cc-decision-strip span { color: #dce8f2; font-size: 13px; }
.cc-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 18px; }
.cc-card { min-width: 0; background: #fff; border: 1px solid #dfe6ed; border-radius: 15px; padding: 20px; box-shadow: 0 5px 18px rgba(20,39,65,.045); }
.cc-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.cc-card h2 { margin: 3px 0 0; color: #172b45; font-size: 19px; }
.cc-card header a { color: #305e86; font-size: 12px; font-weight: 700; text-decoration: none; }
.cc-attention { grid-column: span 2; }
.live-pill,.truth-badge { padding: 5px 8px; color: #27624a; background: #eaf7f0; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.truth-badge { color: #725517; background: #fff4d5; }
.attention-list { display: grid; gap: 9px; }
.attention-item { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid #e7ebf0; border-radius: 11px; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; background: #e1a42f; }
.attention-item.critical .priority-dot { background: #c83e4d; box-shadow: 0 0 0 4px #fdebed; }
.attention-item.high .priority-dot { background: #e27633; }
.attention-item strong { font-size: 13px; color: #1c2f47; }
.attention-item p { margin: 3px 0 0; font-size: 12px; color: #6f7b8b; }
.task-actions { display: flex; gap: 6px; align-items: center; }
.task-actions a,.task-actions button { border: 0; background: #edf3f8; color: #284e71; padding: 7px 9px; border-radius: 7px; font: 700 11px inherit; text-decoration: none; cursor: pointer; }
.task-actions button { background: transparent; color: #6d7887; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.metric-grid article { padding: 15px; background: #f5f8fb; border-radius: 11px; }
.metric-grid strong { display: block; color: #173b5e; font-size: 25px; }
.metric-grid span { color: #6d7786; font-size: 11px; }
.finance-lines p { display: flex; justify-content: space-between; gap: 14px; margin: 0; padding: 13px 0; border-bottom: 1px solid #edf0f3; }
.finance-lines span { color: #687486; font-size: 12px; }
.finance-lines strong { color: #173957; font-size: 15px; }
.finance-lines .danger-line strong { color: #b42f3f; }
.intelligence-card { grid-column: span 2; background: linear-gradient(140deg,#f9fbfd,#f1f6fa); }
.intelligence-list { display: grid; gap: 8px; }
.intelligence-list p { display: flex; gap: 10px; margin: 0; padding: 10px 12px; background: rgba(255,255,255,.8); border-radius: 9px; color: #34465a; font-size: 12px; }
.intelligence-list p span { color: #1d668e; font-weight: 900; }
.cc-note { margin: 14px 0 0; color: #788391; font-size: 10px; }
.quality-ring { display: grid; place-items: center; width: 120px; height: 120px; margin: 6px auto 18px; border: 11px solid #e8eef3; border-top-color: #2c7890; border-radius: 50%; text-align: center; }
.quality-ring strong { display: block; color: #183a58; font-size: 17px; }
.quality-ring span { color: #7a8592; font-size: 9px; }
.truth-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.truth { padding: 5px 7px; border-radius: 6px; font-size: 9px; font-weight: 900; }
.truth.planned { color: #315e84; background: #e7f0f8; }.truth.actual { color: #246245; background: #e7f6ed; }.truth.missing { color: #943846; background: #fae8eb; }
.event-list { display: grid; gap: 0; }
.event-list p { display: grid; grid-template-columns: 94px 1fr auto; gap: 8px; margin: 0; padding: 9px 0; border-bottom: 1px solid #edf0f3; font-size: 11px; }
.event-list span,.event-list small { color: #7b8593; }.event-list strong { color: #33475d; }
.cc-empty { display: grid; gap: 4px; padding: 24px; text-align: center; background: #f4faf7; border-radius: 11px; color: #2a694c; }
.cc-empty span { color: #668174; font-size: 12px; }
.error-state { padding: 14px; color: #a52d3c; background: #fff0f2; border-radius: 9px; }

@media (max-width: 1100px) {
  .cc-grid { grid-template-columns: 1fr 1fr; }
  .cc-attention,.intelligence-card { grid-column: span 2; }
}
@media (max-width: 760px) {
  .command-center { padding: 18px 14px 90px; }
  .cc-hero { align-items: flex-start; flex-direction: column; }
  .cc-hero-actions { width: 100%; }.cc-btn { flex: 1; }
  .cc-decision-strip { grid-template-columns: 1fr; }
  .cc-decision-strip div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.13); padding: 14px 18px; }
  .cc-grid { grid-template-columns: 1fr; }.cc-attention,.intelligence-card { grid-column: span 1; }
  .attention-item { grid-template-columns: 10px 1fr; }.task-actions { grid-column: 2; }
  .event-list p { grid-template-columns: 1fr auto; }.event-list span { grid-column: 1/-1; }
  .nav-section { display: none; }
}
/* Central order case: explicit provenance and audit context */
.order-truth-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0 18px; }
.order-truth-summary > div { display:grid; gap:5px; padding:12px; border:1px solid #e0e7ee; border-radius:10px; background:#f8fafc; }
.order-truth-summary span { color:#6e7a89; font-size:11px; }.order-truth-summary b { color:#193956; font-size:14px; }
.truth-origin { width:max-content; padding:4px 6px; border-radius:5px; font-size:9px; font-weight:900; font-style:normal; }
.truth-origin.planned { color:#315e84; background:#e7f0f8; }.truth-origin.actual { color:#246245; background:#e7f6ed; }.truth-origin.missing { color:#943846; background:#fae8eb; }
.order-case-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:18px 0; }
.order-case-grid > section { padding:14px; border:1px solid #e2e8ef; border-radius:10px; }.order-case-grid h3 { margin:0 0 10px; color:#203b56; }
.case-timeline p { display:flex; gap:12px; margin:0; padding:8px 0; border-bottom:1px solid #edf1f4; color:#617082; font-size:11px; }.case-timeline b { color:#31485e; }
@media (max-width:760px) { .order-truth-summary { grid-template-columns:1fr 1fr; }.order-case-grid { grid-template-columns:1fr; } }
/* Mobile-first guided driver day */
.driver-next-step { display:grid; gap:5px; margin:16px 0; padding:16px 18px; border-radius:14px; color:#fff; background:linear-gradient(125deg,#143a5c,#1e6684); }
.driver-next-step span { color:#c8dfeb; font-size:9px; font-weight:900; letter-spacing:.14em; }.driver-next-step strong { font-size:14px; }

/* Shared Business OS workspaces */
.os-page { max-width:1380px; margin:0 auto; padding:28px; }
.os-page > h1 { margin:5px 0 6px; color:#10243e; font-size:34px; letter-spacing:-.03em; }
.os-page > p { margin:0 0 22px; color:#667085; }
.os-grid { display:grid; gap:16px; }.os-grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.os-grid .wide { grid-column:1/-1; }
.module-section { min-width:0; padding:20px; border:1px solid #dfe6ed; border-radius:14px; background:#fff; box-shadow:0 5px 18px rgba(20,39,65,.04); }
.module-section h2 { margin:0 0 14px; color:#1b3855; font-size:18px; }
.module-inline-form,.form-actions-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; margin-bottom:14px; }
.module-inline-form label { display:grid; gap:5px; color:#667085; font-size:12px; }
.module-inline-form input,.module-inline-form select,.os-page textarea { border:1px solid #cfd9e3; border-radius:9px; padding:10px; background:#fff; }
.os-page textarea { width:100%; min-height:118px; resize:vertical; }
.os-page button.primary { border:0; border-radius:9px; padding:11px 15px; color:#fff; background:#163f66; font-weight:750; cursor:pointer; }
.quick-prompts { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }.quick-prompts button { border:1px solid #d7e0e9; border-radius:999px; padding:7px 10px; background:#f8fafc; color:#31516f; cursor:pointer; }
.ai-console form { display:grid; gap:9px; }.ai-answer { margin-top:14px; padding:14px; border-radius:11px; background:#eef5fa; }.ai-answer span { color:#2d6689; font-size:10px; font-weight:900; letter-spacing:.1em; }.ai-answer p { margin:5px 0 0; color:#243a50; }
.tool-registry,.os-list,.dispatch-result { display:grid; gap:8px; }.os-list article,.tool-registry article,.dispatch-result article { padding:12px; border:1px solid #e3e9ef; border-radius:10px; background:#f9fbfc; }
.os-row { display:flex; justify-content:space-between; align-items:center; gap:14px; }.os-row > div:first-child { display:grid; gap:3px; }.os-row strong { color:#203b56; }.os-row span,.os-row small { color:#718093; font-size:11px; }.os-row button { border:0; border-radius:8px; padding:8px 10px; color:#234d6e; background:#e8f0f6; font-weight:700; cursor:pointer; }
.tool-cloud { display:flex; flex-wrap:wrap; gap:6px; }.tool-cloud span,.status-chip { padding:5px 7px; border-radius:7px; color:#315d7d; background:#e8f1f7; font-size:10px; font-weight:750; }.tool-registry h3 { margin:12px 0 7px; color:#516172; font-size:12px; }
.os-list article header { display:flex; justify-content:space-between; gap:12px; }.os-list article p { margin:5px 0; color:#667085; font-size:12px; }.os-list article small { color:#7b8794; }
.module-status { color:#5f6f80; font-size:12px; }.summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:18px 0; }.summary-grid article,.summary-grid > div { padding:15px; border-radius:12px; color:#fff; background:#173f62; }.summary-grid article strong,.summary-grid > div b { display:block; margin:4px 0; font-size:22px; }.summary-grid article span,.summary-grid > div span,.summary-grid > div em { display:block; color:#d4e4ef; font-size:11px; font-style:normal; }
@media (max-width:820px) { .os-page { padding:18px 14px 90px; }.os-grid.two,.summary-grid { grid-template-columns:1fr; }.os-grid .wide { grid-column:auto; } }

/* 1.8.0-alpha: one calm, dark product language across SaaS and Business OS. */
.module-main { grid-template-rows:auto minmax(0,1fr); background:linear-gradient(145deg,#030a15,#07182b); }
.module-topbar { min-width:0; min-height:56px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:8px 18px; border-bottom:1px solid #173553; background:rgba(3,12,25,.94); }
.global-search { position:relative; width:min(430px,42vw); }
.global-search input { padding-left:13px; background:#071a2e; }
.global-search-results { position:absolute; z-index:40; top:42px; width:100%; max-height:360px; overflow:auto; padding:7px; border:1px solid #2a506f; border-radius:10px; background:#061426; box-shadow:0 20px 45px rgba(0,0,0,.48); }
.global-search-results button { width:100%; display:grid; gap:3px; padding:9px 10px; border:0; border-bottom:1px solid #17334d; text-align:left; color:var(--text); background:transparent; }
.global-search-results button:hover { background:#0b2945; }
.global-search-results small { color:var(--muted); }
.system-info { display:flex; align-items:center; gap:12px; color:var(--muted); font-size:11px; }
.company-identity { color:#d6e8fa; }
.topbar-logout { color:#9fc8ed; text-decoration:none; font-weight:700; }
.notification-wrap { position:relative; }
.notification { position:relative; width:35px; height:35px; border:1px solid #2b506f; border-radius:10px; color:#bcd9f2; background:#071a2e; }
.notification i { position:absolute; top:-6px; right:-6px; min-width:18px; padding:2px 4px; border-radius:99px; color:white; background:#cf4454; font-size:9px; font-style:normal; }
.notification-menu { position:absolute; z-index:45; top:42px; right:0; width:330px; max-height:410px; overflow:auto; padding:14px; border:1px solid #2a506f; border-radius:12px; background:#07182b; box-shadow:0 20px 45px rgba(0,0,0,.48); }
.notification-menu p { padding:9px 0; margin:0; border-bottom:1px solid #17344d; color:#b8cce0; }

.command-center,.os-page,.os-page > h1,.cc-hero h1,.cc-card h2,.os-row strong,.tool-registry h3 { color:var(--text); }
.command-center,.os-page { background:transparent; }
.cc-hero p,.os-page > p,.os-row span,.os-row small,.cc-card header a { color:var(--muted); }
.cc-card,.module-section,.order-case-grid>section,.order-truth-summary>div { border-color:#244661; background:linear-gradient(180deg,#0a223c,#061527); box-shadow:0 8px 25px rgba(0,0,0,.2); }
.cc-btn.secondary,.attention-item,.metric-grid article,.intelligence-list p { border-color:#294b67; color:#d9e9f8; background:#081a2e; }
.attention-item strong,.finance-lines strong,.order-case-grid h3,.order-truth-summary b { color:#e9f4ff; }
.attention-item p,.finance-lines span,.case-timeline p { color:var(--muted); }
.finance-lines p,.event-list p,.case-timeline p { border-color:#1e3d57; }
.quality-ring { border-color:#203d57; border-top-color:var(--cyan); }
.quality-ring strong,.event-list strong { color:#e8f3ff; }
.os-row { border-color:#23445f; background:#07192d; }
.summary-grid article,.summary-grid>div { background:linear-gradient(135deg,#123e63,#0a273f); }
.driver-order-card { border-color:#244761; color:var(--text); background:#07192d; }
.driver-order-card p { color:#c4d7e9; }

.business-dashboard { width:100%; min-height:0; overflow:auto; padding:24px clamp(14px,2vw,30px) 120px; }
.bd-hero { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:20px; }
.bd-hero h1 { margin:4px 0; font-size:clamp(27px,3vw,42px); letter-spacing:-.04em; }
.bd-hero p { margin:0; color:var(--muted); }
.bd-kicker { color:#69bfff; font-size:9px; font-weight:900; letter-spacing:.16em; }
.bd-live { display:flex; align-items:center; gap:10px; padding:10px 13px; border:1px solid #25516f; border-radius:11px; background:#081c31; }
.bd-live>span { width:9px; height:9px; border-radius:50%; background:var(--green); box-shadow:0 0 0 5px rgba(66,222,119,.12); }
.bd-live div { display:grid; }.bd-live small { color:var(--muted); }
.bd-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:13px; }
.bd-kpis article { display:grid; gap:5px; padding:14px; border:1px solid #244963; border-radius:12px; background:linear-gradient(155deg,#0b2743,#061527); }
.bd-kpis span,.bd-kpis small { color:var(--muted); font-size:10px; }.bd-kpis strong { font-size:clamp(18px,1.8vw,27px); }
.bd-kpis .warning { border-color:#765a22; }.bd-kpis .critical { border-color:#73323d; }
.bd-main-grid { display:grid; grid-template-columns:1.35fr 1fr 1fr; gap:13px; }
.bd-panel { min-width:0; padding:17px; border:1px solid #244963; border-radius:13px; background:linear-gradient(165deg,#09223b,#061426); box-shadow:0 14px 32px rgba(0,0,0,.18); }
.bd-panel>header { display:flex; justify-content:space-between; gap:13px; margin-bottom:13px; }.bd-panel h2 { margin:3px 0 0; font-size:17px; }.bd-panel header a,.bd-panel header button { border:0; color:#7fc8ff; background:transparent; text-decoration:none; font-weight:750; font-size:11px; }
.decisions-panel { grid-column:span 2; }
.bd-attention-list,.bd-action-list,.bd-event-list { display:grid; gap:7px; }
.bd-attention-list article { display:grid; grid-template-columns:8px 1fr auto; align-items:center; gap:11px; padding:10px; border:1px solid #24445e; border-radius:9px; background:#071a2e; }
.bd-attention-list article.critical { border-color:#65313a; }.bd-severity { width:7px; height:7px; border-radius:50%; background:#e2a336; }.critical .bd-severity { background:#f05d6b; }
.bd-attention-list p { margin:3px 0 0; color:var(--muted); font-size:11px; }.bd-attention-list a { color:#79c3fa; font-size:11px; text-decoration:none; }
.bd-action-list { grid-template-columns:1fr 1fr; }.bd-action-list button { display:grid; gap:4px; padding:11px; border:1px solid #28516f; border-radius:9px; color:var(--text); text-align:left; background:#09223a; }.bd-action-list button:hover { border-color:var(--cyan); }.bd-action-list span,.bd-action-list small { color:var(--muted); font-size:9px; }
.bd-stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }.bd-stat-grid div { padding:11px; border-radius:9px; background:#081a2d; }.bd-stat-grid strong { display:block; font-size:24px; }.bd-stat-grid span { color:var(--muted); font-size:10px; }
.bd-health { margin-top:9px; padding:11px; border:1px solid #244761; border-radius:9px; }.bd-health span,.bd-health p { color:var(--muted); font-size:10px; }.bd-health strong { display:block; margin:3px 0; }
.bd-finance-lines p { display:flex; justify-content:space-between; gap:10px; margin:0; padding:11px 0; border-bottom:1px solid #1d3b54; }.bd-finance-lines span { color:var(--muted); font-size:11px; }.missing { color:#ff8994!important; }
.truth-panel { grid-column:span 2; }.bd-truth-layout { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:18px; }.bd-quality { display:grid; place-items:center; width:110px; height:110px; border:8px solid #24425c; border-top-color:#29bbd8; border-radius:50%; text-align:center; }.bd-quality strong { font-size:18px; }.bd-quality span { padding:0 10px; color:var(--muted); font-size:8px; }.bd-truth-layout p { color:var(--muted); font-size:11px; }
.truth.calculated { color:#7dd4ec; background:#103b4a; }.bd-event-list article { display:grid; grid-template-columns:105px 1fr; gap:10px; padding:8px; border-bottom:1px solid #1d3b54; }.bd-event-list time,.bd-event-list span { color:var(--muted); font-size:10px; }.bd-event-list div { display:grid; gap:2px; }
.bd-all-clear,.bd-role-note { display:grid; gap:5px; padding:16px; border-radius:9px; color:#bfead0; background:#0b2a27; }.bd-all-clear span,.bd-role-note { color:#99bcb0; font-size:11px; }.bd-loading { color:var(--muted); }
.dashboard-ai-leader { display:grid; grid-template-columns:1fr 1.4fr; gap:20px; margin-top:13px; padding:23px; border:1px solid #2875a3; border-radius:15px; background:linear-gradient(125deg,#092d4a,#0a1c31 56%,#10223c); box-shadow:0 18px 50px rgba(0,115,220,.12); }.dashboard-ai-leader h2 { margin:5px 0; font-size:24px; }.dashboard-ai-leader p { color:#b3cade; }.ai-brief-bullets { display:flex; flex-wrap:wrap; gap:6px; }.ai-brief-bullets span { padding:6px 8px; border-radius:7px; color:#c8e7fb; background:#0b3859; font-size:10px; }.ai-quick-row { display:flex; flex-wrap:wrap; gap:6px; }.ai-quick-row button { padding:7px 9px; border:1px solid #2e6388; border-radius:8px; color:#cbe8fb; background:#0b2a45; }.ai-leader-chat form>div { display:flex; gap:7px; }.ai-leader-chat label { display:block; margin:11px 0 5px; color:#8ab8d6; font-size:10px; }.ai-leader-chat form button { border:0; border-radius:8px; padding:0 15px; color:white; background:#087cff; }.dashboard-ai-answer { display:grid; gap:5px; margin-top:9px; padding:10px; border-radius:8px; color:#d9eafb; background:rgba(3,13,25,.58); }.dashboard-ai-answer small { color:#7fa1bb; }
.context-ai-launcher { position:fixed; z-index:60; right:18px; bottom:18px; display:flex; align-items:center; gap:8px; padding:9px 13px; border:1px solid #31a6eb; border-radius:99px; color:white; background:#0868ad; box-shadow:0 10px 35px rgba(0,105,200,.35); }.context-ai-launcher span { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#0a2841; font-size:9px; }.context-ai-panel { position:fixed; z-index:65; right:18px; bottom:75px; width:min(390px,calc(100vw - 24px)); max-height:74vh; overflow:auto; border:1px solid #2d719a; border-radius:14px; background:#061426; box-shadow:0 24px 70px rgba(0,0,0,.58); }.context-ai-panel header { display:flex; justify-content:space-between; padding:15px; border-bottom:1px solid #1d4360; }.context-ai-panel header div { display:grid; gap:2px; }.context-ai-panel header span,.context-ai-panel header small { color:#79b5da; font-size:9px; }.context-ai-panel header button { border:0; color:white; background:transparent; font-size:24px; }.context-ai-messages { display:grid; gap:8px; max-height:310px; overflow:auto; padding:13px; }.context-ai-messages article { padding:10px; border-radius:9px; background:#0a223a; }.context-ai-messages p { margin:4px 0 0; color:#c2d6e8; font-size:12px; white-space:pre-wrap; }.context-ai-messages .user { background:#103a5d; }.context-ai-quick { display:flex; gap:5px; overflow:auto; padding:0 13px 8px; }.context-ai-quick button { flex:0 0 auto; padding:6px 8px; border:1px solid #285674; border-radius:7px; color:#abd8f5; background:#081c30; font-size:10px; }.context-ai-panel form { display:flex; gap:7px; padding:11px 13px 13px; border-top:1px solid #1d4360; }.context-ai-panel form button { border:0; border-radius:8px; padding:0 12px; color:white; background:#087cff; }
@media(max-width:1100px){.bd-kpis{grid-template-columns:repeat(2,1fr)}.bd-main-grid{grid-template-columns:1fr 1fr}.decisions-panel,.truth-panel{grid-column:span 2}.dashboard-ai-leader{grid-template-columns:1fr}}
@media(max-width:760px){.module-topbar{padding:7px}.company-identity,#moduleClock{display:none}.global-search{width:100%}.bd-hero{align-items:flex-start;flex-direction:column}.bd-kpis,.bd-main-grid{grid-template-columns:1fr}.decisions-panel,.truth-panel{grid-column:auto}.bd-action-list{grid-template-columns:1fr}.dashboard-ai-leader{padding:16px}.context-ai-launcher b{display:none}}
.order-intelligence-first { border-color:#276f98; background:linear-gradient(135deg,#0a2d49,#07182b); }
.order-intelligence-first>header { display:flex; justify-content:space-between; align-items:start; gap:12px; }.order-intelligence-first h2 { margin:4px 0 12px; font-size:20px; }.order-intelligence-first header a { color:#7ac9f7; font-size:11px; }
.order-intelligence-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }.order-intelligence-metrics article { padding:11px; border:1px solid #26506c; border-radius:9px; background:#071a2d; }.order-intelligence-metrics b { display:block; font-size:23px; }.order-intelligence-metrics span { color:var(--muted); font-size:10px; }.order-intelligence-metrics .warn { border-color:#755827; }
.order-intelligence-cases { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }.order-intelligence-cases article { display:flex; justify-content:space-between; gap:10px; padding:11px; border:1px solid #244761; border-radius:9px; background:#07192b; }.order-intelligence-cases article>div:first-child { display:grid; gap:3px; }.order-intelligence-cases span,.order-intelligence-cases small { color:#84b9d9; font-size:9px; }.order-intelligence-cases p { margin:0!important; color:var(--muted)!important; font-size:10px!important; }.order-intelligence-cases article>div:last-child { display:flex; align-items:center; gap:5px; }.order-intelligence-cases button { padding:7px 8px; border:1px solid #2b5d7e; border-radius:7px; color:#c5e6fa; background:#0a2943; font-size:10px; }
@media(max-width:760px){.order-intelligence-metrics,.order-intelligence-cases{grid-template-columns:1fr 1fr}.order-intelligence-cases article{grid-column:1/-1}}
.finance-jump { display:flex; flex-wrap:wrap; gap:7px; margin:-8px 0 14px; }.finance-jump a { padding:7px 9px; border:1px solid #28506d; border-radius:8px; color:#9dd7fa; background:#071a2d; text-decoration:none; font-size:10px; }

/* 1.11.0.4: sichtbarer, eindeutiger Fahrerzuordnungs-Workflow. */
.order-driver-assignment { display:grid; gap:3px; min-width:175px; }
.order-driver-assignment small { color:var(--muted); font-size:9px; }
.order-driver-select[aria-busy="true"] { opacity:.72; cursor:wait; }
.module-table tr.is-workflow-target > td { background:rgba(18,112,177,.13); }
.module-table tr.is-workflow-target > td:first-child { box-shadow:inset 3px 0 0 #4bb7ff; }
/* 1.12.0: ruhige Soll-Ist-Nachkalkulation in der bestehenden Auftragsakte */
.order-actuals-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.order-actuals-heading h2{margin:.2rem 0 0}
#orderActualsCompleteness[data-state="complete"]{border-color:#35c89a;color:#75e6c4;background:rgba(53,200,154,.12)}
#orderActualsCompleteness[data-state="incomplete"],#orderActualsCompleteness[data-state="partial"]{border-color:#d6a84a;color:#f0cb7c;background:rgba(214,168,74,.12)}
#orderActualsCompleteness[data-state="not_started"],#orderActualsCompleteness[data-state="missing_data"]{border-color:#47647d;color:#a9bed0;background:rgba(71,100,125,.12)}
.actuals-missing{margin:1rem 0;padding:.9rem 1rem;border:1px solid #6f5832;border-radius:10px;background:#17170f;color:#ead39f}
.actuals-missing ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.25rem 1.5rem;margin:.65rem 0 0;padding-left:1.1rem}
.postcalc-table-wrap{margin:1rem 0 1.25rem}
.postcalc-table th:first-child{min-width:150px}
.postcalc-table td,.postcalc-table th{vertical-align:middle}
.postcalc-table .value-missing{color:#d4ad67;font-style:italic}
.postcalc-table .value-actual{color:#dcecf7}
.postcalc-table .variance-positive{color:#62d6ae}
.postcalc-table .variance-negative{color:#f19a9a}
.postcalc-table .variance-neutral{color:#a9bed0}
.postcalc-table .variance-unknown{color:#738da2}
.order-actuals-form{margin:1rem 0}
.order-cost-entry-list{display:grid;gap:.4rem;margin:.75rem 0 1rem}
.order-cost-entry-list p{display:flex;justify-content:space-between;gap:1rem;margin:0;padding:.65rem .8rem;border:1px solid var(--line,#244159);border-radius:8px;background:rgba(7,24,36,.45)}
@media(max-width:760px){.order-actuals-heading{align-items:stretch;flex-direction:column}.postcalc-table{min-width:650px}.actuals-missing ul{grid-template-columns:1fr}.order-cost-entry-list p{align-items:flex-start;flex-direction:column}}
.onboarding-progress{height:10px;border-radius:999px;background:#10283b;overflow:hidden}.onboarding-progress span{display:block;height:100%;background:linear-gradient(90deg,#20b8a5,#3b82f6)}.onboarding-step-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0}.onboarding-step-nav button{display:grid;grid-template-columns:32px 1fr;gap:2px 10px;text-align:left;padding:12px;border:1px solid #294960;border-radius:10px;background:#0a1b27;color:#d9efff}.onboarding-step-nav button>span{grid-row:1/3;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#12334a;font-weight:800}.onboarding-step-nav button small{color:#8fb5cc}.onboarding-step-nav button.active{border-color:#36c9b5;box-shadow:0 0 0 1px #36c9b533}.onboarding-step-nav button.status-ready>span{background:#12675e}.readiness-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.readiness-item{border:1px solid #294960;border-radius:10px;background:#0a1b27;padding:12px}.status-warning{border-color:#8c6a18}.status-blocked{border-color:#a84155}@media(max-width:800px){.onboarding-step-nav,.readiness-grid{grid-template-columns:1fr}}
