:root{
  --bg:#0b1220;
  --card:#111a2b;
  --muted:#9aa7bd;
  --text:#eaf0ff;
  --accent:#4aa3ff;
  --danger:#ff4a4a;
  --border: rgba(255,255,255,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
body{
	min-width: 320px;
    max-width: 1200px;
    margin: 0px auto;

  background: radial-gradient(1200px 800px at 10% 10%, rgba(74,163,255,.18), transparent 60%),
              radial-gradient(900px 700px at 90% 30%, rgba(74,255,138,.12), transparent 60%),
              var(--bg);
  color: var(--text);
}


/* =========================
   FIX: Body-Hintergrund nicht kacheln
   ========================= */
html, body {
  min-height: 100%;
}

body {
	min-height: 100vh;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}



a {
    color: #ffffff;
}

body.light a {
    color: #000000;
}

.container{
  max-width: none !important;
  width: 100% !important;
  margin: 0 auto;
  padding: 20px;
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding: 16px 20px;
  background: rgba(17,26,43,.85);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  position: sticky; top: 10px; backdrop-filter: blur(10px);
  z-index: 5;
      margin-bottom: 16px !important;
	    position: static !important;
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand .logo{
  width:75px; height:auto; border-radius: 12px;
  /*background: linear-gradient(135deg, rgba(74,163,255,1), rgba(74,255,138,1));*/
}
.brand h1{ margin:0; font-size: 18px; }
.badge{
  font-size: 10px; padding:4px 8px; border-radius: 999px;
  border:1px solid var(--border); color: var(--muted);
}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn.primary{
  background: rgba(74,163,255,.18);
  border-color: rgba(74,163,255,.35);
}
.btn.danger{
  background: rgba(255,74,74,.16);
  border-color: rgba(255,74,74,.35);
}
.btn.small{ padding:6px 10px; border-radius: 10px; font-size: 13px; }

.grid{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  margin-top: 16px;
}

.card{
  background: rgba(17,26,43,.85);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card .head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px;
 
}
.card .head h2{ margin:0; font-size: 16px; }
.card .body{ padding: 14px 16px; }

.label{ font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input, select, textarea{
  width:100%;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  color: #818080;
}
textarea{ min-height: 90px; resize: vertical; }

.row{ display:flex; gap:10px; }
.row > *{ flex:1; }

.hr{ height:1px; background: var(--border); margin: 12px 0; }

.muted{ color: var(--muted); font-size: 13px; }
.error{ color: #ffb3b3; font-size: 13px; }
.ok{ color: #b5ffd0; font-size: 13px; }

.collapsible-toggle{ display:flex; align-items:center; justify-content:space-between; cursor:pointer; }
.collapsed .body{ display:none; }

.student-item{
  padding: 10px 12px;
  border:1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor:pointer;
}
.student-item:hover{ background: rgba(255,255,255,.06); }
.student-item.active{
  border-color: rgba(74,163,255,.45);
  background: rgba(74,163,255,.12);
}
body.light .student-item > div {
background-color: transparent;
}
.table-wrap{ overflow:auto; border-top:1px solid var(--border); }
.eval-table{
  border-collapse: collapse;
  width: auto !important;
}
.eval-table th, .eval-table td{
  border:1px solid var(--border);
  padding: 8px 8px;
  vertical-align: top;
  background: rgba(255,255,255,.02);
}
.eval-table th{
  position: sticky; top: 0;
  background: rgba(17,26,43,.95);
  z-index: 2;
}
.eval-table td{
  padding: 4px !important;
}
.eval-table .topic-col{
  position: sticky; left: 0;
  background: rgba(17,26,43);
  z-index: 3;
}
.group-row{
  background: rgba(255,255,255,.06) !important;
  font-weight: 600;
  color: #f5f7ff;
}

.cell{ min-width: 160px; }

.meta-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cellbox{
  border-radius: 12px;
  border:1px solid var(--border);
  padding: 8px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}

.colorbtn{
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 28px !important;
  border-radius: 6px !important;
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1e40af !important;
  padding: 0 !important;
}


.note{
  width:100%;
  min-height: 70px;
  padding: 8px 10px;
  border-radius: 10px;
}



/* Color states: 0 white, 1 blue, 2 red, 3 yellow, 4 green */
.c1{ background: rgba(74,163,255); }
.c2{ background: rgba(255,74,74); }
.c3{ background: rgba(255,210,74); }
.c4{ background: rgba(74,255,138); }
/* LILA – Hausaufgabe */
.c5{ background: rgba(180,120,255); }



.login-shell{
  min-height: 100vh;
  display:flex; align-items:center; justify-content:center;
  padding: 24px;
}

body.light .login-shell, body.light .container {
	background-color: transparent !important;
}
.login-card{ width: min(420px, 100%); }
.login-card h1{ margin: 0; font-size: 20px; }

/* =========================
   Overlay + Spinner
   ========================= */
.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
 
  padding: 20px;
  z-index: 999999;
}

.overlay-card{
  width: min(420px, 100%);
  background: rgba(17,26,43,.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.22);
  border-top-color: rgba(255,255,255,.85);
  animation: spin 1s linear infinite;
}

@keyframes spin{
  to{ transform: rotate(360deg); }
}

.overlay-text{
  font-size: 14px;
  color: var(--text);
  text-align: center;
}

/* =========================
   HELL-MODUS – ALLES ERZWINGEN
   ========================= */

body.light {
  background-color: #f5f6fa !important;
  color: #111827 !important;
}

/* Alle Hauptcontainer */
body.light header,
body.light main,
body.light footer,
body.light section,
body.light div,
body.light .card,
body.light .panel,
body.light .sidebar
 {
  background-color: #ffffff;
  color: #111827 !important;
}

/* Texte */
body.light h1,
body.light h2,
body.light h3,
body.light h4,
body.light h5,
body.light h6,
body.light p,
body.light span,
body.light label,
body.light small,
body.light strong,
body.light em {
  color: #111827 !important;
}

/* Muted / Secondary Text */
body.light .muted {
  color: #374151 !important;
}

/* Tabellen */
body.light table,
body.light thead,
body.light tbody,
body.light tr,
body.light th,
body.light td {
  background-color: #ffffff !important;
  color: #111827 !important;
}

body.light th {
  background-color: #f1f3f7 !important;
}

/* Inputs */
body.light input,
body.light select,
body.light textarea {
  background-color: #ffffff !important;
  color: #111827 !important;
  border-color: rgba(0,0,0,0.25) !important;
}

/* Buttons */
body.light .btn {
  background-color: #e5e7eb !important;
  color: #111827 !important;
  border-color: rgba(0,0,0,0.25) !important;
}

body.light .btn.primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

/* Badges */
body.light .badge {
  background-color: #e5e7eb !important;
  color: #111827 !important;
}

/* Overlay */
body.light .overlay {
  background: rgba(0,0,0,0.25) !important;
}

/* Spinner */
body.light .spinner {
  border-color: rgba(0,0,0,0.2) !important;
  border-top-color: rgba(0,0,0,0.7) !important;
}

/* =========================
   Weitere gewünschte Anpassungen
   ========================= */

/* colorbtn farblich abheben */
.colorbtn{
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 28px !important;

  border-radius: 8px !important;
  border: 1px solid rgba(0,0,0,0.25) !important;

  background-clip: padding-box !important;

  /* Plastischer Effekt */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),   /* Licht oben */
    inset 0 -2px 3px rgba(0,0,0,0.25),      /* Schatten unten */
    0 2px 4px rgba(0,0,0,0.25) !important;  /* Button hebt sich ab */

  cursor: pointer !important;
}
.colorbtn:hover{
  filter: brightness(1.1) !important;
}

/* textarea.note kleiner */
textarea.note{
  min-height: 28px !important;
  /*height: 28px !important;*/
  padding: 4px 6px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  resize: vertical !important;
}

/* Themen-Spalte: 300px */
td.topic-col{
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
}


/* StudentCard über der Haupt-Card */
.student-card,
.main-card{
  width: 100% !important;
}

/* Kein Grid mehr nötig */
.grid{
  display: block !important;
}

/* Abstand zwischen den Cards */
.student-card{
  margin-bottom: 16px !important;
}

/* Einklapp-Animation */
.student-card .body{
  overflow: hidden !important;
  transition: max-height 0.3s ease, padding 0.3s ease !important;
}

.student-card.collapsed .body{
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Toggle-Icon */
#studentToggle{
  cursor: pointer !important;
  user-select: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.student-card.collapsed #studentBody{
  display: none !important;
}
.colorbtn{
  background-color: transparent !important;
  background: transparent !important;
}



td.topic-col{
  text-align: center !important;
}

th.topic-col{
  text-align: center !important;
}

/* Cellbox: Inhalte untereinander */
.cellbox{
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

/* Inputs in Cellbox immer volle Breite */
.cellbox input,
.cellbox select,
.cellbox textarea{
  width: 100% !important;
  box-sizing: border-box !important;
}
/* Dummy-Labels in Cellbox */
.cellbox .dummy-label{
  font-size: 11px !important;
  color: var(--muted) !important;
  margin-bottom: 2px !important;
  text-align: left !important;
}

.eval-table {
  width: auto !important;
  table-layout: auto;
}




/* Alle anderen Spalten zusammen = restliche 50% (durch table-layout:fixed) */
.eval-table th.cell,
.eval-table td.cell{
  width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}
.cell,
.topic-col {
  min-width: 150px !important;
  width: 150px !important;
}

/* Tabelleninhalt komplett zentrieren */
.eval-table th,
.eval-table td {
  text-align: center !important;
  vertical-align: middle !important;
}
/* Dunklere Input-Hintergründe in der Bewertungstabelle */
.eval-table input,
.eval-table select,
.eval-table textarea {
  background-color: rgba(0, 0, 0, 0.35) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.25) !important;
}

/* Hellmodus: trotzdem leicht dunkel lassen */
body.light .eval-table input,
body.light .eval-table select,
body.light .eval-table textarea {
  background-color: rgba(0, 0, 0, 0.15) !important;
  color: #111827 !important;
  border-color: rgba(0,0,0,0.25) !important;
}
/* Hellmodus: dunklere Tabellenrahmen */
body.light .eval-table th,
body.light .eval-table td {
  border-color: rgba(0, 0, 0, 0.35) !important;
}

/* Optional: auch äußeren Tabellenrahmen etwas kräftiger */
body.light .eval-table {
  border-color: rgba(0, 0, 0, 0.45) !important;
}

/* Farbwahl-Buttons */
.color-picker {
  display: flex !important;
  justify-content: center !important;
  gap: 6px !important;
      background-color: transparent !important;
}

.color-dot {
    width: 25px !important;
    height: 25px !important;
    border-radius: 50% !important;
    /* border: 1px solid rgba(0, 0, 0, 0.4) !important; */
    cursor: pointer !important;
}

/* Farben */
.color-dot.c1 { background: rgba(74,163,255,.8) !important; }   /* blau */
.color-dot.c2 { background: rgba(255,74,74,.8) !important; }    /* rot */
.color-dot.c3 { background: rgba(255,210,74,.8) !important; }   /* gelb */
.color-dot.c4 { background: rgba(74,255,138,.8) !important; }   /* grün */
.color-dot.c5 {
  background: rgba(180,120,255,.85) !important;
}

/* aktive Auswahl */
.color-dot.active {
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
}

.logo img {
	width: 100%;
	height: auto;
}

/* =========================
   Inline-Legende unter Themen
   ========================= */

.legend-row th {
  padding-top: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.topic-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

.topic-legend-inline .l-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.topic-legend-inline .l-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.35);
}

/* Farben (identisch zur Bewertung) */
.l-dot.c1 { background: rgba(74,163,255,.85); }   /* blau */
.l-dot.c2 { background: rgba(255,74,74,.85); }    /* rot */
.l-dot.c3 { background: rgba(255,210,74,.9); }    /* gelb */
.l-dot.c4 { background: rgba(74,255,138,.85); }   /* grün */
.l-dot.c5 {
  background: rgba(180,120,255,.85);
}

.topic-legend-inline{
  width: 100%;
  display: flex;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.topic-legend-inline .l-item{
  width: 100%;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

body.light .topic-legend-inline .l-item{
  background: rgba(0,0,0,0.06);
}

/* Light Mode Feinschliff */
body.light .topic-legend-inline {
  color: #555;
  background-color: transparent
}


/* speziell gegen body.light div{...} */
body.light .cellbox.c0{ background: rgba(245,247,255) !important; }
body.light .cellbox.c1{ background: rgba(74,163,255) !important; }
body.light .cellbox.c2{ background: rgba(255,74,74) !important; }
body.light .cellbox.c3{ background: rgba(255,210,74) !important; }
body.light .cellbox.c4{ background: rgba(74,255,138) !important; }
body.light .cellbox.c5{
  background: rgba(180,120,255) !important;
}


#kbOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#kbModal {
  background: #fff;
    border: 1px solid var(--border);
  width: 90%;
  max-width: 1100px;
  height: 85%;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

/* iframe unter dem Close-Button */
#kbModal iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
}

#kbClose {
  position: absolute;
  
  top: 10px;
  right: 25px;
  z-index: 2;              /* WICHTIG */
  pointer-events: auto;    /* WICHTIG */
}



@media (max-width: 600px) {
  .topbar > div:last-child {
    flex-wrap: wrap;
  }

  #themeSelect {
    flex: 1 1 100%;
  }

  #logoutBtn {
    flex: 1 1 100%;
  }
    .eval-table .topic-col {
	  word-break: break-all;
	  width: 50px !important;
    min-width: 50px !important;
  }
  .eval-table th.cell, .eval-table td.cell {
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
}
.topic-legend-inline {
	width: 120px !important;
}

.topic-legend-inline,
.topic-legend-inline .l-item {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important; /* 🔑 bricht auch extrem lange Wörter */
}

/* optional: etwas mehr Luft */
.topic-legend-inline .l-item {
  line-height: 1.3;
}
.color-dot {
	height: 18px !important;
	    width: 18px !important;
}
.color-dot.reset {
	
	font-size: 12px;
}
}

/* =========================
   Knowledgebase Overlay – Light Mode
   ========================= */
body.light #kbOverlay,
#kbOverlay.light{
  background: rgba(255,255,255,0.85) !important;
}

