:root {
  --bckclr: #f0f2f5;  /* Hintergrund Seite */
  --navbg: #ffffff;
  --dark: #1e293b;
  --lightdark: #334155;


  --bg1: #007292;  /* Farbverlauf Start */
  --bg2: #075A8F;  /* Farbverlauf Ende */
  --textw: #fff;
  --radius: 2rem;
  --border: #075A8F;


    --cbckclr: #e7e5d9;
    --lnkclr: #0284c7;
    --nvbck: #f6a800;
    --clrblue: #006e8d;
    --tclr: #555555;
    --alnkclr: #ef980c;
}

/* Grund-Reset */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    font-family: sans-serif;
}

body {
    font-size: 1em;
    font-weight: 300;
    line-height: 1.5em;
    display: flex;
    flex-direction: row;
    background-color: var(--bckclr);
    min-height: 100vh;
    padding: 24px;
    gap: 24px;
}

/* Navigation */
.sidebar {
    width: 78px;
    background-color: var(--navbg); /* Weißer Hintergrund */
    color: var(--dark); /* Dunkle/Schwarze Schrift */
    border-radius: 16px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05); /* Etwas softerer Schatten auf Weiß */
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar:hover {
    width: 260px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 8px;
    overflow: hidden;
}


.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
    transition: opacity 0.2s;
    color: var(--dark);
}

.sidebar .brand-text { opacity: 0; }
.sidebar:hover .brand-text { opacity: 1; }
.sidebar .nav-text { opacity: 0; }
.sidebar:hover .nav-text { opacity: 1; }


/* Navigation Links */
.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item, .nav-item-active {
    position: relative;
    min-width:48px;
    padding-bottom: 0; 
}

.nav-item-active {
    background-color:var(--alnkclr);
}


.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--lightdark); /* Dunkelgrau/Schwarz für gute Lesbarkeit */
    padding: 12px;
    border-radius: 10px;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
    height: 48px;
    cursor: pointer;
}

.nav-link:hover {
    background-color: #f1f5f9; /* Heller Hover-Effekt */
    color: var(--dark);
}

.nav-link > img {
    min-width: 46px;
    display: inline-flex;
}

.nav-text {
    font-weight: 500;
    flex-grow: 1;
    margin-left:1em;
}

.navisvg, .iconsvg {
    width:24px;
    height:24px;
    min-width:24px;
    min-height:24px;
    fill:none;
    stroke:#1e293b;
    stroke-width:1.5;
    stroke-linecap:round;
    stroke-linejoin:round;
    flex-shrink:0;
}
.lnksvg {
    stroke: var(--lnkclr);
}

.sidebar-footer {
    margin-top: auto; /* Sicherheitsnetz, um ganz unten zu bleiben */
    padding-top: 16px;
    border-top: 1px solid #f1f5f9; /* Subtile Trennlinie */
}

/* Spezifischer Hover-Effekt für den Logout-Button (dezentes Rot) */
.logout-link:hover {
    background-color: #fef2f2 !important;
    color: #ef4444 !important;
}
.logout-link:hover i.main-icon {
    color: #ef4444 !important;
}

/* Login */
#loginwrapper {
    flex:1;
    display: flex;
    flex-direction: column;
    max-width:100%;
}

#login {
    padding:1rem;
    border:1px solid var(--border);
    border-radius:var(--radius);
    margin:8% auto 0 auto;
    text-align:center;
    display: flex;
    flex-direction: column;
}
/* Container für das 2FA-Formular */
.totp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 12px;
}

/* Die Box, die die 6 Inputs nebeneinander hält */
.totp-inputs {
    display: flex;
    gap: 12px; /* Abstand zwischen den Feldern */
    justify-content: center;
}

/* Styling für jedes einzelne der 6 Felder */
.totp-field {
    width: 48px;
    max-width: 48px;
    height: 56px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid #cbd5e1;
    border-radius: 10px; /* Abgerundete Ecken passend zur Sidebar */
    background-color: #ffffff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

/* Wenn der Nutzer in ein Feld klickt */
.totp-field:focus {
    border-color: #0284c7; /* Unser Dashboard-Blau */
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Versteckt die kleinen Pfeile bei Pfeiltasten (Up/Down) in manchen Browsern */
.totp-field::-webkit-outer-spin-button,
.totp-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.totp-field[type=number] {
    -moz-appearance: textfield;
}

/* Toast */
.toastContainer {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 9999; /* Immer ganz oben */
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width:500px;
    display: none; 
}

.toast-message {
    background-color: var(--navbg);
    color: #0f172a;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #cbd5e1; /* Standard-Grau */
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-message.success {
    border-left-color: #10b981; 
}
.toast-message.success svg {
    stroke: #10b981;
}
#ajax-link {
    display: none;
}

.toast-message.error {
    border-left-color: #ef4444; /* Rot */
}
.toast-message.error svg {
    stroke: #ef4444;
}

.toastsvg {
    width:24px;
    height:24px;
    min-width:24px;
    min-height:24px;
    fill:none;
    stroke-width:1.5;
    stroke-linecap:round;
    stroke-linejoin:round;
    flex-shrink:0;
}
.tast-text {
    height:24px;
}

/* Content */
#site-content {
    flex:1;
    padding: 12px 16px;
    text-align: left; 
    font-size: 0.9em;
    line-height: 1.6em;
    color: var(--tclr);
    display:flex;
    flex-direction:column;
}

#site-content a {
    text-decoration: none;
    color: var(--lnkclr);
}
.smallwrapper {
    flex:0;
    display: flex;
    justify-content:left;
    gap:24px;
}

