/* root */
:root{
--sidebar-width: 260px;
--header-height: 56px;
/* --bg: #f5f7fb; */
--bg: #39284c;
--sidebar-bg: #384c61;
/*--sidebar-bg: #e10514; */
--sidebar-color: #fff;
--muted: rgba(255,255,255,0.06);
--active-bg: rgba(255,255,255,0.12);
--radius: 8px;
}
 
/* Basis */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue";
  background: var(--bg);
/*   color: #111; */
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
 
/* Layout */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}
 
#modified, #listname {
    background: var(--sidebar-bg);
    border-radius: var(--radius);
    padding: 0.3rem;
    margin: 0.3rem;
}

header.app-header {
  grid-area: header;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: #384c61;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  gap: .75rem;
}
 
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #fff;
}
 
.app-title { 
  font-weight: 600; 
  color: #fff;
}
 
.app > main.app-main {
  grid-area: main !important;
  padding-left: .5rem;
}
 
/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, var(--sidebar-bg), #391d46);
  color: var(--sidebar-color);
  padding: 1rem;
  overflow: auto;
  border-right: 1px solid rgba(255,255,255,0.03);
}
 
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li { margin: 0 0 .5rem; }
 
/* Toplink */
/* bestehende Basisregeln (bleiben) */
.sidebar a.toplink {
  display: inline-flex;        /* statt block: inline-flex für bessere Zentrierung, wirkt aber wie Block wenn Breite genutzt wird */
  align-items: center;         /* vertikale Zentrierung von Icon + Text */
  gap: 0.5rem;                 /* Abstand zwischen Icon und Text */
  padding: .6rem .75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  width: 100%;                 /* sorgt dafür, dass Link die volle Breite der Sidebar einnimmt (wie display:block) */
  box-sizing: border-box;      /* Padding wird innerhalb der Breite berücksichtigt */
}

/* Hover / Active verbleiben, keine Änderung nötig */
.sidebar a.toplink:hover { background: var(--muted); }
.sidebar a.toplink.active { background: var(--active-bg); font-weight: 600; }

/* Bild-Feinheiten */
.sidebar a.toplink img {
  display: inline-block;       /* sicherstellen, dass Bild korrekt gerendert wird */
  height: 24px;                /* fixe Höhe, wie in deinem HTML */
  width: auto;
  vertical-align: middle;      /* Fallback, falls inline-flex nicht unterstützt wird */
  flex-shrink: 0;              /* verhindert, dass das Icon bei knapper Breite skaliert */
}

/* Optional: wenn du möchtest, dass der Text in einem eigenen Element ist */
.sidebar a.toplink .tl-text {
  display: inline-block;
  line-height: 1;              /* verhindert vertikale Verschiebungen durch unterschiedliche line-heights */
}

/* Radios (visuell versteckt) */
.sidebar input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Label-Design für Hauptmenüeinträge */
.sidebar label.main-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  padding: .6rem .75rem;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font: inherit;
  border: 1px solid transparent;
}
.sidebar label.main-label:hover,
.sidebar label.main-label:focus {
  background: var(--muted);
  outline: none;
}

/* Pfeil-Icon */
.sidebar .chev {
  display: inline-block;
  transition: transform .18s ease;
  opacity: .95;
}

/* Submenu: standardmäßig versteckt */
.submenu {
  display: none;
  margin-top: .25rem;
  padding-left: .25rem;
}

input[type="text"] {
  font-size: 1.5rem;
}

/* Wenn das Radio checked ist, zeige das entsprechende Submenu */
#r-projects:checked ~ .submenu#sub-projects,
#r-studies:checked ~ .submenu#sub-studies {
  display: block;
}

/* Visual Selected-State: Label erhält Styling, wenn Radio checked */
#r-projects:checked + label[for="r-projects"],
#r-studies:checked + label[for="r-studies"] {
  background: var(--active-bg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* Drehen des Pfeils bei Auswahl */
#r-projects:checked + label[for="r-projects"] .chev,
#r-studies:checked + label[for="r-studies"] .chev {
  transform: rotate(90deg);
}

/* Sub-items */
.submenu a {
  display: block;
  padding: .5rem .75rem .5rem 1.75rem;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}
.submenu a:hover { background: var(--muted); }
.submenu a.active { background: var(--active-bg); font-weight: 600; }

/* Responsive: mobil Verhalten der Sidebar (Checkbox-Trick) */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.06);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: var(--sidebar-width);
    max-width: 85vw;
    z-index: 1000;
    padding-top: var(--header-height);
    transition: left .25s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
  }
  .sidebar.open { left: 0; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 900;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
  }
  .sidebar-overlay.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Checkbox zum togglen */
  #nav-toggle:checked ~ .sidebar { left: 0; }
  #nav-toggle:checked ~ .sidebar-overlay { display: block; opacity: 1; pointer-events: auto; }
}

