* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    background-color: #fff;
    color: #333;
    padding: 20px;
}
h1 {
    font-size: 1.6rem;
    color: #1a1a2e;
    margin-bottom: 5px;
    border-bottom: 3px solid #4a90d9;
    padding-bottom: 8px;
}
h2 {
    font-size: 1.2rem;
    color: #1a1a2e;
    margin: 30px 0 10px 0;
    padding-left: 8px;
    border-left: 4px solid #4a90d9;
}
p {
    margin: 8px 0;
    line-height: 1.5;
}

/* ── Tabellen allgemein ── */
table {
    border-collapse: collapse;
    width: auto;
    min-width: unset;
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
thead tr {
    background-color: #4a90d9;
    color: #fff;
    text-align: center;
}
thead th {
    padding: 10px 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid #3a7fc1;
	white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.15s;
}
tbody tr:nth-child(even) {
    background-color: #f7f9fc;
}
tbody tr:hover {
    background-color: #e8f0fb;
}
tbody td {
    padding: 8px 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
	white-space: nowrap;
}

/* erste Spalten linksbündig */
tbody td:nth-child(2) {
    text-align: left;
}

/* ── Fehlzeiten-Markierungen ── */
td strong {
    color: #c0392b;
}
td[style*="background-color:#cccccc"] {
    background-color: #d0d0d0 !important;
    color: #555;
}
td[style*="background-color:#f4cccc"] {
    background-color: #f4cccc !important;
    color: #333;
}

/* ── Formular ── */
form {
    background-color: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 600px;
}
label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #444;
}
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #4a90d9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.2);
}
button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
button[type="submit"]:hover {
    background-color: #357abd;
}

/* ── Fehlermeldungen ── */
p strong {
    color: #c0392b;
}

/* ── Tab-Navigation ── */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 0 0;
}
.tab-btn {
    padding: 10px 20px;
    background-color: #d0e4f7;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: background-color 0.2s;
}
.tab-btn:hover {
    background-color: #b0cef0;
}
.tab-btn.tab-active {
    background-color: #4a90d9;
    color: #fff;
}
.tab-panel {
    border-top: 3px solid #4a90d9;
    padding-top: 10px;
}

/* ── Anklickbare Fehlzeiten-Zellen ── */
.absence-cell {
    cursor: pointer;
    transition: background-color 0.15s;
}
.absence-cell:hover {
    background-color: #fff3cd !important;
}
.absence-cell.absence-active {
    background-color: #ffd700 !important;
    font-weight: bold;
}
.exam-cell{
    position:relative;
    box-shadow:inset 0 0 0 1px #c00000;
}
.exam-cell::after{
    content:'';
    position:absolute;
    top:0;
    right:0;
    width:0;
    height:0;
    border-top:10px solid #c00000;
    border-left:10px solid transparent;
}
.exam-row td{
    background:#f4cccc !important;
}

/* ── Detail-Bereich ── */
.absence-detail {
    width: fit-content;
    margin-top: 20px;
    padding: 16px;
    background-color: #f7f9fc;
    border: 2px solid #4a90d9;
    border-radius: 8px;
}
.absence-detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 4px solid #4a90d9;
}
.absence-detail-table {
	width: auto;
	border-collapse: collapse;
	background-color: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
	margin-bottom: 0;
}
.absence-detail-table thead tr {
    background-color: #4a90d9;
    color: #fff;
}
.absence-detail-table thead th {
    padding: 8px 10px;
    font-size: 0.85rem;
    border: 1px solid #3a7fc1;
}
.absence-detail-table tbody td {
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    text-align: center;
}
.absence-detail-table tbody tr:nth-child(even) {
    background-color: #f0f5ff;
}
.absence-detail-table tbody tr:hover {
    background-color: #e8f0fb;
}

/* ── Logout-Link ── */
.logout-link {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #c0392b;
    border: 2px solid #c0392b;
    border-radius: 6px;
    padding: 6px 22px;
    text-decoration: none;
    vertical-align: middle;
    transition: background-color 0.2s, color 0.2s;
}

.logout-link:hover {
    background-color: #c0392b;
    color: #fff;
}

