.project-delete-button{
  background:#c62828 !important;
  border:1px solid #e05252 !important;
  color:#fff !important;
  text-decoration:none;
}
.project-delete-button:hover,
.project-delete-button:focus-visible{
  background:#a91f1f !important;
  border-color:#ff6b6b !important;
  color:#fff !important;
}
.project-delete-confirmation{
  border-color:#8f3540 !important;
  box-shadow:inset 4px 0 0 #c62828;
}
.project-delete-confirmation h2{color:#ffb7bd}
.project-delete-warning{color:var(--muted);line-height:1.5}
.project-delete-form{margin:0;display:inline-flex}

/* 1.8.32 – Aktionsbuttons im Projektformular einheitlich */
form .actions.span-2 > button,
form .actions.span-2 > a.button{
  width:180px;
  min-width:180px;
  height:52px;
  min-height:52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 18px;
  text-align:center;
  white-space:nowrap;
}

/* 1.8.33 – gleiche Typografie für alle drei Projekt-Aktionsbuttons */
form .actions.span-2 > button,
form .actions.span-2 > a.button{
  font-family:inherit !important;
  font-size:16px !important;
  font-weight:700 !important;
  line-height:1 !important;
  letter-spacing:0 !important;
}

/* 1.8.35 – globale einheitliche Button-Typografie */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
a.button,
.button{
  font-family:inherit !important;
  font-size:16px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  letter-spacing:0 !important;
  text-decoration:none;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* 1.8.36 – Buttontexte dürfen niemals über den Button hinausragen */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
a.button,
.button{
  max-width:100%;
  white-space:normal !important;
  overflow-wrap:anywhere;
  word-break:normal;
  text-align:center;
}

/* Lange Aktionsbeschriftungen bekommen genug Innenraum und dürfen umbrechen. */
button:not(.small),
input[type="submit"],
input[type="button"],
input[type="reset"],
a.button:not(.small),
.button:not(.small){
  min-height:52px;
  height:auto;
  padding:12px 18px !important;
  line-height:1.2 !important;
}

/* Auf schmalen Bereichen nutzt ein Button die verfügbare Breite statt überzulaufen. */
@media (max-width:900px){
  button:not(.small),
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a.button:not(.small),
  .button:not(.small){
    width:min(100%,360px);
    min-width:0;
  }
}

/* 1.8.38 – Projektaktionen direkt unter Seitentitel/Projektstammdaten-Hinweis */
.project-top-actions{
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  margin:18px 0 26px;
}
.project-top-actions > button,
.project-top-actions > a.button{
  width:180px;
  min-width:180px;
  min-height:52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:inherit !important;
  font-size:16px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  text-align:center;
}

/* 1.8.39 – Projekt-Löschabfrage als echtes Popup */
.project-delete-dialog{
  width:min(680px,calc(100vw - 40px));
  max-width:680px;
  margin:auto;
  padding:0;
  border:1px solid #9f3540;
  border-radius:20px;
  background:var(--surface);
  color:var(--text);
  box-shadow:0 30px 100px rgba(0,0,0,.65), inset 4px 0 0 #c62828;
}
.project-delete-dialog::backdrop{
  background:rgba(3,8,16,.78);
  backdrop-filter:blur(4px);
}
.project-delete-dialog-content{
  padding:28px 30px 26px;
}
.project-delete-dialog h2{
  margin:0 0 18px;
  color:#ffb7bd;
}
.project-delete-dialog p{
  margin:0 0 16px;
  line-height:1.55;
}
.project-delete-dialog-actions{
  display:flex;
  gap:14px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:24px;
}
.project-delete-dialog-actions > button,
.project-delete-dialog-actions .project-delete-button{
  width:180px;
  min-width:180px;
  min-height:52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* 1.8.40 – JS-unabhängiges modales Lösch-Popup */
.project-delete-dialog[open]{
  position:fixed;
  inset:0;
  z-index:10000;
  display:block;
  width:min(680px,calc(100vw - 40px));
  max-height:calc(100vh - 60px);
  overflow:auto;
  margin:auto;
}
.project-delete-dialog[open]::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:rgba(3,8,16,.82);
  backdrop-filter:blur(4px);
}

/* 1.8.41 – Freitext Sonstiges bei Genehmigungen */
.permit-other-field{
  display:block;
  margin-top:18px;
}
.permit-other-field input{
  width:100%;
  margin-top:8px;
}


/* 1.8.48 – saubere, konfliktfreie Ausrichtung Leistungen/Genehmigungen */
.project-options{
  align-items:stretch !important;
  gap:24px !important;
}

.project-options > fieldset{
  padding:20px 22px 22px !important;
}

.project-options .checkbox-grid{
  gap:12px 14px !important;
}

.project-options .checkbox-grid .check{
  min-height:52px !important;
  margin:0 !important;
}

/* Normale, einheitliche Feldhöhe */
.project-options .service-other-field input,
.project-options .permit-other-field input,
.project-options .permit-cost-field input{
  box-sizing:border-box !important;
  width:100% !important;
  height:54px !important;
  min-height:54px !important;
  max-height:54px !important;
  padding:0 16px !important;
  line-height:normal !important;
}

/* Linkes Sonstiges */
.project-options .service-other-field{
  display:block !important;
  margin-top:20px !important;
  padding-top:18px !important;
  border-top:1px solid var(--border) !important;
}
.project-options .service-other-field input{
  margin-top:10px !important;
}

/* Rechtes Sonstiges */
.project-options .permit-other-field{
  display:block !important;
  margin-top:18px !important;
  padding-top:0 !important;
  border-top:0 !important;
}
.project-options .permit-other-field input{
  margin-top:10px !important;
}

/* Genehmigungskosten:
   Der gesamte Block wird etwas tiefer gesetzt, damit das Eingabefeld
   exakt auf derselben horizontalen Linie wie "Sonstiges" links startet. */
.project-options .permit-cost-field{
  display:block !important;
  margin-top:49px !important;
  padding-top:18px !important;
  border-top:1px solid var(--border) !important;
}
.project-options .permit-cost-field input{
  margin-top:10px !important;
}
.project-options .permit-cost-field small{
  display:block !important;
  margin-top:7px !important;
  line-height:1.35 !important;
}

@media (max-width:900px){
  .project-options{
    gap:18px !important;
  }

  /* Untereinander braucht es keine künstliche vertikale Ausrichtung. */
  .project-options .permit-cost-field{
    margin-top:22px !important;
  }
}

/* 1.8.49 – Einstellungen: Untermenü und Standard-Firmenanteile */
.nav-settings-submenu a{
  display:block;
}
.settings-link-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.settings-link-card{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface-2);
  color:var(--text);
  text-decoration:none;
}
.settings-link-card:hover{
  border-color:var(--accent);
}
.settings-link-card span{
  color:var(--muted);
  font-size:14px;
}
.default-share-form{
  margin-top:18px;
}
@media(max-width:900px){
  .settings-link-grid{grid-template-columns:1fr}
}

/* 1.8.51 – Einstellungen-Untermenü direkt links ausrichten */
.nav-settings-group .nav-settings-submenu{
  margin-left:0 !important;
  padding-left:0 !important;
  border-left:0 !important;
}
.nav-settings-group .nav-settings-submenu a{
  margin-left:0 !important;
  padding-left:18px !important;
  text-align:left !important;
}

/* 1.8.52 – Einstellungen-Navigation sauber hierarchisch ausrichten */

/* Hauptpunkt: Text direkt nach dem Icon statt rechts im Menüpunkt. */
.nav-settings-group > summary{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:12px !important;
  text-align:left !important;
}
.nav-settings-group > summary .nav-icon{
  flex:0 0 auto !important;
  margin:0 !important;
}

/* Unterpunkte bewusst etwas einrücken, damit die Hierarchie sichtbar ist. */
.nav-settings-group .nav-settings-submenu{
  margin-left:0 !important;
  padding-left:22px !important;
  border-left:0 !important;
}
.nav-settings-group .nav-settings-submenu a{
  margin-left:0 !important;
  padding-left:18px !important;
  text-align:left !important;
}

/* 1.8.53 – „Neues Projekt“ als Untermenü von Projekte einrücken */
.nav-project-group .nav-project-submenu > a.project-new-link{
  margin-left:18px !important;
  width:calc(100% - 18px) !important;
}

/* 1.8.54 – tatsächliche Position von „Neues Projekt“ korrigiert
   Der Link liegt nicht in .nav-project-submenu, daher eigener Wrapper. */
.project-new-submenu{
  padding-left:18px !important;
  box-sizing:border-box !important;
}
.project-new-submenu .project-new-link{
  width:100% !important;
  margin-left:0 !important;
  box-sizing:border-box !important;
}

/* 1.8.55 – „Neuer Kunde“ als Untermenü von Kunden */
.customer-new-submenu{
  padding-left:18px !important;
  box-sizing:border-box !important;
}
.customer-new-submenu .customer-new-link{
  width:100% !important;
  margin-left:0 !important;
  box-sizing:border-box !important;
}

/* 1.8.57 – Equipment wie Kunden/Projekte strukturieren */
.equipment-new-submenu{
  padding-left:18px !important;
  box-sizing:border-box !important;
}
.equipment-new-submenu .equipment-new-link{
  width:100% !important;
  margin-left:0 !important;
  box-sizing:border-box !important;
}

/* 1.8.58 – Kunden, Projekte und Equipment als aufklappbare Navigationsgruppen */
.nav-entity-group > summary{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:12px !important;
  text-align:left !important;
  cursor:pointer;
}
.nav-entity-group > summary .nav-icon{
  flex:0 0 auto !important;
  margin:0 !important;
}
.nav-entity-group .nav-entity-submenu{
  margin-left:0 !important;
  padding-left:22px !important;
  border-left:0 !important;
}
.nav-entity-group .nav-entity-submenu a{
  margin-left:0 !important;
  padding-left:18px !important;
  text-align:left !important;
}

/* 1.8.59 – Übersicht direkt auf Hauptmenü; nur Neu als Untermenü */
.nav-entity-new-submenu{
  padding-left:40px !important;
  box-sizing:border-box !important;
}
.nav-entity-new-submenu a{
  display:block !important;
  width:100% !important;
  box-sizing:border-box !important;
  padding:8px 12px !important;
  text-align:left !important;
}

/* 1.8.60 – Erfassungs- und Änderungsinformationen */
.record-meta{
  margin-top:6px !important;
  font-size:.82rem !important;
  line-height:1.45 !important;
  opacity:.76;
}
.record-meta strong{
  font-weight:600;
}
.record-meta-cell{
  white-space:nowrap;
  line-height:1.25;
}
.record-meta-cell small{
  opacity:.76;
}

/* 1.8.61 – kompaktere und sauberere Übersichtslisten */
.overview-data-table{
  min-width:1120px;
}
.overview-data-table th,
.overview-data-table td{
  vertical-align:middle !important;
}
.overview-data-table .record-meta-cell{
  min-width:150px;
  white-space:nowrap;
}
.record-meta-user{
  display:block;
  font-weight:650;
  line-height:1.25;
}
.record-meta-time{
  display:block;
  margin-top:3px;
  font-size:.82rem;
  line-height:1.25;
  opacity:.72;
}
.projects-table th:last-child,
.projects-table td:last-child,
.overview-data-table th:last-child,
.overview-data-table td:last-child{
  width:190px;
  min-width:190px;
}
.project-list-actions{
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  min-width:176px;
}
.project-list-actions .button{
  flex:0 0 auto;
  white-space:nowrap !important;
}
.overview-data-table .row-actions{
  min-width:170px;
  flex-wrap:nowrap !important;
  justify-content:flex-end;
}
.overview-data-table .row-actions a,
.overview-data-table .row-actions button{
  white-space:nowrap !important;
  word-break:normal !important;
}

/* 1.8.62 – Fahrtkosten */
.form-grid label small{
  font-weight:400;
  opacity:.72;
}

/* 1.8.64 – Datumsfelder */
.form-grid label > small{
  display:block;
  margin-top:5px;
}
