/* ==========================================
   DESIGN SYSTEM - KursSelect
   Aesthetics: Sleek Charcoal Glassmorphism
   Theme: Neutral Charcoal & Emerald Green Accent (No Purple/Blue)
   Fonts: Outfit (Headings), Inter (Body)
   ========================================== */

:root {
    --bg-app: #18181b;
    --bg-glass: rgba(39, 39, 42, 0.82);
    --bg-glass-hover: rgba(63, 63, 70, 0.9);
    --border-glass: rgba(255, 255, 255, 0.12);
    
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-soft: rgba(16, 185, 129, 0.18);
    
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.2);
    
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.2);
    
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.2);

    --info: #2563eb;
    
    --text-main: #f4f4f5;
    --text-muted: #d4d4d8;
    --text-white: var(--text-main);
    
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.16);
    --shadow-premium: 0 1px 3px rgba(15, 23, 42, 0.06);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --font-size-offset: 0px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & accessible font scaling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: calc(16px + var(--font-size-offset, 0px));
}

button, input, select, textarea, table {
    font-size: inherit;
    font-family: inherit;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px 24px;
    margin-bottom: 24px;
}

/* Title block takes the free space; actions always stay beside it on desktop */
.page-header > :first-child {
    flex: 1;
    min-width: 0;
}

.page-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .header-actions {
        flex-wrap: wrap;
    }
}

.page-header .btn {
    min-height: 42px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.5;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.section-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 2px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

.app-header {
    background-color: var(--bg-header, rgba(24, 24, 27, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    padding: 8px 0 6px 0;
}

.header-container {
    width: 95%;
    max-width: 1560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 1.625rem;
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.brand-logo-img {
    height: 32px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    margin-right: 8px;
}

.header-right-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.school-year-global-wrapper {
    flex-shrink: 0;
}

.header-active-year-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.school-year-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
}

.school-year-select {
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    outline: none;
}

.school-year-select option {
    background: var(--bg-glass);
    color: var(--text-main);
}

.font-size-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

/* User Badge & Avatar */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 4px 8px 4px 6px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    width: auto;
    max-width: none;
    box-sizing: border-box;
}

.badge-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.user-badge-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    max-width: 140px;
    min-width: 0;
}

.badge-name {
    font-size: 0.84375rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    box-sizing: border-box;
}

.logout-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.logout-btn[title="Abmelden"]:hover {
    color: #ef4444;
    border-color: var(--danger);
    background: var(--danger-soft);
}

/* Navigation Bar */
.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid var(--border-glass);
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 4px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border: none;
}

.main-nav a:hover {
    color: var(--text-main);
    background-color: var(--primary-soft);
}

.main-nav a.active {
    color: #ffffff;
    background-color: var(--primary);
    font-weight: 600;
}

.main-nav a.active:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

/* Grouped navigation dropdowns (admin) */
.nav-group { position: relative; }
.nav-group__toggle {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-weight: 500; font-size: 0.8125rem; font-family: inherit;
    padding: 5px 12px; border-radius: var(--radius-md); border: none; background: transparent; cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.nav-group__toggle:hover { color: var(--text-main); background-color: var(--primary-soft); }
.nav-group__toggle.active { color: var(--primary); font-weight: 600; background-color: var(--primary-soft); }
.nav-group__toggle svg { transition: transform var(--transition-fast); }
.nav-group.open .nav-group__toggle svg { transform: rotate(180deg); }
.main-nav .nav-group__menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    min-width: 190px; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px;
    background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    box-shadow: var(--shadow-premium); z-index: 120;
}
.nav-group.open .nav-group__menu { display: flex; }
.nav-group__menu a { width: 100%; }

/* Burger button (mobile only) */
.nav-burger {
    display: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-md);
    border: 1px solid var(--border-glass); background: var(--bg-app); color: var(--text-main); cursor: pointer;
}

.logout-btn:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

/* Application Layout */
.app-content-wrapper {
    flex: 1;
    width: 90%;
    max-width: 1400px;
    margin: 40px auto;
}

.content-container {
}

/* Welcome Banner */
.welcome-banner {
    margin-bottom: 30px;
}

.banner-title {
    font-size: 2rem;
    font-weight: 700;
}

.banner-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.text-primary {
    color: var(--primary);
}