.login-fehler{
    max-width:500px;
    margin:80px auto;
    padding:20px;
    border:1px solid #c00000;
    border-radius:8px;
    background:#fff0f0;
    color:#800000;
    text-align:center;
}
.login-info{
    max-width:500px;
    margin:0 auto 20px auto;
    padding:15px;
    border:1px solid #1565c0;
    border-radius:8px;
    background:#eef6ff;
    color:#1565c0;
    text-align:center;
}

/* Klickmarkierung einer Schülerzeile */
.monitor-row-markiert td {
    box-shadow:
        inset 0 1px 0 #4A90D9,
        inset 0 -1px 0 #4A90D9;
}
.monitor-row-markiert td:first-child {
    box-shadow:
        inset 2px 0 0 #4A90D9,
        inset 0 1px 0 #4A90D9,
        inset 0 -1px 0 #4A90D9;
}
.monitor-row-markiert td:last-child {
    box-shadow:
        inset -2px 0 0 #4A90D9,
        inset 0 1px 0 #4A90D9,
        inset 0 -1px 0 #4A90D9;
}
.monitor-row-markiert td.exam-cell {
    box-shadow:
        inset 0 0 0 1px #c00000,
        inset 0 1px 0 #4A90D9,
        inset 0 -1px 0 #4A90D9;
}

/* Klickbare Bereiche links */
.row-marker {
    cursor: pointer;
}

