/* ---------------------------------------------------------------------------------- */
/* Spezielle Festlegungen für Ajudi - Farbkonstanten übernommen von w3.css            */
/* ---------------------------------------------------------------------------------- */

:root {

    --hue: 200;          /* 200  */
    --saturation: 20%;   /*  20  */

    --color-l5: #000;
    --color-l4: #000;
    --color-l3: #000;
    --color-l2: #000;
    --color-l1: #fff;
    --color-d1: #fff;
    --color   : #fff;
    --color-d2: #fff;
    --color-d3: #fff;
    --color-d4: #fff;
    --color-d5: #fff;
    --background-color-l5: hsl(var(--hue), var(--saturation), 97%);
    --background-color-l4: hsl(var(--hue), var(--saturation), 89%);
    --background-color-l3: hsl(var(--hue), var(--saturation), 78%);
    --background-color-l2: hsl(var(--hue), var(--saturation), 68%);
    --background-color-l1: hsl(var(--hue), var(--saturation), 57%);
    --background-color   : hsl(var(--hue), var(--saturation), 46%); 
    --background-color-d1: hsl(var(--hue), var(--saturation), 42%);
    --background-color-d2: hsl(var(--hue), var(--saturation), 37%);
    --background-color-d3: hsl(var(--hue), var(--saturation), 32%);
    --background-color-d4: hsl(var(--hue), var(--saturation), 28%);
    --background-color-d5: hsl(var(--hue), var(--saturation), 23%);

    /* Status colors for qualification views - lighter matte finish */
    --status-fehlend-bg: #ffe5e5;
    --status-fehlend-text: #721c24;
    --status-in-bearbeitung-bg: #e5f3ff;
    --status-in-bearbeitung-text: #004085;
    --status-abgelaufen-bg: #fff7e5;
    --status-abgelaufen-text: #856404;
    --status-gueltig-bg: #e8f7eb;
    --status-gueltig-text: #155724;
    --status-hover-bg: #4CAF50;
}

.w3-theme-l5                 {color:var(--color-l5)!important; background-color:var(--background-color-l5)!important}
.w3-theme-l4                 {color:var(--color-l4)!important; background-color:var(--background-color-l4)!important}
.w3-theme-l3                 {color:var(--color-l3)!important; background-color:var(--background-color-l3)!important}
.w3-theme-l2                 {color:var(--color-l2)!important; background-color:var(--background-color-l2)!important}
.w3-theme-l1                 {color:var(--color-l1)!important; background-color:var(--background-color-l1)!important}
.w3-theme                    {color:var(--color)   !important; background-color:var(--background-color)   !important}
.w3-theme-d1                 {color:var(--color-d1)!important; background-color:var(--background-color-d1)!important}
.w3-theme-d2                 {color:var(--color-d2)!important; background-color:var(--background-color-d2)!important}
.w3-theme-d3                 {color:var(--color-d3)!important; background-color:var(--background-color-d3)!important}
.w3-theme-d4                 {color:var(--color-d4)!important; background-color:var(--background-color-d4)!important}
.w3-theme-d5                 {color:var(--color-d5)!important; background-color:var(--background-color-d5)!important}

.w3-theme-light              {color:var(--color-l5)!important; background-color:var(--background-color-l5)!important}
.w3-theme-dark               {color:var(--color-d5)!important; background-color:var(--background-color-d5)!important}
.w3-theme-action             {color:var(--color-d5)!important; background-color:var(--background-color-d5)!important}

.w3-text-theme               {color:var(--color)   !important; background-color:var(--background-color)   !important}
.w3-border-theme             {color:var(--color)   !important; background-color:var(--background-color)   !important}

.w3-hover-theme:hover        {color:var(--color)   !important; background-color:var(--background-color)   !important}
.w3-hover-text-theme:hover   {color:var(--color)   !important; background-color:var(--background-color)   !important}
.w3-hover-border-theme:hover {color:var(--color)   !important; background-color:var(--background-color)   !important}

html, body {
    margin: 0;
    background: #f6f8fa;
}

html, body, h1, h2, h3, h4, h5 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

table {
    padding:8px 8px;
    display:table-cell;
    text-align:left;
    vertical-align:top
}

/* Suchfeld                     */
input.aj-search {
    font-size: 1.2rem;
    width:20rem;
}

.aj-hint {
    color: rgb(197, 21, 30);
    font-weight: bold;
}

/* Listenelemente auf den aj-cards    */
li.aj-card {
    list-style-type: none;
    margin-left: 10px;
}

/* ---------------------------------------------------------------------------------- */
/* Komplette aj-cards sollen immer floaten können und dabei eine feste Grösse haben   */

.aj-card {
    position: relative;
    isolation: isolate;
}

/* Common card content resets */
.aj-card p {
    margin: 0 0 0.5rem 0;
}

.aj-card ul {
    margin-top: 0;
    padding-left: 1.2rem;
}

/* Eine Variante der aj-card, die als Block-Element (volle Breite) in Listen verwendet wird */
.aj-card-inline {
    display: block;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    background: var(--w3-theme-l4, #f7f7f7);
    margin-bottom: 0.75rem;
}

div.aj-card {
    width: 30rem;
    min-height: 10rem;
    padding: 16px;
    margin-right: 16px;
    margin-bottom: 16px;
    float: left;
    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(243, 240, 240, 0.19) ;

    position:relative;
}

div.aj-card:hover{
    box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 darkgray;
    /* transform: scale(1.05); */
    /* transition: 0.5s ease-in-out */
}

.aj-card .w3-button {
    width: 8rem;
    margin-right: 16px;
    color: #fff;
    background-color: var(--background-color);
}

.aj-card .aj-plus {
    position: absolute;
    top: 16px;
    right: 16px;
    text-decoration: none;
}



/* obj sind Objekte (Kunden, Personen, ...)                                        
   Sie verwenden immer die komplette Breite, damit das Ergebnis auf dem Handy ok ist.
   Individuell muss dann style="max-width: xx rem" gesetzt werden.
*/

div.aj-obj {
    border-radius:8px;
    width:100%;
    max-width:30rem;
}

.aj-obj header {
    border-radius:8px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 8px;
    text-align: center; 
    font-size: large;
    font-weight: xbold;

    white-space: nowrap;
    line-height: 1.5em;
    color: var(--color);
    background-color: var(--background-color);
}

.aj-obj th {
   padding-right: 10px; 
}

/* aj-buttons auf Objekten sollen als Buttons unten links dargestellt werden   */
.aj-obj .w3-button {
    position: absoluteflex;
    left:0;
    bottom: 0;
}

/* ---------------------------------------------------------------------------------- */
/* Eingabefelder auf Formularen                                                       */
input.aj-field {
    padding: 4px;
    display: block;
    border: 2px;
    width: 100%;
    max-width: 50rem;
}

input:required {
    border-bottom: 4px solid var(--background-color-d4);
}

textarea.aj-field {
    width: 100%;
    height: 5rem;
    max-width: 80rem;
}

select.aj-field {
    padding: 4px;
    width: 40%;
    max-width: 30rem;
}

input.aj-field[type="radio"] {
    padding: -5px;
    width:2rem;
    display: inline;
}

input.aj-field[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
}

input.aj-field[type="date"] {
    width: 8rem;
}

input.aj-field[type="time"] {
    width: 8rem;
}

input.aj-field[type="number"] {
    width: 8rem;
}

.aj-field:disabled {
    background-color: white;
    color : var(--background-color-d5);
    opacity: 1;
}

/* ---------------------------------------------------------------------------------- */
/* Styles für die Kacheln der Teilnahmen auf der Teilnahme und Profil-Seite                          */

.aj-jobprofil .aj-card {
    min-height: 18rem;
    width: 35rem;
    position: relative;
    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(243, 240, 240, 0.19) !important;

}

.aj-teilnahmen .aj-card {
    padding-top: 0;
    height: 12rem;
    position: relative;
    padding-bottom: 3.5rem; /* je nach Button/Notizhöhe anpassen */
}

.aj-teilnahmen .aj-todo a {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 12rem;
    color: var(--color-l4);
    background-color: none;
}

.aj-teilnahmen .aj-todo div[style*="display: flex"] {
    position: absolute;
    left: 16px;
    bottom: 16px;
}

.aj-teilnahmen .aj-todo div[style*="display: flex"] a {
    position: static;
    width: auto;
}

.aj-teilnahmen .aj-work a {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 12rem;
    color: var(--color-l4);
}

.aj-teilnahmen .aj-work div[style*="display: flex"] {
    position: absolute;
    left: 16px;
    bottom: 16px;
}

.aj-teilnahmen .aj-work div[style*="display: flex"] a {
    position: static;
    width: auto;
}

.aj-teilnahmen .aj-done a {
    position: absolute;
    left: 16px;
    bottom: 16px;
    width: 12rem;
    color: var(--color);
    background-color: var(--background-color);
}

.aj-teilnahmen .aj-done div[style*="display: flex"] {
    position: absolute;
    left: 16px;
    bottom: 16px;
}

.aj-teilnahmen .aj-done div[style*="display: flex"] a {
    position: static;
    width: auto;
}

.aj-teilnahmen .aj-todo {
    color: var(--color-l4);
    background-color: none;
}

.aj-teilnahmen .aj-work {
    color: var(--color-l4);
    background-color: none;
}

.aj-teilnahmen .aj-done {
    color: var(--color-l4);
    background-color: none;
    height: 18rem;
}

/* Notiz für offline-Teilnahmen unten platzieren */
.aj-teilnahmen .aj-card.offline .offline-note,
.aj-teilnahmen .aj-card .offline-note {
    position: absolute;
    left: 16px;
    bottom: 16px;
    font-size: 15px;
    line-height: 1.2;
    max-width: calc(100% - 32px); /* verhindert Überlaufen an den Seiten */
    box-sizing: border-box;
    /* Optional: falls du willst, dass die Notiz nicht hinter anderen Elementen verschwindet */
    z-index: 2;
}

.aj-teilnahmen .aj-card.offline .offline-note {
    bottom: 15px; 
    margin-left: 10rem;
}

.aj-teilnahmen.w3-container,
.aj-teilnahme.w3-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
}
/* Start-Notiz rechts unten positionieren */
.aj-card .start-note {
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-size: 15px;
    text-align: right;
    max-width: calc(100% - 32px); /* verhindert Überlaufen */
    z-index: 2;
}

