.instruction-page {
    display: grid;
    gap: 24px;
    padding: 24px;
}

.quarterly-filter-panel { padding: 1.25rem; margin-bottom: 1rem; }
.quarterly-filter-form { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.quarterly-filter-form label { display: grid; gap: .4rem; min-width: 10rem; font-weight: 700; }
.quarterly-filter-form select { min-height: 2.8rem; border: 1px solid var(--ui-border, #c9d5dd); border-radius: .65rem; padding: .55rem .75rem; background: var(--ui-surface, #fff); color: inherit; }
.ui-page-toolbar:has(+ .quarterly-filter-panel) .ui-page-title p { color: #344a57; font-size: .84rem; font-weight: 600; line-height: 1.45; }
.quarterly-report { padding: 1.5rem; }
.quarterly-report-header { display: flex; justify-content: space-between; align-items: start; gap: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--ui-border, #d7e0e6); }
.quarterly-report-header h2 { margin: .15rem 0; font-size: 1.65rem; }
.quarterly-report-header p { margin: 0; color: var(--ui-text, #26313c); font-weight: 650; }
.quarterly-report-meta { display: grid; min-width: 13rem; padding: .8rem 1rem; border-radius: .75rem; background: var(--ui-surface-soft, #f2f6f8); text-align: right; }
.quarterly-report-meta span,.quarterly-report-meta small,.quarterly-report-metrics span { color: var(--ui-text, #26313c); font-size: .8rem; font-weight: 600; }
.quarterly-report-meta strong { font-size: 1.3rem; }
.quarterly-report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; }
.quarterly-report-metrics div { display: grid; gap: .25rem; padding: .8rem 1rem; border: 1px solid var(--ui-border, #d7e0e6); border-radius: .7rem; background: var(--ui-surface-soft, #f7fafb); }
.quarterly-report-metrics strong { font-size: 1.25rem; }
.quarterly-table-wrap { overflow-x: auto; border: 1px solid var(--ui-border-strong, #9fb0ba); border-radius: .2rem; background: var(--ui-panel, #fff); }
.quarterly-report-table,.quarterly-summary-table { width: 100%; border-collapse: collapse; }
.quarterly-report-table th,.quarterly-report-table td,.quarterly-summary-table th,.quarterly-summary-table td { padding: .7rem .8rem; border: 1px solid var(--ui-border-strong, #aebcc5); text-align: left; vertical-align: middle; }
.quarterly-report-table thead th,.quarterly-summary-table thead th { background: var(--ui-surface-soft, #e7eef2); color: var(--ui-text, #26313c); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.quarterly-report-table tbody tr:nth-child(even),.quarterly-summary-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--ui-surface-soft, #f7fafb) 70%, transparent); }
.quarterly-report-table td small { display: block; margin-top: .15rem; color: var(--ui-text-muted, #607483); }
.quarterly-report-table tfoot th { background: var(--ui-surface-soft, #edf3f6); border-bottom: 0; font-size: .95rem; }
.quarterly-report-table .is-money,.quarterly-summary-table .is-money { text-align: right; white-space: nowrap; }
.quarterly-report-table .is-number,.quarterly-summary-table .is-number { text-align: center; }
.quarterly-matrix-table { min-width: max-content; }
.quarterly-matrix-table th:first-child,.quarterly-matrix-table td:first-child { border-left: 0; }
.quarterly-matrix-table th:last-child,.quarterly-matrix-table td:last-child { border-right: 0; }
.quarterly-matrix-table thead tr:first-child th { border-top: 0; }
.quarterly-matrix-table tfoot tr:last-child th { border-bottom: 0; }
.quarterly-matrix-table .quarterly-group-row th { padding: .65rem; text-align: center; }
.quarterly-matrix-table .matrix-index { width: 3rem; min-width: 3rem; }
.quarterly-matrix-table .matrix-date { width: 7.5rem; min-width: 7.5rem; }
.quarterly-matrix-table .matrix-total { width: 6.5rem; min-width: 6.5rem; }
.quarterly-matrix-table .matrix-group-events { border-left: 3px solid #667785; border-right: 3px solid #667785; background: #edf1f4; color: #293943; }
.quarterly-matrix-table .matrix-group-activities { border-left: 3px solid #e45d34; border-right: 3px solid #e45d34; background: #fff0ea; color: #8e3218; }
.quarterly-matrix-table .matrix-group-people { border-left: 3px solid #1688b7; border-right: 3px solid #1688b7; background: #e9f6fb; color: #075776; }
.quarterly-matrix-table .vertical-heading { width: 2.65rem; min-width: 2.65rem; height: 12rem; padding: .45rem .35rem; vertical-align: bottom; }
.quarterly-matrix-table .vertical-heading > span { display: inline-flex; align-items: center; gap: .35rem; writing-mode: vertical-rl; transform: rotate(180deg); line-height: 1.15; text-transform: none; letter-spacing: 0; }
.quarterly-matrix-table .vertical-heading small { color: inherit; font-size: .65rem; font-weight: 600; opacity: .82; }
.quarterly-matrix-table .vertical-heading .activity-base-rate { margin-top: .2rem; padding-top: .2rem; border-top: 1px solid currentColor; font-size: .58rem; font-weight: 500; opacity: .62; }
.quarterly-matrix-table .event-heading { background: #f3f6f8; color: #293943; }
.quarterly-matrix-table .activity-heading { background: #fff7f3; color: #7d301d; }
.quarterly-matrix-table .person-heading { background: #f0f8fb; color: #124e67; }
.quarterly-matrix-table .matrix-mark { padding: .55rem .25rem; text-align: center; font-size: 1rem; font-weight: 900; }
.quarterly-matrix-table .event-mark { color: #526675; background: color-mix(in srgb, #f3f6f8 65%, transparent); }
.quarterly-matrix-table .activity-mark { color: #e45d34; background: color-mix(in srgb, #fff7f3 60%, transparent); }
.quarterly-matrix-table .person-mark { color: #14734a; }
.quarterly-matrix-table tbody tr:hover td { background-color: color-mix(in srgb, var(--ui-info, #2787ba) 7%, var(--ui-panel, #fff)); }
.quarterly-person-summary { margin-top: 1.5rem; }
.quarterly-person-summary h3 { margin: 0 0 .7rem; font-size: 1.05rem; }
.quarterly-summary-table { border: 1px solid var(--ui-border, #d7e0e6); }
.quarterly-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3.5rem; }
.quarterly-signatures div { padding-top: .45rem; border-top: 1px solid currentColor; color: var(--ui-text-muted, #607483); font-size: .75rem; }
:root[data-theme="dark"] .ui-page-toolbar:has(+ .quarterly-filter-panel) .ui-page-title p,
:root[data-theme="dark"] .quarterly-report-header p,
:root[data-theme="dark"] .quarterly-report-meta span,
:root[data-theme="dark"] .quarterly-report-meta small,
:root[data-theme="dark"] .quarterly-report-metrics span,
:root[data-theme="dark"] .quarterly-report-table thead th,
:root[data-theme="dark"] .quarterly-summary-table thead th { color: #e6f0f5; }
:root[data-theme="dark"] .quarterly-matrix-table .matrix-group-events,
:root[data-theme="dark"] .quarterly-matrix-table .event-heading { background: #202c34; color: #e2ecf1; }
:root[data-theme="dark"] .quarterly-matrix-table .matrix-group-activities,
:root[data-theme="dark"] .quarterly-matrix-table .activity-heading { background: #3a2119; color: #ffd9cc; }
:root[data-theme="dark"] .quarterly-matrix-table .matrix-group-people,
:root[data-theme="dark"] .quarterly-matrix-table .person-heading { background: #122d39; color: #d7f2fc; }
@media (max-width: 760px) { .quarterly-report-header { flex-direction: column; } .quarterly-report-meta { width: 100%; text-align: left; } .quarterly-report-metrics { grid-template-columns: 1fr; } }
@media print {
    @page { size: 297mm 210mm; margin: 8mm; }
    .sidebar,.topbar,.page-toolbar,.quarterly-filter-panel,.no-print { display: none !important; }
    body,.app-shell,.app-main,.main-content { width: 100% !important; margin: 0 !important; padding: 0 !important; background: #fff !important; color: #111 !important; }
    html,body { height: auto !important; overflow: visible !important; }
    .quarterly-report { width: var(--quarterly-print-width, 100%) !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; zoom: var(--quarterly-print-scale, 1); break-inside: avoid; page-break-inside: avoid; page-break-after: avoid; }
    .quarterly-report-meta,.quarterly-report-metrics div { background: #fff !important; }
    .quarterly-table-wrap { width: 100% !important; max-width: none !important; overflow: visible !important; }
    .quarterly-matrix-table { width: 100% !important; min-width: 100% !important; table-layout: fixed; }
    .quarterly-report-table,.quarterly-summary-table { font-size: 8pt; }
    .quarterly-report-table th,.quarterly-report-table td,.quarterly-summary-table th,.quarterly-summary-table td { padding: 4pt 5pt; }
    .quarterly-report-table th,.quarterly-report-table td,.quarterly-summary-table th,.quarterly-summary-table td { border-color: #777 !important; }
    .quarterly-matrix-table thead th { background: #f2f2f2 !important; color: #111 !important; }
    .quarterly-report-table tr,.quarterly-summary-table tr { break-inside: avoid; }
    .quarterly-matrix-table .vertical-heading { width: 19pt; min-width: 19pt; height: 105pt; padding: 3pt 2pt; }
    .quarterly-matrix-table .matrix-date { width: 58pt; min-width: 58pt; }
    .quarterly-signatures { margin-top: 18pt; break-inside: avoid; }
    .quarterly-report, .quarterly-report * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.instruction-panel {
    padding: 28px;
}

.instruction-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: -4px 0 0;
}

.instruction-overview-panel .ui-panel-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ui-border, #dce5e9);
}

.instruction-overview-panel .ui-panel-header h2,
.instruction-list-header h2 {
    margin: 0 0 8px;
    color: var(--ui-text, #26313c);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.25;
}

.instruction-overview-panel .ui-panel-header p,
.instruction-list-header p {
    max-width: 72ch;
    margin: 0;
    color: var(--ui-text-muted, #627682);
    line-height: 1.6;
}

.instruction-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.instruction-category-card {
    display: flex;
    align-items: center;
    min-height: 88px;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--ui-border, #dce5e9);
    border-radius: 14px;
    background: var(--ui-surface-soft, #f7fafb);
}

.instruction-category-card div {
    display: grid;
    gap: 5px;
}

.instruction-category-card strong {
    font-size: 1rem;
    line-height: 1.35;
}

.instruction-category-card span:not(.instruction-category-icon) {
    color: var(--ui-text-muted, #627682);
    font-size: .86rem;
}

.instruction-category-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    background: color-mix(in srgb, var(--accent, #e45d34) 14%, transparent);
    color: var(--accent-dark, #ae3f20);
    font-weight: 800;
}

.instruction-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.instruction-count {
    display: grid;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent, #e45d34);
    color: #fff;
    font-weight: 800;
}

.instruction-list-panel .ui-table-wrapper {
    border: 1px solid var(--ui-border, #dce5e9);
    border-radius: 14px;
    overflow: hidden;
}

.instruction-list-panel .ui-table th,
.instruction-list-panel .ui-table td {
    padding: 15px 16px;
    vertical-align: middle;
}

.instruction-form-section {
    min-width: 0;
    margin: 0;
    padding: 0 0 22px;
    border: 0;
}

.instruction-form-section
    + .instruction-form-section {
    padding-top: 22px;
    border-top: 1px solid #dce5e9;
}

.instruction-form-section legend {
    display: block;
    width: 100%;
    margin: 0 0 4px;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
}

.instruction-section-description {
    margin: 0 0 18px;
    color: var(--ui-text-muted, #627682);
    font-size: 13px;
}

.instruction-form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.instruction-content-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.25fr)
        minmax(0, .75fr);
    gap: 18px 24px;
}

.instruction-form-wide {
    grid-column: 1 / -1;
}

.instruction-form-grid > div,
.instruction-content-grid > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.instruction-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.instruction-form input,
.instruction-form select,
.instruction-form textarea {
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.instruction-form input,
.instruction-form select {
    min-height: 40px;
}

.instruction-form textarea {
    min-height: 140px;
    resize: vertical;
}

.instruction-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid #dce5e9;
}

.instruction-detail-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 20px 30px;
    margin: 0;
}

.instruction-detail-grid dt {
    margin-bottom: 5px;
    color: #627682;
    font-size: 12px;
    font-weight: 700;
}

.instruction-detail-grid dd {
    margin: 0;
}

.instruction-detail-wide {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .instruction-page {
        gap: 16px;
        padding: 10px;
    }

    .instruction-panel {
        padding: 18px;
    }

    .instruction-category-grid {
        grid-template-columns: 1fr;
    }

    .instruction-form-grid,
    .instruction-content-grid,
    .instruction-detail-grid {
        grid-template-columns: 1fr;
    }

    .instruction-form-wide,
    .instruction-detail-wide {
        grid-column: auto;
    }
}

/* BLAULICHT_INSTRUCTION_PARTICIPANTS_START */

.instruction-participant-panel {
    margin-top: 16px;
}

.instruction-participant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.instruction-participant-header h2 {
    margin: 0 0 4px;
}

.instruction-participant-header p {
    margin: 0;
    color: #627682;
}

.instruction-participant-form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.instruction-participant-form-wide {
    grid-column: 1 / -1;
}

.instruction-participant-form-grid > div {
    min-width: 0;
}

.instruction-participant-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.instruction-participant-form input,
.instruction-participant-form select,
.instruction-participant-form textarea {
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.instruction-participant-form input,
.instruction-participant-form select {
    min-height: 40px;
}

.instruction-participant-form textarea {
    min-height: 100px;
    resize: vertical;
}

.instruction-participant-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.instruction-participant-status.is-planned {
    background: #e7f1f7;
    color: #176789;
}

.instruction-participant-status.is-attended {
    background: #e5f4e9;
    color: #22733b;
}

.instruction-participant-status.is-excused {
    background: #fff4d8;
    color: #8a6200;
}

.instruction-participant-status.is-absent {
    background: #fbe5e5;
    color: #a32424;
}

@media (max-width: 760px) {
    .instruction-participant-header {
        flex-direction: column;
    }

    .instruction-participant-form-grid {
        grid-template-columns: 1fr;
    }

    .instruction-participant-form-wide {
        grid-column: auto;
    }
}

/* BLAULICHT_INSTRUCTION_PARTICIPANTS_END */