/* General components: Glass Cards */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 30px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

/* Buttons Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.625rem;
    line-height: 1.25;
    padding: 8px 20px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    filter: brightness(0.92);
    color: #ffffff;
}

.btn-outline {
    background: var(--bg-app);
    border: 1.5px solid var(--border-glass);
    color: var(--text-main);
}

.btn-outline:hover,
.btn-outline.active {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-soft);
}

.btn-outline-warning {
    background: transparent;
    border: 1.5px solid var(--warning);
    color: var(--warning);
}

.btn-outline-warning:hover {
    background-color: var(--warning-soft);
    color: var(--warning);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    min-height: 0;
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* Grids & Panels */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.clickable-stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: var(--bg-glass-hover);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    background: var(--primary-soft);
    padding: 10px;
    border-radius: var(--radius-md);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8125rem;
}

.table th {
    padding: 0.625rem 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: transparent;
    border-bottom: 1.5px solid var(--border-glass);
}

.table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.8125rem;
    color: var(--text-main);
}

.table td .font-bold {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Legacy inline badge sizes in tables follow the user font scale */
.table td .badge { font-size: 0.6875rem !important; }
.table td .text-xs { font-size: 0.6875rem; }
.table td .btn { font-size: 0.75rem; }

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-compact th, .table-compact td {
    padding: 8px 10px;
    font-size: 0.75rem;
}

/* Disable any table row hover effects globally */
table tbody tr:hover {
    background-color: var(--primary-soft) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Badges & Course types */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    box-sizing: border-box;
}

.badge-pill {
    border-radius: 30px;
}

.badge-success { background-color: var(--success-soft); color: var(--success); border: 1px solid var(--success); }
.badge-warning { background-color: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning); }
.badge-danger { background-color: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.badge-primary { background-color: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary); }
.badge-info { background-color: rgba(59, 130, 246, 0.18); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-neutral { background-color: rgba(128, 128, 128, 0.12); color: var(--text-main); border: 1px solid var(--border-glass); }
.badge-subject { background-color: rgba(128, 128, 128, 0.15); color: var(--text-main); border: 1.5px solid var(--border-glass); font-weight: 600; }
.badge-outline { border: 1px solid var(--border-glass); color: var(--text-muted); }

/* Semantic badges (shared across views & JS) */
.badge-sm { font-size: 0.625rem; padding: 1px 5px; border-radius: 4px; vertical-align: middle; }
.badge-draft { background-color: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning); }
.badge-rejected { background-color: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.badge-cancelled { background-color: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.badge-semester { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.badge-maturabel { background-color: var(--success-soft); color: var(--success); border: 1px solid var(--success); }
.badge-enrollment-type { background-color: rgba(236, 72, 153, 0.15); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-draft-visibility { display: inline-flex; align-items: center; font-size: 10px; font-weight: 400; line-height: 1; padding: 1.5px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.badge-draft-visible { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-draft-hidden { background: rgba(255, 255, 255, 0.05); color: #a1a1aa; border: 1px solid rgba(255, 255, 255, 0.12); }
.course-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.625rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.02em; }

/* Student progress summary */
.progress-summary__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.progress-bar { width: 100%; height: 10px; background: var(--border-glass); border-radius: 10px; overflow: hidden; margin: 12px 0 4px; }
.progress-bar__fill { height: 100%; background: var(--primary); border-radius: 10px; transition: width 0.3s ease; }
.progress-summary__matura { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.matura-chip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--border-glass); background: var(--bg-app); color: var(--text-main); }
.matura-chip--ok { border-color: var(--success); background: var(--success-soft); }
.matura-chip--open { border-color: var(--warning); }
.matura-chip__icon { font-weight: 700; }
.matura-chip--ok .matura-chip__icon { color: var(--success); }
.matura-chip--open .matura-chip__icon { color: var(--warning); }
.matura-chip__name { font-weight: 600; }
.matura-chip__count { font-weight: 700; }
.matura-chip__missing { color: var(--text-muted); font-size: 11px; }

.alert-warning-compact {
    font-size: 13px;
    padding: 8px 12px;
    background: var(--warning-soft);
    border: 1px solid var(--warning);
    color: var(--warning);
    border-radius: 8px;
}

.clickable-log-row {
    transition: background-color 0.15s ease;
}

.clickable-log-row:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

.course-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.25;
    text-align: center;
    box-sizing: border-box;
}

.type-pflicht { background-color: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.type-wahlpflicht { background-color: var(--success-soft); color: var(--success); border: 1px solid var(--success); }
.type-ag_freifach { background-color: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning); }

/* WebUntis-Style Participant & Waitlist Badges (Pill & Split-Pill) */
.seat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.3px;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
    transition: transform 0.12s ease;
}

.seat-pill:hover {
    transform: scale(1.04);
}

.seat-pill--free {
    background-color: #16a34a; /* Lebendiges Grün wie in WebUntis */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.seat-pill--full {
    background-color: #dc2626; /* Kräftiges Rot */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Split pill: waitlist count (amber) next to seats (green, red only when full) */
.seat-pill-split {
    display: inline-flex;
    align-items: stretch;
    border-radius: 9999px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.12s ease;
}

.seat-pill-split:hover {
    transform: scale(1.04);
}

.seat-pill-split__waitlist {
    background-color: #fef3c7;
    color: #92400e;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.seat-pill-split__seats--full {
    background-color: #dc2626;
}

.seat-pill-split__seats {
    background-color: #16a34a;
    color: #ffffff;
    padding: 3px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Orange circle badge (für Wochenstunden / Priorität wie in WebUntis) */
.badge-circle-orange {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background-color: #f97316;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Light Theme Fine-Tuning */

/* Row-Highlighting for confirmed enrolled courses (wie in WebUntis) */
.enrollment-row-confirmed {
    background-color: rgba(16, 185, 129, 0.08) !important;
}
.enrollment-row-confirmed:hover {
    background-color: rgba(16, 185, 129, 0.14) !important;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
}

.alert-danger {
    background-color: var(--danger-soft);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background-color: var(--success-soft);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background-color: var(--warning-soft);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-danger-compact {
    background-color: var(--danger-soft);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    text-align: center;
    border: 1px solid var(--danger);
}

/* Make SVG icons scale with text */
.btn svg,
.alert svg,
.logout-btn svg,
.flex-actions svg,
.glass-card svg {
    width: 1.2em !important;
    height: 1.2em !important;
    flex-shrink: 0;
}

/* Authentication Styling */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 40px;
}

.auth-title {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.875rem;
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

/* Microsoft sign-in and the collapsible password login for admins */
.sso-btn {
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.admin-login {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
}

.admin-login summary {
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    list-style: none;
}

.admin-login summary::-webkit-details-marker {
    display: none;
}

.admin-login[open] summary {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-glass);
    background-color: var(--bg-app);
    transition: var(--transition-fast);
    outline: none;
    color: var(--text-main);
    font-family: inherit;
}

/* Selects: vertical padding plus fixed heights clips the text, so centre it via min-height instead */
.form-group select,
select.form-control {
    padding-top: 0;
    padding-bottom: 0;
    min-height: 2.75rem;
    line-height: normal;
    text-overflow: ellipsis;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

select option {
    background-color: var(--bg-glass);
    color: var(--text-main);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .col-6 {
    flex: 0 0 calc(50% - 8px);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-app);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-glass);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Teacher picker: live search + chips above the teacher checkbox grid (teacher_picker.js) */
.teacher-picker-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.teacher-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 26px;
    align-items: center;
}

.teacher-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--text-main);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
}

.teacher-chip-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 6px;
    border-radius: 999px;
}

.teacher-chip-remove:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.teacher-picker-search {
    width: 100%;
}

.checkbox-grid.teacher-picker {
    margin-top: 0;
}

.checkbox-grid.teacher-picker .checkbox-item[hidden] {
    display: none !important;
}

.teacher-picker-empty {
    grid-column: 1 / -1;
    margin: 0;
}

/* Wide course modals on large screens (create/edit course) */
@media (min-width: 1000px) {
    dialog.modal.modal-wide {
        max-width: min(1100px, 92vw) !important;
    }
    dialog.modal.modal-wide .modal-content,
    .modal-content.modal-wide {
        max-width: min(1100px, 92vw);
    }
}

/* Markdown editor with live preview (md_editor.js) */
.md-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.md-editor-toolbar:empty {
    display: none;
}

.md-editor-toolbar .md-editor-label {
    margin-bottom: 0;
}

.md-editor-tabs {
    display: flex;
    gap: 4px;
}

.md-editor-tab {
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.md-editor-tab[aria-selected="true"] {
    background: var(--primary-soft);
    color: var(--text-main);
    border-color: transparent;
}

.md-editor-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.md-editor-toggle input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.md-editor-panes textarea {
    min-height: 200px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.md-editor-preview {
    min-height: 200px;
    overflow-y: auto;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-glass);
    background: var(--bg-app);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-main);
    word-wrap: break-word;
}

.md-editor-placeholder {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.md-editor[data-mode="write"] .md-editor-preview,
.md-editor[data-mode="preview"] .md-editor-panes textarea {
    display: none;
}

/* Preview switched off: plain textarea, no tabs */
.md-editor[data-preview="off"] .md-editor-tabs,
.md-editor[data-preview="off"] .md-editor-preview {
    display: none !important;
}

/* Side by side once there is room: both panes always visible, tabs not needed */
@media (min-width: 1000px) {
    .modal-wide .md-editor-tabs,
    .md-editor-standalone .md-editor-tabs {
        display: none;
    }
    .modal-wide .md-editor[data-preview="on"] .md-editor-panes,
    .md-editor-standalone .md-editor[data-preview="on"] .md-editor-panes {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
        align-items: stretch;
    }
    .modal-wide .md-editor[data-preview="on"] .md-editor-preview,
    .modal-wide .md-editor[data-preview="on"] .md-editor-panes textarea,
    .md-editor-standalone .md-editor[data-preview="on"] .md-editor-preview,
    .md-editor-standalone .md-editor[data-preview="on"] .md-editor-panes textarea {
        display: block;
        min-height: 260px;
    }
    /* The textarea alone sets the row height (also when resized); long previews scroll */
    .modal-wide .md-editor[data-preview="on"] .md-editor-preview,
    .md-editor-standalone .md-editor[data-preview="on"] .md-editor-preview {
        contain: size;
    }
}

/* Markdown help page: syntax / result examples */
.md-example {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-glass);
}

.md-example:last-child {
    border-bottom: none;
}

.md-example h3 {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.md-example pre {
    margin: 0;
    padding: 10px 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    white-space: pre-wrap;
    color: var(--text-main);
}

/* Editable source of a help example (help.ejs): looks like the former <pre>, grows with its content */
.md-example-source {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.md-example textarea {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-main);
    resize: vertical;
    overflow: hidden;
    min-height: 0;
}

.md-example textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.md-example-reset {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
}

.md-example-reset[hidden] {
    display: none;
}

.md-example .md-example-result {
    padding: 10px 12px;
    border: 1.5px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.55;
}

@media (max-width: 700px) {
    .md-example {
        grid-template-columns: 1fr;
    }
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Demo quicklogin styles */
.demo-login-box {
    margin-top: 30px;
    padding: 16px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    border: 1px dashed var(--primary);
}

.demo-login-box h3 {
    font-size: 0.8125rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.demo-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Teacher View Grid */
.teacher-view-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    align-items: start;
}

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

.courses-list-column, .left-column-wrapper {
    min-width: 0;
}

.courses-compact-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-compact-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.border-left-pflicht { border-left: 5px solid var(--danger); }
.border-left-wahlpflicht { border-left: 5px solid var(--primary); }
.border-left-ag_freifach { border-left: 5px solid var(--warning); }
.border-left-gray { border-left: 5px solid var(--text-muted); }

.c-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.c-title {
    font-size: 1.125rem;
    color: var(--text-main);
}

/* Course Grid for Student Selector */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
}

.course-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-disabled {
    opacity: 0.75;
    background: var(--bg-app);
}

.course-disabled:hover {
    transform: none;
    box-shadow: var(--shadow-premium);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.course-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.2;
}

.course-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 66px;
}

.course-details-mini {
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.detail-mini-item {
    display: flex;
    font-size: 0.8125rem;
    justify-content: space-between;
}

.detail-mini-item .label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-mini-item .value {
    color: var(--text-main);
    font-weight: 600;
}

/* Occupancy progress bar */
.course-occupancy-bar-wrapper {
    margin-bottom: 8px;
}

.occupancy-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 6px;
}

.occupancy-bar-bg {
    width: 100%;
    height: 8px;
    background-color: var(--border-glass);
    border-radius: 10px;
    overflow: hidden;
}

.occupancy-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width var(--transition-normal);
}

.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }

/* Course Detailed View */
.course-detail-header-card {
    background: var(--bg-glass);
}

.detail-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.course-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.occupancy-large {
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
}

.occupancy-number {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.occupancy-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-glass);
    margin: 20px 0;
}

.course-meta-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.meta-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.enrollment-lists-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .enrollment-lists-grid {
        grid-template-columns: 1fr;
    }
}