.headline {
    margin-bottom: 24px;
}
.stammdaten {
    min-width: 300px;
}
.stark {
    font-weight: 600;
}
.subhead {
    font-weight: 600;
    font-size: 1.5em;
}


/* Cardelements  */

/* Grid Layout für die Karten */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Basis-Karte (Ähnlich HomeAssistant) */
.recard {
    background-color: var(--navbg);
    border-radius: 12px; /* Abgerundete Ecken */
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recard:hover {
    transform: translateY(-2px); /* Hebt sich beim Hover minimal an */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.card-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

.card-link {
    font-size: 0.9rem;
    color: #0284c7; /* Schickes Info-Blau für Aktionen */
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    transition: color 0.1s;
}

.card-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

/* Spezifisches Styling für den Button-Card Typ */
.recard.card-button {
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 120px; /* Damit sie optisch gut zu den Text-Karten passt */
    cursor: pointer;
    border-style: dashed; /* Macht deutlich, dass es eine "Aktion" ist */
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.recard.card-button:hover {
    border-color: #0284c7;
    background-color: #ffffff;
}

.recard.card-button .card-title-link {
    text-decoration: none;
    color: #0284c7;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}


/* FORM ELEMENTS */
.form-group { /* div das ein input und label beherbergt */

}
.form-group-radios { /* div das radios und label beherbergt */

}
.form-group-checkboxes { /* div das checkboxes und label beherbergt */

}
.nicebtn, .btn-link {
  display:inline-block; 
  width:250px;
  border: none; /* gleiche Farbfamilie wie Button */
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--textw);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  text-decoration: none;
}
.active:hover {
  transform: translateY(+2px);
  box-shadow: 0 6px 8px rgba(60, 136, 222, 1);
  filter: brightness(1.1);
}
input[type="text"], input[type="password"] {background-color:#85cdf9;width: 100%;color:#000;}

.niceinput {
  position: relative;
  font-family: system-ui, sans-serif;
  margin: 1.5rem 0;
  width: 100%;
  max-width: 350px;
}

.niceinput input,
.niceinput select {
  width: calc(100% - 2rem);
  padding: 1rem 0.75rem;
  border: 2px solid var(--border); /* gleiche Farbfamilie wie Button */
  border-radius: var(--radius);
  background: var(--bckclr);
  color: #000;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

/* Label */
.niceinput label {
  position: absolute;
  left: 1.5rem;
  top: 1rem;
  color: var(--border); /* helleres Blau als Akzent */
  pointer-events: none;
  font-size: 1rem;
  transition: all 0.25s ease;
  background: var(--bckclr); /* Seitenhintergrund anpassen, damit Text lesbar bleibt */
  padding: 0 0.35rem;
}

.blue {
    color: var(--border); /* helleres Blau als Akzent */
}

/* Effekt: Wenn aktiv oder befüllt → Label schwebt nach oben */
.niceinput input:focus + label,
.niceinput input:not(:placeholder-shown) + label {
  top: -0.6rem;
  left: 1.3rem;
  font-size: 0.8rem;
  color: var(--border); /* Highlightfarbe, wie der Button-Schatten */
}

.highlight {
    background-color: #8ef59b; /* hellgrün */
    transition: background-color 1.5s ease;
}

.redhighlight {
    background-color: #FA6466; /* hellrot */
    transition: background-color 1.5s ease;
}

/* Fokuszustand */
.niceinput input:focus {
  border-color: #35dbca;
  box-shadow: 0 0 6px rgba(53, 219, 202, 0.5);
}




/* Responsive Anpassungen */
@media (max-width: 768px) {
    .nav-list { display: none; flex-direction: column; width: 100%; }
    .nav-list > li { width: 100%; }
    .submenu { position: static; background-color: var(--nvbck);}
    .submenu > li {padding-left:25px;}
    .burger-menu { display: flex; }
    #slide_caption { padding-left:20px;font-size: 1.35em; }
}