/* ══ Global ══ */
body { background: #f8f9fa; min-height: 100vh; }
.navbar-brand { font-weight: 700; }
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.priority-badge { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; font-size: .85rem; }
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.table th { font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; }

/* ══ Collapsible Info Blocks ══ */
details.info-block { border: 1px solid #b6d4fe; border-radius: .375rem; margin-bottom: 1rem; background: #f0f7ff; }
details.info-block > summary { padding: .6rem 1rem; cursor: pointer; font-weight: 600; font-size: .925rem; list-style: none; display: flex; align-items: center; gap: .5rem; color: #084298; user-select: none; }
details.info-block > summary::-webkit-details-marker { display: none; }
details.info-block > summary::before { content: '\F285'; font-family: 'bootstrap-icons'; font-size: 1.1rem; transition: transform .2s; }
details.info-block[open] > summary::before { transform: rotate(90deg); }
details.info-block > summary .info-icon { font-size: 1.1rem; color: #0d6efd; }
details.info-block > .info-block-content { padding: .5rem 1rem 1rem 1rem; border-top: 1px solid #b6d4fe; font-size: .9rem; }

/* ══ Accessible Help-Tooltip Trigger ══ */
button.help-tooltip { background: transparent; line-height: 1; vertical-align: middle; }
button.help-tooltip:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; border-radius: 2px; }

/* ══ Sortable Table Headers ══ */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background-color: rgba(0,0,0,.05); }
.sortable i { transition: transform 0.2s; }

/* ══ Course Table Styles ══ */
.separator-row td { padding: 2px 8px !important; border: none !important; background: transparent !important; }
.separator-line { border-top: 2px dashed #dc3545; margin: 0; }
.separator-text { font-size: 0.75rem; color: #dc3545; font-style: italic; }
.form-check-input { width: 1.4em; height: 1.4em; border: 2px solid #6c757d; background-color: #fff; }
.form-check-input:not(:checked) { border-color: #495057; background-color: #f8f9fa; }
.form-check-input:checked { background-color: #0d6efd; border-color: #0d6efd; }
.form-check-input:disabled { opacity: 0.6; }
.move-up-btn, .move-down-btn { display: block; line-height: 1; font-size: 0.75rem; color: #6c757d; text-decoration: none; }
.move-up-btn:hover, .move-down-btn:hover { color: #0d6efd; }

@media (max-width: 768px) {
    #courseTable thead { display: none; }
    #courseTable tbody tr.course-row { display: block; border: 1px solid #dee2e6; border-radius: 0.5rem; margin-bottom: 0.5rem; padding: 0.75rem; position: relative; }
    #courseTable tbody tr.course-row td { display: inline-block; border: none !important; padding: 0.15rem 0.25rem !important; }
    #courseTable tbody tr.course-row td:nth-child(1) { position: absolute; top: 0.5rem; right: 0.5rem; }
    #courseTable tbody tr.course-row td:nth-child(2) { display: inline-block; vertical-align: middle; }
    #courseTable tbody tr.course-row td:nth-child(3) { display: inline-block; vertical-align: middle; }
    #courseTable tbody tr.course-row td:nth-child(4) { display: block; width: 100%; padding-top: 0.25rem !important; }
    #courseTable tbody tr.course-row td:nth-child(5),
    #courseTable tbody tr.course-row td:nth-child(6),
    #courseTable tbody tr.course-row td:nth-child(7) { display: inline-block; margin-right: 0.5rem; }
    #courseTable tbody tr.course-row td:nth-child(5)::before { content: 'Kap: '; font-size: .75rem; color: #6c757d; }
    #courseTable tbody tr.course-row td:nth-child(6)::before { content: 'Prio: '; font-size: .75rem; color: #6c757d; }
    #courseTable tbody tr.course-row td:nth-child(7)::before { content: 'Abs: '; font-size: .75rem; color: #6c757d; }
    #courseTable tbody tr.separator-row td { display: block; width: 100%; }
}

/* ══ Admin Dashboard ══ */
.db-header { background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 50%, #1a4a7a 100%); border-radius: 1rem; color: #fff; padding: 1.75rem 2rem; margin-bottom: 1.5rem; }
.db-header h2 { color: #fff; margin: 0; font-size: 1.5rem; font-weight: 700; }
.db-header .text-muted-light { color: rgba(255,255,255,.7); }
.db-period-badge { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: .5rem; padding: .5rem 1rem; display: inline-flex; align-items: center; gap: .75rem; }
.db-countdown { background: rgba(255,193,7,.2); border: 1px solid rgba(255,193,7,.35); color: #ffc107; border-radius: 999px; padding: .25rem .75rem; font-size: .8rem; font-weight: 600; }

.db-action-card { border-radius: .75rem; border: 1px solid transparent; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; transition: transform .15s, box-shadow .15s; text-decoration: none; color: inherit; }
.db-action-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); color: inherit; }
.db-action-card-warning { background: #fff8e1; border-color: #ffc107; }
.db-action-card-info { background: #e3f2fd; border-color: #42a5f5; }
.db-action-card-success { background: #e8f5e9; border-color: #66bb6a; }
.db-action-icon { width: 3rem; height: 3rem; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.db-action-icon-warning { background: #fff3cd; color: #e65100; }
.db-action-icon-info { background: #bbdefb; color: #1565c0; }
.db-action-icon-success { background: #c8e6c9; color: #2e7d32; }

.db-stat { text-align: center; padding: 1rem; }
.db-stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.db-stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; font-weight: 600; margin-top: .25rem; }
.db-stat-sub { font-size: .8rem; color: #6c757d; }

.db-stepper { display: flex; gap: 0; overflow-x: auto; padding: .5rem 0; -webkit-overflow-scrolling: touch; }
.db-step { flex: 1; min-width: 120px; text-align: center; position: relative; padding: .75rem .5rem; text-decoration: none; color: inherit; border-radius: .5rem; transition: background .15s; }
.db-step:hover { background: rgba(0,0,0,.03); color: inherit; }
.db-step-num { width: 2.25rem; height: 2.25rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; margin: 0 auto .4rem; position: relative; z-index: 1; }
.db-step-title { font-size: .78rem; font-weight: 600; line-height: 1.3; margin-bottom: .2rem; }
.db-step-badge { font-size: .65rem; padding: .15rem .45rem; border-radius: 999px; }

.db-step:not(:last-child)::after { content: ''; position: absolute; top: 1.85rem; right: -1px; width: 50%; height: 2px; background: #dee2e6; z-index: 0; }
.db-step:not(:first-child)::before { content: ''; position: absolute; top: 1.85rem; left: -1px; width: 50%; height: 2px; background: #dee2e6; z-index: 0; }

.step-done .db-step-num { background: #198754; color: #fff; }
.step-done:not(:last-child)::after, .step-done + .db-step::before { background: #198754; }
.step-active .db-step-num { background: #0d6efd; color: #fff; box-shadow: 0 0 0 3px rgba(13,110,253,.25); }
.step-active:not(:last-child)::after { background: #dee2e6; }
.step-active::before { background: #0d6efd; }
.step-attention .db-step-num { background: #ffc107; color: #000; box-shadow: 0 0 0 3px rgba(255,193,7,.3); animation: pulse-attention 2s infinite; }
@keyframes pulse-attention { 0%,100% { box-shadow: 0 0 0 3px rgba(255,193,7,.3); } 50% { box-shadow: 0 0 0 6px rgba(255,193,7,.15); } }
.step-waiting .db-step-num { background: #e9ecef; color: #adb5bd; }

.db-course-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; font-weight: 700; border-bottom-width: 2px; }
.db-course-table td { vertical-align: middle; }
.db-capacity-bar { height: 6px; border-radius: 3px; background: #e9ecef; overflow: hidden; min-width: 60px; }
.db-capacity-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.db-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: #6c757d; margin-bottom: .75rem; }