.back-link {
    margin-bottom: 10px;
}

.btn-back {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-back:hover {
    color: var(--primary);
}

/* Filter controls */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.filter-form label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-form select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-glass);
    outline: none;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-app);
}

.admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.flex-actions {
    display: flex;
    gap: 8px;
}

/* Footer layout */
.app-footer {
    background-color: var(--bg-header, rgba(24, 24, 27, 0.95));
    border-top: 1px solid var(--border-glass);
    padding: 24px 0;
    margin-top: 60px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Utilities */
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 40px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 40px; }
.p-4 { padding: 24px !important; }
.p-5 { padding: 40px !important; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

/* Keyframe animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Overlay & Card Centering */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease-out;
}

dialog.modal {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: auto !important;
    overflow: visible !important;
    width: 90vw !important;
    max-width: 600px !important;
    color: var(--text-main) !important;
}

dialog.modal::backdrop {
    background: rgba(18, 18, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 30px;
    color: var(--text-main);
}

/* Keep the scrollbar inside the rounded corners: inset the track by the corner radius */
.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: var(--radius-lg) 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.45);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(128, 128, 128, 0.7);
}

/* Browsers without ::-webkit-scrollbar (Firefox): thin, unobtrusive scrollbar */
@supports not selector(::-webkit-scrollbar) {
    .modal-content {
        scrollbar-width: thin;
        scrollbar-color: rgba(128, 128, 128, 0.45) transparent;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--border-glass);
}

