/* Fahrer-Dokumente */

/* Status-Toast: schwebt unten rechts, damit das Einblenden
   (z. B. „Gespeichert.") die Tabelle nicht verschiebt. */
.app-main-content > #status-bar.status-bar {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  margin: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  max-width: 360px;
}

.dd-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.dd-kpi {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.dd-kpi-label { font-size: var(--font-size-sm); color: var(--color-text-muted); margin-bottom: 4px; }
.dd-kpi-value { font-size: 28px; font-weight: var(--font-weight-bold); letter-spacing: -0.5px; }
.dd-kpi-red { border-color: #fca5a5; }
.dd-kpi-red .dd-kpi-value { color: #991b1b; }
.dd-kpi-amber { border-color: #fcd34d; }
.dd-kpi-amber .dd-kpi-value { color: #92400e; }

.dd-loading { padding: 24px; color: var(--color-text-muted); text-align: center; }
.dd-empty { padding: 24px; color: var(--color-text-muted); text-align: center; }

/* Excel-pure Tabelle */
.dd-table-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.dd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.dd-table thead th {
  padding: 8px;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Gruppen-Header (obere Zeile) */
.dd-thead-group .dd-group {
  text-align: center;
  text-transform: uppercase;
  color: var(--color-text-default);
  font-size: 12px;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: 8px 12px;
}
.dd-thead-group .dd-subhead {
  display: block;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Sub-Header (untere Zeile) */
.dd-thead-sub th {
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 35px;       /* unterhalb der Gruppen-Zeile */
  z-index: 1;
}
.dd-thead-sub .dd-sub-fs   { border-left: 1px solid var(--color-border); }
.dd-thead-sub .dd-sub-fs:first-child { border-left: 1px solid var(--color-border); }
.dd-thead-sub .dd-sub-faka { border-left: 1px solid var(--color-border); }
.dd-thead-sub .dd-sub-last { border-right: 1px solid var(--color-border); }

.dd-th-name { min-width: 170px; text-align: left; text-transform: uppercase; }

/* Visuelle Trenner zwischen Gruppen (vertikale Linien in den Body-Zellen) */
.dd-table tbody td:nth-child(2)  { border-left: 1px solid var(--color-border); }  /* FS Start */
.dd-table tbody td:nth-child(4)  { border-right: 1px solid var(--color-border); } /* FS Ende  */
.dd-table tbody td:nth-child(6)  { border-right: 1px solid var(--color-border); } /* FaKa Ende */
.dd-table tbody td:nth-child(7)  { border-right: 1px solid var(--color-border); } /* §95 Ende */
.dd-table tbody td:nth-child(8)  { border-right: 1px solid var(--color-border); } /* Arzt Ende */
.dd-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.dd-table tbody tr:last-child td { border-bottom: none; }
.dd-table tbody tr:hover { background: var(--color-surface-muted); }

.dd-td-name {
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  color: var(--color-text-default);
}
.dd-td-input {
  white-space: nowrap;
}
.dd-td-input .dd-input {
  width: 130px;
  display: inline-block;
}
.dd-td-num {
  width: 80px;
}
.dd-input-num {
  width: 64px !important;
  text-align: right;
}

.dd-next-vorlage {
  font-family: var(--font-family-mono);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dd-next-vorlage-red   { color: #991b1b; font-weight: var(--font-weight-semibold); }
.dd-next-vorlage-amber { color: #92400e; font-weight: var(--font-weight-semibold); }

.dd-input {
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-base);
}
.dd-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--color-brand-primary-soft);
}
.dd-input-red {
  border-color: #fca5a5;
  background: #fef2f2;
}
.dd-input-amber {
  border-color: #fcd34d;
  background: #fffbeb;
}

.dd-snooze-btn {
  padding: 2px 6px;
  margin-left: 2px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12px;
  vertical-align: middle;
}
.dd-snooze-btn:hover { background: var(--color-surface-muted); }

.dd-licenses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dd-license {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  min-width: 42px;
}
.dd-license:hover { border-color: var(--color-border-strong); }
.dd-license.is-set {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.dd-license-amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.dd-license-red {
  background: #fde2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* Snooze-Modal */

.dd-modal {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.dd-modal::backdrop { background: rgba(0, 0, 0, 0.45); }
.dd-modal::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--color-brand-primary), color-mix(in srgb, var(--color-brand-primary) 75%, white));
}
.dd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--color-border);
}
.dd-modal-head h2 { margin: 0; font-size: var(--font-size-lg); }
.dd-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dd-modal-text { margin: 0; color: var(--color-text-muted); font-size: var(--font-size-sm); }
.dd-snooze-presets { display: flex; gap: 6px; }
.dd-snooze-presets .btn {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
}
.dd-snooze-presets .btn:hover { background: var(--color-surface-muted); }
.dd-snooze-date {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dd-snooze-date > span {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
.dd-snooze-date input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
}
.dd-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
}
.dd-modal-foot .btn {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  cursor: pointer;
  font-size: var(--font-size-md);
}
.dd-modal-foot .btn-primary {
  background: var(--color-brand-primary);
  color: var(--color-brand-primary-on);
  border-color: var(--color-brand-primary);
}

@media (max-width: 900px) {
  .dd-kpis { grid-template-columns: 1fr; }
  .dd-row-grid { grid-template-columns: 1fr 1fr; }
}

/* Deep-Link-Highlight: gewählte Zeile bleibt grau hinterlegt
   bis irgendwo anders hingeklickt wird. */
tr.dd-row-highlight > td {
  background: #e5e7eb;
}
tr.dd-row-highlight {
  box-shadow: inset 3px 0 0 var(--color-brand-primary);
}

/* Auslese-Datum: nur lesen (wird vom DDD-Upload gesetzt, siehe Tacho-Seite).
   Optik bewusst wie ein deaktiviertes Eingabefeld — gleiche Höhe und
   Ampelfarben wie die editierbaren Zellen daneben, aber ohne Rahmen-Affordanz. */
.dd-readonly {
  display: inline-block;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 4px);
  color: var(--color-text);
  cursor: default;
}
.dd-readonly-red   { background: #fef2f2; border-color: #fca5a5; color: #991b1b; font-weight: var(--font-weight-bold); }
.dd-readonly-amber { background: #fffbeb; border-color: #fcd34d; color: #92400e; font-weight: var(--font-weight-bold); }