/* damit der Inhalt oben nicht über die Note läuft */
.aj-card {
    padding-bottom: 3rem; /* ggf. anpassen */
}


.aj-todo {
    color: var(--color);
    /* border-right: 8px solid darkred; */
}

.aj-todo .w3-button {
    color: var(--color-l4);
    background-color: var(--background-color-l4);
}

.aj-card li.aj-todo {
    list-style-type: none;
    color:darkred;
    background-color: inherit;
    margin-left: -20px;
}

.aj-work {
    color: var(--color-l2);
    /* border-right: 8px solid darkorange; */
}

.aj-work .w3-button {
    color: var(--color-l4);
    background-color: var(--background-color-l4);
}


.aj-card li.aj-work {
    list-style-type: none;
    color:orange;
    background-color: inherit;
    margin-left: -20px;
}

.aj-done {
    color: var(--color-l4);
    background-color: none;
    /* border-right: 8px solid darkgreen; */
}

.aj-done.aj-card {
    min-height: 16rem;  /* Höhe mindestens 18rem */
    position: relative;
}

.aj-done.aj-card a.w3-button {
    min-width: 12rem !important;
    display: inline-block;
}

.aj-card li.aj-done {
    list-style-type: none;
    color:darkgreen;
    background-color: inherit;
    margin-left: -20px;
}

/* --- Quali-Badge auf teilnahmen.html Start --- */
.aj-qualifikationen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.aj-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    font-weight: 500;
    white-space: nowrap;
}

.aj-badge.aj-todo {
    background: #fff4f4;
    color: #8b0000;
    border: 1px solid rgba(0,0,0,0.03);
}

.aj-badge.aj-done {
    background: #f2fff2;
    color: #166400;
    border: 1px solid rgba(0,0,0,0.03);
}

/* --- Icons automatisch voranstellen --- */
.aj-badge.aj-todo::before {
    content: "🔴 ";
}

.aj-badge.aj-done::before {
    content: "🟢 ";
}

/* --- Quali-Badge auf teilnahmen.html Ende--- */

.aj-link {
    font-weight: bold; 
    color: blue;
}

.aj-email-button {
    padding: 8px 14px;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 6px;
    background: var(--background-color);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--color);
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.aj-email-button:hover {
    background-color: darkgray;
    color: #000;
}

.aj-team-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform:translate(-50%,0%)
}

.aj-fullscreen-view {
    position: fixed;   /* Lock it to viewport */
    top: 0;
    left: 0;
    width: 200vw;      /* Exactly full viewport width */
    height: 200vh;     /* Exactly full viewport height */
    border: none;
    margin: 0;
    padding: 0;
    display: block;    /* Ensure it doesn't behave like inline */
    z-index: 9999;     /* Stay above other elements */
}

.aj-bold {
    font-weight: bold;
}

.aj-card-bottom-buttons {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    justify-content: center;
}

.aj-card .aj-download {
    position: absolute;
    top: 16px;
    right: 53px;
    text-decoration: none;
    font-size: 1.4rem;
    color: var(--background-color-d3);
}

.aj-card .aj-download:hover {
    color: var(--background-color-d5);
}


/* Startseite specific styles */
.aj-startseite {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: #f8f9fb;
  color: #333;
  margin: 40px auto;
  max-width: 1500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 40px;
}

.aj-startseite-header {
  text-align: center;
  justify-content: center;
  margin-left: 10px;
}

.aj-startseite h1 {
  color: #4d636f;
  margin-bottom: 20px;
}

.aj-startseite h2 {
  color: #333;
  margin-top: 10px;
  margin-bottom: 20px;
}

.aj-startseite p {
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Aktionen - Karten untereinander */
.aj-startseite .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}


.aj-startseite .card {
  background-color: #419aff38;
  color: #3a3a3a;
  text-decoration: none;
  padding: 14px;
  border-radius: 10px;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.aj-startseite .card:hover {
  transform: translateY(-3px);
  background: #4D636F;
  color: #fff;
}

/* Admin-spezifische Karten */
.aj-startseite .admin-card {
  background-color: #ffd41670;
  color: #3a3a3a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.aj-startseite .admin-card:hover {
  background: #4D636F;
  color: #fff;
}

.aj-startseite .card h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}

.aj-startseite .card p {
  margin: 0;
}



.aj-startseite .green-text {
  color: #4d636f;
  font-weight: 700;
}

@media (max-width: 600px) {
  .aj-startseite {
    padding: 20px;
  }
  .aj-startseite .definitions td:first-child {
    width: 100px;
  }

  /* Optional: kleinere Button-Schrift auf sehr kleinen Displays */
  .aj-startseite .btnDiagramm {
    font-size: 0.75em;
    padding: 6px 10px;
  }
}

.wider-buttons {
    display: flex;
    width: 9rem !important;
    flex-shrink: 0;
    text-align: center; /* Ensures text is centered in all buttons */
}

.aj-demo-button {
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the text in the "Demo" button */
}

.aj-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.aj-action-buttons > * {
    flex: 0 0 auto;
}

.aj-actions-container {
  display: flex;
  gap: 40px; /* Abstand zwischen den beiden Spalten */
  flex-wrap: wrap; /* Auf kleinen Bildschirmen untereinander */
}

.aj-actions-column {
  flex: 1; /* Beide Spalten gleich breit */
  min-width: 300px; /* Mindestbreite für Responsiveness */
}

/* Aktionen innerhalb der Spalten */
.aj-actions-column .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* ---------------------------------------------------------------------------------- */
/* Klassennamen für die unterschiedlichen Arten der Seiten    

Nach Art der Anzeige:
    aj-elem     = ein einzelnes Objekt
    aj-list     = mehrere Objekte einer Klasse 
    aj-menu     = Auswahl von Objekttypen
    aj-nav      = Navigationsbaum in base.html

Nach Klasse des Objektes:
    aj-{klassenname} 
    zum Beispiel:
    aj-standort = Standort-Objekt
    aj-person   = Person-Objekt
    
Nach Art der Aktionen
    aj-verwaltung 
    aj-planung
    usw.
*/

.aj-menu h1, .aj-list h1, .aj-elem h1, .aj-load h1 {
    padding: 16px 16px 16px 16px;
}

.aj-menu h2 {
    padding: 16px 16px 16px 16px;
    
}

.aj-menu h3 {
    padding: 16px;
    background-color: none !important;
    color : var(--color-l2);
}

.aj-menu .w3-container {
    padding : 32px 16px;
}

.aj-align-top {
    vertical-align: top;
}

.aj-highlight {
    background-color: var(--background-color-d5);
}

/* Die Links auf den cards sollen für den kompletten Header gelten */

.aj-card header {
    position: relative;
}

.aj-card header a {
    position:absolute; 
    top:0; 
    left:0; 
    right:0; 
    bottom:0; 
}


.aj-card.aj-obj .aj-card-side-edit {
    position: absolute !important;
    top: 16px !important;
    right: 10px !important;
    left: auto !important; /* Erzwingt, dass 'left' ignoriert wird */
    
    /* Dein restlicher Style */
    background-color: white;
    color: #5E7D8D;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 100; /* Sehr hoch setzen */
}

.aj-card.aj-obj .aj-card-side-edit:hover {
    /* ENTFERNE translateY, wenn das Icon oben rechts bleiben soll! */
    transform: scale(1.3); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}  


/* Beispiel: Einstellung der Personen-Informationen 


.aj-menu .aj-person, 
.aj-list .aj-person header, .aj-list .aj-person h1,
.aj-elem .aj-person header, .aj-elem .aj-person h1,
.aj-person h1
{
    background-color: hsl(120, 60%, 90%);
    color : black;
}

.aj-person header
{
    background-color: hsl(120, 60%, 30%);
    color : white;
}

*/

/* Beispiel: Einstellung aller System-Kacheln 


#system h2,
.aj-kunde header, .aj-kunde h1,
.aj-paket header, .aj-paket h1, 
.aj-rolle header, .aj-rolle h1 
{
    background-color: hsl(0, 20%, 20%);  
    color: #fff;
}

#system .w3-container
{
    background-color: hsl(0, 20%, 60%);  
    color: #fff;
}


.aj-kunde, .aj-paket, .aj-rolle 
{
    background-color: hsl(0, 20%, 90%);
    color: #000;
}
*/

.aj-kunde .aj-aktiv header {
    background-color: green;
}