#nav-toggle {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0; pointer-events: none;
}
/* Hinweis: Optional kannst Du eine reine CSS-Animation mit max-height verwenden:
   .submenu { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
   #r-projects:checked ~ .submenu#sub-projects { max-height: 400px; } */


.header-actions {
    margin-left: auto; /* schiebt Actions an den rechten Rand */
    display: flex; align-items: center; gap: 0.5rem;
}

/* Button-Optik für Icons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit; cursor: pointer;
}
.icon-btn:hover, .icon-btn:focus {
    background: rgba(0,0,0,0.04); /* dezenter Hover */
    outline: none; box-shadow: none;
}

/* kleine Trennlinie */
.header-sep {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.06);
    margin: 0 0.25rem; opacity: 0.9;
}

/* Benutzername (optional) */
.user-name {
    color: inherit;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

user-name:hover {
    background: rgba(0,0,0,0.04);
}

/* Responsive: bei sehr kleinen Screens evtl. nur Icon zeigen */
@media (max-width:480px){
    .user-name {
        display: none;
    }
    .header-actions {
        gap: 0.25rem;
    }
}


.datatable {
    font-family: "Verdana", "Helvetica", "Arial", sans-serif;
}

.datatable td,
.datatable th {
    padding-bottom: 0.5em;
    padding-top: 0em;
    padding-left: 0.5em;
    padding-right: 0.5em;
    text-align: left;
    font-size: 1.5rem;
}

.formtable {
    font-family: "Verdana", "Helvetica", "Arial", sans-serif;
}

.formtable td,
.formtable th {
    text-align: left;
    padding-bottom: 0em;
    padding-top: 0em;
    padding-left: 0em;
    padding-right: 1em;
}

.sidebar-logo {
    max-width: 160px;

    margin: 0 auto;

    padding-top: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    text-align: center;

}
.sidebar-logo a {
    display: block;
    margin: 0 auto;
    width: 100%;
}
.sidebar-logo img {
    width: 100%;
    height: auto;
    display: block;
    color: white;

}

@media (max-width: 360px) {
    .sidebar-logo {
        max-width: 120px;
    }
}

.dn_line {
    border-top-style:solid;
    border-top-width:thin;
    background-color: #96D4D4;
}

.dn_line_inacc {
    border-top-style:solid;
    border-top-width:thin;
    background-color: #ff6868;
}

.input_std {
}
.input_err {
    background-color: #ff0000;
}

.icons {
    width: 2em;
    height: auto;
}
.icons2 {
    width: 2.6em;
    height: auto;
}

.page {
    padding: 0 1rem; /* links/rechts je 1rem */
}
    
.cart_table { 
    border-collapse: collapse; 
    width: 100%; 
    max-width: 100%;
    margin: 1.5rem 0;
    /* Optional: damit die Tabelle nicht über den Container hinausgeht */
    box-sizing: border-box;
}
.cart_table td {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    transition: background-color 250ms ease, box-shadow 250ms ease, transform 120ms ease;
    cursor: pointer;
    user-select: none;
}

    /* Kurzzeitiger Highlight-Zustand */
.cart_table td.clicked {
    background-color: #d4f0c6; /* hellgrün */
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.03);
    transform: translateY(1px);
}

    /* Fokus für Tastaturbedienung (Barrierefreiheit) */
td:focus {
    outline: 3px solid #b3d4ff;
    background-color: #eef7ff;
}

/* Optional: leichter Fade-Out beim Entfernen */
.fading-out {
    opacity: 0;
    transition: opacity 220ms ease;
}

.fullwidth-table { width: 100%; border-collapse: collapse; }


.input-row {
  display: flex;
  gap: 0.5rem;           /* Abstand zwischen Input und Icon */
  align-items: center;
}

/* Textinput füllt den verfügbaren Platz */
.input-row input[type="text"] {
  flex: 1 1 auto;        /* wächst und schrumpft mit verfügbarem Platz */
  min-width: 0;          /* wichtig für korrektes Schrumpfen in flex-Containern */
  box-sizing: border-box;
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
  display: block;
}

/* Icon-Submit: nur so groß wie das Bild (verhindert Stauchung) */
.input-row input.icon-submit {
  flex: 0 0 auto;        /* bleibt so groß wie nötig */
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  width: 36px;           /* passe Größe an dein Icon an */
  height: 36px;
  cursor: pointer;
}

/* Bild im input[type="image"] skaliert automatisch; bei Bedarf:
   .input-row input.icon-submit img { object-fit: contain; } */

/* Accessibility / Fokus */
.input-row input[type="text"]:focus,
.input-row input.icon-submit:focus {
  outline: 2px solid Highlight; /* ggf. an eigenes Design anpassen */
  outline-offset: 2px;
}

.datatable a {
  text-decoration: none;
  color: inherit;
}

.descspan {
  color: #000;
}