.btn-close, .close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Hide the "×" glyph (never optically centered) and draw an SVG cross instead */
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

.btn-close::before, .close-btn::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9M10.5 1.5l-9 9' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9M10.5 1.5l-9 9' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn-close:hover, .close-btn:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
    transform: scale(1.06);
}

/* Clickable Course Table Rows */
.clickable-course-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.clickable-course-row:hover td {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Course Details Modal Styles */
.course-modal-badge-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 14px;
}
.course-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.course-modal-card {
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}
.course-modal-card .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}
.course-modal-card .value {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-word;
}
.course-modal-card .value .badge-semester,
.course-modal-card .value .course-times { font-size: inherit; font-weight: 500; color: var(--text-main); }
.course-modal-desc {
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-main);
    margin-top: 14px;
    word-break: break-word;
}
.course-detail-desc {
    word-break: break-word;
    line-height: 1.6;
}
.course-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
    cursor: pointer;
    transition: filter 0.15s ease, color 0.15s ease;
}
.course-link:hover {
    filter: brightness(1.2);
    text-decoration: underline;
}

/* Course Description Markdown Styling */
.desc-heading {
    color: var(--text-main);
    font-weight: 700;
    margin: 12px 0 6px 0;
    line-height: 1.35;
}
.desc-heading:first-child {
    margin-top: 0;
}
.desc-h1 { font-size: 1.15rem; }
.desc-h2 { font-size: 1.05rem; }
.desc-h3 { font-size: 0.95rem; }

