/* 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;
}

.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: 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-secondary {
    padding: 0.6rem 1.2rem;
    background: #95a5a6;
    color: white !important;
    border: none;
    border-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: 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; }
.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: #e74c3c; margin-top: 0.5rem; font-size: 0.9rem; text-align: center; }

.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;
}

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

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

.mail-meta {
    color: #777;
    font-size: 0.75rem;
}

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

/* 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;
}

/* 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;
}

.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;
}

/* 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 */
.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;
}

/* 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;
}

.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;
}

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

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .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; }
.slot-student-name {
    font-size: 0.55rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 1px;
    opacity: 0.9;
}
.slot-btn {
    height: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.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: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.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 Icon module color consistency */
.btn-icon i.fa-bars, 
.btn-icon i.fa-bars-staggered,
.btn-icon i.fa-bars-progress,
.btn-icon i.fa-arrow-left {
    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;
}

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

.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; } }

