/* Shared MYCURIE components, adapted from HTQ Admin V114. base.css stays untouched. */
.table-action-menu-popover {
    min-width:214px; max-width:calc(100vw - 24px); padding:5px; border-radius:var(--radius-lg);
    box-shadow:0 8px 24px rgba(0,0,0,.12); z-index:100000;
}
.table-action-menu-popover a,.table-action-menu-popover button {
    gap:10px; min-height:40px; margin:2px 0; border:0; border-radius:var(--radius-md);
    transition:filter .15s ease; line-height:1.4; padding:10px 12px;
}
.table-action-menu-popover i {width:18px; flex:0 0 18px; text-align:center; color:inherit;}
.table-action-menu-popover .app-menu-info {background:#edf6ff; color:#246b9f;}
.table-action-menu-popover .app-menu-success {background:#eef9f0; color:#24743a;}
.table-action-menu-popover .app-menu-warning {background:#fff9e6; color:#8a6500;}
.table-action-menu-popover .app-menu-neutral {background:#f4f6f8; color:#5f6368;}
.table-action-menu-popover .table-action-menu-danger {background:#fff0f0; color:#b3261e;}
.table-action-menu-popover a:hover,.table-action-menu-popover button:hover {filter:brightness(.96);}
.table-action-menu-popover :is(a,button):focus-visible {outline:2px solid var(--color-primary); outline-offset:-2px;}
.app-modal-backdrop {
    position:fixed; inset:0; z-index:110000; display:grid; place-items:center;
    box-sizing:border-box; padding:20px; background:rgba(18,29,41,.42); backdrop-filter:blur(2px);
}
.app-modal {
    width:min(780px,100%); max-height:calc(100dvh - 40px); display:flex; flex-direction:column;
    box-sizing:border-box; overflow:hidden; padding:0; border:1px solid var(--color-border-light);
    border-radius:var(--radius-lg); background:var(--color-background); box-shadow:0 18px 55px rgba(18,29,41,.22);
    animation:app-modal-in .18s ease-out;
}
.app-modal-hero {display:flex; align-items:center; gap:14px; padding:24px; border-bottom:1px solid #e1e9f1; background:linear-gradient(120deg,#edf6ff,#f8fbfe 75%,#fff);}
.app-modal-hero-icon {display:grid; place-items:center; flex:0 0 46px; width:46px; height:46px; border-radius:14px; color:#125292; background:#deebf8; font-size:21px;}
.app-modal-heading {min-width:0; flex:1;}
.app-modal-title {margin:0; color:var(--color-text); font-size:21px; font-weight:700; line-height:1.3;}
.app-modal-description {margin:5px 0 0; color:var(--color-text-secondary); font-size:13px; line-height:1.5;}
.app-modal-close {flex:0 0 36px; width:36px; height:36px; border:0; border-radius:10px; background:#fff; color:#5f6368; font-size:25px; cursor:pointer;}
.app-modal-close:hover {background:#e5edf5; color:#125292;}
.app-modal-close:focus-visible {outline:2px solid #125292; outline-offset:2px;}
.app-modal-frame {display:block; width:100%; min-height:200px; height:560px; max-height:calc(100dvh - 175px); border:0; background:#fff;}
.app-modal-loading {padding:24px; color:var(--color-text-secondary);}
body.app-modal-open {overflow:hidden;}
html.app-modal-document {background:#fff;}
body.app-modal-document {margin:0; padding:24px; background:#fff; box-sizing:border-box;}
body.app-modal-document:before {display:none;}
.app-modal-document [data-app-modal-content] {margin:0;}
.app-modal-document [data-app-modal-content] > .section-header {display:none;}
.app-modal-document .form-card {width:100%; max-width:none; padding:0; border:0; box-shadow:none; background:none;}
.app-modal-document .form-actions {position:sticky; bottom:-24px; padding:16px 0; margin-bottom:0; background:#fff; border-top:1px solid #edf0f4;}
.app-modal-document .form-control {box-sizing:border-box; max-width:100%;}
.app-modal-document .form-grid {min-width:0;}
.app-modal-document .app-modal-error {margin:0 0 18px;}
@keyframes app-modal-in {from {opacity:0; transform:translateY(8px) scale(.99);} to {opacity:1; transform:none;}}
@media(max-width:620px) {
    .app-modal-backdrop {padding:10px;}
    .app-modal {max-height:calc(100dvh - 20px);}
    .app-modal-hero {padding:18px; gap:10px;}
    .app-modal-title {font-size:19px;}
    .app-modal-hero-icon {flex-basis:38px; width:38px; height:38px; border-radius:11px;}
    body.app-modal-document {padding:18px;}
    .app-modal-document .form-grid {grid-template-columns:1fr;}
    .app-modal-document .form-actions {bottom:-18px; flex-wrap:wrap;}
    .app-modal-document .form-actions .btn {width:100%; justify-content:center;}
}
@media(prefers-reduced-motion:reduce) {.app-modal {animation:none;}}
.app-modal-frame[hidden],.app-modal-loading[hidden] {display:none!important;}
.mail-preview {display:block; width:100%; height:680px; border:1px solid var(--color-border); border-radius:14px; background:#f2f5f7;}
.mail-status {display:inline-block; padding:5px 9px; border-radius:8px; background:#f1f3f5; color:#5f6368; font-size:12px; font-weight:600;}
.mail-status-sent {background:#eef9f0; color:#24743a;}
.mail-status-failed,.mail-status-uncertain {background:#fff0f0; color:#b3261e;}
.mail-status-queued {background:#edf6ff; color:#246b9f;}
.mail-toolbar {display:flex; flex-wrap:wrap; gap:10px; margin-bottom:20px; align-items:center;}
.mail-toolbar form {margin:0;}
.mail-table-wrap {overflow-x:auto;}
.mail-log {width:100%; border-collapse:collapse; font-size:13px;}
.mail-log td,.mail-log th {padding:12px; border-bottom:1px solid var(--color-border-light); text-align:left; vertical-align:top;}
.mail-log small {display:block; margin-top:4px; color:var(--color-text-secondary);}
.mail-log form {display:inline-block; margin:3px;}

/* The dialog owns one scrolling content area; its actions are always visible. */
html.app-modal-document,body.app-modal-document {height:100%; overflow:hidden;}
body.app-modal-document {padding:0;}
.app-modal-document [data-app-modal-content] {height:100%; min-height:0; display:flex; flex-direction:column;}
.app-modal-document .form-card {flex:1; min-height:0; margin:0; display:flex; flex-direction:column;}
.app-modal-document form.form {flex:1; min-height:0; margin:0; display:flex; flex-direction:column;}
.app-modal-scroll {flex:1; min-height:0; overflow:auto; padding:24px; overscroll-behavior:contain;}
.app-modal-document .form-actions {position:static; flex:0 0 auto; margin:0; padding:16px 24px; border-top:1px solid #e1e9f1; box-shadow:0 -4px 16px rgba(18,29,41,.04); background:#fff;}
.app-modal-hero {flex-shrink:0;}
.app-modal-frame {min-height:0; flex:1 1 560px;}
.app-sticky-head {position:fixed; z-index:700; margin:0; overflow:hidden; border-radius:0; pointer-events:auto; box-shadow:0 4px 12px rgba(18,29,41,.09);}
.app-sticky-head[hidden] {display:none;}
.app-sticky-head table {table-layout:fixed; margin:0;}
.app-sticky-head th {background:var(--color-background-soft);}
.app-project-status {display:inline-block; width:13px; height:13px; border-radius:50%; vertical-align:middle; box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);}
.app-project-status-approved {background:#24964b;}
.app-project-status-open {background:#edbb2b;}
.app-project-status-rejected {background:#d94343;}
.app-project-type {display:inline-flex; width:26px; height:26px; align-items:center; justify-content:center; border-radius:50%; font-size:12px; font-weight:600; background:#edf3f9; color:#125292;}
.app-project-type-student {background:#f1f3f5; color:#5f6368;}
.app-table-legend {display:flex; gap:12px 22px; flex-wrap:wrap; align-items:center; padding:14px 18px; color:var(--color-text-secondary); font-size:12px; border-top:1px solid var(--color-border-light);}
.app-table-legend > span {display:inline-flex; align-items:center; gap:7px;}
.app-sr-only {position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;}
.mcg-capacity-input {width:82px; min-width:64px; padding:8px 10px; border:1px solid var(--color-border); border-radius:8px; background:#fff; color:var(--color-text); font:inherit; font-variant-numeric:tabular-nums;}
.mcg-capacity-input:focus {outline:2px solid var(--color-primary); outline-offset:1px;}
.mcg-capacity-input[aria-invalid=true] {border-color:#c62828; background:#fff5f5;}
.mcg-capacity-input:disabled {opacity:.65;}
.mcg-total-row td {background:var(--color-background-soft); font-weight:600; border-top:1px solid var(--color-border);}
/* HTQ's check confirmation, reused with the shared notification component. */
.notification-stack.notification-stack-save {left:auto; right:22px; z-index:120000;}
.notification-stack-save .notification {transform-origin:bottom right;}
.notification-stack-save .notification-success .notification-icon i {animation:app-save-confirm 420ms cubic-bezier(.2,.8,.2,1.25) both;}
@keyframes app-save-confirm {0%{opacity:0;transform:scale(.55) rotate(-18deg);}100%{opacity:1;transform:scale(1) rotate(0);}}
@media(max-width:620px) {
    .app-modal-scroll {padding:18px;}
    .app-modal-document .form-actions {padding:12px 18px;}
    .notification-stack.notification-stack-save {left:14px; right:14px; width:auto;}
}
@media(prefers-reduced-motion:reduce) {.notification-stack-save .notification-success .notification-icon i {animation:none;}}

/* Annual teacher absence: muted appearance with fully usable actions. */
.data-table tbody tr.teacher-row-absent > td,.data-table tbody tr.projectweek-row-absent > td {background:#f6f7f8; color:#7b8189;}
.data-table tbody tr.teacher-row-absent:hover > td,.data-table tbody tr.projectweek-row-absent:hover > td {background:#eef0f3;}
.teacher-no-project,.projectweek-no-project {display:block; font-weight:500; color:#767d86;}
.teacher-absence-reason,.projectweek-absence-reason {display:block; margin-top:5px; max-width:400px; white-space:pre-line; overflow-wrap:anywhere; font-family:var(--font-main); font-size:12px; font-weight:400; line-height:1.55; color:#858c95;}
.teacher-absence-details[hidden],.student-absence-details[hidden] {display:none!important;}

/* Same field rhythm as the shared form used by “Projekt einreichen”. */
.app-modal-document form.form {gap:0;}
.app-modal-scroll {display:flex; flex-direction:column; gap:var(--space-5);}
.app-modal-scroll > * {flex-shrink:0;}
.app-modal-document .form-grid {gap:var(--space-5); align-items:start;}