.desc-list {
    margin: 6px 0 10px 0;
    padding-left: 22px;
    color: var(--text-main);
}
.desc-list li {
    margin-bottom: 3px;
    line-height: 1.5;
}

.desc-quote {
    border-left: 3px solid var(--primary);
    background: rgba(16, 185, 129, 0.08);
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-main);
    font-style: italic;
}

.desc-code {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 1.5px 5px;
    font-family: var(--font-mono, monospace);
    font-size: 0.85em;
    color: var(--primary);
}

.desc-pre {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin: 8px 0;
    overflow-x: auto;
}
.desc-pre .desc-code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-main);
}

.desc-divider {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: 12px 0;
}

.desc-table-wrap {
    overflow-x: auto;
    margin: 10px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    max-width: 100%;
}
.desc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-main);
    background: var(--bg-card);
}
.desc-table th,
.desc-table td {
    padding: 7px 12px;
    border: 1px solid var(--border-glass);
    line-height: 1.45;
}
.desc-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-main);
}
.desc-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}
.course-modal-alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-top: 12px;
}
.course-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

/* Multi-column layout additions */
.flex-column {
    flex-direction: column;
}

.left-column-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================
   MOBILE-FIRST RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet & Mobile Layouts */
@media (max-width: 768px) {
    .app-header {
        padding: 10px 0 6px 0;
    }
    
    .header-top-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .nav-burger {
        display: inline-flex;
    }

    /* Collapsed by default on mobile; opened via burger */
    .header-right-section,
    .main-nav {
        display: none;
    }

    .app-header.nav-open .header-right-section {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
        padding-top: 8px;
    }

    .app-header.nav-open .user-badge {
        justify-content: space-between;
    }

    .app-header.nav-open .user-badge-info {
        max-width: none;
        flex: 1;
    }

    .app-header.nav-open .main-nav {
        display: block;
        padding-top: 8px;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .main-nav a,
    .nav-group__toggle {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Groups render inline as labelled sections on mobile */
    .main-nav .nav-group__toggle {
        pointer-events: none;
        padding-bottom: 2px;
        font-size: 11px;
        background: transparent;
        color: var(--text-muted);
    }

    .nav-group__toggle svg {
        display: none;
    }

    .main-nav .nav-group__menu {
        display: flex;
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 8px;
    }
    
    .school-year-global-wrapper {
        margin-right: 0 !important;
        margin-top: 2px;
    }
    
    .app-content-wrapper {
        margin: 20px auto;
        width: 94%;
    }
    
    .banner-title {
        font-size: 26px;
    }
    
    .banner-subtitle {
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table td, .table th {
        padding: 0.5rem 0.625rem;
    }
}

/* Small Smartphone Layouts */
@media (max-width: 576px) {
    .glass-card {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-row .col-6 {
        flex: 0 0 100%;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .course-card {
        padding: 18px 14px;
    }
    
    .course-title {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 20px 16px;
        width: 95%;
        max-height: 90vh;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .footer-links {
        justify-content: center;
    }
}

.coursebook-card:hover {
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-md);
}

/* ==========================================
   INTERACTIVE TIMETABLE (STUNDENPLAN)
   ========================================== */

.timetable-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.view-toggle-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
}

.btn-view-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-view-toggle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.btn-view-toggle.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-soft);
}

.timetable-hint-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-main);
    background: var(--primary-soft);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.timetable-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 14px;
}