body.light #kbModal{
  background: #ffffff !important;
  color: #111827 !important;
  border-color: rgba(0,0,0,0.25) !important;
}

/* Close Button im Light Mode besser sichtbar */
body.light #kbClose{
  border-color: rgba(0,0,0,0.25) !important;
  color: #111827 !important;
}

.color-dot.reset {
	background: #ffffff;
	color: #000000;	
}

body#standard .brand .logo{
width: 110px;
}

/* =========================
   Schülerliste scrollbar
   ========================= */
#studentList{
  max-height: 20vh;
  overflow-y: auto;
  padding-right: 6px; /* Platz für Scrollbar */
}

/* dezente Scrollbar (WebKit) */
#studentList::-webkit-scrollbar{
  width: 8px;
}

#studentList::-webkit-scrollbar-track{
  background: transparent;
}

#studentList::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
}

/* Hellmodus */
body.light #studentList::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.25);
}

.student-meta-card {
  margin-top: 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}

.student-meta-card .head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
}

.student-meta-card .head h3 {
  margin: 0;
  font-size: 14px;
}

.student-meta-card .head span {
  margin-left: auto;
}

.student-meta-card .body {
  padding: 12px;
}

.student-meta-card.collapsed .body {
  display: none;
}

/* =========================
   ADK Print Overlay
   ========================= */
#printOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#printModal{
  background: #fff;
  width: 92%;
  max-width: 1100px;
  height: 88%;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.2);
}

/* iframe full */
#printModal iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
}

/* Buttons oben */
#printClose{
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  pointer-events: auto;
  color:black;
}

#printDo{
  position: absolute;
  top: 10px;
  right: 70px;
  z-index: 2;
  pointer-events: auto;
  color:black;
}
#printSave{
  position: absolute;
  top: 10px;
  right: 150px;   /* links neben "Drucken" */
  z-index: 2;
  pointer-events: auto;
  color: black;
}


@media print and (max-width: 700px){
 .results-grid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
}

.lesson-meta{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 10px;
  font-size: 11px;
  margin-bottom: 6px;
}

#studentMetaBody input {
	    min-width: 100px;
}
#viewerEmails, #studentOptions  {
	overflow-y: auto;
}