.aj-helpbox {
      padding: 0px 0px;
      /* border-radius: 8px; */
      text-align: left;
      margin: 20px 0;
    }
.aj-helpbox ul {
  padding-left: 0;
  margin-left: 0;
  list-style-position: inside;
}

/* Button-Stil */
.aj-help {
      background: #f0f4f9;
      /* border-left: 4px solid #4d636f; */
      border-right: 4px solid #4d636f;
      padding: 20px 24px;
      /* border-radius: 8px; */

      margin: 20px 0;
    }
.aj-help .btnDiagramm {
    background-color: #4d636f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 100px;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    line-height: 1.1em;
    text-decoration: none; /* entfernt Unterstreichung */
    margin-left: 8px; /* kleiner Abstand zum Text */
    display: inline-block;
}

.aj-help .btnDiagramm:hover,
.btnDiagramm:focus {
    background-color: #3b4d56;
    outline: none;
    text-decoration: none;
}

/* Unsichtbare Tabelle */
.aj-help table {
    font-size: large;
    width: 100%;
    border-collapse: collapse;
}

.aj-help td {
    padding: 6px 10px;
    vertical-align: top;
}

.aj-help td:first-child {
    font-weight: bold;
    width: 160px; /* feste Breite für Spalte der Begriffe */
    white-space: nowrap;
}

.aj-home {
    float : right;
    color: var(--background-color-d1) !important
}


.aj-kommentar {
    color: var(--color);
    background-color: var(--background-color);
    padding: 2px;
    border-right: 8px solid rgb(53, 139, 0);
}

.aj-margin-left {
    margin-left: 4rem !important;
}

.aj-cli-name {
    padding-left: 8px;
}

/* Corner ribbon for inactive status */
.aj-ribbon-left {
    position: absolute;
    top: 20px;
    left: -35px;
    width: 120px;
    padding: 6px 0;
    background: #c41e3a;
    color: #fff;
    text-align: center;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Email redirect indicator */
.aj-redirect-info {
    color: #c41e3a;
}

/* ============================================================================ */
/* QUALIFICATION STATUS VIEWS                                                    */
/* ============================================================================ */

/* --- Action Buttons --- */
.aj-action-btn {
    width: 120px !important;
    text-align: center !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
}

/* --- Qualification Status Table --- */
.qual-status-table {
    display: table !important;
    width: 1200px !important;
    table-layout: fixed !important;
    border-collapse: collapse;
    margin-top: 16px;
    padding: 0 !important;
}
.qual-status-table thead tr {
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
}
.qual-status-table th {
    padding: 10px 12px;
    font-weight: 600;
    color: #555;
    text-align: left;
    background: transparent;
}
.qual-status-table td {
    padding: 4px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.qual-status-table tbody tr:last-child td {
    border-bottom: none;
}
/* Fixed column widths in pixels for consistent alignment across cards */
.qual-status-table th:nth-child(1),
.qual-status-table td:nth-child(1) { width: 150px !important; }  /* Status */
.qual-status-table th:nth-child(2),
.qual-status-table td:nth-child(2) { width: 600px !important; }  /* Qualifikation */
.qual-status-table th:nth-child(3),
.qual-status-table td:nth-child(3) { width: 150px !important; }  /* Modus */
.qual-status-table th:nth-child(4),
.qual-status-table td:nth-child(4) { width: 150px !important; }  /* Teilnahme */
.qual-status-table th:nth-child(5),
.qual-status-table td:nth-child(5) { width: 150px !important; }  /* Gültig bis */
.qual-status-table th:nth-child(6),
.qual-status-table td:nth-child(6) { width: 150px !important; text-align: center !important; }  /* Aktion */

/* --- Qualification Status Card --- */
.qual-card {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    background: #fff;
    margin-bottom: 20px;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s ease;
}
.qual-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
}
.qual-card-header {
    background-color: var(--background-color);
    padding: 16px 20px;
    color: var(--color);
    border-bottom: 1px solid var(--background-color-d1);
}
.qual-card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.qual-card-name {
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--color);
}
.qual-card-dept {
    font-weight: 500;
    color: var(--color);
    opacity: 0.9;
    margin-left: 6px;
}
.qual-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.3);
}
.qual-card-meta-item {
    color: var(--color);
    opacity: 0.9;
}
.qual-card-meta-item span {
    font-weight: 600;
    color: var(--color);
    opacity: 1;
}
.qual-card-body {
    padding: 16px 20px;
}
.qual-empty-message {
    color: #888;
    font-style: italic;
    padding: 16px;
    text-align: center;
    background: #fafafa;
    border-radius: 6px;
    margin-top: 12px;
}

/* --- Qualification Info Sections (Card Body) --- */
.qual-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (min-width: 900px) {
    .qual-info-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.qual-info-section,
.qual-info-section-full {
    background: #f8f9fb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.qual-info-section-full {
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}
.qual-info-section h4,
.qual-info-section-full h4 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: #444;
}
.qual-info-section-full h4 {
    margin-bottom: 0.75rem;
}
.qual-info-section-full .qual-status-table {
    margin: 0;
    width: 100% !important;
}

/* --- Qualification Badges --- */
.qual-badge {
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 1em;
    font-weight: 500;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}
.qual-badge-fehlend {
    background-color: var(--status-fehlend-bg);
    color: var(--status-fehlend-text);
}
.qual-badge-abgelaufen {
    background-color: var(--status-abgelaufen-bg);
    color: var(--status-abgelaufen-text);
}
.qual-badge-gueltig {
    background-color: var(--status-gueltig-bg);
    color: var(--status-gueltig-text);
}