.timetable-container {
    min-width: 860px;
    position: relative;
}

.timetable-grid {
    display: grid;
    grid-template-columns: 80px repeat(6, minmax(120px, 1fr));
    grid-template-rows: 44px repeat(11, minmax(62px, auto));
    gap: 6px;
    position: relative;
}

/* Header row (matches table th style) */
.timetable-header-cell {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    user-select: none;
}

.timetable-header-cell.corner-cell {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 700;
}

/* Period Label Column */
.timetable-period-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    user-select: none;
    text-align: center;
}

.timetable-period-num {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.1;
}

.timetable-period-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Background Grid Cells (Drop Targets & Click to Add) */
.timetable-cell {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-glass);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
}

.timetable-cell:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.timetable-cell .add-slot-btn {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.15s ease;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.timetable-cell:hover .add-slot-btn {
    opacity: 1;
    transform: scale(1);
}

/* Drop target highlight states */
.timetable-cell.drop-target-active {
    background: var(--primary-soft) !important;
    border: 2px dashed var(--primary) !important;
    box-shadow: 0 0 12px var(--primary-soft);
    z-index: 4;
}

/* Timeslot Cards in the Grid */
.timeslot-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 6px 8px 12px 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 10;
    cursor: grab;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.timeslot-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    z-index: 12;
}

.timeslot-card:active {
    cursor: grabbing;
}

.timeslot-card.is-dragging {
    opacity: 0.4;
    transform: scale(0.97);
    border: 2px dashed var(--primary);
    box-shadow: none;
}

