/* Modal Style */
#leitbild-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    line-height: 1.6;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-content h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.modal-content h3 {
    color: var(--secondary);
    margin-top: 1.5rem;
}

.modal-content p {
    margin-bottom: 1rem;
}

.modal-content ul {
    padding-left: 1.2rem;
}

.modal-content li {
    margin-bottom: 0.8rem;
}

.release-notes .release-notes-h3 {
    margin: 0.35rem 0 0.25rem;
    color: var(--primary-color, var(--primary));
    font-size: 1.05rem;
}

.release-notes .release-notes-h4 {
    margin: 0.65rem 0 0.2rem;
    border-bottom: 1px solid var(--border-color, #eee);
    padding-bottom: 0.15rem;
    font-size: 0.98rem;
}

.release-notes .release-notes-h5 {
    margin: 0.45rem 0 0.1rem;
    font-size: 0.9rem;
}

.release-notes .release-notes-list {
    margin: 0.1rem 0 0.35rem;
    padding-left: 1.1rem;
    line-height: 1.35;
}

.release-notes .release-notes-list li {
    margin-bottom: 0.12rem;
}

.release-notes .release-notes-p {
    margin: 0.15rem 0 0.3rem;
    line-height: 1.4;
}

.modal-content strong {
    color: var(--primary);
}

.modal-footer {
    margin-top: 2rem;
    font-style: italic;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

/* Settings Card */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.btn {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white !important;
    border: none;
    border-radius: var(--btn-radius, 4px);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background: #2980b9;
    color: white !important;
}

.btn:active {
    transform: scale(0.98);
    background: #2471a3;
    color: white !important;
}

.btn:focus {
    outline: 2px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

.btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    background: #95a5a6;
    color: white !important;
    border: none;
    border-radius: var(--btn-radius, 4px);
    cursor: pointer;
}

.btn-secondary:hover {
    background: #7f8c8d;
    color: white !important;
}

.btn-secondary:active {
    background: #707b7c;
    color: white !important;
}

.btn-danger {
    padding: 0.6rem 1.2rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: var(--btn-radius, 4px);
    cursor: pointer;
}

/* Recipient Search Layout */
.recipient-search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 767px) {
    .recipient-search-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.search-column {
    display: flex;
    flex-direction: column;
}

.parents-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.parents-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.parent-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

.info-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.95rem;
    color: #333;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-row i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.info-row.flex-start {
    align-items: flex-start;
}

.btn-danger:hover {
    background: #c0392b;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.gap-1 {
    gap: 1rem;
}

.qr-container {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

canvas {
    max-width: 100%;
    height: auto;
}

/* Utility classes for converted inline styles */
.text-center { text-align: center; }
.clickable { cursor: pointer; }
.hidden { display: none !important; }
.margin-0 { margin: 0 !important; }
.margin-top-0 { margin-top: 0 !important; }
.margin-bottom-1 { margin-bottom: 1rem; }
.margin-top-1 { margin-top: 1rem; }
.margin-top-2 { margin-top: 2rem; }
.padding-1 { padding: 1rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-column { display: flex; flex-direction: column; }
.flex-gap-05 { display: flex; gap: 0.5rem; }
.flex-gap-025 { display: flex; gap: 0.25rem; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-0-5 { gap: 0.5rem; }
.gap-0-8 { gap: 0.8rem; }
.flex-row { display: flex; flex-direction: row; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-start { align-items: flex-start; }
.gap-05 { gap: 0.5rem; }
.gap-1 { gap: 1rem; }
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 800px) {
    .grid-2-col, .grid-3-col {
        grid-template-columns: 1fr !important;
    }
}

body.is-phone .grid-2-col, 
body.is-phone .grid-3-col {
    grid-template-columns: 1fr !important;
}

@media (max-width: 600px) {
    .grid-2-col, .grid-3-col {
        grid-template-columns: 1fr;
    }
}

.width-100 { width: 100% !important; }
.padding-05 { padding: 0.5rem !important; }
.border-top { border-top: 1px solid #eee; }
.padding-top-1 { padding-top: 1rem; }

.margin-left-1 { margin-left: 1rem; }
.margin-left-05 { margin-left: 0.5rem; }

.tfa-status-success { color: #27ae60; }
.tfa-setup-section { border-top: 1px solid #eee; padding-top: 1rem; }
.tfa-instruction-list { padding-left: 1.2rem; font-size: 0.9rem; color: #666; margin-bottom: 1rem; }
.tfa-secret-box { border: 1px dashed #ccc; background: #fff; display: block !important; }
.tfa-secret-label { font-size: 0.8rem; color: #666; text-transform: uppercase; margin-bottom: 0.3rem; }
.tfa-secret-value { font-family: monospace; font-size: 1.4rem; font-weight: bold; letter-spacing: 3px; color: #000; word-break: break-all; }
.tfa-input-code { padding: 0.6rem; border: 1px solid #ddd; border-radius: 4px; width: 180px; text-align: center; font-size: 1.2rem; letter-spacing: 1px; }
.tfa-error {
    color: #5d4345;
    background: #fdecea;
    border: 1px solid #f5c2c0;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: left;
    line-height: 1.45;
}

.text-danger { color: #e74c3c; }
.text-small { font-size: 0.85rem; }

.nav-settings-btn { border: none; background: none; font-size: 1.2rem; display: flex; align-items: center; }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.dashboard-card {
    height: auto;
}

.dashboard-card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.mail-preview-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    min-width: 0;
    overflow: hidden;
}

.mail-preview-item:last-child {
    border-bottom: none;
}

.mail-subject {
    font-weight: 400;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-preview-item.unseen .mail-subject {
    font-weight: 700;
}

.mail-meta {
    color: #777;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dashboard-mailbox,
#dashboard-mailbox .mailbox-status-loaded,
#dashboard-mailbox .latest-mails {
    min-width: 0;
    overflow: hidden;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--btn-radius, 4px);
    cursor: pointer;
    margin-top: 0.5rem;
}

/* Schulberichte: Toolbar — Buttons = Dropdown-Höhe, unten ausgerichtet */
.school-reports-toolbar-card {
    padding: 0.75rem 1rem;
}
.school-reports-toolbar {
    align-items: flex-end;
}
.school-reports-toolbar .form-group {
    margin-bottom: 0;
}
.school-reports-toolbar .form-group label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}
.school-reports-toolbar .form-control {
    width: auto;
    min-width: 11rem;
    height: 2.25rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.school-reports-toolbar .btn,
.school-reports-toolbar .btn-small {
    margin-top: 0 !important;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.85rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-sizing: border-box;
    line-height: 1.2;
    align-self: flex-end;
}
.school-reports-toolbar #report-param-filters,
.school-reports-toolbar #timetable-filters,
.school-reports-toolbar #teacher-timetable-filters,
.school-reports-toolbar #applicant-filters,
.school-reports-toolbar #report-actions {
    align-items: flex-end;
}

/* Children Grid */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.badge-primary {
    background: var(--accent);
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-info {
    background: #3498db;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Notification center (Nachrichtenzentrale) */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.notification-bell-btn {
    position: relative;
    font-size: 1.1rem;
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.notification-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(28rem, 70vh);
    overflow-y: auto;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 2000;
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #eee);
    position: sticky;
    top: 0;
    background: inherit;
}

.notification-panel-empty {
    padding: 1.25rem 1rem;
    color: var(--text-muted, #666);
    font-size: 0.9rem;
}

.notification-module-group + .notification-module-group {
    border-top: 1px solid var(--border-color, #eee);
}

.notification-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.notification-item-list {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem 0.5rem;
}

.notification-item {
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.notification-item:hover {
    background: #f5f7fa;
}

.notification-item.is-unread {
    background: #fff8e6;
}

.notification-item.is-unread:hover {
    background: #fff3d6;
}

.notification-item.priority-high.is-unread {
    background: #fff0f0;
}

.notification-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color, #222);
}

.notification-item-body {
    font-size: 0.78rem;
    color: var(--text-muted, #666);
    margin-top: 0.15rem;
}

.dashboard-action-strip {
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent, #f39c12);
}

.dashboard-action-strip-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.dashboard-action-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.35rem;
    border-top: 1px solid var(--border-color, #eee);
    cursor: pointer;
    font-size: 0.9rem;
}

.dashboard-action-item:first-child {
    border-top: none;
}

.dashboard-action-item:hover {
    color: var(--primary);
}

.dashboard-action-item.priority-high .dashboard-action-label {
    font-weight: 600;
}

/* Form Grid Table */
.form-grid-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
}

.form-grid-table th, .form-grid-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.form-grid-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.form-grid-table tr:nth-child(even) {
    background-color: #fafafa;
}

.form-grid-table tr:hover {
    background-color: #f1f1f1;
}

.form-grid-table .text-center {
    text-align: center;
}

.grid-field-container {
    margin-bottom: 20px;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .form-grid-table th, .form-grid-table td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
}

    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 3px;
    vertical-align: middle;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tabs-container-small {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

.tab-btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.tab-btn-small.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.child-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent);
}

.child-sick {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

/* Documents View */
.category-item {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #eee;
    transition: background 0.2s;
}

.category-item:hover {
    background: #f0f2f5;
}

.document-item {
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.document-name {
    flex: 1;
    min-width: 0;
}

.document-item:hover {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.padding-left-1 { padding-left: 1rem; }

.stats-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stats-compact-item {
    font-size: 0.9rem;
    padding: 0.2rem 0;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
}

/* Timetable Styles */
.timetable-container {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
}

.timetable-grid {
    display: grid;
    grid-template-columns: 50px repeat(5, 1fr);
    min-width: 600px;
}

.timetable-header {
    background: #f8f9fa;
    padding: 0.8rem;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.timetable-header:last-child {
    border-right: none;
}

.timetable-period {
    background: #f8f9fa;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6;
    border-right: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timetable-cell {
    padding: 0;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    min-height: 80px;
    background: #fff;
    display: flex;
}

.timetable-cell:last-child {
    border-right: none;
}

.tt-entry {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-width: 0;
}

.tt-subject {
    color: var(--primary);
    margin-bottom: 0.2rem;
    word-break: break-word;
}

.tt-teacher, .tt-room {
    color: #666;
    font-size: 0.8rem;
}

.tt-multi-entry {
    border-left: 1px dashed #ddd;
}

/* Wochen-Stundenplan-Tabelle (Eltern/Schüler) */
.tt-week-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.tt-week-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.82rem;
}

.tt-week-table thead th {
    background: #f3f4f6;
    font-weight: 600;
    text-align: center;
    padding: 0.55rem 0.35rem;
    border-bottom: 2px solid #d1d5db;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tt-week-table th:last-child,
.tt-week-table td:last-child {
    border-right: none;
}

.tt-week-time-col {
    width: 4.75rem;
    background: #f8fafc !important;
    text-align: center !important;
    vertical-align: middle;
    border-right: 2px solid #d1d5db;
    padding: 0.4rem 0.25rem !important;
}

.tt-period-num {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    color: #111827;
}

.tt-period-time {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    color: #6b7280;
    margin-top: 0.1rem;
}

.tt-week-table tbody td {
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
    padding: 0.25rem;
    height: auto;
}

/* Sek I: einheitliche Blockhöhe, parallele Gruppen in einem Block */
.tt-week-table.tt-week-seki tbody td {
    height: 4.25rem;
    vertical-align: middle;
    overflow: hidden;
}

.tt-week-table.tt-week-seki .tt-week-empty {
    height: 4.25rem;
}

.tt-week-table.tt-week-seki .tt-week-cell {
    height: 100%;
    min-height: 0;
    justify-content: center;
}

.tt-week-table.tt-week-seki .tt-week-lesson {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.tt-week-table.tt-week-seki .tt-week-merged .tt-week-subject {
    font-size: 0.78rem;
    line-height: 1.2;
}

.tt-week-table.tt-week-seki .tt-week-merged .tt-week-meta {
    font-size: 0.65rem;
    line-height: 1.2;
    max-height: 2.1em;
    overflow: hidden;
}

.tt-week-table.tt-week-seki .tt-week-parallel .tt-week-lesson {
    background: #f5f9fc;
    border-style: dashed;
}

.tt-week-empty {
    background: #fafafa;
    height: 2.75rem;
}

.tt-week-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 2.5rem;
}

.tt-week-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tt-week-lesson {
    text-align: center;
    padding: 0.3rem 0.25rem;
    border-radius: 4px;
    background: #f0f7ff;
    line-height: 1.25;
    border: 1px solid #d6e6f8;
}

.tt-week-multi .tt-week-lesson {
    background: #f8fbff;
}

.tt-week-lesson + .tt-week-lesson {
    margin-top: 0;
}

.tt-week-subject {
    font-weight: 700;
    color: var(--primary, #1d4ed8);
    word-break: break-word;
}

.tt-week-meta {
    font-size: 0.72rem;
    color: #4b5563;
}

/* Oberstufe: Zellen wachsen mit Kursliste */
.tt-week-table.tt-week-phase tbody td {
    height: auto;
    vertical-align: top;
}

.tt-vp-notice {
    border-radius: 8px;
    border: 1px solid #f0e0b0;
}

.timetable-week-card > .flex-between {
    background: #fafbfc;
}

@media (max-width: 768px) {
    .tt-week-table {
        min-width: 560px;
        font-size: 0.75rem;
    }
    .tt-week-time-col {
        width: 3.75rem;
    }
    .tt-week-table thead th {
        padding: 0.4rem 0.2rem;
        font-size: 0.72rem;
    }
    .tt-week-meta {
        font-size: 0.65rem;
    }
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    transition: background 0.2s;
}

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

.position-relative { position: relative; }

@media (max-width: 768px) {
    .timetable-grid {
        grid-template-columns: 40px repeat(5, 1fr);
        min-width: 500px;
    }
    .timetable-cell {
        min-height: 60px;
        font-size: 0.8rem;
    }
    .tt-teacher, .tt-room {
        font-size: 0.7rem;
    }
}

/* Parents Consultation — compact parent booking */
.pc-parent-view h3 {
    margin-bottom: 0.75rem;
}

.pc-consultation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pc-consultation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    margin: 0;
    cursor: pointer;
}

.pc-consultation-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
    min-width: 0;
}

.pc-booking-container {
    margin-top: 0.5rem;
}

.pc-booking-header h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.pc-busy-hint {
    margin: -0.35rem 0 0.75rem;
}

.pc-timeline-scroll {
    /* Desktop: kein Extra-Scroll; Mobile siehe Media Query */
    overflow: visible;
}

.pc-timeline-inner {
    min-width: 0;
}

.pc-children {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pc-child-block {
    border: 1px solid var(--border-color, #e6eaee);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.pc-child-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: #f5f7fa;
    border-bottom: 1px solid var(--border-color, #e6eaee);
    font-weight: 600;
    font-size: 0.95rem;
}

.pc-child-class {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-muted, #667);
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
}

.pc-empty {
    padding: 0.75rem;
    margin: 0;
}

.pc-teacher-table {
    display: flex;
    flex-direction: column;
}

.pc-teacher-row {
    display: grid;
    grid-template-columns: minmax(9rem, 12rem) 1fr;
    gap: 0.4rem 0.75rem;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #e2e7ec;
    align-items: start;
    background: #ffffff;
}

.pc-teacher-row:last-child {
    border-bottom: none;
}

.pc-teacher-row:nth-child(even) {
    background: #e8eef5;
}

.pc-teacher-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.25;
}

.pc-teacher-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #667);
    line-height: 1.3;
    margin-top: 0.1rem;
}

.pc-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    min-width: 0;
}

.pc-parent-view .slot-btn {
    min-width: 2.85rem;
    width: 2.85rem;
    height: 1.85rem;
    padding: 0.15rem 0.2rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 2.85rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pc-parent-view .slot-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: #f0f7ff;
}

.pc-parent-view .slot-btn.free {
    border-color: #2ecc71;
    color: #1e8449;
}

.pc-parent-view .slot-btn.booked {
    background: #f1f3f5;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.pc-parent-view .slot-btn.blocked {
    background: #fde8e8;
    color: #c0392b;
    cursor: not-allowed;
}

.pc-parent-view .slot-btn.busy {
    background: #f1f3f5;
    border-color: #ced4da;
    color: #868e96;
    cursor: not-allowed;
    opacity: 0.72;
    text-decoration: line-through;
}

.pc-parent-view .slot-btn.my-booking {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    cursor: pointer;
    font-weight: 600;
}

.pc-parent-view .slot-btn.my-booking:hover {
    background: #c3e6cb;
}

@media (max-width: 640px) {
    .pc-consultation-item {
        flex-direction: column;
        align-items: stretch;
    }

    /* Ein gemeinsamer Horizontal-Scroll für alle Kinder/Lehrkräfte */
    .pc-timeline-scroll {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        margin: 0 -0.15rem;
        padding-bottom: 0.35rem;
        scrollbar-width: thin;
        mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 1.5rem), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 1.5rem), transparent 100%);
    }

    .pc-timeline-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .pc-timeline-scroll::-webkit-scrollbar-thumb {
        background: #c5ced8;
        border-radius: 2px;
    }

    .pc-timeline-inner {
        width: max-content;
        min-width: 100%;
    }

    .pc-child-block {
        overflow: visible;
    }

    .pc-child-header,
    .pc-empty {
        position: sticky;
        left: 0;
        z-index: 3;
        width: var(--pc-sticky-w, 100%);
        box-sizing: border-box;
    }

    .pc-teacher-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.5rem;
        width: max-content;
        min-width: 100%;
        padding: 0.5rem 0.75rem 0.5rem 0;
        padding-left: 0;
    }

    .pc-teacher-meta {
        position: sticky;
        left: 0;
        z-index: 2;
        flex: 0 0 8.75rem;
        width: 8.75rem;
        padding: 0.15rem 0.55rem 0.15rem 0.65rem;
        background: inherit;
        box-shadow: 6px 0 10px -6px rgba(26, 40, 60, 0.28);
    }

    .pc-slots {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        overflow: visible;
        gap: 0.35rem;
        padding-right: 1rem;
    }

    .pc-parent-view .slot-btn {
        flex: 0 0 2.75rem;
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2rem;
        font-size: 0.8rem;
    }
}

/* Oberstufe: vorläufige Phasenübersicht im Vertretungs-/Stundenplan */
.pc-phase-notice {
    margin: 0;
    padding: 0.75rem 1rem;
    background: #fff8e6;
    border-bottom: 1px solid #f0e0b0;
    color: #5c4a1a;
}

.pc-phase-notice-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.pc-phase-notice-text {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.pc-phase-notice-text:last-child,
.pc-phase-notice-text.margin-0 {
    margin-bottom: 0;
}

/* Parents Consultation — teacher schedule */
.pc-teacher-view {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pc-teacher-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    padding: 0.35rem 0 0.55rem;
    border-bottom: 1px solid var(--border-color, #e6eaee);
}

.pc-teacher-picker-select {
    flex: 1 1 240px;
    min-width: 0;
    max-width: 420px;
    height: 2.5rem;
    box-sizing: border-box;
    padding: 0.45rem 0.65rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
}

.pc-teacher-bar-room {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    flex: 0 1 auto;
}

.pc-teacher-bar-room label {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color, #333);
    line-height: 1;
}

.pc-teacher-bar-room #teacher-room {
    width: 7rem;
    height: 2.5rem;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    font-size: 1.05rem;
    line-height: 1.2;
}

.pc-teacher-bar-room .btn-small,
.pc-teacher-bar-room #pc-teacher-save-room {
    height: 2.5rem;
    box-sizing: border-box;
    margin: 0;
    margin-left: 0.35rem;
    padding: 0 0.9rem;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.pc-teacher-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pc-teacher-schedule-table {
    width: 100%;
    table-layout: fixed;
}

.pc-teacher-schedule-table .pc-col-time {
    width: 7.5rem;
    white-space: nowrap;
}

.pc-teacher-schedule-table .pc-col-status {
    width: 5.5rem;
}

.pc-teacher-schedule-table .pc-col-people {
    width: 32%;
    min-width: 11rem;
}

.pc-teacher-schedule-table .pc-col-participants {
    width: 22%;
    min-width: 8.5rem;
}

.pc-teacher-schedule-table .pc-col-actions {
    width: 7rem;
}

.pc-teacher-schedule-table td.pc-col-people,
.pc-teacher-schedule-table td.pc-col-participants {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.pc-people-compact {
    display: none;
}

.pc-people-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pc-people-student {
    font-weight: 500;
}

.pc-people-parent {
    font-size: 0.85rem;
    color: var(--text-muted, #667);
}

.pc-teacher-print-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

@media (max-width: 767px) {
    .pc-teacher-bar {
        flex-wrap: nowrap;
        gap: 0.4rem;
        align-items: center;
    }

    .pc-teacher-bar-room {
        flex: 0 0 auto;
    }

    .pc-teacher-bar-room label {
        display: none;
    }

    .pc-teacher-bar-room #teacher-room {
        width: 4.2rem;
        font-size: 1rem;
        padding: 0.4rem 0.35rem;
        height: 2.35rem;
    }

    .pc-teacher-bar-room .btn-small,
    .pc-teacher-bar-room #pc-teacher-save-room {
        height: 2.35rem;
        margin-left: 0.25rem;
        padding: 0 0.55rem;
        font-size: 0.8rem;
    }

    .pc-teacher-picker-select {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        font-size: 1rem;
        padding: 0.4rem 0.5rem;
        height: 2.35rem;
    }

    /* Compact: Zeit + Lernende (Klasse); Farben bleiben via .slot-* */
    .pc-teacher-schedule-table {
        table-layout: fixed;
        min-width: 0;
        width: 100%;
    }

    .pc-teacher-schedule-table .pc-col-status,
    .pc-teacher-schedule-table .pc-col-participants,
    .pc-teacher-schedule-table .pc-col-actions {
        display: none;
    }

    .pc-teacher-schedule-table .pc-col-time {
        width: 38%;
    }

    .pc-teacher-schedule-table .pc-col-people {
        width: 62%;
        min-width: 0;
    }

    .pc-teacher-schedule-table .pc-people-full {
        display: none;
    }

    .pc-teacher-schedule-table .pc-people-compact {
        display: inline;
        font-weight: 500;
        font-size: 0.95rem;
    }

    .pc-teacher-print-actions {
        margin-top: 1rem;
    }

    .pc-teacher-print-actions .btn {
        flex: 1 1 auto;
    }
}

/* Parents Consultation (admin/teacher shared) */
.consultation-list {
    width: 100%;
}

.teacher-matrix {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.slot-btn {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    min-width: 60px;
    text-align: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.slot-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: #f0f7ff;
}

.slot-btn.free {
    border-color: #2ecc71;
    color: #27ae60;
}

.slot-btn.booked {
    background: #f8f9fa;
    color: #95a5a6;
    cursor: not-allowed;
}

.slot-btn.my-booking {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.slot-student-name {
    font-size: 0.6rem;
    font-weight: bold;
    margin-top: 2px;
}

.no-propagation {
    /* Marker class, handled in JS */
}

@media print {
    .no-print {
        display: none !important;
    }
}

/* Admin Matrix */
.matrix-wrapper {
    overflow: auto;
    max-height: 600px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.matrix-table th, .matrix-table td {
    border: 1px solid #eee;
    padding: 4px;
    text-align: center;
    min-width: 30px;
}

.matrix-table th {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.matrix-table .sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 11;
    min-width: 150px;
    text-align: left;
    border-right: 2px solid #ddd;
}

.matrix-table th.sticky-col {
    z-index: 12;
}

/* Status Colors for Matrix and Legend */
.slot-free {
    background-color: #e8f5e9 !important; /* Light green */
}

.slot-booked {
    background-color: #f1c40f !important; /* Gold/Yellow for booked slots */
}

.slot-blocked {
    background-color: #fce4ec !important; /* Light red */
}

.matrix-table td[title]:hover {
    filter: brightness(0.9);
    cursor: help;
}

.matrix-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-item .box {
    width: 15px;
    height: 15px;
    border-radius: 2px;
}

.text-tiny { font-size: 0.7rem; }

@media print {
    .matrix-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }
    .matrix-table {
        font-size: 0.6rem;
    }
    .matrix-table .sticky-col {
        position: static;
        border-right: 1px solid #eee;
    }
    .matrix-table th {
        position: static;
    }
}

/* Meeting search and tags */
.search-container {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.search-category {
    background: #f1f3f5;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
}

.search-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-item:hover {
    background: #f8f9fa;
}

.search-item:last-child {
    border-bottom: none;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #e9ecef;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    border: 1px solid #dee2e6;
}

.tag-blue {
    background: #e7f5ff;
    color: #1971c2;
    border: 1px solid #a5d8ff;
}

.tag-green {
    background: #ebfbee;
    color: #2b8a3e;
    border: 1px solid #b2f2bb;
}

.tag i {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tag i:hover {
    opacity: 1;
}

.bold { font-weight: bold; }
.full-width { width: 100%; }
.margin-right-05 { margin-right: 0.5rem; }
.padding-top-1 { padding-top: 1rem; }
.border-top { border-top: 1px solid #eee; }
.cursor-pointer { cursor: pointer; }

@media (min-width: 768px) {
    .border-left-md { border-left: 1px solid #eee; }
    .padding-left-md { padding-left: 1.5rem; }
}

.btn-large { padding: 0.8rem 1.5rem; font-size: 1rem; }
.text-danger { color: #e74c3c !important; }

.hidden {
    display: none !important;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}



.form-group label {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--primary);
}

/* Parent Info View */
.student-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.8rem;
    padding: 0.5rem;
}

.student-item-mini {
    padding: 0.8rem;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.2s;
}

.student-item-mini:hover {
    background: #e9ecef;
    border-color: var(--accent);
}

.parents-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.parent-detail-box {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.parent-name-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.1rem;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.info-row i {
    width: 20px;
    color: var(--accent);
    margin-top: 3px;
    text-align: center;
}


.form-group input, 
.form-group select, 
.form-group textarea {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-size: 1rem;
}

/* Formular-Editor: Kategorie + Gruppe nebeneinander */
.form-assign-split {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.form-assign-split .form-assign-category {
    width: 14rem;
    min-width: 12rem;
    max-width: 16rem;
    flex: 0 0 14rem;
}
.form-assign-split .form-assign-entity {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
}

/* Formular-Editor: einklappbare Metadaten */
.editor-settings-panel {
    margin-bottom: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #f8f9fa;
    /* visible: Besitzer-Autocomplete darf aus dem Panel ragen */
    overflow: visible;
}
.editor-settings-panel .editor-settings-body {
    overflow: visible;
}
.editor-settings-panel .form-owner-search {
    position: relative;
    z-index: 20;
}
.form-owner-chips {
    min-height: 0;
    margin-bottom: 0.35rem;
}
.form-owner-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem 0.2rem 0.55rem;
    background: #fff;
    border: 1px solid #cfd6dd;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1.2;
}
.form-owner-chip-remove {
    border: 0;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.1rem;
}
.form-owner-chip-remove:hover {
    color: #b00020;
}
.editor-settings-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}
.editor-settings-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}
.editor-settings-toggle-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.editor-settings-toggle-left .editor-settings-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.editor-settings-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}
.forms-editor-card.settings-collapsed .editor-container {
    height: calc(100vh - 190px);
    min-height: 560px;
}
.forms-editor-card:not(.settings-collapsed) .editor-container {
    height: calc(100vh - 350px);
    min-height: 500px;
}

/* True form preview modal (fill renderer) */
.modal-content.form-preview-modal {
    width: min(1100px, 96vw);
    max-width: min(1100px, 96vw);
    max-height: 94vh;
}

.form-preview-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.form-preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.form-preview-frame {
    background: #eef1f4;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    padding: 1rem;
    overflow: auto;
    max-height: calc(94vh - 180px);
}

.form-preview-frame--mobile {
    display: flex;
    justify-content: center;
}

.form-preview-frame--mobile .form-preview-card {
    width: 100%;
    max-width: 390px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.form-preview-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1rem 0.5rem;
}

.form-preview-title {
    margin: 0;
    font-size: 1.25rem;
}

.form-preview-divider {
    margin: 1rem 0 0;
    border: 0;
    border-top: 1px solid #eee;
}

.form-preview-fields {
    padding: 0.25rem 0 1rem;
}

.form-preview-actions {
    display: flex;
    justify-content: flex-end;
}

/* Form Generator & Renderer Styles */
.editor-container {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 1.5rem;
    height: calc(100vh - 350px);
    min-height: 500px;
}

.editor-toolbox, .editor-canvas, .editor-properties {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
}

.toolbox-section {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #999;
    margin: 0.5rem 0 0.3rem;
    border-bottom: 1px solid #f0f0f0;
}

.toolbox-item {
    padding: 0.6rem;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.toolbox-item:hover {
    background: #eef2f7;
    border-color: var(--accent);
}

.editor-toolbox h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.2rem;
}

.editor-canvas {
    display: block;
    position: relative;
    background: #f4f6f8;
    background-image: 
        linear-gradient(45deg, #e5e5f7 25%, transparent 25%), 
        linear-gradient(-45deg, #e5e5f7 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #e5e5f7 75%), 
        linear-gradient(-45deg, transparent 75%, #e5e5f7 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    min-height: 800px;
    overflow: auto; /* Allow scrolling if fields are outside */
    padding: 0;
    margin: 0;
}

.editor-wysiwyg-header {
    position: relative;
    padding: 0;
    background: transparent;
    margin-bottom: 1.5rem;
    pointer-events: none;
    width: 100%;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 2px solid #333;
    padding-bottom: 0.8rem;
}

.editor-wysiwyg-header h2, 
.editor-wysiwyg-header p {
    padding: 0;
    margin: 0;
}

.editor-wysiwyg-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.editor-wysiwyg-header p {
    color: #666;
    font-size: 0.95rem;
}

.editor-field-card {
    position: absolute;
    background: white;
    padding: 0.8rem;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: move;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    user-select: none;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.editor-field-card.selected {
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3), 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
}

/* Rich Text Editor */
.richtext-editor-container {
    background: #fff;
    cursor: default;
}

.richtext-content {
    user-select: text;
    cursor: text;
}

.richtext-toolbar button {
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    color: #444;
}

.richtext-display {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
}

.field-item-richtext {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Rich Text List Styling */
.richtext-content ul, .richtext-display ul {
    list-style-type: disc !important;
    padding-left: 2rem !important;
    margin: 0.5rem 0 !important;
}

.richtext-content li, .richtext-display li {
    margin-bottom: 0.2rem !important;
    display: list-item !important;
}

.richtext-content ol, .richtext-display ol {
    list-style-type: decimal !important;
    padding-left: 2rem !important;
    margin: 0.5rem 0 !important;
}

.editor-field-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.resize-handle-w, .resize-handle-h, .resize-handle-se {
    position: absolute;
    background: transparent;
    z-index: 21;
}

.resize-handle-w {
    right: 0;
    top: 0;
    bottom: 10px;
    width: 10px;
    cursor: ew-resize;
}

.resize-handle-h {
    bottom: 0;
    left: 0;
    right: 10px;
    height: 10px;
    cursor: ns-resize;
}

.resize-handle-se {
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
    opacity: 0;
}

.editor-field-card.selected .resize-handle-w,
.editor-field-card.selected .resize-handle-h {
    background: var(--accent);
    opacity: 0.3;
}

.editor-field-card.selected .resize-handle-se {
    opacity: 1;
}

.editor-grid-12 { width: 100%; }
.editor-grid-6 { width: calc(50% - 0.75rem); }
.editor-grid-4 { width: calc(33.33% - 0.75rem); }
.editor-grid-3 { width: calc(25% - 0.75rem); }

.info-box {
    background: #e7f3ff;
    padding: 0.8rem;
    border-radius: 4px;
    border-left: 4px solid #007bff;
    font-size: 0.9rem;
}

.signature-preview {
    height: 60px;
    background: #fff;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8rem;
}

/* Parent Portal Form Renderer */
.form-container {
    position: relative;
    overflow-x: auto;
    min-height: 400px;
    background: white;
    padding: 2rem 0;
    border-radius: 8px;
}

.form-container > p,
.form-container .form-actions {
    padding: 0 2rem;
}

.form-renderer-grid {
    position: relative;
    display: block;
    width: 100%;
    min-height: 300px;
    overflow: visible;
}

.field-item {
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    gap: 0.3rem;
    z-index: 5;
}

.form-footer-actions {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
    display: flex;
    justify-content: flex-start;
    position: relative;
    z-index: 100;
    background: white;
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.field-item label {
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.3rem;
}

.field-item input, .field-item select, .field-item textarea {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .form-renderer-grid {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 1.5rem !important;
    }
    
    .field-item {
        position: static !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .editor-wysiwyg-header {
        position: static !important;
        margin-bottom: 2rem;
    }
}

.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.8rem;
    background: #fff;
    border-radius: 4px;
}

.group-border {
    border: 1px solid #ddd;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    color: #666;
}

.signature-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    display: inline-block;
    max-width: 100%;
}

.signature-pad {
    background: #fff;
    border: 1px solid #f0f0f0;
    cursor: crosshair;
    max-width: 100%;
}

.info-text {
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid var(--accent);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.form-completed {
    opacity: 0.8;
    background: #f0fff4;
}

.form-expired {
    border-color: #f5c6cb;
    background: #fff5f5;
}

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

.badge-danger {
    background: #dc3545;
    color: white;
}

.form-item-card {
    transition: transform 0.2s;
}

.form-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.invite-editor-wrapper {
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.invite-editor-wrapper .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--border-color, #ddd);
}

.invite-editor-wrapper .ql-container.ql-snow {
    border: none;
    min-height: 220px;
    font-size: 0.95rem;
}

.invite-editor-wrapper .ql-editor {
    min-height: 200px;
}

.invite-editor-wrapper .ql-editor img {
    max-width: 100%;
    height: auto;
}

.invite-placeholders .btn-small {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
}

.student-group-title {
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    margin-top: 1.5rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle-label {
    user-select: none;
}

/* Calendar Views */
.view-switcher {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Shared Calendar Styles for School and Personal Calendar */
.calendar-container {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 160px);
    min-height: 500px;
}

.calendar-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-group {
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.btn-group .btn {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    background: #fff;
    color: #333 !important;
}

.btn-group .btn:last-child {
    border-right: none;
}

.btn-group .btn.btn-primary {
    background: var(--accent);
    color: white !important;
}

.btn-group .btn:hover:not(.btn-primary) {
    background: #f8f9fa;
}

.desktop-only { display: inline; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .calendar-container {
        flex-direction: column;
        height: auto;
    }
    
    .calendar-toolbar {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .desktop-only { display: none; }
    .mobile-only { display: inline-block; }
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}

.view-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #eee;
    background: #fff;
}

.calendar-header-cell {
    padding: 0.8rem;
    background: #f8f9fa;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
}

.calendar-cell {
    min-height: 100px;
    padding: 0.5rem;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
}

.calendar-cell.other-month {
    background: #fcfcfc;
    color: #ccc;
}

.calendar-cell.today {
    background: #fffdeb;
}

.calendar-day-num {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.calendar-event {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    background: #eef6ff;
    color: var(--primary);
    border-left: 3px solid var(--accent);
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event:hover {
    background: #dceaff;
}

.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calendar-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    transition: transform 0.2s;
}

.calendar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.calendar-item-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    background: #eef6ff;
    color: var(--primary);
    border: 1px solid var(--accent);
    border-radius: 8px;
}

.date-day {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
}

.date-month {
    font-size: 0.8rem;
    text-transform: uppercase;
}

.calendar-item-info {
    flex: 1;
}

.calendar-item-summary {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary);
}

.calendar-item-location {
    font-size: 0.85rem;
    color: #666;
    margin: 0.3rem 0;
}

.calendar-item-desc {
    font-size: 0.9rem;
    color: #444;
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    .calendar-header-cell {
        display: none;
    }
    .calendar-cell {
        min-height: auto;
    }
    
    .calendar-week-desktop {
        display: none;
    }
    .calendar-week-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    .calendar-week-desktop {
        display: block;
    }
    .calendar-week-mobile {
        display: none;
    }
}

/* Calendar Time Grid Desktop */
.calendar-time-grid-container {
    overflow-x: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-top: 1rem;
}

.calendar-time-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    position: relative;
    min-width: 800px;
    background: #fff;
}

.time-column-header, .day-column-header {
    height: 60px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #eee;
}

.day-column-header.today {
    background: #fffdeb;
    color: var(--accent);
}

.time-cell {
    padding: 0.5rem;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    font-size: 0.8rem;
    color: #666;
    border-right: 2px solid #dee2e6;
    border-bottom: 1px solid #eee;
    height: 50px;
}

.grid-row-cell {
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    height: 50px;
}

.grid-row-cell:nth-child(8n) {
    border-right: none;
}

.all-day-label {
    background: #f1f3f4;
    font-weight: bold;
    font-size: 0.75rem;
    height: auto;
    min-height: 50px;
    align-items: center;
}

.all-day-cell {
    background: #f8f9fa;
    border-right: 1px solid #eee;
    border-bottom: 2px solid #dee2e6;
    min-height: 50px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event-header {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.events-overlay {
    position: absolute;
    top: 110px; /* Header (60px) + All-day row (min 50px) */
    left: 60px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.calendar-event-absolute {
    position: absolute;
    padding: 1px;
    pointer-events: auto;
    z-index: 10;
}

.event-inner {
    background: #eef6ff;
    color: var(--primary);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    height: 100%;
    padding: 4px;
    font-size: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.event-inner:hover {
    background: #dceaff;
    z-index: 20;
}

.event-time {
    font-weight: bold;
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.event-summary {
    line-height: 1.1;
    word-break: break-word;
}

.calendar-nav-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.calendar-nav-controls .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Child Status Styles */
.child-sick {
    border-left-color: #e74c3c !important;
    background: #fff5f5 !important;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Modal tweaks */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    text-align: right;
    margin-top: 0;
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: #999;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tabs */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    padding: 0.8rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Tags / Groups */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #eef2f7;
    color: #4a5568;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

.margin-top-05 { margin-top: 0.5rem; }
.btn-block { width: 100%; }
.col-6 { width: calc(50% - 0.5rem); }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

.sidebar-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    font-weight: bold;
    display: inline-block;
    vertical-align: middle;
}

.text-right { text-align: right; }

/* Formularwesen Styles */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-item-card {
    border-left: 5px solid #f1c40f;
}

.form-item-card.form-completed {
    border-left: 5px solid #27ae60;
}

.form-renderer-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-warning { background: #f1c40f; color: #000; }
.badge-success { background: #27ae60; color: #fff; }
.badge-danger { background: #e74c3c; color: #fff; }

.info-text {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #444;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 4px;
}

.btn-block {
    width: 100%;
}

.btn-filter {
    padding: 0.4rem 0.8rem;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-filter.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-filter:hover:not(.active) {
    background: #e9ecef;
}

.assignment-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Form Editor Improvements */
.editor-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
}

.editor-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.editor-toolbox {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.toolbox-section.collapsible {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #eee;
    border-radius: 4px;
    margin-bottom: 2px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.toolbox-section.collapsible:hover {
    background: #e0e0e0;
}

.toolbox-content {
    padding: 0.5rem 0;
}

.toolbox-item {
    background: white;
    border: 1px solid #ccc;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.toolbox-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editor-canvas {
    flex: 1;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 500px;
    overflow: auto;
    position: relative;
}

.editor-properties {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.grid-12 { grid-column: span 12; }
.grid-6 { grid-column: span 6; }
.grid-4 { grid-column: span 4; }
.grid-3 { grid-column: span 3; }

.info-box {
    background: #e7f3ff;
    padding: 0.8rem;
    border-radius: 4px;
    border-left: 4px solid #007bff;
    font-size: 0.9rem;
}

/* Form Grouping & Toggle */
.student-forms-group {
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 8px;
    background: #fdfdfd;
}

.student-group-title {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    color: var(--primary);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle-switch input {
    width: 40px;
    height: 20px;
    appearance: none;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    outline: none;
}

.toggle-switch input:checked {
    background: var(--accent);
}

.toggle-switch input::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch input:checked::before {
    transform: translateX(20px);
}

.form-item-card.form-completed {
    opacity: 0.8;
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

/* Parent Information Layout */
.parents-search-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 340px);
    min-height: 400px;
}

@media (max-width: 767px) {
    .parents-search-layout {
        flex-direction: column;
        height: auto;
        min-height: 0;
        gap: 0;
    }
}

.parents-list-pane {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

@media (max-width: 767px) {
    .parents-list-pane {
        flex: 1;
        width: 100%;
    }
}

.parents-details-pane {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.parents-list-pane .card.full-height {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.listbox-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    min-height: 0;
}

.listbox-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.listbox-item:last-child {
    border-bottom: none;
}

.listbox-item:hover {
    background: #f8f9fa;
}

.listbox-item.active {
    background: var(--accent);
    color: white;
}

.listbox-item.active .text-muted {
    color: rgba(255,255,255,0.8);
}

.parents-info-split {
    display: flex;
    gap: 0;
    margin-top: 1rem;
}

.parent-detail-box {
    flex: 1;
    padding: 0 1.5rem;
}

.parent-detail-box.border-right {
    border-right: 1px solid #eee;
}

.parent-name-header {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.info-row.flex-start {
    align-items: flex-start;
}

.info-row i {
    width: 20px;
    color: var(--accent);
    text-align: center;
}

.full-height {
    height: 100%;
}

@media (max-width: 992px) {
    .parents-search-layout {
        flex-direction: column;
        height: auto;
    }
    
    .parents-list-pane {
        flex: none;
        height: 300px;
    }
    
    .parents-info-split {
        flex-direction: column;
        gap: 2rem;
    }
    
    .parent-detail-box {
        padding: 0;
    }
    
    .parent-detail-box.border-right {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 1.5rem;
    }
}


/* File Manager Styles */
.file-table .file-row:hover {
    background: #f8f9fa;
}

.file-row td {
    vertical-align: middle;
}

.action-cell {
    position: relative;
    width: 40px;
}

/* File Manager Styles */
.breadcrumb-item {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb-item:hover {
    text-decoration: underline;
    color: var(--accent);
}

.file-row:hover {
    background-color: #f8f9fa;
}

.file-table {
    user-select: none;
}

.file-table td {
    vertical-align: middle;
}

.file-actions {
    margin-bottom: 1rem;
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.badge-office {
    font-size: 0.7rem;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 5px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

.badge-text {
    font-size: 0.7rem;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 5px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

.btn-icon {
    background: none;
    border: none;
    color: #666;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.btn-icon:hover {
    background: #eee;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 150px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    border-radius: 4px;
    z-index: 100;
    text-align: left;
}

.dropdown-menu a {
    display: block;
    padding: 0.8rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f9f9f9;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    margin: 0.3rem 0;
    overflow: hidden;
    background-color: #eee;
}

.dropdown-menu a i {
    width: 1.2rem;
    margin-right: 0.5rem;
}

.card-header h5 {
    font-size: 1.1rem !important;
    font-weight: 600;
    margin: 0;
    color: var(--primary);
}

.btn-primary {
    background: var(--accent, #3498db) !important;
    color: white !important;
    border: none;
}

.btn-primary:hover {
    background: #2980b9 !important;
}

.btn-outline {
    background: white !important;
    border: 1px solid var(--accent, #3498db) !important;
    color: var(--accent, #3498db) !important;
}

.btn-outline:hover {
    background: var(--accent, #3498db) !important;
    color: white !important;
}

.margin-right-05 {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .show-desktop {
        display: none !important;
    }
}

/* Substitution Schedule */
.subst-cancelled {
    color: var(--danger-color, #dc3545);
    background-color: #fff5f5;
}
.subst-cancelled td:not(:last-child):not(:nth-last-child(2)) {
    text-decoration: line-through;
}
.subst-active {
    font-weight: bold;
    background-color: #fffdf0;
}
.subst-event {
    background-color: #f0f7ff;
    color: #004085;
}
.table-mini {
    font-size: 0.85rem;
}
.table-mini td {
    padding: 4px 8px !important;
}

/* Modern Form Styling */
.modern-form {
    max-width: 800px;
}

.form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row > .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Krankmeldung: kompakte Felder auf Tablet/Desktop */
.sick-note-form .form-row {
    max-width: 36rem;
}

.sick-note-form .sick-note-child {
    max-width: 22rem;
}

.sick-note-form .sl-type-pane .form-row input {
    width: 100%;
}

.sick-note-quick .form-row {
    max-width: 100%;
}

/* Lehrkraft Krankmeldungen */
.teacher-sick-page {
    padding: 0;
    overflow: hidden;
}

.teacher-sick-toolbar {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.teacher-sick-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    min-width: 8rem;
}

.teacher-sick-toolbar .toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.teacher-sick-class-select {
    width: auto;
    min-width: 9rem;
    max-width: 12rem;
    margin-left: 1.25rem;
    height: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.teacher-sick-body {
    padding: 0.5rem 0.75rem 0.75rem;
}

.teacher-sick-meta {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted, #777);
}

.teacher-sick-class-block {
    margin-bottom: 1.35rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--accent, #3498db);
}

.teacher-sick-class-heading {
    margin: 0 0 0.45rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-color, #222);
}

.teacher-sick-class-count {
    margin-left: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted, #888);
}

.teacher-sick-person-list {
    margin: 0;
    padding-left: 0.15rem;
    list-style: none;
}

.teacher-sick-person {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    padding: 0.2rem 0;
    font-size: 0.92rem;
}

.teacher-sick-person-name {
    font-weight: 500;
    color: #444;
}

.teacher-sick-person-meta {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted, #888);
}

.teacher-sick-week-scroll {
    overflow-x: auto;
}

.teacher-sick-week-table {
    width: 100%;
    min-width: 32rem;
    font-size: 0.88rem;
    margin-bottom: 0;
}

.teacher-sick-week-table th,
.teacher-sick-week-table td {
    vertical-align: middle;
}

.teacher-sick-cell.is-sick {
    color: #c0392b;
}

.teacher-sick-cell.is-sick .fa-user-injured {
    font-size: 1.25rem;
    line-height: 1;
}

.teacher-sick-cell.is-unexcused {
    color: #a04000;
}

.teacher-sick-cell.is-unexcused .fa-user-times {
    font-size: 1.25rem;
    line-height: 1;
}

.teacher-sick-mark-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-muted, #f7f7f8);
}

.teacher-sick-mark-option {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    margin: 0;
    cursor: pointer;
}

.teacher-sick-period-inputs {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.teacher-sick-period-inputs label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    font-size: 0.78rem;
}

.teacher-sick-period-input {
    width: 2.75rem;
    height: 1.6rem;
    padding: 0.1rem 0.25rem;
    display: inline-block;
    font-size: 0.8rem;
}

.teacher-sick-mark-hint {
    margin-left: auto;
    font-size: 0.75rem;
}

.teacher-sick-roster-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.teacher-sick-roster-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    min-height: 2rem;
    padding: 0.15rem 0.1rem;
    border-bottom: 1px solid var(--border-color, #eee);
    font-size: 0.88rem;
    line-height: 1.25;
}

.teacher-sick-roster-row.is-absent {
    background: rgba(192, 57, 43, 0.04);
}

.teacher-sick-roster-row .teacher-sick-person-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 500;
}

.teacher-sick-roster-leaves {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem 0.4rem;
    flex: 0 1 auto;
    max-width: 42%;
    overflow: hidden;
}

.teacher-sick-roster-leave {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15rem 0.25rem;
    white-space: nowrap;
}

.teacher-sick-roster-leave .teacher-sick-person-meta {
    font-size: 0.72rem;
}

.teacher-sick-roster-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.teacher-sick-mark-btn {
    padding: 0.12rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.2;
    min-height: 1.6rem;
}

.teacher-sick-undo-btn {
    padding: 0.12rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.2;
    min-height: 1.6rem;
    color: #555;
    border: 1px solid var(--border-color, #ccc);
    background: #fff;
}

.teacher-sick-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.05rem 0.28rem;
    border-radius: 0.15rem;
    line-height: 1.2;
    min-width: 1rem;
    text-align: center;
    border: none;
    font-family: inherit;
}

button.teacher-sick-badge.is-toggle {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

button.teacher-sick-badge.is-toggle:active {
    transform: scale(0.96);
}

.teacher-sick-status-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.35rem;
    border-left: 1px solid var(--border-color, #ddd);
}

.teacher-sick-badge.is-excused {
    color: #1e6b3a;
    background: rgba(39, 174, 96, 0.14);
}

.teacher-sick-badge.is-unexcused {
    color: #8a3b00;
    background: rgba(230, 126, 34, 0.16);
}

.teacher-sick-withdraw-btn {
    padding: 0.05rem 0.28rem;
    line-height: 1;
    font-size: 0.7rem;
    min-height: 1.35rem;
}

@media (max-width: 768px) {
    .teacher-sick-class-select {
        margin-left: 0;
        min-width: 6.5rem;
        max-width: 9rem;
        height: 1.85rem;
        font-size: 0.8rem;
    }

    .teacher-sick-mark-hint {
        display: none;
    }

    .teacher-sick-roster-row {
        min-height: 1.85rem;
        padding: 0.1rem 0;
        gap: 0.25rem 0.35rem;
    }

    .teacher-sick-roster-leaves {
        max-width: 38%;
    }

    .teacher-sick-roster-leave .teacher-sick-person-meta {
        max-width: 4.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row > .form-group {
        margin-bottom: 1rem;
    }

    .sick-note-form .form-row,
    .sick-note-form .sick-note-child {
        max-width: none;
    }
    
    .btn-block-mobile {
        width: 100%;
    }
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: #333;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-footer {
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-primary.btn-block-mobile i {
    margin-right: 0.5rem;
}

.margin-top-15 { margin-top: 1.5rem; }

/* Collapsible Card */
.collapsible-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.collapsible-trigger h3 {
    margin: 0;
    border: none !important;
    padding: 0 !important;
}

.collapsible-marker {
    transition: transform 0.3s ease;
    color: var(--secondary);
}

.collapsible-content {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.card.active .collapsible-content {
    display: block;
}

.card.active .collapsible-marker {
    transform: rotate(180deg);
}

.group-folder-row {
    background-color: #f0f7ff !important;
}
.group-folder-row:hover {
    background-color: #e1efff !important;
}

/* Parents Consultation */
.teacher-matrix {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
}

.slot-btn {
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.slot-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.slot-btn.booked {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
}

.slot-btn.blocked {
    background: #e74c3c;
    color: white;
    cursor: not-allowed;
}

.slot-btn.free {
    border-color: #27ae60;
    color: #27ae60;
}

.slot-booked { background-color: #fff3cd; }
.slot-blocked { background-color: #f8d7da; }
.slot-free { background-color: #d4edda; }

.badge-draft { background: #95a5a6; color: white; }
.badge-active { background: #27ae60; color: white; }
.badge-closed { background: #34495e; color: white; }

/* Overrides for compact dialogs */
.modal-overlay .modal-content { padding: 1rem !important; }
.modal-overlay .modal-header { padding: 0.5rem 0 !important; margin-bottom: 0.5rem; border-bottom: 1px solid #eee; }
.modal-overlay .modal-header h2 { font-size: 1.1rem !important; margin: 0 !important; }
.modal-overlay .modal-footer { margin-top: 0.75rem !important; padding-top: 0.5rem !important; }
.booking-dialog-compact p { margin-top: 0; margin-bottom: 0.5rem; }

.student-header {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid var(--accent);
    margin-bottom: 10px;
}
.badge-subject {
    background: #e1f5fe;
    color: #0288d1;
    font-weight: normal;
    font-size: 0.75rem;
    margin-left: 8px;
}
.slot-btn.my-booking {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
    cursor: pointer;
}
.slot-btn.my-booking:hover {
    background-color: #c3e6cb;
}
.teacher-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dual List Styles */
.dual-list-container {
    display: flex;
    flex-direction: column;
}

.dual-list {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    min-height: 300px;
}

.list-panel .list-group {
    overflow-y: auto;
    max-height: 500px;
}

.list-item {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:hover {
    background: #f8f9fa;
}

.list-item.selected {
    background: #e3f2fd !important;
    border-left: 3px solid #007bff;
}

.list-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.form-control-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.bg-primary-light {
    background-color: #e3f2fd !important;
}

.span-2 {
    grid-column: span 2;
}

/* SASS Applicants Module */
.applicant-manager {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 160px);
    align-items: stretch;
}

.applicant-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.applicant-sidebar.collapsed {
    width: 40px;
}

.applicant-sidebar.collapsed .card-header,
.applicant-sidebar.collapsed .list-group {
    display: none;
}

.sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.applicant-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

.tabs-header {
    display: flex;
    background: #eee;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.2s;
    border-right: 1px solid #ddd;
}

.tab-btn:hover {
    background: #e5e5e5;
}

.tab-btn.active {
    background: white;
    color: var(--accent);
    font-weight: bold;
    border-bottom: 2px solid var(--accent);
}

.applicant-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1rem;
    padding: 0.5rem;
}

.applicant-form-grid .form-group {
    margin-bottom: 0.25rem;
}

.applicant-form-grid label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 0.1rem;
    color: #666;
}

.applicant-form-grid .form-control {
    padding: 0.25rem 0.5rem;
    height: auto;
    font-size: 0.9rem;
}

.small-field {
    max-width: 120px;
}

.deckblatt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.deckblatt-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #eee;
    height: 100%;
}

.deckblatt-section h6 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 0.2rem;
    font-size: 0.9rem;
}

.deckblatt-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.deckblatt-label {
    color: #666;
    font-weight: bold;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.doc-item:hover {
    background: #f1f3f5;
}

.doc-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.doc-status-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-present { background: #d4edda; color: #155724; }
.status-missing { background: #f8d7da; color: #721c24; }
.status-not-required { background: #e2e3e5; color: #383d41; }
.status-placeholder { background: #e2e3e5; color: #383d41; }

.log-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
}

/* Switch/Toggle styles */
.account-list-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .account-list-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.switch-sm {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(14px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

@media (max-width: 768px) {
    .deckblatt-grid {
        grid-template-columns: 1fr;
    }
    
    .applicant-form-grid {
        grid-template-columns: 1fr;
    }
    
    .small-field {
        max-width: 100%;
    }

    #applicant-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: max(20px, env(safe-area-inset-top, 0px));
    right: max(20px, env(safe-area-inset-right, 0px));
    left: max(20px, env(safe-area-inset-left, 0px));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 250px;
    animation: slideIn 0.3s ease-out;
}

.toast-success { background-color: #27ae60; }
.toast-error { background-color: #e74c3c; }
.toast-warning { background-color: #f39c12; }
.toast-info { background-color: #3498db; }

.toast.fade-out {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Sidebar Drag & Drop */
[draggable="true"] {
    cursor: grab;
    transition: transform 0.2s, background-color 0.2s;
    position: relative;
}

[draggable="true"]:active {
    cursor: grabbing;
}

[draggable="true"].dragging {
    opacity: 0.4;
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.05);
}

.drag-over-top::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
    z-index: 10;
}

.drag-over-bottom::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
    z-index: 10;
}

/* Ensure accordions also show drag feedback correctly */
.nav-accordion[draggable="true"].drag-over-top {
    border-top: none;
}

/* Dashboard Tiles Drag & Drop */
.draggable-tile {
    cursor: grab;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.draggable-tile:active {
    cursor: grabbing;
}

.draggable-tile.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.05);
}

.drag-over-left::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -10px;
    width: 6px;
    background-color: var(--accent);
    border-radius: 3px;
    z-index: 10;
}

.drag-over-right::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -10px;
    width: 6px;
    background-color: var(--accent);
    border-radius: 3px;
    z-index: 10;
}

/* Module Header & Consistency */
.module-header {
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
}

.module-header h5 {
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
}

.module-sidebar-header {
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
}

/* List Item Truncation */
.list-group .list-item, .tree-item, .listbox-item {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.list-group .list-item > div, .tree-item > span, .listbox-item > div {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100%;
}

/* Hamburger / Sidebar-Toggle: dunkle Farbe für Sichtbarkeit */
.btn-icon i.fa-bars, 
.btn-icon i.fa-bars-staggered,
.btn-icon i.fa-bars-progress,
.btn-icon i.fa-arrow-left,
.btn-icon i.fa-table-columns {
    color: #2c3e50 !important;
    font-size: 1.2rem;
}

/* Firefox Fix for Outline Buttons */
.btn-outline {
    -moz-appearance: none;
    text-shadow: none;
}

@-moz-document url-prefix() {
    .btn-outline {
        color: var(--accent, #3498db) !important;
    }
}

/* IT Info Module Styles */
.it-management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.it-span-2 {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .it-management-grid {
        grid-template-columns: 1fr;
    }
    .it-span-2 {
        grid-column: span 1;
    }
}

.license-module {
    margin-bottom: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.license-module.is-inactive {
    opacity: 0.6;
    background: #fafafa;
}

.license-module-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.license-groups {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.license-group-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.25rem;
}

.license-functions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.5rem;
}

.license-function-item {
    font-size: 0.85rem;
    color: #666;
}

.badge-light {
    background: #eee;
    color: #666;
}

.text-muted { color: #6c757d; }

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator-small {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-green { background-color: #27ae60; box-shadow: 0 0 5px #27ae60; }
.status-yellow { background-color: #f1c40f; box-shadow: 0 0 5px #f1c40f; }
.status-red { background-color: #e74c3c; box-shadow: 0 0 5px #e74c3c; }

.dot-red { background-color: #e74c3c; width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background-color: #27ae60; width: 8px; height: 8px; border-radius: 50%; }

.status-select {
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.it-msg-item {
    transition: opacity 0.3s;
}

.resolved-op {
    opacity: 0.7;
}

.it-thread {
    background: #f9f9f9;
    padding: 0.5rem;
    border-radius: 4px;
}

.text-xs { font-size: 0.75rem; }
.text-bold { font-weight: bold; }

.it-dashboard-sys-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.it-dashboard-sys-item:last-child {
    border-bottom: none;
}

.scrollable-y {
    overflow-y: auto;
}

.padding-y-025 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.padding-y-05 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.bg-light { background-color: #f8f9fa; }
.border-radius-4 { border-radius: 4px; }
.transition-transform { transition: transform 0.2s ease; }
.fa-rotate-90 { transform: rotate(90deg); }
.animate-fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* License Management Styles */
.it-management-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.it-span-2 {
    grid-column: span 2;
}

.license-structure {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.license-module {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.license-module.is-active {
    border-left: 5px solid #27ae60;
}

.license-module.is-limited {
    border-left: 5px solid #f39c12;
    background: #fffdf5;
}

.license-module.is-inactive {
    border-left: 5px solid #bdc3c7;
    opacity: 0.8;
}

.license-module-header {
    padding: 1rem;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.license-groups {
    padding: 1rem;
    flex-grow: 1;
}

.license-group {
    margin-bottom: 1rem;
}

.license-group:last-child {
    margin-bottom: 0;
}

.license-group-name {
    font-size: 0.8rem;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed #ddd;
}

.license-functions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.license-function-item {
    font-size: 0.85rem;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #eee;
    color: #444;
}

/* Toggle Switch */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent);
}

input:checked + .slider:before {
  -webkit-transform: translateX(14px);
  -ms-transform: translateX(14px);
  transform: translateX(14px);
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

.text-warning { color: #f39c12; }
.text-muted { color: #95a5a6; }

@media (max-width: 1100px) {
    .it-management-grid {
        grid-template-columns: 1fr;
    }
}

/* Context Menu (shared) */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    padding: 5px 0;
    min-width: 160px;
    z-index: 2000;
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-item:hover {
    background: #f0f0f0;
}

.context-menu-item i {
    width: 16px;
    text-align: center;
    color: #555;
}

.context-menu-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.context-menu-item.text-danger,
.context-menu-item.danger {
    color: #dc3545;
}

.context-menu-item.text-success {
    color: #28a745;
}

/* Context Menu Trigger (Kebab Menu) */
.context-menu-trigger {
    margin-left: auto;
    padding: 4px 8px;
    color: #aaa;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Show on hover or on touch devices */
.list-item:hover .context-menu-trigger, 
.tree-item:hover .context-menu-trigger, 
.tree-branch .tree-item:hover .context-menu-trigger,
.file-list-row:hover .context-menu-trigger,
.grid-item:hover .context-menu-trigger,
.is-phone .context-menu-trigger, 
.is-tablet .context-menu-trigger {
    display: flex !important;
}

.context-menu-trigger:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

/* Help System */
.help-mode-active [data-help-id] {
    cursor: help !important;
    outline: 2px dashed #3498db !important;
    outline-offset: 2px;
    transition: outline 0.2s ease;
}

.help-mode-active [data-help-id]:hover {
    outline-color: #2980b9 !important;
    background-color: rgba(52, 152, 219, 0.05);
}

.help-tooltip-container {
    position: absolute;
    z-index: 10000;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 12px;
    display: none;
    pointer-events: none;
    border: 1px solid #ddd;
    font-size: 14px;
    line-height: 1.4;
}

.help-tooltip-container.visible {
    display: block;
    animation: fadeIn 0.2s ease;
}

.help-tooltip-container.persisted {
    pointer-events: auto;
    border-left: 4px solid #3498db;
}

.help-tooltip-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.help-tooltip-content {
    color: #555;
}

.help-tooltip-footer {
    margin-top: 10px;
    font-size: 12px;
    text-align: right;
}

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

.user-profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.btn-help-toggle {
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.btn-help-toggle:hover {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.help-mode-active .btn-help-toggle {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: max(20px, env(safe-area-inset-top, 0px));
    right: max(20px, env(safe-area-inset-right, 0px));
    left: max(20px, env(safe-area-inset-left, 0px));
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

#toast-container .toast {
    pointer-events: auto;
    max-width: min(100%, 360px);
    margin-left: auto;
}

.toast {
    min-width: 250px;
    padding: 12px 20px;
    background: #fff;
    color: #333;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid #3498db;
}

.toast.visible {
    transform: translateX(0);
}

.toast-success { border-left-color: #2ecc71; }
.toast-error { border-left-color: #e74c3c; }
.toast-warning { border-left-color: #f1c40f; }
.toast-info { border-left-color: #3498db; }

.toast i {
    font-size: 1.2rem;
}

.toast-success i { color: #2ecc71; }
.toast-error i { color: #e74c3c; }
.toast-warning i { color: #f1c40f; }
.toast-info i { color: #3498db; }

.audit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}
.audit-detail-full { grid-column: 1 / -1; }
.audit-details-json {
    max-height: 240px;
    overflow: auto;
    background: var(--bg-secondary, #f5f5f5);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
}

/* Audit-Protokoll: kompakte Darstellung für mehr Tabellenzeilen */
.audit-container h2 {
    margin: 0 0 0.15rem;
    font-size: 1.3rem;
    line-height: 1.2;
}
.audit-container .audit-subtitle {
    font-size: 0.82rem;
    line-height: 1.25;
}
.audit-container .audit-header {
    margin-bottom: 0.45rem;
}
.audit-container .audit-stats-row {
    margin-bottom: 0.45rem;
    gap: 0.5rem;
}
.audit-container .card-compact,
.audit-container .audit-filters-card,
.audit-container .audit-table-card {
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.45rem;
}
.audit-container .card-compact h3 {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}
.audit-stats-table td { padding: 0.12rem 0; line-height: 1.2; font-size: 0.82rem; }
.audit-container .audit-filters-grid {
    gap: 0.45rem;
}
.audit-container .audit-filters-card .form-group {
    margin-bottom: 0;
    gap: 0.15rem;
}
.audit-container .audit-filters-card .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0;
}
.audit-container .audit-filters-card .form-control {
    padding: 0.32rem 0.45rem;
    font-size: 0.84rem;
    line-height: 1.2;
}
.audit-container .audit-filters-actions {
    margin-top: 0.35rem;
    gap: 0.35rem;
}
.audit-table { font-size: 0.82rem; }
.audit-table td, .audit-table th {
    vertical-align: top;
    padding: 0.28rem 0.4rem;
    line-height: 1.25;
}
.audit-container .audit-table-card .table-responsive {
    margin: 0 -0.15rem;
}
.audit-container .audit-pagination {
    margin-top: 0.35rem;
    margin-bottom: 0;
    font-size: 0.82rem;
    line-height: 1.2;
}

/* ── Year Promotion mapping editor ─────────────────────────────── */
.yp-map-editor {
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-color);
}

.yp-map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-top: 0.75rem;
}

.yp-map-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.yp-map-toolbar .form-control {
    min-width: 12rem;
    font-size: 0.95rem;
    font-family: var(--font-family);
}

.yp-map-card {
    padding: 0;
    overflow: hidden;
}

.yp-map-table-wrap {
    max-height: min(70vh, 720px);
    overflow: auto;
}

.yp-map-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--font-family);
    font-size: 0.95rem;
    line-height: 1.35;
}

.yp-map-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef2f5;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.7rem 0.75rem;
    border-bottom: 2px solid #cfd8dc;
    white-space: nowrap;
}

.yp-map-table tbody td {
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #e8ecef;
    background: #fff;
}

.yp-map-table tbody tr:hover td {
    background: #f7fafc;
}

.yp-map-table .yp-input,
.yp-map-table .yp-select {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: 0.95rem;
    line-height: 1.3;
    padding: 0.45rem 0.55rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    color: var(--text-color);
    min-height: 2.25rem;
}

.yp-map-table .yp-input:focus,
.yp-map-table .yp-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.yp-map-table .yp-cn {
    font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.yp-map-table .yp-select {
    cursor: pointer;
    appearance: auto;
}

.yp-map-table .yp-input:disabled {
    background: #f0f2f4;
    color: #8899a6;
    cursor: not-allowed;
}

.yp-map-table col.yp-col-from { width: 9rem; }
.yp-map-table col.yp-col-to { width: 9rem; }
.yp-map-table col.yp-col-action { width: 13.5rem; }
.yp-map-table col.yp-col-type { width: 7.5rem; }
.yp-map-table col.yp-col-del { width: 3rem; }

.yp-map-table tr.yp-action-skip td { background: #f5f6f7; }
.yp-map-table tr.yp-action-rename td { background: #fff; }
.yp-map-table tr.yp-action-exit_to_e1_phase td,
.yp-map-table tr.yp-action-exit_to_e_phase td { background: #eef6fb; }
.yp-map-table tr.yp-action-exit_to_q1_phase td { background: #eefaf5; }
.yp-map-table tr.yp-action-exit td { background: #fff8ee; }

.yp-map-table tr.yp-action-skip:hover td { background: #eceef0; }
.yp-map-table tr.yp-action-rename:hover td { background: #f7fafc; }
.yp-map-table tr.yp-action-exit_to_e1_phase:hover td,
.yp-map-table tr.yp-action-exit_to_e_phase:hover td { background: #e3f0f9; }
.yp-map-table tr.yp-action-exit_to_q1_phase:hover td { background: #e3f6ef; }
.yp-map-table tr.yp-action-exit:hover td { background: #fff1df; }

.yp-map-table .yp-row-del {
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem;
}

.yp-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0;
    padding: 0.65rem 0.9rem;
    border-top: 1px solid #e8ecef;
    font-size: 0.85rem;
    color: #555;
    background: #fafbfc;
}

.yp-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.yp-map-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.08);
}

.yp-map-swatch-skip { background: #f5f6f7; }
.yp-map-swatch-rename { background: #fff; border-color: #ccc; }
.yp-map-swatch-e1 { background: #eef6fb; }
.yp-map-swatch-q1 { background: #eefaf5; }
.yp-map-swatch-exit { background: #fff8ee; }

.yp-plan-table {
    font-family: var(--font-family);
    font-size: 0.95rem;
}

.yp-plan-table th,
.yp-plan-table td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}

.yp-plan-table code {
    font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas, monospace;
    font-size: 0.92em;
    font-weight: 600;
    background: #f0f3f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* ——— Internetfreigabe (unified dialog) ——— */
.internet-sharing-page {
    max-width: 32rem;
    margin: 0 auto;
    padding: 0 0.5rem 1.5rem;
}
.internet-sharing-card {
    padding: 1.1rem 1.15rem;
}
.internet-sharing-card .is-section {
    margin-bottom: 1rem;
}
.internet-sharing-card .is-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color, #333);
    margin-bottom: 0.35rem;
}
.internet-sharing-card .is-control {
    width: 100%;
    min-height: 2.6rem;
    font-size: 1rem;
    border: 1px solid #999;
}
.internet-sharing-card .is-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.15rem 0;
    color: var(--text-muted, #666);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.internet-sharing-card .is-divider::before,
.internet-sharing-card .is-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #ddd);
}
.internet-sharing-card .is-guest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.internet-sharing-card .is-duration-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.internet-sharing-card .is-duration-row--with-days {
    grid-template-columns: 1fr 1fr;
}
.internet-sharing-card .is-submit {
    margin-top: 0.35rem;
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    min-height: 2.85rem;
}
.internet-sharing-card .is-success {
    text-align: center;
    padding: 0.5rem 0.25rem;
}
.internet-sharing-card .is-success-title {
    margin: 0 0 1rem;
    color: #155724;
    font-size: 1.25rem;
}
.internet-sharing-card .is-success-stat {
    font-size: 2rem;
    font-weight: 800;
    color: #155724;
    margin-bottom: 0.75rem;
}
.internet-sharing-card .is-success-stat span {
    font-size: 1rem;
    font-weight: 600;
}
.internet-sharing-card .is-success-until {
    background: rgba(217, 83, 79, 0.1);
    color: #d9534f;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.internet-sharing-card .is-cred {
    margin-bottom: 0.85rem;
    text-align: left;
}
.internet-sharing-card .is-cred label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #155724;
    margin-bottom: 0.25rem;
    text-align: center;
}
.internet-sharing-card .is-cred-value {
    font-family: ui-monospace, 'Courier New', monospace;
    font-size: clamp(1.25rem, 5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    background: #fff;
    border: 2px solid #155724;
    border-radius: 6px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    word-break: break-all;
}
.internet-sharing-card .is-hint {
    text-align: left;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

@media (max-width: 520px) {
    .internet-sharing-card .is-guest-grid {
        grid-template-columns: 1fr;
    }
    .internet-sharing-card .is-duration-row--with-days {
        grid-template-columns: 1fr;
    }
    .internet-sharing-card {
        padding: 0.9rem 0.85rem;
    }
}

/* ——— Elterninfo: Klasse + kompakte Verteiler ——— */
.parent-info-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 700px) {
    .parent-info-search-row { grid-template-columns: 1fr; }
}
.pi-dist-card .pi-dist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}
.pi-dist-cell {
    padding: 0.65rem 0.75rem;
    border-right: 1px solid var(--border-color, #e5e5e5);
    min-width: 0;
}
.pi-dist-cell:last-child { border-right: none; }
.pi-dist-cell--empty { opacity: 0.65; }
.pi-dist-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted, #666);
    margin: 0;
    min-width: 0;
}
.pi-dist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.pi-dist-mail {
    font-size: 0.85rem;
    font-weight: 600;
    word-break: break-all;
    line-height: 1.25;
}
.pi-dist-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    align-items: center;
}
/* Unified Copy / Mail action buttons (Elterninfo) */
.pi-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    border: none;
    border-radius: var(--btn-radius, 4px);
    cursor: pointer;
    line-height: 1;
    font-size: 0.85rem;
    transition: background 0.15s, transform 0.1s;
}
.pi-action-btn i {
    font-size: 0.85rem;
    color: inherit;
    line-height: 1;
}
.pi-action-btn--copy {
    background: #95a5a6;
    color: #fff;
}
.pi-action-btn--copy:hover {
    background: #7f8c8d;
}
.pi-action-btn--mail {
    background: var(--accent, #3498db);
    color: #fff;
}
.pi-action-btn--mail:hover {
    background: #2980b9;
}
#parent-info-student-detail .pi-student-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
#parent-info-student-detail .pi-student-head h4 {
    margin: 0;
    min-width: 0;
    flex: 1;
}
@media (max-width: 900px) {
    .pi-dist-card .pi-dist-grid {
        grid-template-columns: 1fr;
    }
    .pi-dist-cell {
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e5e5);
    }
    .pi-dist-cell:last-child { border-bottom: none; }
}

/* Eltern-Schnellsuche Widget */
.quick-parent-lookup {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.quick-parent-control {
    padding: 6px 10px;
    height: auto;
    font-size: 0.85rem;
    border: 1px solid #999;
    border-radius: 4px;
    background: #e9ecef;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}
.quick-parent-control:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.quick-parent-control:focus {
    outline: 2px solid rgba(52, 152, 219, 0.35);
    outline-offset: 1px;
    background: #eef1f3;
}
.quick-parent-search-wrap {
    position: relative;
}
.quick-parent-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.quick-parent-suggest {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.quick-parent-suggest-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: none;
    border-bottom: 1px solid #eee;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
}
.quick-parent-suggest-item:last-child { border-bottom: none; }
.quick-parent-suggest-item:hover {
    background: #f4f7fb;
}
.quick-parent-results {
    margin-top: 0.15rem;
}
.quick-parent-both {
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.45rem;
    background: #f0f4f8;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
}
.quick-parent-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.45rem;
    line-height: 1.4;
}
.quick-parent-footer {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.quick-parent-footer .btn-small {
    flex: 1;
    margin-top: 0;
    text-align: center;
}
.quick-parent-footer .quick-parent-done-btn {
    background: #95a5a6;
}
.quick-parent-footer .quick-parent-done-btn:hover {
    background: #7f8c8d;
}
@media (max-width: 520px) {
    .quick-parent-selects {
        grid-template-columns: 1fr;
    }
}

/* Sekretariat: Krankmeldung telefonisch erfassen (Dashboard-Widget) */
.office-sick-entry {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.office-sick-control {
    min-height: 2.5rem;
    font-size: 1rem;
}
.office-sick-search-wrap {
    position: relative;
}
.office-sick-suggest {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.office-sick-suggest-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-bottom: 1px solid #eef1f4;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.office-sick-suggest-item:last-child { border-bottom: none; }
.office-sick-suggest-item:hover {
    background: #f4f7fa;
}
.office-sick-selected {
    margin-top: 0.4rem;
}
.office-sick-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    background: #eef6f0;
    border-left: 3px solid var(--accent, #2d8a4e);
    border-radius: 4px;
}
.office-sick-tabs .tab-btn {
    min-height: 2.4rem;
    min-width: 5.5rem;
}
.office-sick-status {
    min-height: 1.25rem;
}
.office-sick-page .office-sick-entry {
    max-width: 32rem;
}

/* Kompaktes Telefon-Widget (Dashboard) */
.office-sick-entry--phone {
    gap: 0.4rem;
}
.office-sick-entry--phone .office-sick-control {
    min-height: 1.85rem;
    height: 1.85rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.85rem;
}
.office-sick-entry--phone .office-sick-suggest {
    max-height: 160px;
}
.office-sick-entry--phone .office-sick-suggest-item {
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}
.office-sick-entry--phone .office-sick-chip {
    padding: 0.3rem 0.45rem;
    font-size: 0.82rem;
}
.office-sick-entry--phone .office-sick-selected {
    margin-top: 0;
}
.office-sick-radios {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    border: 0;
}
.office-sick-radios-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.75rem;
}
.office-sick-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.office-sick-radio input {
    margin: 0;
    width: 0.85rem;
    height: 0.85rem;
}
.office-sick-compact-row {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(5.5rem, 0.85fr);
    gap: 0.35rem;
    align-items: end;
}
.office-sick-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0;
    min-width: 0;
}
.office-sick-field > span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #6a737d);
    line-height: 1.1;
}
.office-sick-period-pair {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.office-sick-period-pair .office-sick-control {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}
.office-sick-period-sep {
    font-size: 0.75rem;
    color: var(--text-muted, #6a737d);
    flex-shrink: 0;
}
.office-sick-entry--phone .office-sick-submit {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}
.office-sick-entry--phone .office-sick-status {
    min-height: 1rem;
    font-size: 0.78rem;
}
@media (max-width: 420px) {
    .office-sick-compact-row {
        grid-template-columns: 1fr 1fr;
    }
    .office-sick-field--period {
        grid-column: 1 / -1;
    }
}

/* Lehrkraft: Wochenübersicht als Std × Mo–Fr Matrix */
.teacher-week-matrix {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.85rem;
}
.teacher-week-matrix th,
.teacher-week-matrix td {
    border: 1px solid var(--border-color, #dde3ea);
    padding: 0.4rem 0.35rem;
    vertical-align: top;
    text-align: left;
}
.teacher-week-matrix thead th {
    background: #f4f7fa;
    font-weight: 600;
    text-align: center;
}
.teacher-week-matrix .tw-period-col {
    width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    background: #fafbfc;
}
.teacher-week-matrix .tw-time-col {
    width: 3.75rem;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}
.teacher-week-matrix .tw-day-col {
    min-width: 5.5rem;
}
.teacher-week-matrix .tw-day-name {
    display: block;
    font-weight: 700;
}
.teacher-week-matrix .tw-day-date {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
}
.teacher-week-empty {
    display: block;
    text-align: center;
    color: #c5cbd3;
    padding: 0.35rem 0;
}
.teacher-week-lesson {
    padding: 0.25rem 0.3rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
    background: #eef6f0;
    border-left: 3px solid var(--accent, #2d8a4e);
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.teacher-week-lesson:last-child { margin-bottom: 0; }
.teacher-week-lesson.is-cancelled {
    background: #fdeeee;
    border-left-color: #e53e3e;
    text-decoration: line-through;
    opacity: 0.85;
}
.teacher-week-lesson.is-subst {
    background: #fff7ed;
    border-left-color: #dd6b20;
}
.teacher-week-lesson.is-event {
    background: #eef6ff;
    border-left-color: #3182ce;
}
@media (max-width: 720px) {
    .teacher-week-matrix {
        font-size: 0.78rem;
    }
    .teacher-week-matrix .tw-time-col {
        width: 2.8rem;
    }
}