/* Hover effects for clickable badges */
a.qual-badge {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.qual-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
a.qual-badge:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* --- List View Cells --- */
.qual-list-cell {
    padding: 6px 8px;
    height: 48px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    border-bottom: 1px solid #ccc;
    color: #000;
}
.qual-list-cell-action {
    justify-content: flex-start;
}
.qual-list-cell.fehlend { background-color: var(--status-fehlend-bg); }
.qual-list-cell.in-bearbeitung { background-color: var(--status-in-bearbeitung-bg); }
.qual-list-cell.abgelaufen { background-color: var(--status-abgelaufen-bg); }
.qual-list-cell.gueltig { background-color: var(--status-gueltig-bg); }
.qual-list-cell.hover-active {
    background-color: var(--status-hover-bg) !important;
    color: #fff !important;
}

/* --- Card Table Rows --- */
.qual-row {
    color: #000;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.qual-row td {
    vertical-align: middle;
}
.qual-row-fehlend { background-color: var(--status-fehlend-bg); }
.qual-row-in-bearbeitung { background-color: var(--status-in-bearbeitung-bg); }
.qual-row-abgelaufen { background-color: var(--status-abgelaufen-bg); }
.qual-row-gueltig { background-color: var(--status-gueltig-bg); }
.qual-row:hover {
    background-color: var(--status-hover-bg) !important;
    color: #fff !important;
}

/* --- Action Button Hover --- */
.aj-action-btn:hover {
    background-color: #fff !important;
    color: #000 !important;
}

/* ============================================================================ */
/* PAGINATION                                                                    */
/* ============================================================================ */

/* --- Show More Button --- */
.show-more-container {
    text-align: center;
    padding: 20px 12px;
    background: linear-gradient(to bottom, #f8f9fa, #f0f1f2);
    border-top: 1px dashed #ddd;
    margin-top: 10px;
    clear: both;
}
.show-more-btn {
    background: transparent;
    color: var(--background-color);
    border: 2px solid var(--background-color);
    padding: 10px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 260px;
    text-decoration: none;
}
.show-more-btn:hover {
    background: var(--background-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.show-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.show-more-btn i { transition: transform 0.2s ease; }
.show-more-btn:hover i.fa-chevron-down { transform: translateY(2px); }
.show-more-btn:hover i.fa-chevron-up { transform: translateY(-2px); }
.show-more-btn.compact {
    background: transparent;
    color: #666;
    border-color: #ccc;
    margin-left: 12px;
}
.show-more-btn.compact:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
}
.show-more-btn.load-all {
    background: var(--background-color);
    color: var(--color);
    border-color: var(--background-color);
    margin-right: 12px;
}
.show-more-btn.load-all:hover {
    background: var(--background-color-l2);
    border-color: var(--background-color-l2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.htmx-request .show-more-btn {
    opacity: 0.7;
    pointer-events: none;
}
.htmx-request .show-more-btn::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================ */
/* TEILNAHMEN PAGE                                                               */
/* ============================================================================ */

/* --- Expired Card (yellow left border) --- */
.aj-card.expired-card {
    border-left: 4px solid #FFEB3B;
}

/* ============================================================================ */
/* PERSON CARD                                                                   */
/* ============================================================================ */

/* --- Card Container --- */
div.aj-card.aj-obj.aj-person-card {
    height: 24rem !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Birthday Badge --- */
.aj-birthday-badge {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: #fff;
    text-align: center;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 0.85rem;
    margin: -8px -16px 8px -16px;
}

/* --- Person Data Table --- */
.aj-person-data {
    flex: 0 0 auto;
    height: 13rem;
    overflow: hidden;
}

.aj-person-data table {
    width: 100%;
    table-layout: fixed;
}

.aj-person-data tr {
    height: 1.8rem;
}

.aj-person-data th {
    width: 6rem;
    padding-right: 8px;
    vertical-align: top;
    white-space: nowrap;
}

.aj-person-data td {
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Action Buttons --- */
.aj-person-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.aj-person-btn {
    flex: 0 1 135px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.9em;
    border-radius: 8px;
    background: var(--background-color);
    color: var(--color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.aj-person-btn:hover {
    background-color: darkgray;
    color: #000;
}

/* Compact dropdown buttons */
.aj-person-actions-compact {
    display: flex;
    gap: 8px;
    flex: 1;
}

.aj-person-actions-compact .w3-dropdown-hover {
    flex: 1;
    min-width: 0;
}

.aj-person-actions-compact .aj-person-btn {
    width: 100%;
    font-size: 0.85em;
    border: none;
    cursor: pointer;
}

.aj-person-actions-compact .aj-person-btn i {
    flex: 0 0 auto;
}

.aj-person-actions-compact .aj-person-btn span {
    flex: 1;
    text-align: center;
}

.aj-person-actions-compact .aj-person-btn i:last-child {
    margin-left: auto;
}

.aj-person-btn:hover i {
    color: #fff;
}

.aj-person-btn i {
    flex: 0 0 1.5em;
    font-size: 1.5em;
    text-align: center;
}

.aj-person-btn span {
    flex: 1;
    text-align: left;
}

/* ============================================================================ */
/* QUALIFICATION STATUS PDF BUTTONS                                             */
/* ============================================================================ */

/* --- Container --- */
.qual-pdf-actions {
    display: flex;
    gap: 8px;
}

/* --- Base Button --- */
.qual-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 0.9em;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 95px;
    background: #fff;
    color: #333;
}

/* --- Icon Styling --- */
.qual-pdf-btn i {
    flex: 0 0 1.2em;
    font-size: 1.2em;
    text-align: center;
    color: #333;
}

.qual-pdf-btn > span:not(.qual-pdf-count) {
    flex: 1;
    text-align: left;
}

/* --- Hover States --- */
.qual-pdf-btn:hover {
    background: var(--background-color-d4);
    color: #fff;
}

.qual-pdf-btn:hover i {
    color: #fff;
}

/* --- Card Override (wider buttons in qual-card) --- */
.qual-card .qual-pdf-btn {
    width: 120px;
}

/* --- Search Components --- */
.aj-search-container {
    position: relative;
}

.aj-search-container .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.aj-search-container input {
    padding-left: 36px;
}

.aj-search-container:focus-within .search-results {
    display: block;
}

.search-results {
    display: none;
    position: absolute;
    /* --- BREITE HIER FESTLEGEN --- */
    width: 100%;            /* Standard: so breit wie das Input */
    min-width: 300px;       /* Optional: Verhindert, dass sie zu schmal wird */
    
    background-color: white; /* Wichtig: Vollflächig weiß, damit nichts durchscheint */
    border: 1px solid #ccc;
    
    /* --- ÜBERLAGERUNG SCHÜTZEN --- */
    z-index: 9999;          /* Sehr hoher Wert, damit es über ALLEM liegt */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Erzeugt Schatten über darunterliegende Hover-Flächen */
    
    max-height: 400px;      /* Verhindert, dass die Liste den Bildschirm sprengt */
    overflow-y: auto;       /* Scrollbar, falls max-height erreicht wird */
    margin-top: 2px;        /* Kleiner Abstand zum Input-Feld */
}

/* Verhindert, dass die Suchergebnisse angezeigt werden, wenn sie leer sind */
.search-results:empty {
    display: none !important;
}

.search-result-item {
    display: block;
    padding: 0.5em;
    text-decoration: none;
    color: #4d636f !important;
    min-width: 100%;
}

.search-result-item:hover {
    background-color: #f0f0f0;
}

/* --- Animations --- */
.fadein-title {
    color: rgb(77,99,111);
    padding: 15px 25px;
    border-radius: 100px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.3s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Ampelsystem (Traffic Light System) --- */
.ampel-red {
    border-bottom: 4px solid #f44336;
    background-color: transparent !important;
    box-shadow: none !important;
}
.ampel-yellow {
    border-bottom: 4px solid #FFEB3B;
    background-color: transparent !important;
    box-shadow: none !important;
}
.ampel-green {
    border-bottom: 4px solid #8BC34A;
    background-color: transparent !important;
    box-shadow: none !important;
    padding-bottom: 4px;
}
.ampel-blue {
    border-bottom: 4px solid #2196F3;
    padding-bottom: 4px;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* --- Toggle Switch --- */
.aj-switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 28px;
}

.aj-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.aj-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 28px;
    box-shadow: 1px 1px 6px rgba(0,0,0,0.3);
    transition: background-color 0.4s;
}

.aj-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.4s;
}

.aj-switch input:checked + .aj-slider:before {
    transform: translateX(42px);
}

.aj-filter-label-left,
.aj-filter-label-right {
    font-size: 1.2rem;
    white-space: nowrap;
}

/* --- Utility Classes --- */
.aj-margin-left-1 {
    margin-left: 1rem !important;
}

.aj-flex-center {
    display: flex;
    justify-content: center;
}

.aj-flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.aj-flex-align-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.aj-admin-card-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.3rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.75rem;
    background-color: #ffd41670;
}

/* --- Help/Explanation Step Numbers --- */
.aj-step-number {
    background-color: rgb(77,99,111);
    color: white;
    padding: 3px 7px;
    border-radius: 10px;
    display: inline-block;
    line-height: 1;
}

.aj-role-badge {
    background-color: rgb(158, 125, 62);
    color: white;
    padding: 3px 7px;
    border-radius: 4px;
    display: inline-block;
}

.aj-role-mitarbeiter {
    background-color: rgb(167, 80, 80);
}

.aj-role-system {
    background-color: rgb(47, 165, 228);
}

.aj-help-table td {
    padding-left: 50px;
}

.aj-help-table td:first-child {
    padding-left: 0;
}

/* --- Common UI Utilities --- */
.visually-hidden {
    border: 0 !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
}

/* --- Table Sorting --- */
.sort-arrow {
    font-size: 0.8em;
    color: rgba(255,255,255,0.5);
    margin-left: 5px;
}

.sort-arrow.active {
    color: #0ce910; /* grün für aktive Spalte */
    border-color: #0ce910;
    border-width: 1px;
    border-style: solid;
}

th:hover .sort-arrow {
    color: #fff;
}

th.aj-sortable, th.aj-sortable-header, .aj-list table th {
    cursor: pointer;
    user-select: none;
}

/* --- GHS Grid --- */
.ghs-grid ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ghs-grid li {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* --- Form Elements --- */
.aj-input-full {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: block;
    box-sizing: border-box;
}

/* --- Material & Question Cards --- */
.material-card, .question-card {
    box-sizing: border-box;
    background: var(--w3-theme-l2, #eef6ff);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    max-width: 760px;
    width: 100%;
}

.question-card {
    background: var(--w3-theme-l4, #f7f7f7);
}

.question-card textarea {
    width: 100%;
    resize: vertical;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.solution-row {
    display: flex;
    gap: 0.5rem;
    align-items: start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.solution-checkbox {
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 auto;
    margin-top: 0.25rem;
}

.solution-text {
    flex: 1 1 320px;
    min-width: 220px;
}

.help-text {
    font-size: 0.9rem;
    color: #444;
}

@media (max-width: 420px) {
    .solution-row {
        flex-direction: column;
        align-items: stretch;
    }
    .solution-row .solution-checkbox {
        margin-top: 0;
    }
}

.material-card.loaded {
    background: #f7f7f7;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.card-header h4 {
    margin: 0;
    font-size: 1rem;
}

/* --- Forms in Cards --- */
.delete-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.delete-label input[type="checkbox"] {
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 auto;
}

.material-card input[type="text"],
.material-card input[type="file"],
.material-card textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* --- Custom File Upload --- */
input[type="file"].hidden-file {
    display: none;
}

.custom-file-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 16rem;
    padding: 8px 10px;
    color: #fff;
    background-color: var(--background-color, darkgreen);
    cursor: pointer;
    text-align: center;
    border-radius: 6px;
    border: none;
    text-decoration: none;
}

.custom-file-upload:hover,
.custom-file-upload:focus {
    background-color: #0056b3;
    outline: none;
}

.file-info {
    display: inline-block;
    margin-left: 0.75rem;
    font-size: 0.95rem;
    color: #222;
    vertical-align: middle;
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aj-icon-sm {
    width: 25px !important;
}

.aj-modal-content-lg {
    max-width: 1000px !important;
    margin-top: 50px !important;
}

.aj-scroll-y-70 {
    max-height: 70vh !important;
    overflow-y: auto !important;
}

/* --- Layout Sections --- */
.aj-jobprofile-section {
    overflow: auto;
    padding-bottom: 1rem;
}

.aj-form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

@media (max-width: 520px) {
    .custom-file-upload { width: 100%; }
    .file-info { display: block; margin-left: 0; margin-top: 0.5rem; }
}

/* --- Layout Variables & Base Styles --- */
:root {
    --customerbar-height: 32px;
    --topbar-height: 64px;
    --glass-bg: rgba(255,255,255,0.06);
    --glass-border: rgba(255,255,255,0.08);
    --accent: #2f8fbd;
    --muted: #f6f8fa;
    --shadow: 0 6px 18px rgba(12,20,30,0.12);
    --radius: 12px;
    --breakpoint-sm: 900px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* --- Topbar --- */
.topbar {
    position: fixed;
    top: var(--customerbar-height);
    left: 0;
    right: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    z-index: 999;
    backdrop-filter: blur(8px) saturate(120%);
    background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.30));
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.topbar .brand {
    display:flex;
    align-items:center;
    gap:12px;
    min-width: 180px;
}
.brand img { height:36px; display:block; }
.brand .brand-name { font-weight:600; letter-spacing:0.2px; color:#123; font-size:1rem; }

/* --- Navigation --- */
.topnav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    justify-content: center;
}

.topnav a, 
.topnav .nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #21343a;
    font-weight: 500;
    transition: all 160ms ease;
    font-size: 1.05rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    justify-content: center;
    box-sizing: border-box;
    min-width: 150px;
    margin: 0 6px;
}

.topnav .nav-link-btn {
    min-width: 200px !important;
}

.topnav a:hover,
.topnav .nav-link-btn:hover {
    background: rgba(47,143,189,0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(47,143,189,0.06);
    outline: none;
}

.topnav a i {
    margin-right: 6px;
}

/* --- Top Actions & User Pill --- */
.top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(47,143,189,0.08);
    border: none;
    outline: none;
    box-shadow: 0 4px 4px rgba(10,20,30,0.08);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.user-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10,20,30,0.08);
}

.user-pill .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6ec1e4);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Badges & Tags --- */
.nav-badge {
    display: inline-block;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    margin-left: 4px;
}

.nav-badge.red { background: #f44336; color: white; }
.nav-badge.green { background: #4CAF50; color: white; }
.nav-badge.blue { background: #2196F3; color: white; }

.admin-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffeeee;
    color: #b22;
    font-size: 12px;
    margin-left: 8px;
}

.badge-in-arbeit {
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 0.7em;
    color: #fff;
    background-color: #f39c12;
    border-radius: 4px;
    white-space: nowrap;
}

/* --- Dropdowns --- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(var(--topbar-height) + 10px);
    min-width: 210px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(10,20,30,0.12);
    overflow: hidden;
    transform-origin: top right;
    transition: transform 160ms cubic-bezier(.2,.9,.2,1), opacity 140ms ease;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.dropdown-menu a, 
.dropdown-menu form {
    display: block;
    padding: 0;
    margin: 0;
    color: #223;
    text-decoration: none;
    font-weight: 500;
}

.dropdown-menu a {
    padding: 12px 14px;
}

.dropdown-menu a:hover,
.dropdown-menu .dropdown-link:hover,
.dropdown-menu .dropdown-link:focus {
    background: #f6f8fa;
    outline: none;
}

.dropdown-menu .dropdown-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

#mgmtMenu {
    right: auto !important;
    left: 0;
    top: 50px;
    transform-origin: top left;
    min-width: 100%;
    width: max-content;
    white-space: nowrap;
}

/* --- Mobile Menu --- */
.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: calc(var(--customerbar-height) + var(--topbar-height));
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    z-index: 900;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    color: #223;
    font-weight: 600;
}

/* --- Layout & Footer --- */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.w3-main {
    flex: 1 0 auto;
    padding: 20px;
    margin-top: calc(var(--customerbar-height) + var(--topbar-height) + 12px);
}

.customer-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    background: #263238;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    z-index: 1000;
}

.customer-bar .customer-label {
    opacity: 0.7;
    font-weight: 500;
}

.customer-bar .customer-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

footer {
    flex-shrink: 0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #263238;
    color: #fff;
    font-size: 14px;
}

footer a {
    color: #fff;
    text-decoration: underline;
    margin: 0 6px;
}

.nav-link.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.help-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    min-width: 90px;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 900px) {
    .topnav { display: none !important; }
    .hamburger { display: flex !important; }
    .brand .brand-name, 
    .text-hide-sm { display: none !important; }
    .topbar { 
        padding: 0 10px; 
        justify-content: space-between; 
    }
    .top-actions { margin-left: 0; }
    .user-pill { padding: 6px; gap: 4px; }
    .user-pill i { margin-left: 2px; }
    footer { 
        flex-direction: column; 
        text-align: center !important; 
        gap: 12px; 
    }
    footer div { text-align: center !important; }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .topnav a { padding: 9px 12px; font-size: 0.95rem; }
}

/* --- Dropdown Adjustments --- */
.aj-dropdown .w3-dropdown-content {
    min-width: 0 !important;
    width: auto !important;
}

.aj-dropdown .w3-dropdown-content a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #000;
}

.aj-dropdown .w3-dropdown-content a:hover {
    background-color: #607d8b;
    color: #fff;
}

/* --- Admin & Special Elements --- */
.aj-admin-header {
    background-color: #f44336;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
}

.aj-btn-plus {
    color: white;
    background-color: #5E7D8D;
    padding: 3px 5px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* --- Participation / Quiz Styles --- */
.aj-checkbox-large {
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: top;
    margin-top: 5px;
    margin-left: 10px;
    margin-right: 10px;
}

.aj-tab-answered {
    background-color: #FFA500 !important;
    color: black !important;
}

.aj-action-bar {
    bottom: 0;
    padding: 1rem;
    text-align: left;
}

.aj-badge-accent {
    padding: 2px 8px;
    color: white;
    background-color: #5E7D8D;
    border-radius: 8px;
    margin-right: 5px;
    display: inline-block;
}

.aj-info-box {
    display: inline-block;
    color: #333232;
    padding: 10px 20px;
    border-width: 1px;
    font-size: 1.3rem;
    line-height: 1.4;
    margin-left: 2rem;
}

/* --- More Utilities --- */
.aj-text-center {
    text-align: center !important;
}

.aj-btn-icon-shadow {
    width: 3em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.aj-card-fixed-height {
    min-height: 12rem;
}

.aj-card-scrollable {
    max-height: 20rem;
    overflow: auto;
}

.aj-shadow-sm {
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
}

/* --- State & Badge Utilities --- */
.aj-in-arbeit {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.aj-badge-in-arbeit {
    margin-left: 10px;
    padding: 3px 8px;
    font-size: 0.8em;
    color: #fff;
    background-color: #f39c12;
    border-radius: 4px;
    display: inline-block;
}

/* --- Print Utilities --- */
@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    
    /* Selective Print: hides everything except these */
    .aj-print-selective body * { visibility: hidden; }
    .aj-print-selective .aj-print-target, 
    .aj-print-selective .aj-print-target * { visibility: visible; }
    .aj-print-selective .aj-print-target { position: absolute; top: 0; left: 0; }
}

.print-only {
    display: none;
}

/* --- Info Boxes --- */
.aj-info-box-yellow {
    display: inline-block;
    color: black;
    background-color: #fffb04;
    border-radius: 10px;
    font-size: 1.2rem;
    line-height: 1.4;
    padding: 8px 15px;
}

/* --- Authentication & Registration Styles --- */
.aj-auth-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    background: transparent !important;
}

.aj-auth-content {
    max-width: 150rem !important;
    width: 90%;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    background: transparent !important;
    text-align: center;
}

.aj-auth-field {
    margin-bottom: 1.2em;
    width: 100%;
    max-width: 100rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.aj-auth-field label {
    margin-bottom: 0.5em;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.aj-auth-field input {
    display: block;
    margin: 0 auto;
    width: 25rem !important;
    max-width: 25rem !important;
    box-sizing: border-box;
    text-align: center;
}

.aj-auth-actions {
    text-align: center;
    margin-top: 1em;
}

.aj-auth-logo-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
}

.aj-auth-logo-top-right img {
    height: 70px;
}

.aj-auth-error {
    color: #f44336;
    font-weight: 600;
    display: block;
}

@media (max-width: 600px) {
    .aj-auth-content {
        padding: 0em;
    }
    .aj-auth-field input {
        width: 100% !important;
        max-width: none !important;
    }
}

/* --- Lernmaterial & Card Forms --- */
.aj-material-card {
    box-sizing: border-box;
    background: var(--w3-theme-l4, #f7f7f7);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    max-width: 760px;
    width: 100%;
}

.aj-material-card.loaded {
    background: var(--w3-theme-l4, #f7f7f7);
    box-shadow: 0 5px 10px rgba(0,0,0,0.06);
}

.aj-card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.aj-card-header-flex h4 {
    margin: 0;
    font-size: 1rem;
}

.aj-delete-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.aj-material-card input[type="text"],
.aj-material-card input[type="file"],
.aj-material-card textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.aj-material-card input[type="file"] {
    padding: 0.35rem;
}

.aj-help-text {
    font-size: 0.95rem;
    color: #444;
}

@media (max-width: 420px) {
    .aj-card-header-flex { flex-direction: column; align-items: stretch; gap: 0.25rem; }
    .aj-delete-label { margin-left: 0; justify-content: flex-end; }
}

/* --- Maintenance Data Grid & Layout --- */
.aj-data-grid {
    display: grid;
    grid-template-columns: auto 660px auto 1fr;
    column-gap: 1rem;
    align-items: center;
    margin-left: 2rem;
    margin-bottom: 0.75rem;
    white-space: nowrap; 
}

.aj-data-label {
    font-weight: 500;
    white-space: nowrap;
}

.aj-data-buttons {
    white-space: nowrap; 
}

.aj-data-buttons a {
    width: 150px;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.aj-btn-pill-yellow {
    padding: 2px 0px;
    border-radius: 100px;
    background-color: #ffd41670;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: center;
}

@media (max-width: 1200px) {
    .aj-data-grid {
        grid-template-columns: auto 1fr;
        row-gap: 0.5rem;
    }
    .aj-data-grid > div:nth-child(2) {
        max-width: 100%;
    }
}

/* --- Data Import & Excel Preview --- */
.aj-import-container {
    max-width: 100%;
    padding: 0 20px;
}

.aj-import-header {
    background: linear-gradient(135deg, var(--background-color) 0%, var(--background-color-d2) 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.aj-import-header h1 {
    margin: 0;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aj-file-info-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.aj-file-info-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.aj-file-info-label {
    font-weight: 600;
    color: #555;
    width: 150px;
    flex-shrink: 0;
}

.aj-file-info-value {
    flex: 1;
    color: #333;
}

.aj-status-banner {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.aj-status-banner.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.aj-status-banner.warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffcc80;
    color: #e65100;
}

.aj-status-banner.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #ef9a9a;
    color: #c62828;
}

.aj-btn-load {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: white !important;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.aj-btn-load:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.aj-sheet-section {
    margin: 25px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.aj-sheet-header {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aj-sheet-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.aj-sheet-badge.new { background: #e8f5e9; color: #2e7d32; }
.aj-sheet-badge.modified { background: #e3f2fd; color: #1565c0; }
.aj-sheet-badge.error { background: #ffebee; color: #c62828; }

.aj-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.aj-sheet-table th {
    background: #fafafa;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.aj-sheet-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.aj-sheet-table tr.row-error { background: #fff5f5; }
.aj-sheet-table tr.row-new { background: #f1f8e9; }
.aj-sheet-table tr.row-modified { background: #e3f2fd; }

.aj-status-cell { font-weight: 600; white-space: nowrap; }
.aj-status-cell.error { color: #c62828; }
.aj-status-cell.new { color: #2e7d32; }
.aj-status-cell.modified { color: #1565c0; }

.aj-cell-error {
    display: block;
    color: #c62828;
    font-size: 0.85em;
    margin-top: 4px;
    padding: 3px 6px;
    background: #ffebee;
    border-radius: 3px;
}

.aj-error-summary {
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 15px;
}

.aj-form-error { background-color: #ffebee !important; color: #c62828 !important; }
.aj-form-error .errorlist { color: #c62828; }

/* inaktiv/geplant badges */
.aj-status-badge {
    font-size: 13px;
    display: inline-block;
    width: 60px;
    text-align: center;
    margin-right: 6px;
}
.aj-status-badge-sm { font-size: 10px; }

/* orange ribbon for geplant */
.aj-ribbon-planned { background: #ff9800; }

.aj-legend {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.aj-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #666;
}

.aj-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.aj-legend-color.new { background: #c8e6c9; }
.aj-legend-color.modified { background: #bbdefb; }
.aj-legend-color.error { background: #ffcdd2; }

.aj-done-summary {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.aj-done-sheets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.aj-done-sheet-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #4caf50;
    min-width: 200px;
    max-width: 280px;
    flex: 0 0 auto;
}

/* --- Custom Fields Help --- */
.aj-custom-fields-help {
    background: #fdf2f8;
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
}

.aj-custom-fields-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.aj-custom-fields-help-header h4 {
    margin: 0;
    font-size: 0.95em;
    color: #be185d;
    font-weight: 600;
}

.aj-custom-fields-help-header .toggle-icon {
    color: #666;
    transition: transform 0.2s;
}

.aj-custom-fields-help-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.aj-custom-fields-help-content {
    margin-top: 12px;
}

.aj-custom-field-info {
    background: white;
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 10px;
}

.aj-custom-field-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.aj-custom-field-badge.required { background: #ffebee; color: #c62828; }
.aj-custom-field-badge.optional { background: #e3f2fd; color: #1565c0; }
.aj-custom-field-badge.type { background: #f3e5f5; color: #7b1fa2; }

.aj-custom-field-details {
    font-size: 0.85em;
    color: #555;
}

.aj-custom-field-details-row {
    display: flex;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}

.aj-custom-field-details-label {
    width: 100px;
    color: #777;
    flex-shrink: 0;
}

.aj-custom-field-details-value {
    flex: 1;
    color: #333;
}

.aj-custom-field-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.aj-custom-field-option {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #555;
}

.aj-custom-field-example {
    font-style: italic;
    color: #666;
    background: #fafafa;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ---------------------------------------------------------------------------------- */
/* Authentication Design System                                                       */
/* ---------------------------------------------------------------------------------- */

.aj-auth-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.aj-auth-content {
    max-width: 150rem !important;
    width: 90%;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
}

.aj-auth-content h2 {
    text-align: center;
    margin-bottom: 1em;
}

.aj-auth-field {
    margin-bottom: 1.2em;
    width: 100%;
    max-width: 100rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.aj-auth-field label {
    margin-bottom: 0.5em;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.aj-auth-field input,
.aj-auth-field input.w3-input {
    width: 25rem !important;
    max-width: none !important;
    text-align: center !important;
}

.aj-auth-actions {
    text-align: center;
    margin-top: 1.5em;
}

.aj-auth-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
}

.aj-auth-top-right img {
    height: 70px;
}

@media (max-width: 600px) {
    .aj-auth-content {
        padding: 0em;
    }
}

/* ---------------------------------------------------------------------------------- */
/* Inventory & Custom Fields                                                         */
/* ---------------------------------------------------------------------------------- */

.aj-custom-field-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--background-color-l4);
}

.aj-custom-field-row:last-child {
    border-bottom: none;
}

.aj-custom-field-label {
    width: 180px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.aj-custom-field-label .required {
    color: #c62828;
}

.aj-custom-field-input {
    flex: 1;
    max-width: 400px;
}

.aj-custom-field-input input,
.aj-custom-field-input select,
.aj-custom-field-input textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--background-color-l3);
    border-radius: 3px;
    font-size: 14px;
    background: white;
}

.aj-custom-field-input input:focus,
.aj-custom-field-input select:focus,
.aj-custom-field-input textarea:focus {
    outline: none;
    border-color: var(--background-color);
}

.aj-custom-field-input input[type="checkbox"] {
    width: auto;
}

.aj-empty-custom-fields {
    text-align: center;
    padding: 16px;
    color: #888;
    font-style: italic;
}

/* ---------------------------------------------------------------------------------- */
/* Inventory Grid System                                                              */
/* ---------------------------------------------------------------------------------- */

:root {
    --aj-inv-sticky-top: calc(var(--customerbar-height) + var(--topbar-height));
}

.aj-inv-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: visible;
    position: relative;
    z-index: 1;
}

.aj-inv-sticky-header {
    position: sticky;
    top: var(--aj-inv-sticky-top);
    z-index: 20;
    background: transparent;
    border-radius: 8px 8px 0 0;
    overflow: visible;
}

.aj-inv-sticky-header.is-stuck {
    background: transparent;
    box-shadow: none;
    border-bottom: none;
}

.aj-inv-header {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 0 0 #eeeeee;
}

.aj-inv-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.aj-inv-badge {
    background: linear-gradient(135deg, var(--background-color-l3) 0%, var(--background-color-l4) 100%);
    color: var(--background-color-d2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid var(--background-color-l2);
}

.aj-inv-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aj-inv-load-all-btn {
    background: var(--background-color);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.aj-inv-load-all-btn:hover {
    background: var(--background-color-d1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.aj-inv-thead-clone {
    display: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

.aj-inv-thead-clone > div {
    margin: 0 !important;
    padding: 0 !important;
}

.aj-inv-thead-clone table {
    margin: 0 !important;
    border-spacing: 0;
}

.aj-inv-table-container {
    overflow-x: auto;
}

.aj-inv-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9em;
    table-layout: auto;
}

.aj-inv-table th,
.aj-inv-table td {
    box-sizing: border-box;
}

.aj-inv-table th {
    background: #fafafa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
}

.aj-inv-table th .sort-arrow {
    color: #8c97ab;
    margin-left: 5px;
}

.aj-inv-table th:hover .sort-arrow { color: #555; }
.aj-inv-table th.asc .sort-arrow,
.aj-inv-table th.desc .sort-arrow { color: var(--background-color); }

/* Fixed column widths: Inventarnummer | Bezeichnung | Person | Bereich | Standort | Kommentar */
.aj-inv-table th:nth-child(1), .aj-inv-table td:nth-child(1) { width: 150px; min-width: 150px; max-width: 150px; }
.aj-inv-table th:nth-child(2), .aj-inv-table td:nth-child(2) { width: 240px; min-width: 240px; max-width: 240px; }
.aj-inv-table th:nth-child(3), .aj-inv-table td:nth-child(3) { width: 150px; min-width: 150px; max-width: 150px; }
.aj-inv-table th:nth-child(4), .aj-inv-table td:nth-child(4) { width: 120px; min-width: 120px; max-width: 120px; }
.aj-inv-table th:nth-child(5), .aj-inv-table td:nth-child(5) { width: 120px; min-width: 120px; max-width: 120px; }
.aj-inv-table th:nth-child(6), .aj-inv-table td:nth-child(6) { width: 240px; min-width: 240px; max-width: 240px; }

.aj-inv-table th.aj-custom-field-col,
.aj-inv-table td.aj-custom-field-col {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    white-space: nowrap;
    overflow: visible;
}

.aj-inv-table th.aj-custom-field-col {
    background: #fff9c4;
    color: #7b6b00;
}

.aj-inv-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.aj-inv-table td.aj-custom-field-col {
    background: #fffde7;
    overflow: visible;
    text-overflow: clip;
}

.aj-inv-table td.aj-empty { 
    color: #999; 
}

.aj-inv-table tr:hover { 
    background: #f5f5f5; 
}

.hidden-row {
    display: none !important;
}

/* ---------------------------------------------------------------------------------- */
/* Custom Field Management (Inventartyp Form)                                         */
/* ---------------------------------------------------------------------------------- */

.aj-cf-card {
    background: white;
    border: 1px solid var(--background-color-l3);
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 12px;
}
.aj-cf-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.aj-cf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--background-color-l4);
}

.aj-cf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.aj-cf-item label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}
.aj-cf-item input,
.aj-cf-item select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--background-color-l3);
    border-radius: 3px;
    font-size: 14px;
}
.aj-cf-item input:focus,
.aj-cf-item select:focus {
    outline: none;
    border-color: var(--background-color);
}
.aj-cf-name-input { background-color: #e9ecef; color: #6c757d; cursor: not-allowed; }
.aj-cf-name-input.error { border-color: red !important; }

.aj-cf-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    margin-top: -2px;
}
.aj-cf-checkbox-wrapper input[type="checkbox"] {
    width: 30px;
    height: 30px;
    cursor: pointer;
    accent-color: var(--background-color);
}
.aj-cf-checkbox-wrapper span { font-size: 14px; color: #333; line-height: 22px; }

.aj-cf-options-container {
    background: var(--background-color-l5);
    border: 1px solid var(--background-color-l4);
    border-radius: 3px;
    padding: 12px;
    margin-top: 12px;
}
.aj-cf-option-row { display: flex; gap: 8px; margin-bottom: 8px; }
.aj-cf-option-row input { flex: 1; }

.aj-cf-actions { display: flex; gap: 4px; }
.aj-cf-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background 0.2s;
}
.aj-cf-btn-icon:hover:not(:disabled) { background: var(--background-color-l4); }
.aj-cf-btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.aj-cf-btn-icon.delete:hover { background: #ffebee; color: #c62828; }

.aj-cf-empty-state { text-align: center; padding: 24px; color: #888; font-style: italic; }

/* ---------------------------------------------------------------------------------- */
/* Inventory Type Grid                                                                */
/* ---------------------------------------------------------------------------------- */

.aj-invtyp-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aj-invtyp-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.aj-invtyp-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.aj-invtyp-card-header {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.aj-invtyp-card-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}
.aj-invtyp-card-header h3 a {
    color: #333;
    text-decoration: none;
}
.aj-invtyp-card-header h3 a:hover { color: var(--background-color); }
.aj-invtyp-card-header .kurz {
    color: var(--background-color);
    font-weight: 700;
    margin-right: 8px;
}

.aj-invtyp-card-body { padding: 16px 18px; }

.aj-invtyp-info {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
    font-size: 0.9em;
}
.aj-invtyp-info-item { display: flex; flex-direction: column; }
.aj-invtyp-info-item.flex-grow { flex: 1; }
.aj-invtyp-info-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.aj-invtyp-info-value { color: #333; }

.aj-invtyp-cf-title {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.aj-invtyp-cf-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.aj-invtyp-cf-item {
    background: #fffde7;
    border: 1px solid #fff59d;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.85em;
    min-width: 180px;
}
.aj-invtyp-cf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.aj-invtyp-cf-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}
.aj-invtyp-cf-name .required { color: #c62828; margin-left: 2px; }
.aj-invtyp-cf-type {
    background: #f5f5f5;
    color: #666;
    font-size: 0.7em;
    padding: 3px 10px;
    border-radius: 12px;
}
.aj-invtyp-cf-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.aj-invtyp-cf-options span {
    background: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    border: 1px solid #ddd;
    color: #555;
}

/* ---------------------------------------------------------------------------------- */
/* Archived / Orphaned Data                                                           */
/* ---------------------------------------------------------------------------------- */

.aj-orphan-header-row,
.aj-orphan-field-row {
    display: grid;
    grid-template-columns: 120px 110px 90px 70px 50px 80px auto;
    gap: 12px;
}
.aj-orphan-header-row {
    padding: 8px 17px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}
.aj-orphan-field-row { align-items: center; }

.aj-orphan-field-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 16px;
    background: white;
}
.aj-orphan-field-card:hover { border-color: #ccc; }

.aj-orphan-col { display: flex; align-items: center; }
.aj-orphan-col-label { font-weight: 600; font-size: 14px; }
.aj-orphan-col-name, .aj-orphan-col-count, .aj-orphan-col-type { font-size: 13px; color: #666; }
.aj-orphan-col-name { color: #888; }
.aj-orphan-col-required { justify-content: center; font-size: 14px; color: #4CAF50; }
.aj-orphan-col-details { justify-content: center; margin-left: 20px; }
.aj-orphan-col-actions { justify-content: flex-end; gap: 6px; }

.aj-orphan-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.aj-orphan-btn-details { background: #f0f0f0; color: #333; }
.aj-orphan-btn-restore { background: #4CAF50; color: white; padding: 8px 10px; }
.aj-orphan-btn-delete { background: #f44336; color: white; padding: 8px 10px; }

.aj-orphan-details-content { display: none; margin-top: 12px; max-width: 400px; }
.aj-orphan-details-header { display: flex; padding: 8px 12px; background: #f8f8f8; font-weight: 500; font-size: 12px; color: #666; border-bottom: 1px solid #eee; }
.aj-orphan-details-list { list-style: none; padding: 0; margin: 0; }
.aj-orphan-details-list li { display: flex; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.aj-orphan-col-inv { width: 160px; color: var(--background-color); text-decoration: none; }
.aj-orphan-col-val { color: #555; }

/* ---------------------------------------------------------------------------------- */
/* Generic Modals                                                                     */
/* ---------------------------------------------------------------------------------- */

.aj-modal-centered {
    display: none;
    padding-top: 60px;
    padding-bottom: 40px;
}
.aj-modal-centered > div {
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}



  
/* --- Viewer Styles --- */  
.aj-viewer-body { margin: 0; padding: 0; height: 100%; width: 100%; overflow: hidden; }  
.aj-fullscreen-view { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; border: none; display: block; z-index: 1; }  
.aj-viewer-back-button { position: fixed; top: 10px; left: 10px; z-index: 2; } 
  
/* --- Control Question Form --- */  
.aj-kontroll-frage-block { margin-bottom: 2em; border: 1px solid #ccc; padding: 1em; }  
.aj-kontroll-frage-field { width: 200px; height: 30px; }  
.aj-kontroll-nummer-field { width: 60px; height: 30px; }  
.aj-kontroll-antwort-container { margin-left: 2em; }  
.aj-kontroll-antwort-form { margin-bottom: 0.5em; }  
.aj-kontroll-nowrap { white-space: nowrap; margin-right: 1em; } 
.aj-font-xbold { font-weight: 800; } 
  
/* === Inventartyp Card List === */  
.aj-invtyp-grid { display: flex; flex-direction: column; gap: 20px; }  
.aj-invtyp-card { background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; transition: box-shadow 0.2s ease; }  
.aj-invtyp-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }  
.aj-invtyp-card-header { background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%); padding: 14px 18px; border-bottom: 1px solid #e0e0e0; display: flex; align-items: center; justify-content: space-between; }  
.aj-invtyp-card-header h3 { margin: 0; font-size: 1.1em; font-weight: 600; }  
.aj-invtyp-card-header h3 a { color: #333; text-decoration: none; }  
.aj-invtyp-card-header h3 a:hover { color: var(--background-color); }  
.aj-invtyp-card-header .kurz { color: var(--background-color); font-weight: 700; margin-right: 8px; }  
.aj-invtyp-card-body { padding: 16px 18px; }  
.aj-invtyp-empty { text-align: center; color: #999; }  
.aj-invtyp-info { display: flex; gap: 24px; margin-bottom: 14px; font-size: 0.9em; }  
.aj-invtyp-info-item { display: flex; flex-direction: column; }  
.aj-invtyp-info-item.flex-grow { flex: 1; }  
.aj-invtyp-info-label { font-size: 0.75em; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }  
.aj-invtyp-info-value { color: #333; } 
.aj-invtyp-cf-title { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; padding-top: 12px; border-top: 1px solid #f0f0f0; }  
.aj-invtyp-cf-list { display: flex; flex-wrap: wrap; gap: 10px; }  
.aj-invtyp-cf-item { background: #fffde7; border: 1px solid #fff59d; border-radius: 6px; padding: 12px 14px; font-size: 0.85em; min-width: 180px; }  
.aj-invtyp-cf-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }  
.aj-invtyp-cf-name { font-weight: 600; color: #333; flex: 1; }  
.aj-invtyp-cf-name .required { color: #c62828; margin-left: 2px; }  
.aj-invtyp-cf-type { background: #f5f5f5; color: #666; font-size: 0.7em; padding: 3px 10px; border-radius: 12px; }  
.aj-invtyp-cf-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }  
.aj-invtyp-cf-options span { background: white; padding: 4px 10px; border-radius: 12px; font-size: 0.8em; border: 1px solid #ddd; color: #555; }  
.aj-invtyp-cf-options .more-options { background: #f0f0f0; color: #666; font-weight: 600; }  
.aj-invtyp-no-fields { color: #999; font-style: italic; font-size: 0.85em; } 

/* --- Navigation Card Grid (Startseite, Verwaltung, Sachmittel) --- */
.aj-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .aj-actions-grid { grid-template-columns: 1fr; }
}

.aj-card-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    text-decoration: none !important;
    color: #4d636f !important;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #eee;
    height: 100%;
}

.aj-card-nav:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    background-color: rgb(77, 99, 111);
}

.aj-card-nav:hover,
.aj-card-nav:hover h3,
.aj-card-nav:hover h4,
.aj-card-nav:hover p,
.aj-card-nav:hover b,
.aj-card-nav:hover .aj-card-nav-icon,
.aj-card-nav:hover .aj-card-nav-icon i {
    color: #ffffff !important;
}

.aj-card-nav-icon {
    font-size: 2.5rem;
    color: rgb(77,99,111);
    min-width: 80px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.aj-card-nav-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.aj-card-nav-content h3, .aj-card-nav-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.aj-card-nav-content p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.aj-card-nav-admin {
    background-color: #fdf7e3;
}

.aj-card-nav-system {
    border-left: 5px solid #f44336;
}

.aj-in-arbeit {
    opacity: 0.6;
    pointer-events: none;
}

.aj-badge-in-arbeit {
    margin-left: 10px;
    padding: 3px 8px;
    font-size: 0.8em;
    color: #fff;
    background-color: #f39c12;
    border-radius: 4px;
}

/* --- Utility Classes --- */
.aj-ml-auto { margin-left: auto !important; }
.aj-mr-auto { margin-right: auto !important; }
.aj-flex-center { display: flex; align-items: center; }
.aj-flex-center-gap { display: flex; align-items: center; gap: 8px; }
.aj-no-border { border: none !important; }
.aj-cursor-pointer { cursor: pointer !important; }
.aj-text-white { color: white !important; }
.aj-bg-red { background-color: #f44336 !important; }
.aj-bg-red-muted { background-color: #e2675e !important; }
.aj-min-w-120 { min-width: 120px !important; }
.aj-min-w-50 { min-width: 50px !important; }
.aj-ml-8 { margin-left: 8px !important; }
.aj-ml-16 { margin-left: 16px !important; }
.aj-ml-1rem { margin-left: 1rem !important; }
.aj-ml-1-2rem { margin-left: 1.2rem !important; }
.aj-ml-2rem { margin-left: 2rem !important; }

.aj-mt-12 { margin-top: 12px !important; }
.aj-mt-1rem { margin-top: 1rem !important; }

.aj-w-16rem { width: 16rem !important; }
.aj-w-full { width: 100% !important; }

.aj-text-red { color: #f44336 !important; }
.aj-text-darkred { color: darkred !important; }
.aj-bg-darkred { background-color: darkred !important; }

.aj-m-0 { margin: 0 !important; }
.aj-mb-8 { margin-bottom: 8px !important; }
.aj-mb-16 { margin-bottom: 16px !important; }
.aj-p-10-20 { padding: 10px 20px !important; }
.aj-py-20 { padding-top: 20px !important; padding-bottom: 20px !important; }

/* --- Table Utilities --- */
.aj-clickable-row { cursor: pointer; }
.aj-read-only-row { cursor: default; }

th.aj-sortable { cursor: pointer; position: relative; }
th.aj-sortable:hover { background-color: #ddd !important; }
.aj-sort-icon { color: #8c97ab; }

.aj-table-vcenter td { vertical-align: middle !important; }

/* --- Table Controls (Spalten button container) --- */
.aj-table-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* --- Column Settings (Hide/Show) --- */
.aj-column-settings {
    position: relative;
    display: inline-block;
}

.aj-column-settings-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.aj-column-settings-dropdown.show,
.aj-column-settings:hover .aj-column-settings-dropdown {
    display: block;
}

.aj-column-settings-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.aj-column-settings-item:hover {
    background: #f5f5f5;
}

.aj-column-settings-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.aj-column-reset-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 0.85em;
    color: #666;
}

.aj-column-reset-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* --- Column Resize --- */
.aj-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    background: transparent;
    border-right: 2px solid rgba(255,255,255,0.3);
}

.aj-resize-handle:hover {
    border-right: 3px solid rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
}

.aj-resize-handle.resizing {
    border-right: 3px solid var(--background-color-l3);
    background: rgba(255,255,255,0.2);
}

.aj-resizable-table {
    width: 100%;
}

.aj-resizable-table.aj-fixed-layout {
    table-layout: fixed;
}

.aj-resizable-table thead {
    position: sticky;
    top: calc(var(--customerbar-height) + var(--topbar-height));
    z-index: 10;
}

.aj-resizable-table th {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid rgba(255,255,255,0.2);
    padding-right: 12px;
    background: #000;
}

.aj-resizable-table th:last-child {
    border-right: none;
}

.aj-resizable-table th:last-child .aj-resize-handle {
    display: none;
}

.aj-col-hidden {
    display: none !important;
}

/* --- Scroll to Top Button --- */
.aj-scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--background-color);
    color: var(--color);
    border: none;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    z-index: 999;
}

.aj-scroll-top-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.aj-scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

/* --- Text Styles --- */
.aj-text-xs { font-size: 11px !important; }
.aj-text-sm { font-size: 0.9em !important; }
.aj-italic-grey { font-style: italic; color: #555; }

/* --- Layout --- */
.aj-flex-between { display: flex; align-items: center; justify-content: space-between; }
.aj-container-1200 { max-width: 1200px; margin: auto; }
.aj-container-1600 { max-width: 1600px; margin: auto; }

.aj-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
}
.aj-badge-red { background-color: #f44336 !important; color: white !important; }
.aj-badge-blue { background-color: #2196F3 !important; color: white !important; }
.aj-badge-gray { background-color: lightgray !important; color: #333 !important; }
.aj-badge-rounded { border-radius: 10px !important; }

/* --- Utility Classes --- */
.aj-font-500 { font-weight: 500 !important; }
.aj-bold { font-weight: bold !important; }
.aj-inline-block { display: inline-block !important; }
.aj-outline-none { outline: none !important; }
.aj-mt-2 { margin-top: 2px !important; }
.aj-mt-8 { margin-top: 8px !important; }
.aj-mb-0 { margin-bottom: 0px !important; }
.aj-mt-0 { margin-top: 0px !important; }
.aj-p-3-8 { padding: 3px 8px !important; }

/* --- Card Styles --- */
.aj-card-footer {
    padding: 8px 16px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 50px;
}

.aj-card-tag {
    margin: 1px 0 !important;
}

.aj-truncate-50 {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50px;
}

.aj-truncate-200 {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.aj-truncate-280 {
    /* z. B. für Card-Body */
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.aj-truncate-350 {
    /* z. B. für Card-Header */
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;

    /* Zentrierung des Blocks selbst */
    margin-left: auto;
    margin-right: auto;
    
    /* Zentrierung des Textes im Block */
    text-align: center;
}

.aj-lh-1-5 { line-height: 1.5 !important; }

/* --- Form & Input Utilities --- */
select[multiple] {
    height: 150px !important;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
}
select[multiple] option:hover {
    background-color: #f0f0f0;
}

.aj-input-full, .aj-input-full select, .aj-input-full input {
    width: 100% !important;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.aj-checkbox-scale-13 {
    transform: scale(1.3);
    cursor: pointer;
}

.aj-formset-row:hover {
    background-color: #f9f9f9;
}

.aj-maint-filter-btn {
    width: 17em;
    font-size: 1rem;
}

.w3-dropdown-content { z-index: 999 !important; }

/* --- Ampelsystem (Traffic Light Indicators) --- */
.aj-ampel-red {
    border-bottom: 4px solid #f44336;
    background-color: transparent !important;
    box-shadow: none !important;
}
.aj-ampel-yellow {
    border-bottom: 4px solid #FFEB3B;
    background-color: transparent !important;
    box-shadow: none !important;
}
.aj-ampel-green {
    border-bottom: 4px solid #8BC34A;
    background-color: transparent !important;
    box-shadow: none !important;
    padding-bottom: 4px;
}
.aj-ampel-blue {
    border-bottom: 4px solid #2196F3;
    padding-bottom: 4px;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* --- Toggle Switch Styles --- */
.aj-switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 28px;
}

.aj-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.aj-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 28px;
  box-shadow: 1px 1px 6px rgba(0,0,0,0.3);
  transition: background-color 0.4s;
}

.aj-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.4s;
}

.aj-switch input:checked + .aj-slider:before {
  transform: translateX(42px);
}

.aj-filter-label {
  font-size: 1.2rem;
  white-space: nowrap;
}

/* --- Progress Bar Styles --- */
.aj-progress-bar {
    height: 35px;
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    border-radius: 4px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
}

.aj-progress-bar-segment {
    min-width: 10px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: flex-grow 0.3s ease;
}

.aj-progress-bar-segment b {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* --- Card Grid Layouts --- */
.aj-card-grid-item {
    float: left;
    width: 400px;
    margin-right: 15px;
    margin-bottom: 15px;
}

@media (max-width: 440px) {
    .aj-card-grid-item {
        width: 100%;
        margin-right: 0;
    }
}

@media (max-width: 600px) {
    .aj-maint-filter-btn {
        width: 100%;
        margin-bottom: 5px;
    }
}