.timeslot-card.is-resizing {
    box-shadow: 0 0 16px var(--primary-soft) !important;
    border-color: var(--primary) !important;
    z-index: 25 !important;
    transition: none !important;
    transform: none !important;
}

body.timetable-resizing-active {
    cursor: ns-resize !important;
    user-select: none !important;
}

/* Card internal elements */
.timeslot-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 4px;
}

.timeslot-period-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.2;
}

.timeslot-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.timeslot-card:hover .timeslot-card-actions {
    opacity: 1;
}

.btn-card-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 2px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-card-action:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.btn-card-action.btn-card-delete:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.timeslot-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.timeslot-duration-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    padding: 1px 5px;
    border-radius: 4px;
}

.timeslot-courses-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--info);
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Resize Handle */
.timeslot-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    background: transparent;
    transition: background 0.15s ease;
}

.timeslot-resize-handle:hover,
.timeslot-card.is-resizing .timeslot-resize-handle {
    background: var(--primary-soft);
}

.resize-handle-bar {
    width: 26px;
    height: 3px;
    background: var(--border-glass);
    border-radius: 2px;
    transition: background 0.15s ease, height 0.15s ease;
}

.timeslot-resize-handle:hover .resize-handle-bar,
.timeslot-card.is-resizing .resize-handle-bar {
    background: var(--primary);
    height: 4px;
}

/* ==========================================
   COURSE SCHEDULE CARDS (STUNDENPLAN KURSE)
   ========================================== */

.schedule-course-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    position: relative;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    text-align: left;
}

.schedule-course-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    z-index: 15;
}

.schedule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.schedule-course-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.schedule-badge-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.schedule-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1.3;
}