/* ── Fehlzeiten-Bereich ── */
.fehlzeiten-box {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin: 20px 0 16px 0;
    padding: 16px;
    background-color: #fff;
    border: 1px solid #cdd8e8;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.fehlzeiten-box label {
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.fehlzeiten-group {
    display: flex;
    flex-direction: column;
}

.fehlzeiten-btn,
.fehlzeit-print-btn {
    padding: 9px 22px;
    background-color: #1565c0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-end;
}

.fehlzeiten-btn:hover,
.fehlzeit-print-btn:hover {
    background-color: #0d47a1;
}

/* ── Hilfe-Link ── */
.hilfe-link {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    border-radius: 6px;
    padding: 6px 22px;
    text-decoration: none;
    vertical-align: middle;
    transition: background-color 0.2s, color 0.2s;
    background-color: transparent;
}
.hilfe-link:hover {
    background-color: #2e7d32;
    color: #fff;
}

/* ── Analyse-Link ── */
.analyse-link {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1565c0;
    border: 2px solid #1565c0;
    border-radius: 6px;
    padding: 6px 22px;
    text-decoration: none;
    vertical-align: middle;
    transition: background-color 0.2s, color 0.2s;
    background-color: transparent;
}
.analyse-link:hover {
    background-color: #1565c0;
    color: #fff;
}

/* ── Overlay ── */
.hilfe-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.hilfe-overlay.aktiv {
    display: flex;
}

/* ── Modal-Fenster ── */
.hilfe-modal {
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 32px;
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.hilfe-modal h2 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: #2c3e50;
}
.hilfe-modal h3 {
    margin: 16px 0 6px;
    font-size: 0.95rem;
    color: #4a90d9;
}
.hilfe-modal ul {
    padding-left: 18px;
}
.hilfe-modal ul li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Schließen-Button ── */
.hilfe-schliessen {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #333;
}
.hilfe-schliessen:hover {
    color: #c0392b;
}

.fehlzeiten-select-date {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    min-width: 140px;
}
.fehlzeiten-select-date:focus {
    border-color: #4a90d9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

/* ── Scrollbarer Tabellen-Container ── */
.tabellen-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 75vh;
}

/* ── Jahresübersicht Container ── */
.jahresuebersicht {
	width: fit-content;
	margin-top: 20px;
	padding: 16px;
	background-color: #f7f9fc;
	border: 2px solid #4a90d9;
	border-radius: 8px;
}
.jahresuebersicht-header {
    margin: 8px 0px 4px 0px;
	padding-left: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
    border-left: 4px solid #4a90d9;
    /* border-bottom: 1px solid #b0c4de; */
    white-space: nowrap;
}
.jahresuebersicht-inhalt {
	padding: 0;
	margin: 0;
	overflow-x: auto;
}

/* ── Jahres-Tabelle ── */
.ju-tabelle {
    width: 100%;
    table-layout: fixed;
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0px;
}
.ju-tabelle thead tr {
    background-color: #4a90d9;
    color: #fff;
}
.ju-tabelle thead th {
    padding: 6px 2px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #3a7fc1;
    width: 26px;
    min-width: 26px;
    text-align: center;
}
.ju-tabelle thead th:first-child {
    text-align: left;
    width: auto;
    min-width: unset;
    white-space: nowrap;
    padding-left: 6px;
    padding-right: 10px;
}
.ju-tabelle tbody td {
    padding: 2px 3px;
    text-align: center !important;
    width: 26px;
    min-width: 26px;
    font-size: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
    border: 1px solid #ccc;
    vertical-align: middle;
}
.ju-tabelle tbody tr td:first-child {
    text-align: left !important;
    width: auto;
    white-space: nowrap;
    padding-left: 6px;
    padding-right: 10px;
    font-size: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
    background-color: #f7f9fc;
}
.ju-legende{
	font-size: 12px;
    margin: 6px 0 0 6px;
    page-break-inside:avoid;
    break-inside:avoid;
}
.ju-druckbox{
    border:1px solid #4a90d9;
    border-radius:6px;
    padding:8px;
}
.ju-stand {
    margin: 6px 0 12px 0;
    color: #555;
    font-size: 12px;
}
/* ── Tageszustände ── */
.ju-tabelle tbody tr td.ju-tag-ferien 	{ background: #dddddd !important; color: #333; font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-frei 	{ background: #ffffff !important; color: #333; font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-sonntag  { background: #dddddd !important; color: #c0392b; font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-D        { background: #FF8080 !important; color: #333; font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-H        { background: #FFBB40 !important; color: #333; font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-M        { background: #FFFF80 !important; color: #333; font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-schultag { background: #80FF80 !important; color: #333;  font-weight: bold; }
.ju-tabelle tbody tr td.ju-tag-leer     { background: #ffffff !important; color: #333; }

/* Tag mit versäumter Klassenarbeit */

.ju-klausur-tag {
    position: relative;
    box-shadow: inset 0 0 0 1px #d50000;
    overflow: visible;
}
/* rotes Dreieck oben rechts */
.ju-klausur-tag::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;

    width: 0;
    height: 0;

    border-top: 10px solid #d50000;
    border-left: 10px solid transparent;
}

.fehlzeitendetails {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.15;
}
.ft-zeile {
    margin-bottom: 2px;
}
.ft-monat {
    display: inline-block;
    width: 32px;
    font-weight: bold;
    color: #333;
}
.ft-eintrag {
    display: inline-block;
    width: 68px;
}

/* ── Ampel ── */
.ampel-cell,
.heatmap-cell,
.fach-cell,
.ka-cell {
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
	cursor: pointer;
}
.ampel-verlauf {
	font-size: 0.85em;
	white-space: nowrap;
}
.heatmap-trenner,
.ampel-trenner {
	margin: 0 0px;
	vertical-align: middle;
}
.ampel-block {
	cursor: pointer;
}

/* Ampel-Symbole */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 2px;
}
.status-dot.rot {
    background-color: #cc0000;
}
.status-dot.orange {
    background-color: #ff8800;
}
.status-dot.gelb {
    background-color: #e6a800;
}
.status-dot.gruen {
    background-color: #2e7d32;
}
.status-dot.grau {
    background-color: #999999;
}

/* ── Heatmap ── */
.heatmap-cell.hm-aktiv,
.fach-cell.fach-aktiv,
.ampel-cell.ju-aktiv,
.ka-cell.ka-aktiv {
    background-color: #ffd700 !important;
}
.heatmap-symbol {
    font-size: 14px;
    margin: 0 0px;
	vertical-align: middle;
}
.ampel-quote,
.ampel-trenner,
.heatmap-zeit,
.heatmap-quote {
    font-size: inherit;
    color: #333;
    vertical-align: middle;
}
.heatmap-detail {
	width: fit-content;
	margin-top: 20px;
	padding: 16px;
	background-color: #f7f9fc;
	border: 2px solid #4a90d9;
	border-radius: 8px;
}
.heatmap-inhalt {
	padding: 0;
	margin: 0;
}
.heatmap-table {
	width: auto;
	table-layout: fixed;
	border-collapse: collapse;
	background-color: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
	margin-bottom: 0;
}

.pdf-heatmap {
    width: 100%;
    table-layout: fixed;
}

.pdf-heatmap .heatmap-day {
    width: auto;
}
.pdf-heatmap th,
.pdf-heatmap td {
    padding: 0 0px;
}
.pdf-heatmap th:first-child,
.pdf-heatmap td:first-child{
    width:75px;
    white-space:nowrap;
}

.heatmap-table thead tr {
	background-color: #4a90d9;
	color: #fff;
}
.heatmap-table thead th {
	padding: 8px 10px;
	font-size: 0.85rem;
	border: 1px solid #3a7fc1;
}
.heatmap-table tbody td {
	padding: 7px 10px;
	border: 1px solid #e0e0e0;
	text-align: center;
}
.heatmap-table th:first-child,
.heatmap-table td:first-child {
	text-align: left;
	white-space: nowrap;
}
.heatmap-table tbody tr:nth-child(even) {
	background-color: #f0f5ff;
}
.heatmap-table tbody tr:hover {
	background-color: #e8f0fb;
}
.heatmap-day {
    width: 48px;
}

/* Hover soll Heatmap-Farbe überlagern */
.heatmap-table tbody tr:hover td {
	background-color: #e8f0fb !important;
}

/* ── Fehlzeiten Säulendiagramm ── */
.verlauf-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.verlauf-bereich {
    display: flex;
    flex-direction: column;
}
.verlauf-chart {
	display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 210px;
}
.verlauf-labelzeile {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.verlauf-label {
    width: 28px;
    text-align: center;
    font-size: 0.8em;
}
.verlauf-saeule {
    width: 28px;
    min-height: 4px;
    border-radius: 2px 2px 0 0;
}
.verlauf-achse {
	display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 210px;
    font-size: 0.75em;
    color: #333;
    text-align: right;
    width: 45px;
    padding-right: 6px;
}
.verlauf-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.verlauf-wert {
    font-size: 10px;
    line-height: 1;
    margin-bottom: 1px;
    white-space: nowrap;
    font-weight: bold;
}

/* ── Fächer ── */
.fach-symbole {
	color: #888;
	font-size: 14px;
	vertical-align: middle;
}
.fach-quote {
	margin-left: 3px;
	font-size: inherit;
	color: #333;
}

/* ── Fachanalyse ── */
.fach-chart {
	min-width: 700px;
}
.fach-row {
    display: grid;
    grid-template-columns: 220px 1fr 190px;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.fach-name {
    overflow-wrap: break-word;
}
.fach-bar-container {
    width: 100%;
}
.fach-bar {
	background-color: #4a90d9;
	height: 24px;
	min-width: 4px;
	border-radius: 2px;
}
.fach-wert {
    white-space: nowrap;
    text-align: left;
}
.fach-prozent {
    font-weight: bold;
}

/* ── Kopfzeile ── */
.fehlzeiten-tabelle thead th {
    background-color: #4a90d9;
}

/* ── Hintergrundfarben für Tabellenzeilen ── */
.fehlzeiten-tabelle tbody tr:nth-child(even) td {
    background-color: #f7f9fc;
}
.fehlzeiten-tabelle tbody tr:nth-child(odd) td {
    background-color: #ffffff;
}
.fehlzeiten-tabelle tbody tr:hover td {
    background-color: #e8f0fb;
}

label.filter-aktiv {
    font-weight: bold !important;
    color: #c00000 !important;
}
.fehlzeiten-select-date.filter-aktiv {
    background-color: #f4cccc !important;
    border: 1px solid #c00000 !important;
    color: #000000 !important;
}

/* Σ-Zelle braucht relativen Kontext für den Badge */
.fehlzeiten-tabelle td.td-sum,
.fehlzeiten-tabelle td.absence-cell {
    position: relative;
}

/* Badge: unentschuldigte Fehltage */
.ft-badge {
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    color: #c0392b;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
        border-radius: 6px;
    }

    .absence-detail-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .fehlzeiten-box {
        flex-wrap: wrap;        /* ← NEU: Umbruch erlauben statt alles stapeln */
        align-items: flex-start;/* ← NEU: Elemente oben ausrichten */
    }

    /* Dropdowns nehmen volle Breite, Buttons bleiben nebeneinander */
    .fehlzeiten-group:has(select) {
        flex: 1 1 100%;         /* ← Dropdowns: volle Breite */
    }

    .fehlzeiten-group:has(button) {
        flex: 0 1 auto;         /* ← Buttons: nur so breit wie nötig */
    }
}
