.teacher-excuses-workspace {
    display: grid;
    gap: 1rem;
}

.teacher-excuses-workspace__interaction-hint {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 1px dashed #9ec7e8;
    border-radius: 0.75rem;
    background: #f2f8fd;
    color: #31526c;
    font-size: 0.88rem;
}

.teacher-excuse-toolbar {
    align-items: end;
}

.teacher-excuse-work-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
    gap: 1rem;
    align-items: start;
}

.teacher-excuse-form-card {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem;
}

.teacher-excuse-impact-options label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.7rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #c9def0;
    border-radius: 0.7rem;
    background: #f8fbfe;
    cursor: pointer;
}

.teacher-excuse-impact-options input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: #1478bd;
}

.teacher-excuse-detail {
    display: grid;
    gap: 0.85rem;
    margin: 0.25rem 0;
    padding: 0.95rem;
    border: 1px solid #9dc8e9;
    border-radius: 0.9rem;
    background: linear-gradient(155deg, #f8fcff 0%, #eef7fe 100%);
    box-shadow: 0 0.45rem 1rem rgba(20, 79, 122, 0.08);
}

.teacher-excuse-detail.is-empty {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 6.25rem;
    border-style: dashed;
    box-shadow: none;
}

.teacher-excuse-detail.is-empty p {
    margin: 0.25rem 0 0;
    color: #527087;
}

.teacher-excuse-detail__empty-icon {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: #d9ecfb;
    color: #0d5f99;
    font-weight: 800;
}

.teacher-excuse-detail__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.teacher-excuse-detail__header h4 {
    margin: 0.1rem 0 0.2rem;
    color: #0a385c;
    font-size: 1.05rem;
}

.teacher-excuse-detail__header p {
    margin: 0;
    color: #4c687d;
    font-size: 0.86rem;
}

.teacher-excuse-detail__eyebrow,
.teacher-excuse-detail__label {
    color: #0d669f;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.teacher-excuse-detail__header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.teacher-excuse-detail__close {
    min-height: 2rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
}

.teacher-excuse-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid #b8d3e8;
    border-radius: 999px;
    background: #eef6fc;
    color: #24536f;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.teacher-excuse-status.is-approved { border-color: #a7d9c1; background: #e9f8f0; color: #176b47; }
.teacher-excuse-status.is-rejected { border-color: #e5b8c2; background: #fff1f4; color: #8b2e42; }
.teacher-excuse-status.is-returned { border-color: #e8cf86; background: #fff8df; color: #785b0a; }
.teacher-excuse-status.is-review { border-color: #a9cbe8; background: #edf6fd; color: #165f91; }

.teacher-excuse-detail__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.teacher-excuse-detail__facts > div {
    display: grid;
    gap: 0.2rem;
    padding: 0.65rem;
    border: 1px solid #d0e2f0;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.84);
}

.teacher-excuse-detail__facts span {
    color: #60788a;
    font-size: 0.72rem;
}

.teacher-excuse-detail__facts strong {
    color: #183f5c;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.teacher-excuse-detail__section {
    display: grid;
    gap: 0.4rem;
    padding: 0.75rem;
    border: 1px solid #d6e5f1;
    border-radius: 0.72rem;
    background: #fff;
}

.teacher-excuse-detail__section.is-private {
    border-color: #ead487;
    background: #fffaf0;
}

.teacher-excuse-detail__section p {
    margin: 0;
    color: #2a4559;
    line-height: 1.45;
    white-space: pre-wrap;
}

.teacher-excuse-impact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.teacher-excuse-impact-list span {
    padding: 0.3rem 0.55rem;
    border: 1px solid #a9d7c1;
    border-radius: 999px;
    background: #eefaf4;
    color: #176343;
    font-size: 0.78rem;
    font-weight: 700;
}

.teacher-excuse-impact-list span.is-muted {
    border-color: #d1dde6;
    background: #f5f8fa;
    color: #617482;
}

.teacher-excuse-support-list,
.teacher-excuse-history {
    display: grid;
    gap: 0.5rem;
}

.teacher-excuse-support {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem;
    border: 1px solid #acd0ea;
    border-radius: 0.7rem;
    background: #f5fbff;
    color: #144d75;
    text-decoration: none;
}

.teacher-excuse-support:hover,
.teacher-excuse-support:focus-visible {
    border-color: #1979bb;
    box-shadow: 0 0 0 3px rgba(25, 121, 187, 0.13);
}

.teacher-excuse-support__index {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #dceefa;
    font-weight: 800;
}

.teacher-excuse-support span:nth-child(2) {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.teacher-excuse-support strong,
.teacher-excuse-support small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-excuse-support small { color: #5b7487; }
.teacher-excuse-support em { font-size: 0.78rem; font-style: normal; font-weight: 800; }

/* Private excuse originals: thumbnails and an in-page viewer only. */
button.teacher-excuse-support { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.teacher-excuse-support small { white-space: normal; }
.teacher-excuse-thumbnail { display: grid; place-items: center; width: 96px; height: 76px; overflow: hidden; background: #fff; border: 1px solid #c9def0; border-radius: .5rem; font-size: .7rem; }
.teacher-excuse-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.teacher-excuse-thumbnail iframe { width: 96px; height: 76px; border: 0; pointer-events: none; }
.teacher-excuse-viewer { box-sizing: border-box; width: min(1100px, 94vw); max-height: 94dvh; padding: 1rem; border: 1px solid #9dc8e9; border-radius: 1rem; background: #f8fcff; color: #183f5c; box-shadow: 0 1rem 4rem #0a385c40; }
.teacher-excuse-viewer::backdrop { background: #0a254866; }
.teacher-excuse-viewer > header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.teacher-excuse-viewer h3 { margin: .35rem 0; overflow-wrap: anywhere; }
.teacher-excuse-viewer header small { color: #0d669f; font-weight: 700; }
.teacher-excuse-viewer [data-excuse-preview-close] { flex: none; width: auto; min-width: 0; padding: .6rem .8rem; }
.teacher-excuse-viewer__description { margin: .5rem 0; font-size: .85rem; }
.teacher-excuse-viewer__body { display: grid; place-items: center; min-height: 10rem; overflow: auto; background: white; }
.teacher-excuse-viewer__body img { display: block; max-width: 100%; max-height: 70dvh; object-fit: contain; }
.teacher-excuse-viewer__body iframe { display: block; width: 100%; height: 70dvh; border: 0; }
@media (max-width: 640px) {
    .teacher-excuse-thumbnail, .teacher-excuse-thumbnail iframe { width: 64px; height: 64px; }
    .teacher-excuse-viewer { padding: .7rem; }
}

.teacher-excuse-detail__notice {
    padding: 0.65rem;
    border: 1px dashed #c2d8e8;
    border-radius: 0.65rem;
    color: #567185;
    background: #f8fbfd;
}

.teacher-excuse-history__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.65rem;
    padding: 0.6rem;
    border-left: 3px solid #6fb1de;
    background: #f5faff;
}

.teacher-excuse-history__item span { color: #587083; font-size: 0.78rem; }
.teacher-excuse-history__item p { grid-column: 1 / -1; margin-top: 0.25rem; }

.teacher-excuse-records,
.teacher-excuse-recent-reviews {
    display: grid;
    gap: 0.65rem;
}

.teacher-excuse-records {
    scroll-margin-top: 6.5rem;
}

.teacher-excuse-records__head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0 0.15rem;
}

.teacher-excuse-records__head span { color: #567084; font-size: 0.82rem; }

.teacher-excuse-record-card {
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.teacher-excuse-record-card:hover,
.teacher-excuse-record-card:focus-visible {
    border-color: #2681bf;
    background: #f5fbff;
    box-shadow: 0 0.45rem 1rem rgba(24, 91, 138, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.teacher-excuse-record-card.is-selected {
    border-color: #1480c4;
    background: #eaf6fe;
    box-shadow: 0 0 0 3px rgba(20, 128, 196, 0.13);
}

.teacher-excuse-record-card__footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.4rem;
    color: #526d80;
    font-size: 0.78rem;
}

.teacher-excuse-record-card__footer strong { color: #0e6ca7; white-space: nowrap; }

@media (max-width: 980px) {
    .teacher-excuse-work-grid { grid-template-columns: 1fr; }
    .teacher-excuse-detail__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .teacher-excuses-workspace { gap: 0.75rem; }
    .teacher-excuse-form-card { padding: 0.75rem; }
    .teacher-excuse-detail__header { display: grid; }
    .teacher-excuse-detail__header-actions { justify-content: flex-start; }
    .teacher-excuse-detail__facts { grid-template-columns: 1fr; }
    .teacher-excuse-support { grid-template-columns: auto minmax(0, 1fr); }
    .teacher-excuse-support em { grid-column: 2; }
    .teacher-excuse-records__head,
    .teacher-excuse-record-card__footer { align-items: flex-start; }
}
.teacher-excuses-readonly { display: grid; gap: .75rem; min-width: 0; }
.teacher-excuses-readonly .teacher-excuse-record-card { width: 100%; text-align: left; font: inherit; color: #173b59; background: #f8fbff; border-color: #c5d9ec; }
.teacher-excuses-readonly .teacher-excuse-record-card > span, .teacher-excuses-readonly .teacher-excuse-record-card > small { overflow-wrap: anywhere; }
.teacher-excuse-readonly__student { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.teacher-excuse-readonly__avatar { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; background: #e4f1ff; color: #0f6cbd; font-size: .8rem; font-weight: 700; }
.teacher-excuses-readonly [data-teacher-excuse-detail-heading] { scroll-margin-top: 90px; }
.teacher-excuses-readonly [data-teacher-excuse-detail-heading]:focus-visible { outline: 2px solid #0f6cbd; outline-offset: 3px; }