.schedule-tag-room {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

.schedule-tag-teacher {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.schedule-tag-semester {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.schedule-tag-confirmed {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.schedule-tag-waiting {
    background: var(--warning-soft);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.schedule-tag-freifach {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.schedule-tag-participants {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

.schedule-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.schedule-stats-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.schedule-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.schedule-stat-item strong {
    color: var(--text-main);
    font-size: 14px;
}





/* Course remarks boxes (teacher views) */
.c-remarks { background: var(--warning-soft); color: var(--text-main); padding: 6px 8px; border-radius: 6px; border-left: 3px solid var(--warning); }
.c-remarks--rejected { background: var(--danger-soft); border-left-color: var(--danger); }

/* Admin dashboard: registration phase banner */
.phase-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-glass); background: var(--bg-glass); margin-top: 20px; font-size: 14px; color: var(--text-main); }
.phase-banner > div { flex: 1; min-width: 200px; }
.phase-banner__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.phase-banner--open { border-color: var(--success); background: var(--success-soft); }
.phase-banner--open .phase-banner__dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.phase-banner--upcoming .phase-banner__dot { background: #3b82f6; }
.phase-banner--none { border-color: var(--warning); background: var(--warning-soft); }
.phase-banner--none .phase-banner__dot { background: var(--warning); }

/* Admin dashboard: KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.kpi-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border-glass); background: var(--bg-glass); color: var(--text-main); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
a.kpi-tile:hover { border-color: var(--primary); }
.kpi-tile--wide { grid-column: span 2; }
.kpi-tile--warn .kpi-tile__label::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); margin-right: 6px; vertical-align: 1px; }
.kpi-tile__label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi-tile__value { font-family: 'Outfit', sans-serif; font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.kpi-tile__value small { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.kpi-tile__hint { font-size: 12px; color: var(--text-muted); }
.kpi-tile .progress-bar { margin: 6px 0 2px; }
@media (max-width: 576px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.empty-state { text-align: center; padding: 20px; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.teacher-dash-card { display: flex; flex-direction: column; }
.teacher-dash-card .course-footer { margin-top: auto; }

/* Compact row action menu (tables) */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; padding: 6px 10px; font-weight: 700; letter-spacing: 1px; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu__list {
    position: fixed; z-index: 300; min-width: 210px; padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
    background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-md); box-shadow: var(--shadow-premium);
}
.row-menu__list form { margin: 0; }
.row-menu__item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: none; background: transparent;
    color: var(--text-main); font-size: 13px; font-family: inherit; cursor: pointer; text-decoration: none;
}
.row-menu__item:hover { background: var(--primary-soft); color: var(--text-main); }
.row-menu__item--danger { color: var(--danger); }
.row-menu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.row-menu__note { font-size: 11px; color: var(--text-muted); padding: 6px 10px; }

/* Calm course meta: semester, times and category as plain text */
.course-times { display: inline-flex; flex-direction: column; color: var(--text-main); font-weight: 500; }
.course-times > span { white-space: nowrap; }
.badge.badge-category { gap: 6px; padding: 0; background: transparent; border: 0; border-radius: 0; color: var(--text-main); font-weight: 500; font-size: inherit; white-space: nowrap; }
/* Category colour as a stripe on the left edge of a course row or tile */
.table tr.cat-row > td:first-child { box-shadow: inset 4px 0 0 var(--cat, transparent); }
.cat-card { border-left: 4px solid var(--cat, transparent) !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Shared building blocks (formerly repeated as inline styles in the views) */
.sub-card { background: var(--bg-app); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 20px; }
.sub-card__title { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 3px; }
.sub-card__desc { font-size: 12px; color: var(--text-muted); margin: 0; }
.panel { background: var(--bg-app); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 14px 16px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.field-label-sm { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.form-hint { display: block; margin-top: 3px; }
.filter-input { width: 100%; height: 38px; padding: 0 10px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 8px; color: var(--text-main); font-size: 13px; outline: none; }
.filter-input:focus { border-color: var(--primary); }
select.filter-input { cursor: pointer; }
.filter-input--search { padding: 0 32px 0 12px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; }
.alert-soft { border: 1px solid; }
.alert-soft--info { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.3); color: var(--info); }
.alert-soft--warning { background: var(--warning-soft); border-color: var(--warning); color: var(--text-main); }
.color-input { width: 44px; height: 38px; padding: 2px; border: 1.5px solid var(--border-glass); border-radius: 8px; cursor: pointer; background: transparent; }
.form-divider { border: 0; border-top: 1px solid var(--border-glass); margin: 24px 0; }
.table th.col-title { min-width: 11rem; }
.table tr.row-edit { cursor: pointer; }
.table tr.row-edit:hover td { background-color: var(--primary-soft); }
.table tr.row-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.table tr.row-select { cursor: pointer; }
.table tr.row-select:hover td { background-color: var(--bg-app); }
.table tr.row-select.is-selected td { background-color: var(--primary-soft); }
.table th.col-select, .table td.col-select { width: 38px; text-align: center; vertical-align: middle; }
.select-cb { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* Batch action bar, shown while table rows are selected */
.batch-bar {
    position: sticky; bottom: 12px; z-index: 40;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-top: 12px; padding: 10px 14px;
    background: var(--bg-glass); border: 1px solid var(--primary); border-radius: var(--radius-md); box-shadow: var(--shadow-premium);
}
.batch-bar[hidden] { display: none; }
.batch-bar__count { font-size: 13px; font-weight: 700; color: var(--text-main); margin-right: 6px; }
.batch-bar__spacer { flex: 1; }
.batch-bar .filter-input { width: auto; height: 32px; }
.card-title { font-size: 1.125rem; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.section-nav { position: sticky; top: var(--header-height, 96px); z-index: 50; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; margin: -8px 0 16px; background: var(--bg-app); }
.section-nav a { padding: 6px 14px; border-radius: 9999px; border: 1px solid var(--border-glass); background: var(--bg-glass); color: var(--text-main); font-size: 13px; font-weight: 600; }
.section-nav a:hover { border-color: var(--primary); color: var(--primary); }
.settings-section { scroll-margin-top: 160px; }

/* Semester and times side by side ("Winter | Di. 6. Std."); stacks only when the cell gets tight.
   Each item carries its own "|" in a 14px gutter; the inner row is shifted left by that gutter and
   clipped, so a separator never shows at the start of a line. */
.sem-times { overflow: hidden; }
.sem-times > div { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 3px; margin-left: -14px; }
.sem-times > div > * { position: relative; padding-left: 14px; }
.sem-times > div > *::before { content: "|"; position: absolute; left: 0; width: 14px; text-align: center; color: var(--text-muted); font-weight: 400; }
