/* ==========================================================================
   DiWa — page-scoped stylesheet (per-page body.page-* sections)
   Shared components that several pages use identically live in the section
   at the top; page sections keep only unique / override rules.
   ========================================================================== */

/* --- Shared components (multi-page) --- */

body.page-admin-clear-daily .back-button,
body.page-admin-update-supervisors .back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-default);
    transition: background-color 0.3s ease;
}

body.page-admin-clear-daily .back-button:hover,
body.page-admin-update-supervisors .back-button:hover {
    background-color: var(--color-primary-hover);
}

body.page-admin-clear-daily .message-container,
body.page-admin-update-supervisors .message-container {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    background-color: var(--color-white);
    border-radius: var(--radius-default);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.page-admin-kbe-assignment .betreuer-container,
body.page-admin-settings .betreuer-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
}

body.page-admin-kbe-assignment .input-container,
body.page-admin-settings .input-container {
    display: grid;
    width: 100%;
    margin-bottom: 20px;
}

body.page-admin-login .btn-guest:hover,
body.page-student-login .btn-guest:hover {
    background-color: var(--color-primary-soft);
}

body.page-admin-login .guest-separator,
body.page-student-login .guest-separator {
    margin: 22px 0 14px;
    color: var(--color-text-muted);
    font-size: 13px;
    position: relative;
}

body.page-admin-login .guest-separator::after,
body.page-student-login .guest-separator::after {
    right: 0;
}

body.page-admin-login .guest-separator::before,
body.page-student-login .guest-separator::before {
    left: 0;
}

body.page-admin-login .startseite-button,
body.page-student-login .startseite-button {
    position: absolute;
    top: 20px;
    left: 20px;
}

body.page-admin-settings .category-level-1,
body.page-admin-student-profile .category-level-1,
body.page-student-profile .category-level-1 {
    background-color: var(--color-info-bg);
    border-left: 4px solid var(--color-info);
}

body.page-admin-settings .category-level-2,
body.page-admin-student-profile .category-level-2,
body.page-student-profile .category-level-2 {
    background-color: var(--color-purple-bg);
    border-left: 4px solid var(--color-purple);
    margin-left: 20px;
}

body.page-admin-settings .category-level-3,
body.page-admin-student-profile .category-level-3,
body.page-student-profile .category-level-3 {
    background-color: var(--color-success-bg);
    border-left: 4px solid var(--color-success);
    margin-left: 40px;
}

body.page-admin-settings h3,
body.page-admin-student-profile h3,
body.page-student-profile h3 {
    color: var(--color-text);
    margin: 20px 0 10px;
}

body.page-admin-settings h2,
body.page-admin-student-profile h2,
body.page-student-profile h2,
body.page-student-user-data h2 {
    color: var(--color-text);
    margin-bottom: 20px;
    text-align: center;
}

body.page-admin-settings .form-group label,
body.page-student-login .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text);
}

body.page-admin-student-profile .category-breakdown,
body.page-student-profile .category-breakdown {
    margin: 20px 0;
}

body.page-admin-student-profile .category-header,
body.page-student-profile .category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

body.page-admin-student-profile .category-level,
body.page-student-profile .category-level {
    margin: 10px 0;
    padding: 15px;
    border-radius: var(--radius-default);
    background-color: var(--color-bg);
}

body.page-admin-student-profile .header-content,
body.page-student-profile .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

body.page-admin-student-profile .legend-item,
body.page-student-profile .legend-item {
    padding: 4px 8px;
    border-radius: var(--radius-default);
    font-size: 12px;
    font-weight: bold;
}

body.page-admin-student-profile .legend-items,
body.page-student-profile .legend-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

body.page-admin-student-profile .level1-toggle-btn,
body.page-student-profile .level1-toggle-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

body.page-admin-student-profile .level1-toggle-btn i,
body.page-student-profile .level1-toggle-btn i {
    transition: transform 0.3s ease;
}

body.page-admin-student-profile .level1-toggle-header,
body.page-student-profile .level1-toggle-header {
    transition: background-color 0.2s ease;
    user-select: none;
}

body.page-admin-student-profile .level1-toggle-header:hover,
body.page-student-profile .level1-toggle-header:hover {
    background-color: var(--color-primary-hover) !important;
}

body.page-admin-student-profile .level2-cell,
body.page-student-profile .level2-cell {
    padding: 6px 4px;
}

body.page-admin-student-profile .level2-details,
body.page-student-profile .level2-details {
    font-size: 8px;
}

body.page-admin-student-profile .level2-header,
body.page-student-profile .level2-header {
    background-color: var(--color-primary-hover) !important;
    font-size: 10px !important;
    padding: 6px 4px !important;
    font-style: italic;
}

body.page-admin-student-profile .level2-progress,
body.page-student-profile .level2-progress {
    height: 16px;
    margin-bottom: 2px;
}

body.page-admin-student-profile .level2-text,
body.page-student-profile .level2-text {
    font-size: 9px;
}

body.page-admin-student-profile .points-stepper,
body.page-student-profile .points-stepper {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}

body.page-admin-student-profile .points-stepper-btn,
body.page-student-profile .points-stepper-btn {
    background: var(--color-nav);
    color: var(--color-white);
    border: none;
    border-radius: 3px;
    width: 22px;
    height: 14px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
}

body.page-admin-student-profile .points-stepper-btn:hover,
body.page-student-profile .points-stepper-btn:hover {
    background: var(--color-accent);
}

body.page-admin-student-profile .points-stepper-down::before,
body.page-student-profile .points-stepper-down::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

body.page-admin-student-profile .points-stepper-input.form-input,
body.page-student-profile .points-stepper-input.form-input {
    width: auto;
    max-width: 88px;
    min-width: 64px;
    padding: 8px 10px;
    font-size: 14px;
    text-align: right;
    -webkit-appearance: auto;
    appearance: auto;
    -moz-appearance: number-input;
}

body.page-admin-student-profile .points-stepper-save,
body.page-student-profile .points-stepper-save {
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

body.page-admin-student-profile .points-stepper-save[hidden],
body.page-student-profile .points-stepper-save[hidden] {
    display: none !important;
}

body.page-admin-student-profile .points-stepper-saving,
body.page-student-profile .points-stepper-saving {
    opacity: 0.65;
    pointer-events: none;
}

body.page-admin-student-profile .points-stepper-spin,
body.page-student-profile .points-stepper-spin {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}

body.page-admin-student-profile .points-stepper-up::before,
body.page-student-profile .points-stepper-up::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
}

body.page-admin-student-profile .points-stepper.is-dirty .points-stepper-save,
body.page-student-profile .points-stepper.is-dirty .points-stepper-save {
    display: inline-block;
}

body.page-admin-student-profile .profile-category-empty,
body.page-student-profile .profile-category-empty {
    padding: 12px 15px;
    color: var(--color-text-muted);
    font-size: 0.95em;
    background-color: var(--color-bg);
    border-radius: var(--radius-default);
}

body.page-admin-student-profile .profile-detail-cell,
body.page-student-profile .profile-detail-cell {
    padding: 12px 15px !important;
    background-color: var(--color-bg);
    border-top: 2px solid var(--color-primary);
    text-align: left;
}

body.page-admin-student-profile .profile-l2-group,
body.page-student-profile .profile-l2-group {
    margin-bottom: 14px;
}

body.page-admin-student-profile .profile-l2-group-title,
body.page-student-profile .profile-l2-group-title {
    font-weight: bold;
    color: var(--color-purple);
    margin-bottom: 8px;
    padding-left: 4px;
    font-size: 0.95em;
}

body.page-admin-student-profile .profile-l3-section-title,
body.page-student-profile .profile-l3-section-title {
    margin: 0 0 12px 0;
    color: var(--color-text);
    font-size: 1em;
}

body.page-admin-student-profile .progress-bar,
body.page-student-profile .progress-bar {
    height: 100%;
    border-radius: var(--radius-default);
    transition: width 0.3s ease;
}

body.page-admin-student-profile .progress-bar-container,
body.page-student-profile .progress-bar-container {
    position: relative;
    background-color: var(--color-bg-muted);
    border-radius: var(--radius-default);
    height: 20px;
    margin-bottom: 4px;
    overflow: hidden;
}

body.page-admin-student-profile .progress-cell,
body.page-student-profile .progress-cell {
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

body.page-admin-student-profile .progress-details,
body.page-student-profile .progress-details {
    font-size: 10px;
    color: var(--color-text-muted);
}

body.page-admin-student-profile .progress-gray,
body.page-student-profile .progress-gray {
    background-color: var(--color-primary);
}

body.page-admin-student-profile .progress-green-light,
body.page-student-profile .progress-green-light {
    background-color: var(--color-success-bg);
}

body.page-admin-student-profile .progress-green-saturated,
body.page-student-profile .progress-green-saturated {
    background-color: var(--color-success);
}

body.page-admin-student-profile .progress-legend,
body.page-student-profile .progress-legend {
    background-color: var(--color-bg);
    padding: 15px;
    border-radius: var(--radius-default);
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}

body.page-admin-student-profile .progress-legend h4,
body.page-student-profile .progress-legend h4 {
    margin: 0 0 10px 0;
    color: var(--color-text);
}

body.page-admin-student-profile .progress-text,
body.page-student-profile .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: var(--color-text-strong);
    text-shadow: 0 0 2px white;
}

body.page-admin-student-profile .progress-yellow,
body.page-student-profile .progress-yellow {
    background-color: var(--color-warning);
}

body.page-admin-student-profile .session-card,
body.page-student-profile .session-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    margin: 10px 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.page-admin-student-profile .session-content,
body.page-student-profile .session-content {
    padding: 15px;
    display: none;
}

body.page-admin-student-profile .session-content.expanded,
body.page-student-profile .session-content.expanded {
    display: block;
}

body.page-admin-student-profile .session-header,
body.page-student-profile .session-header {
    background-color: var(--color-bg);
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

body.page-admin-student-profile .session-header:hover,
body.page-student-profile .session-header:hover {
    background-color: var(--color-bg-muted);
}

body.page-admin-student-profile .session-status,
body.page-student-profile .session-status {
    padding: 4px 8px;
    border-radius: var(--radius-card);
    font-size: 12px;
    font-weight: bold;
}

body.page-admin-student-profile .stat-card,
body.page-student-profile .stat-card {
    background: linear-gradient(135deg, var(--color-primary), var(--color-text));
    color: white;
    padding: 20px;
    border-radius: var(--radius-card);
    text-align: center;
    box-shadow: var(--shadow-card);
}

body.page-admin-student-profile .stat-label,
body.page-student-profile .stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

body.page-admin-student-profile .stat-number,
body.page-student-profile .stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

body.page-admin-student-profile .stats-grid,
body.page-student-profile .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

body.page-admin-student-profile .course-tooth-head,
body.page-student-profile .course-tooth-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
    margin-bottom: var(--space-5);
}

body.page-admin-student-profile .course-tooth-head h2,
body.page-student-profile .course-tooth-head h2 {
    flex: 1 1 12rem;
    margin-bottom: 0;
}

body.page-admin-student-profile .course-tooth-head .course-tooth,
body.page-student-profile .course-tooth-head .course-tooth {
    flex: 0 1 220px;
}

body.page-admin-student-profile .course-tooth-slot,
body.page-student-profile .course-tooth-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px 12px;
}

body.page-admin-student-profile .course-tooth,
body.page-student-profile .course-tooth {
    margin: 0;
    width: 220px;
    text-align: center;
}

body.page-admin-student-profile .course-tooth-frame,
body.page-student-profile .course-tooth-frame {
    position: relative;
    width: 200px;
    margin: 0 auto;
}

body.page-admin-student-profile .course-tooth-ghost,
body.page-student-profile .course-tooth-ghost {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(1);
    opacity: 0.28;
}

body.page-admin-student-profile .course-tooth-grow,
body.page-student-profile .course-tooth-grow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--growth, 0%);
    overflow: hidden;
    animation: course-tooth-grow 1.2s ease-out both;
}

body.page-admin-student-profile .course-tooth-color,
body.page-student-profile .course-tooth-color {
    display: block;
    width: 100%;
    height: auto;
}

body.page-admin-student-profile .course-tooth-caption,
body.page-student-profile .course-tooth-caption {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 6px;
    margin-top: 8px;
    line-height: 1.25;
    text-align: left;
}

body.page-admin-student-profile .course-tooth-lines,
body.page-student-profile .course-tooth-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.page-admin-student-profile .course-tooth-line,
body.page-student-profile .course-tooth-line {
    font-size: 0.82rem;
    color: #5e5c56;
}

body.page-admin-student-profile .course-tooth-line-credit,
body.page-student-profile .course-tooth-line-credit {
    font-weight: 700;
    color: var(--color-text);
}

body.page-admin-student-profile .course-tooth-info-wrap,
body.page-student-profile .course-tooth-info-wrap {
    position: relative;
    display: inline-flex;
}

body.page-admin-student-profile .course-tooth-info,
body.page-student-profile .course-tooth-info {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--color-primary);
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    line-height: 16px;
    text-align: center;
    cursor: help;
}

body.page-admin-student-profile .course-tooth-info-tip,
body.page-student-profile .course-tooth-info-tip {
    display: none !important;
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: 16rem;
    max-width: 70vw;
    padding: 10px 12px;
    border-radius: var(--radius-card);
    background: var(--color-white);
    color: var(--color-text);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
    font-size: 0.78rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.4;
    text-align: left;
    z-index: 20;
}

body.page-admin-student-profile .course-tooth-info-wrap:hover .course-tooth-info-tip,
body.page-student-profile .course-tooth-info-wrap:hover .course-tooth-info-tip,
body.page-admin-student-profile .course-tooth-info-wrap:focus-within .course-tooth-info-tip,
body.page-student-profile .course-tooth-info-wrap:focus-within .course-tooth-info-tip {
    display: block !important;
}

@keyframes course-tooth-grow {
    from { height: 0; }
    to { height: var(--growth, 0%); }
}

@media (prefers-reduced-motion: reduce) {
    body.page-admin-student-profile .course-tooth-grow,
    body.page-student-profile .course-tooth-grow {
        animation: none;
        height: var(--growth, 0%);
    }
}

@media (max-width: 600px) {
    body.page-admin-student-profile .course-tooth-head,
    body.page-student-profile .course-tooth-head {
        flex-direction: column;
    }

    body.page-student-profile .course-tooth-head .course-tooth {
        order: -1;
    }

    body.page-admin-student-profile .course-tooth,
    body.page-student-profile .course-tooth {
        width: 180px;
    }

    body.page-admin-student-profile .course-tooth-frame,
    body.page-student-profile .course-tooth-frame {
        width: 160px;
    }
}

body.page-admin-student-profile .status-active,
body.page-student-profile .status-active {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

body.page-admin-student-profile .status-completed,
body.page-student-profile .status-completed {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
}

body.page-admin-student-profile .student-overview-table,
body.page-student-profile .student-overview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-default);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.page-admin-student-profile .student-overview-table .sub-header th,
body.page-student-profile .student-overview-table .sub-header th {
    background-color: var(--color-primary-hover);
    font-size: 11px;
    padding: 8px 6px;
    border-top: 1px solid var(--color-primary-hover);
}

body.page-admin-student-profile .student-overview-table .sub-header th:first-child,
body.page-student-profile .student-overview-table .sub-header th:first-child {
    background-color: var(--color-primary);
    border-top: none;
}

body.page-admin-student-profile .student-overview-table th,
body.page-student-profile .student-overview-table th {
    background-color: var(--color-primary);
    color: white;
    font-weight: bold;
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
}

body.page-admin-student-profile .student-overview-table th:first-child,
body.page-student-profile .student-overview-table th:first-child {
    text-align: left;
    font-size: 14px;
}

body.page-admin-student-profile .total-points,
body.page-student-profile .total-points {
    font-weight: bold;
    padding: 12px 8px;
    text-align: center;
    background-color: var(--color-bg);
}

body.page-admin-student-profile .total-points-value,
body.page-student-profile .total-points-value {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-default);
}

body.page-admin-student-profile .total-points-value.total-points-complete,
body.page-student-profile .total-points-value.total-points-complete {
    border: 2px solid var(--color-success);
    background-color: var(--color-success-bg);
}

body.page-admin-student-profile table,
body.page-student-profile table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-default);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.page-admin-student-profile th,
body.page-student-profile th {
    background-color: var(--color-primary);
    color: white;
    font-weight: bold;
}

body.page-admin-student-profile tr.profile-detail-row.collapsed,
body.page-student-profile tr.profile-detail-row.collapsed {
    display: none;
}

body.page-admin-student-profile tr:hover,
body.page-student-profile tr:hover {
    background-color: var(--color-bg);
}

body.page-admin-student-profile .form-group,
body.page-student-profile .form-group,
body.page-student-user-data .form-group {
    display: flex;
    flex-direction: column;
}

body.page-admin-student-profile .form-group label,
body.page-student-profile .form-group label,
body.page-student-user-data .form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text);
}

body.page-admin-student-profile .form-row,
body.page-student-profile .form-row,
body.page-student-user-data .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

body.page-admin-waiting-list .table-container li:last-child,
body.page-zfa-xray-waiting-list .table-container li:last-child {
    border-bottom: none;
}

body.page-admin-waiting-list .table-container ul,
body.page-zfa-xray-waiting-list .table-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

body.page-student-kbe-assignment .guest-banner a,
body.page-student-waiting-list .guest-banner a {
    color: var(--color-nav);
    font-weight: bold;
}

@media (max-width: 480px) {
    body.page-admin-login .startseite-button,
    body.page-student-login .startseite-button {
        top: 15px;
        left: 15px;
    }

    body.page-admin-settings h2,
    body.page-admin-student-profile h2,
    body.page-student-profile h2 {
        font-size: 1.5em;
    }

}

@media (max-width: 768px) {
    body.page-admin-student-profile .category-level-2,
    body.page-student-profile .category-level-2 {
        margin-left: 10px;
    }

    body.page-admin-student-profile .category-level-3,
    body.page-student-profile .category-level-3 {
        margin-left: 20px;
    }

    body.page-admin-student-profile .form-row,
    body.page-student-profile .form-row {
        grid-template-columns: 1fr;
    }

    body.page-admin-student-profile .legend-items,
    body.page-student-profile .legend-items {
        flex-direction: column;
        gap: 8px;
    }

    body.page-admin-student-profile .progress-bar-container,
    body.page-student-profile .progress-bar-container {
        height: 16px;
    }

    body.page-admin-student-profile .progress-details,
    body.page-student-profile .progress-details {
        font-size: 8px;
    }

    body.page-admin-student-profile .progress-text,
    body.page-student-profile .progress-text {
        font-size: 8px;
    }

    body.page-admin-student-profile .stats-grid,
    body.page-student-profile .stats-grid {
        grid-template-columns: 1fr;
    }

    body.page-admin-student-profile .student-overview-table,
    body.page-student-profile .student-overview-table {
        font-size: 10px;
    }

    body.page-student-waiting-list header h1,
    body.page-zfa-xray-waiting-list header h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

}

@supports (-webkit-touch-callout: none) {
    body.page-admin-settings input[type="file"],
    body.page-admin-student-profile input[type="file"],
    body.page-student-profile input[type="file"] {
        font-size: 16px;
    }

}

/* --- student_profile.php (page-student-profile) --- */

body.page-student-profile .propose-shared-row {
    margin-bottom: 15px;
}

body.page-student-profile .propose-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

body.page-student-profile .propose-line {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 160px) auto;
    gap: 12px;
    align-items: end;
}

body.page-student-profile .propose-line-remove {
    background: var(--color-danger);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    touch-action: manipulation;
    margin-bottom: 2px;
}

body.page-student-profile .propose-line-remove:hover {
    background: var(--color-danger-hover);
}

body.page-student-profile .propose-line-remove:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

body.page-student-profile .propose-add-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

body.page-student-profile .propose-add-hint {
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.35;
    max-width: 100%;
}

body.page-student-profile .propose-add-btn {
    background-color: var(--color-success);
    color: var(--color-white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: manipulation;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

body.page-student-profile .propose-add-btn:hover {
    background-color: var(--color-success-hover);
}

body.page-student-profile .propose-add-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

body.page-student-profile th,
body.page-student-profile td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

body.page-student-profile .progress-legend-hint {
    margin: 0 0 10px 0;
    color: var(--color-text-muted);
    font-size: 14px;
}

body.page-student-profile .progress-legend-hint .fa-chevron-down {
    color: var(--color-text);
    font-size: 0.9em;
}

body.page-student-profile .validation-status {
    padding: 2px 6px;
    border-radius: var(--radius-default);
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
}

body.page-student-profile .status-validated {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

body.page-student-profile .status-pending {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
}

body.page-student-profile td .points-stepper,
body.page-student-profile .points-stepper {
    overflow: visible;
}

body.page-student-profile input,
body.page-student-profile textarea,
body.page-student-profile select,
body.page-student-profile button,
body.page-student-profile a {
    -webkit-tap-highlight-color: transparent;
}

body.page-student-profile input,
body.page-student-profile select {
    font-size: 16px;
}

body.page-student-profile .student-overview-table th,
body.page-student-profile .student-overview-table td {
    padding: 6px 4px;
}

body.page-student-profile .gamification-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

body.page-student-profile .gamification-rank-box {
    background: linear-gradient(135deg, var(--color-nav), var(--color-text));
    color: white;
    padding: 20px 16px;
    border-radius: var(--radius-card);
    text-align: center;
}

body.page-student-profile .gamification-rank-number {
    font-size: 2em;
    font-weight: bold;
    line-height: 1.15;
}

body.page-student-profile .gamification-rank-label {
    font-size: 0.9em;
    opacity: 0.85;
    margin-top: 4px;
}

body.page-student-profile .gamification-rank-note {
    font-size: 0.75em;
    color: var(--color-text-muted);
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
}

body.page-student-profile .gamification-rank-medal {
    font-size: 2em;
    margin-bottom: 6px;
    line-height: 1;
}

body.page-student-profile .gamification-rank-box--top3 {
    background: linear-gradient(135deg, var(--color-nav), var(--color-nav));
}

body.page-student-profile .badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

body.page-student-profile .badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
}

body.page-student-profile .badge-item.earned {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    border-color: var(--color-primary-hover);
}

body.page-student-profile .badge-item.locked {
    background: var(--color-bg);
    color: var(--color-border);
    border-color: var(--color-border);
}

body.page-student-profile .badge-icon {
    font-size: 1.7em;
    margin-bottom: 6px;
}

body.page-student-profile .badge-label {
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1.2;
}

body.page-student-profile .badge-desc {
    font-size: 0.67em;
    margin-top: 3px;
    line-height: 1.25;
    opacity: 0.85;
}

@media (max-width: 600px) {
    body.page-student-profile .gamification-grid {
        grid-template-columns: 1fr;
    }

    body.page-student-profile .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

}

@media (max-width: 768px) {
    body.page-student-profile .propose-line {
        grid-template-columns: 1fr;
    }

    body.page-student-profile .propose-line-remove {
        width: 100%;
        margin-top: 4px;
    }

}

/* --- admin_student_profile.php (page-admin-student-profile) --- */

body.page-admin-student-profile .student-selector {
    background-color: var(--color-info-bg);
    border: 2px solid var(--color-info);
    border-radius: var(--radius-default);
    padding: 15px;
    margin-bottom: 20px;
}

body.page-admin-student-profile .student-selector h3 {
    color: var(--color-info);
    margin-top: 0;
}

body.page-admin-student-profile .category-level1-content {
    display: block;
}

body.page-admin-student-profile .category-level1-content.collapsed {
    display: none;
}

body.page-admin-student-profile .profile-category-detail {
    margin: 0 0 16px 0;
    padding: 0;
}

body.page-admin-student-profile .profile-category-detail .category-level-2:first-child {
    margin-top: 10px;
}

body.page-admin-student-profile .profile-l3-details .profile-category-detail {
    background-color: var(--color-bg);
    border-radius: var(--radius-default);
    padding: 12px 15px;
    border-left: 4px solid var(--color-info);
}

body.page-admin-student-profile th,
body.page-admin-student-profile td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

body.page-admin-student-profile .level2-col.collapsed {
    display: none !important;
}

body.page-admin-student-profile .sortable-header .sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.page-admin-student-profile .sortable-header .sort-link:hover {
    text-decoration: underline;
}

body.page-admin-student-profile .sort-icon {
    font-size: 0.85em;
    opacity: 0.95;
}

body.page-admin-student-profile .student-row {
    transition: background-color 0.2s ease;
}

body.page-admin-student-profile .student-row:hover {
    background-color: var(--color-info-bg);
}

body.page-admin-student-profile .student-name {
    font-weight: bold;
    padding: 12px 8px;
    text-align: left;
}

body.page-admin-student-profile .student-select-link {
    color: inherit;
    text-decoration: none;
}

body.page-admin-student-profile .student-select-link:hover {
    text-decoration: underline;
}

body.page-admin-student-profile .unvalidated-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    background-color: var(--color-warning);
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 10px;
}

body.page-admin-student-profile .overview-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 24px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-bg-muted);
    border-radius: var(--radius-default);
}

body.page-admin-student-profile .overview-filter-bar .filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.page-admin-student-profile .overview-filter-bar .filter-field > span,
body.page-admin-student-profile .overview-filter-bar .filter-field > label.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

body.page-admin-student-profile .overview-filter-bar .filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-strong);
    cursor: pointer;
    white-space: nowrap;
}

body.page-admin-student-profile .overview-filter-bar select {
    min-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-white);
    font-size: 14px;
}

body.page-admin-student-profile .overview-filter-empty {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-default);
    color: var(--color-warning-text);
}

body.page-admin-student-profile input,
body.page-admin-student-profile textarea,
body.page-admin-student-profile select,
body.page-admin-student-profile button,
body.page-admin-student-profile a {
    -webkit-tap-highlight-color: transparent;
}

body.page-admin-student-profile input,
body.page-admin-student-profile select {
    font-size: 16px;
}

body.page-admin-student-profile .student-overview-table th,
body.page-admin-student-profile .student-overview-table td {
    padding: 6px 4px;
}

body.page-admin-student-profile td .points-stepper,
body.page-admin-student-profile .points-stepper {
    overflow: visible;
}

body.page-admin-student-profile .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

body.page-admin-student-profile .modal-content {
    background-color: var(--color-white);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--color-text-muted);
    border-radius: var(--radius-default);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-header);
}

body.page-admin-student-profile .modal-header {
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-nav);
}

body.page-admin-student-profile .modal-body {
    margin-bottom: 15px;
}

body.page-admin-student-profile .modal-body label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text);
}

body.page-admin-student-profile .modal-body textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
    min-height: 80px;
}

body.page-admin-student-profile .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

body.page-admin-student-profile .modal-footer button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 14px;
}

body.page-admin-student-profile .category-breakdown {
    width: 100%;
    max-width: 100%;
}

body.page-admin-student-profile .category-level {
    width: 100%;
}

body.page-admin-student-profile .category-level-2 {
    width: calc(100% - 20px);
}

body.page-admin-student-profile .category-level-3 {
    width: calc(100% - 40px);
}

body.page-admin-student-profile .student-overview-table {
    min-width: 100%;
}

body.page-admin-student-profile .level1-toggle-btn i {
    font-size: 0.8em;
}

/* --- admin_settings.php (page-admin-settings) --- */

body.page-admin-settings .instruction-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, var(--color-primary-soft) 0%, var(--color-primary-soft) 100%);
    border: 1px solid var(--color-primary-soft);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--color-nav);
    transition: box-shadow 0.2s, transform 0.2s;
}

body.page-admin-settings .instruction-banner:hover {
    box-shadow: 0 4px 14px rgba(118, 181, 197, 0.3);
    transform: translateY(-1px);
    color: var(--color-nav);
}

body.page-admin-settings .instruction-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

body.page-admin-settings .instruction-banner-icon {
    width: 42px;
    height: 42px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

body.page-admin-settings .instruction-banner-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

body.page-admin-settings .instruction-banner-text span {
    font-size: 0.88rem;
    color: var(--color-text);
}

body.page-admin-settings .instruction-banner-arrow {
    color: var(--color-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

body.page-admin-settings .settings-section {
    margin-bottom: 20px;
}

body.page-admin-settings .mb-2 {
    margin-bottom: 10px;
}

body.page-admin-settings .mb-4 {
    margin-bottom: 20px;
}

body.page-admin-settings .block {
    display: block;
}

body.page-admin-settings .text-center {
    text-align: center;
}

body.page-admin-settings .image-preview {
    max-width: 300px;
    max-height: 200px;
    margin: 10px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.page-admin-settings .image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

body.page-admin-settings .image-item {
    text-align: center;
    margin-bottom: 20px;
    flex-basis: calc(50% - 20px);
}

body.page-admin-settings .betreuer-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.page-admin-settings .abteilung-select {
    cursor: pointer;
    background-color: var(--color-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    font-size: 14px;
}

body.page-admin-settings .btn-primary.active {
    background-color: var(--color-accent);
}

body.page-admin-settings .collapsible-section {
    margin-bottom: 20px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    background: white;
}

body.page-admin-settings .collapsible-header {
    background-color: var(--color-primary);
    color: var(--color-text);
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body.page-admin-settings .collapsible-header:hover {
    background-color: var(--color-primary-hover);
}

body.page-admin-settings .collapsible-header h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

body.page-admin-settings .settings-scope-switch {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

body.page-admin-settings .settings-scope-tab {
    flex: 1;
    text-align: left;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    cursor: pointer;
    color: var(--color-text-strong);
}

body.page-admin-settings .settings-scope-tab.is-global {
    border-color: var(--color-nav);
}

body.page-admin-settings .settings-scope-tab.is-course {
    border-color: var(--color-accent);
}

body.page-admin-settings .settings-scope-tab.is-global.is-active {
    background: var(--color-nav);
    color: var(--color-white);
}

body.page-admin-settings .settings-scope-tab.is-course.is-active {
    background: var(--color-accent);
    color: var(--color-white);
}

body.page-admin-settings .settings-scope-kicker {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 2px;
}

body.page-admin-settings .settings-scope-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
}

body.page-admin-settings .settings-scope-banner {
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: var(--radius-default);
    border-left: 4px solid var(--color-nav);
    background: var(--color-primary-soft);
    color: var(--color-nav);
    font-weight: 600;
}

body.page-admin-settings .settings-scope-banner.is-course {
    border-left-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-text-strong);
}

body.page-admin-settings .settings-scope-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 999px;
    vertical-align: middle;
}

body.page-admin-settings .settings-scope-chip.is-global {
    background: var(--color-nav);
    color: var(--color-white);
}

body.page-admin-settings .settings-scope-chip.is-course {
    background: var(--color-accent);
    color: var(--color-white);
}

body.page-admin-settings .collapsible-section[hidden] {
    display: none !important;
}

body.page-admin-settings .weekplan-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 640px;
}

body.page-admin-settings .weekplan-range-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 700px) {
    body.page-admin-settings .settings-scope-switch,
    body.page-admin-settings .weekplan-range-grid {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}

body.page-admin-settings .collapsible-toggle {
    font-size: 1.2em;
    transition: transform 0.3s ease;
    color: var(--color-text);
}

body.page-admin-settings .collapsible-section.expanded .collapsible-toggle {
    transform: rotate(180deg);
}

body.page-admin-settings .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
}

body.page-admin-settings .collapsible-section.expanded .collapsible-content {
    max-height: 10000px;
}

body.page-admin-settings .collapsible-content-inner {
    padding: 20px;
}

body.page-admin-settings .category-tree {
    margin: 20px 0;
}

body.page-admin-settings .category-item {
    margin: 10px 0;
    padding: 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    background-color: var(--color-bg);
}

body.page-admin-settings .category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

body.page-admin-settings .category-name {
    font-weight: bold;
    font-size: 16px;
}

body.page-admin-settings .category-level-badge {
    background-color: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-card);
    font-size: 12px;
    margin-left: 10px;
}

body.page-admin-settings .minimum-points-badge {
    background-color: var(--color-accent);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-card);
    font-size: 12px;
    margin-left: 10px;
}

body.page-admin-settings .category-actions {
    display: flex;
    gap: 5px;
}

body.page-admin-settings .btn-success {
    background-color: var(--color-success);
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

body.page-admin-settings .btn-success:hover {
    background-color: var(--color-success-hover);
}

body.page-admin-settings .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
}

body.page-admin-settings .form-group {
    flex: 1;
}

body.page-admin-settings input,
body.page-admin-settings textarea,
body.page-admin-settings select,
body.page-admin-settings button,
body.page-admin-settings a {
    -webkit-tap-highlight-color: transparent;
}

body.page-admin-settings input,
body.page-admin-settings select {
    font-size: 16px;
}

body.page-admin-settings .kbe-config-container {
    background: var(--color-bg);
    border-radius: var(--radius-default);
    padding: 20px;
}

body.page-admin-settings .kbe-config-controls {
    margin-bottom: 20px;
}

body.page-admin-settings .kbe-config-info {
    padding: 12px;
    background-color: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-radius: var(--radius-default);
    color: var(--color-info-text);
    font-style: italic;
}

body.page-admin-settings .kbe-floorplan-wrapper {
    position: relative;
    width: 100%;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-default);
    overflow: hidden;
    background: white;
}

body.page-admin-settings .kbe-floorplan-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
}

body.page-admin-settings .kbe-floorplan-image.config-active {
    cursor: crosshair;
}

body.page-admin-settings .kbe-marker {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
    transform: translate(-50%, -50%);
    background-color: var(--color-success);
}

body.page-admin-settings .kbe-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

body.page-admin-settings .kbe-positions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

body.page-admin-settings .kbe-position-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-success);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

body.page-admin-settings .kbe-delete-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    transition: background-color 0.2s;
    padding: 0;
}

body.page-admin-settings .kbe-delete-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
    body.page-admin-settings .form-row {
        flex-direction: column;
        gap: 10px;
    }

    body.page-admin-settings .category-level-2 {
        margin-left: 10px;
    }

    body.page-admin-settings .category-level-3 {
        margin-left: 20px;
    }

}

@media (max-width: 768px) {
    body.page-admin-settings .image-item {
        flex-basis: 100%;
    }

    body.page-admin-settings .image-preview {
        max-width: 100%;
    }

    body.page-admin-settings .kbe-marker {
        width: 28px;
        height: 28px;
        font-size: 10px;
        border: 2px solid white;
    }

}

/* --- admin_waiting_list.php (page-admin-waiting-list) --- */

body.page-admin-waiting-list .proposal-banner {
    background-color: var(--color-info-bg);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-card);
    padding: 20px;
    margin: 20px 10px;
    width: 100%;
    flex: 0 0 100%;
    box-sizing: border-box;
    text-align: center;
    box-shadow: var(--shadow-card);
}

body.page-admin-waiting-list .proposal-banner form {
    margin: 0;
    padding: 0;
}

body.page-admin-waiting-list .banner-text {
    color: var(--color-text);
    font-size: 1.1em;
    margin-bottom: 15px;
    font-weight: 500;
}

body.page-admin-waiting-list .banner-button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-default);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

body.page-admin-waiting-list .banner-button:hover {
    background-color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.page-admin-waiting-list .table-container h2 {
    background-color: var(--color-primary);
    color: var(--color-text);
    padding: 10px;
    border-radius: var(--radius-default);
    font-size: 1.2em;
    margin-bottom: 15px;
}

body.page-admin-waiting-list .table-container li {
    padding: 10px;
    border-bottom: 1px solid var(--color-bg-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent wrapping on wider screens too */
            font-size: 0.9em;
    word-break: break-word;
    gap: 5px;
}

body.page-admin-waiting-list .table-container li > :first-child {
    flex: 1;
    /* Allow content to take available space */
            text-align: left;
    padding-right: 5px;
}

body.page-admin-waiting-list .table-container li span {
    min-width: 60px;
    text-align: right;
    white-space: nowrap;
}

body.page-admin-waiting-list .table-container form {
    display: inline-flex;
    margin-left: 5px;
    flex-shrink: 0;
}

body.page-admin-waiting-list .table-container form button {
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-default);
    padding: 8px 12px;
    /* Increased touch target size */
            cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    white-space: nowrap;
}

body.page-admin-waiting-list .table-container form button:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

body.page-admin-waiting-list .waiting-list-main {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

body.page-admin-waiting-list .waiting-list-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 20px 4px;
    box-sizing: border-box;
}

body.page-admin-waiting-list .ios-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--color-text);
}

body.page-admin-waiting-list .ios-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

body.page-admin-waiting-list .ios-switch-track {
    position: relative;
    width: 51px;
    height: 31px;
    background: var(--color-bg-muted);
    border-radius: 31px;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

body.page-admin-waiting-list .ios-switch input:checked + .ios-switch-track {
    background-color: var(--color-success);
}

body.page-admin-waiting-list .ios-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background: var(--color-white);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

body.page-admin-waiting-list .ios-switch input:checked + .ios-switch-track .ios-switch-thumb {
    transform: translateX(20px);
}

body.page-admin-waiting-list .box-last-entries {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--color-border);
    text-align: left;
}

body.page-admin-waiting-list .box-last-entries h3 {
    font-size: 0.95em;
    color: var(--color-text);
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
}

body.page-admin-waiting-list .box-last-entries-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.page-admin-waiting-list .box-last-entries .box-last-entries-list li {
    padding: 8px 6px;
    border-bottom: 1px solid var(--color-bg-muted);
    font-size: 0.88em;
    display: block;
    justify-content: flex-start;
}

body.page-admin-waiting-list .box-last-entries-list li:last-child {
    border-bottom: none;
}

body.page-admin-waiting-list .box-last-entries-list li.entry-entfernt {
    color: var(--color-text-muted);
}

body.page-admin-waiting-list .box-last-entry-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

body.page-admin-waiting-list .box-last-entry-name {
    font-weight: 600;
}

body.page-admin-waiting-list .box-last-entry-time {
    color: var(--color-text-muted);
    white-space: nowrap;
}

body.page-admin-waiting-list .box-last-entry-content {
    margin-bottom: 4px;
    word-break: break-word;
}

body.page-admin-waiting-list .box-last-entry-status {
    font-size: 0.85em;
    font-weight: 600;
}

body.page-admin-waiting-list .box-last-entry-status.status-aktiv {
    color: var(--color-success-hover);
}

body.page-admin-waiting-list .box-last-entry-status.status-entfernt {
    color: var(--color-text-muted);
}

body.page-admin-waiting-list .waiting-list-toolbar,
body.page-admin-waiting-list .box-last-entries {
    display: none !important;
}

body.page-admin-waiting-list input,
body.page-admin-waiting-list textarea,
body.page-admin-waiting-list button,
body.page-admin-waiting-list select,
body.page-admin-waiting-list a {
    -webkit-tap-highlight-color: transparent;
}

body.page-admin-waiting-list .nav-button,
body.page-admin-waiting-list .table-container form button {
    padding-top: 10px;
    padding-bottom: 10px;
}

@media (max-width: 360px) {
    body.page-admin-waiting-list .table-container li {
        font-size: 0.85em;
    }

    body.page-admin-waiting-list .table-container li span {
        min-width: 50px;
        /* Smaller minimum width */
                font-size: 0.85em;
    }

    body.page-admin-waiting-list .table-container form button {
        padding: 5px 8px;
        /* Even smaller padding but still tappable */
                font-size: 0.8em;
    }

}

@media (max-width: 480px) {
    body.page-admin-waiting-list .proposal-banner {
        margin: 10px 2px;
        padding: 12px;
        border-radius: var(--radius-default);
    }

    body.page-admin-waiting-list .banner-text {
        font-size: 0.95em;
        margin-bottom: 10px;
    }

    body.page-admin-waiting-list .banner-button {
        padding: 10px 18px;
        font-size: 14px;
        width: 100%;
    }

    body.page-admin-waiting-list .table-container h2 {
        font-size: 1em;
    }

    body.page-admin-waiting-list .table-container li {
        font-size: 0.9em;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px 5px;
        gap: 5px;
    }

    body.page-admin-waiting-list .table-container li span {
        margin-top: 0;
        font-size: 0.9em;
    }

    body.page-admin-waiting-list .table-container form {
        margin-top: 0;
        align-self: center;
        margin-left: auto;
    }

    body.page-admin-waiting-list .table-container form button {
        padding: 6px 10px;
        font-size: 0.85em;
        white-space: nowrap;
    }

}

@media (max-width: 768px) {
    body.page-admin-waiting-list .proposal-banner {
        margin: 15px 5px;
        padding: 15px;
    }

    body.page-admin-waiting-list .banner-text {
        font-size: 1em;
        margin-bottom: 12px;
    }

    body.page-admin-waiting-list .banner-button {
        padding: 10px 20px;
        font-size: 15px;
        width: 100%;
        max-width: 300px;
    }

    body.page-admin-waiting-list .waiting-list-toolbar {
        padding: 10px 10px 4px;
    }

    body.page-admin-waiting-list .ios-switch {
        font-size: 13px;
    }

}

/* --- admin_daily_list.php (page-admin-daily-list) --- */

body.page-admin-daily-list .zuordnung-table-container {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin: 20px auto;
    width: 100%;
    max-width: 1200px;
    overflow-x: auto;
    /* Enable horizontal scrolling on small devices */
            -webkit-overflow-scrolling: touch;
}

body.page-admin-daily-list .zuordnung-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

body.page-admin-daily-list .zuordnung-table th,
body.page-admin-daily-list .zuordnung-table td {
    border: 1px solid var(--color-border);
    padding: 12px;
    text-align: left;
}

body.page-admin-daily-list .zuordnung-table th {
    background-color: var(--color-primary);
    color: var(--color-text);
    position: sticky;
    top: 0;
    z-index: 10;
}

body.page-admin-daily-list .zuordnung-table tr:nth-child(even) {
    background-color: var(--color-bg);
}

body.page-admin-daily-list .zuordnung-table tr:hover {
    background-color: var(--color-bg-muted);
}

body.page-admin-daily-list .date-info {
    background-color: var(--color-bg);
    padding: 10px;
    border-radius: var(--radius-default);
    margin-bottom: 15px;
    text-align: right;
    font-style: italic;
    color: var(--color-text);
}

body.page-admin-daily-list .date-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 12px 14px;
    background-color: var(--color-bg);
    border-radius: var(--radius-default);
}

body.page-admin-daily-list .date-selector label {
    font-weight: 600;
    color: var(--color-text);
}

body.page-admin-daily-list .date-selector input[type="date"],
body.page-admin-daily-list .date-selector select {
    padding: 10px 12px;
    border: 1px solid var(--color-border, #ccc);
    border-radius: var(--radius-default);
    font-size: 16px;
    min-height: 44px;
    background: var(--color-white, #fff);
    color: var(--color-text);
    -webkit-appearance: none;
    appearance: none;
}

body.page-admin-daily-list .date-selector .print-button,
body.page-admin-daily-list .date-selector a.print-button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-weight: bold;
    color: white;
    background-color: var(--color-nav);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    touch-action: manipulation;
}

body.page-admin-daily-list .date-selector .print-button:hover,
body.page-admin-daily-list .date-selector a.print-button:hover {
    background-color: var(--color-accent);
}

body.page-admin-daily-list .zuordnung-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

body.page-admin-daily-list .zuordnung-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-admin-daily-list .zuordnung-buttons button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    color: white;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

body.page-admin-daily-list .delete-button {
    background-color: var(--color-accent);
    min-width: 120px;
}

body.page-admin-daily-list .delete-button:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

body.page-admin-daily-list .print-button {
    background-color: var(--color-nav);
    min-width: 120px;
}

body.page-admin-daily-list .print-button:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

body.page-admin-daily-list .floorplan-container {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-header);
    padding: 20px;
    margin: 20px auto;
    width: 100%;
    max-width: 1200px;
}

body.page-admin-daily-list .floorplan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

body.page-admin-daily-list .floorplan-header h2 {
    color: var(--color-primary);
    margin: 0;
}

body.page-admin-daily-list .floorplan-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-admin-daily-list .floorplan-controls button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    color: white;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    font-size: 14px;
}

body.page-admin-daily-list .config-button {
    background-color: var(--color-nav);
}

body.page-admin-daily-list .config-button:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

body.page-admin-daily-list .config-button.active {
    background-color: var(--color-accent);
}

body.page-admin-daily-list .kbe-selector {
    padding: 8px 12px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-default);
    background: white;
    font-size: 14px;
    display: none;
}

body.page-admin-daily-list .kbe-selector.active {
    display: block;
}

body.page-admin-daily-list .floorplan-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-default);
    overflow: hidden;
    background: var(--color-bg);
}

body.page-admin-daily-list .floorplan-image {
    width: 100%;
    height: auto;
    display: block;
}

body.page-admin-daily-list .kbe-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

body.page-admin-daily-list .kbe-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

body.page-admin-daily-list .kbe-marker.occupied {
    background-color: var(--color-success);
}

body.page-admin-daily-list .kbe-marker.empty {
    background-color: var(--color-danger);
}

body.page-admin-daily-list .kbe-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-default);
    font-size: 14px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.page-admin-daily-list .kbe-tooltip.visible {
    opacity: 1;
}

body.page-admin-daily-list .kbe-tooltip strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--color-primary);
}

body.page-admin-daily-list .kbe-tooltip .betreuer {
    margin: 4px 0;
    font-style: italic;
}

body.page-admin-daily-list .kbe-tooltip .info {
    margin: 4px 0;
    font-size: 13px;
}

body.page-admin-daily-list .floorplan-info {
    margin-top: 15px;
    padding: 12px;
    background-color: var(--color-bg);
    border-radius: var(--radius-default);
    font-style: italic;
    color: var(--color-text);
    text-align: center;
}

body.page-admin-daily-list .zuordnung-table th,
body.page-admin-daily-list .zuordnung-table td {
    padding: 4px;
    border: 1px solid var(--color-text-muted);
}

@media (max-width: 768px) {
    body.page-admin-daily-list .zuordnung-table {
        font-size: 14px;
    }

    body.page-admin-daily-list .zuordnung-table-container {
        width: 99%;
        /* Make zuordnung table use more screen space */
                padding: 15px 8px;
        /* Reduce padding to maximize content area */
                max-width: 100%;
    }

    body.page-admin-daily-list .zuordnung-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    body.page-admin-daily-list .zuordnung-buttons {
        width: 100%;
        justify-content: space-between;
    }

    body.page-admin-daily-list .floorplan-container {
        width: 99%;
        padding: 15px 8px;
        max-width: 100%;
    }

    body.page-admin-daily-list .floorplan-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    body.page-admin-daily-list .floorplan-controls {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    body.page-admin-daily-list .kbe-selector.active {
        width: 100%;
    }

    body.page-admin-daily-list .kbe-marker {
        width: 32px;
        height: 32px;
        font-size: 12px;
        border: 2px solid white;
    }

    body.page-admin-daily-list .kbe-tooltip {
        max-width: 250px;
        font-size: 13px;
    }

}

@media print {
    body.page-admin-daily-list * {
        visibility: hidden;
    }

    body.page-admin-daily-list .zuordnung-table-container,
    body.page-admin-daily-list .zuordnung-table-container *,
    body.page-admin-daily-list .date-info,
    body.page-admin-daily-list .date-info * {
        visibility: visible;
    }

    body.page-admin-daily-list .zuordnung-buttons,
    body.page-admin-daily-list .zuordnung-buttons *,
    body.page-admin-daily-list .date-selector,
    body.page-admin-daily-list .date-selector *,
    body.page-admin-daily-list .header,
    body.page-admin-daily-list .nav-container {
        visibility: hidden;
        display: none;
    }

    body.page-admin-daily-list .zuordnung-table-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        padding: 10px;
        margin: 0;
    }

    body.page-admin-daily-list .zuordnung-header h2 {
        margin-bottom: 10px;
        font-size: 18pt;
        text-align: center;
    }

    body.page-admin-daily-list .zuordnung-header,
    body.page-admin-daily-list .date-info {
        page-break-after: avoid;
    }

    body.page-admin-daily-list .zuordnung-table {
        font-size: 10pt;
        width: 100%;
        page-break-inside: auto;
        border-collapse: collapse;
    }

    body.page-admin-daily-list .zuordnung-table tr {
        page-break-inside: avoid;
    }

    @page {
        size: landscape;
        margin: 0.5cm;
    }
}

/* --- admin_statistics.php (page-admin-statistics) --- */

body.page-admin-statistics .container > .card,
body.page-admin-statistics .container > .section {
    display: block;
    width: 100%;
    clear: both;
}

body.page-admin-statistics h2 {
    color: var(--color-text);
    margin-bottom: 15px;
    font-size: 1.4em;
}

body.page-admin-statistics h3 {
    color: var(--color-text);
    margin: 15px 0 10px;
    font-size: 1.05em;
    font-weight: 600;
}

body.page-admin-statistics .section {
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    overflow: hidden;
}

body.page-admin-statistics .section-head {
    background: var(--color-nav);
    color: var(--color-white);
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

body.page-admin-statistics .section-head:hover {
    background: var(--color-nav);
}

body.page-admin-statistics .section-head .toggle {
    transition: transform 0.2s ease;
}

body.page-admin-statistics .section.collapsed .section-head .toggle {
    transform: rotate(-90deg);
}

body.page-admin-statistics .section-body {
    padding: 20px;
}

body.page-admin-statistics .section.collapsed .section-body {
    display: none;
}

body.page-admin-statistics .filter-overview-card {
    padding: 16px 20px;
}

body.page-admin-statistics .filter-overview-card h2 {
    margin-bottom: 10px;
}

body.page-admin-statistics .overview-heading {
    margin: 14px 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--color-bg-muted);
}

body.page-admin-statistics .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-default);
    margin-bottom: 0;
}

body.page-admin-statistics .filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

body.page-admin-statistics .filter-field.betreuer-field {
    flex: 1;
    min-width: 280px;
}

body.page-admin-statistics .filter-field label {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--color-text);
}

body.page-admin-statistics .filter-field input[type="date"],
body.page-admin-statistics .filter-field select {
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    font-size: 14px;
    min-width: 140px;
}

body.page-admin-statistics .betreuer-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    align-content: flex-start;
}

body.page-admin-statistics .betreuer-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

body.page-admin-statistics .betreuer-chip input {
    margin: 0;
}

body.page-admin-statistics .betreuer-chip:has(input:checked) {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

body.page-admin-statistics .filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

body.page-admin-statistics .btn {
    background: var(--color-nav);
    color: var(--color-white);
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

body.page-admin-statistics .btn:hover {
    background: var(--color-accent);
}

body.page-admin-statistics .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

body.page-admin-statistics .kpi {
    background: var(--color-bg);
    border-radius: var(--radius-default);
    padding: 14px;
    border-left: 4px solid var(--color-primary);
    text-align: center;
}

body.page-admin-statistics .kpi.warn {
    border-left-color: var(--color-accent);
}

body.page-admin-statistics .kpi.ok {
    border-left-color: var(--color-success);
}

body.page-admin-statistics .kpi-value {
    font-size: 1.7em;
    font-weight: bold;
    color: var(--color-nav);
}

body.page-admin-statistics .kpi-sub {
    font-size: 0.85em;
    color: var(--color-text);
    margin-top: 2px;
}

body.page-admin-statistics .kpi-label {
    font-size: 0.85em;
    color: var(--color-text);
    margin-top: 4px;
    font-weight: 600;
}

body.page-admin-statistics .chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

body.page-admin-statistics .chart-box {
    background: var(--color-bg);
    border-radius: var(--radius-default);
    padding: 14px;
    min-height: 280px;
}

body.page-admin-statistics .chart-box.full {
    grid-column: 1/-1;
}

body.page-admin-statistics .chart-title {
    font-weight: bold;
    color: var(--color-nav);
    margin-bottom: 8px;
    font-size: 0.95em;
}

body.page-admin-statistics .chart-canvas {
    position: relative;
    height: 280px;
    width: 100%;
}

body.page-admin-statistics .chart-canvas.tall {
    height: 380px;
}

body.page-admin-statistics .data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    font-size: 0.9em;
}

body.page-admin-statistics .data-table th,
body.page-admin-statistics .data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-bg-muted);
    text-align: left;
}

body.page-admin-statistics .data-table th {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

body.page-admin-statistics .data-table tr:hover {
    background: var(--color-bg);
}

body.page-admin-statistics .data-table.compact td,
body.page-admin-statistics .data-table.compact th {
    padding: 5px 8px;
    font-size: 0.85em;
}

body.page-admin-statistics .data-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

body.page-admin-statistics .data-table th.sortable-th:hover {
    background: var(--color-primary-hover);
}

body.page-admin-statistics .sort-ind {
    font-size: 0.8em;
    margin-left: 3px;
    opacity: 0.9;
}

body.page-admin-statistics .heatmap-wrap {
    overflow-x: auto;
}

body.page-admin-statistics .hour-heatmap {
    display: grid;
    grid-template-columns: auto repeat(24, 1fr);
    gap: 2px;
    min-width: 700px;
}

body.page-admin-statistics .hour-cell {
    aspect-ratio: 1/1;
    border-radius: 2px;
    min-height: 18px;
    cursor: default;
}

body.page-admin-statistics .hour-label,
body.page-admin-statistics .hour-corner {
    font-size: 11px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

body.page-admin-statistics .hour-header {
    font-weight: bold;
}

body.page-admin-statistics .completion-wrap {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

body.page-admin-statistics .completion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    background: var(--color-white);
}

body.page-admin-statistics .completion-table th,
body.page-admin-statistics .completion-table td {
    padding: 4px 6px;
    text-align: center;
    border: 1px solid var(--color-bg-muted);
    min-width: 50px;
}

body.page-admin-statistics .completion-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-primary);
    color: var(--color-white);
}

body.page-admin-statistics .completion-table th.name-col,
body.page-admin-statistics .completion-table td.name-col {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--color-white);
    min-width: 130px;
    font-weight: 500;
}

body.page-admin-statistics .completion-table th.name-col {
    background: var(--color-primary);
    color: var(--color-white);
}

body.page-admin-statistics .completion-table td.name-col a {
    color: var(--color-nav);
    text-decoration: none;
}

body.page-admin-statistics .completion-table td.name-col a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

body.page-admin-statistics .cell-zero {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

body.page-admin-statistics .cell-low {
    background: var(--color-accent-soft);
    color: var(--color-text);
}

body.page-admin-statistics .cell-30 {
    background: var(--color-warning-bg);
    color: var(--color-text);
}

body.page-admin-statistics .cell-80 {
    background: var(--color-success-bg);
    color: var(--color-nav);
}

body.page-admin-statistics .cell-100 {
    background: var(--color-success);
    color: var(--color-white);
    font-weight: bold;
}

body.page-admin-statistics .empty {
    text-align: center;
    color: var(--color-primary);
    padding: 30px 15px;
    font-style: italic;
}

body.page-admin-statistics .help-text {
    color: var(--color-primary);
    font-size: 0.85em;
    margin-bottom: 10px;
}

body.page-admin-statistics .stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--color-text);
}

body.page-admin-statistics .stat-strip strong {
    color: var(--color-nav);
}

body.page-admin-statistics .header,
body.page-admin-statistics .filter-bar,
body.page-admin-statistics .nav-container,
body.page-admin-statistics .filter-actions,
body.page-admin-statistics .section-head .toggle {
    background: var(--color-white) !important;
    color: var(--color-black) !important;
    box-shadow: none !important;
}

body.page-admin-statistics .chart-box,
body.page-admin-statistics .kpi {
    box-shadow: none;
    border: 1px solid var(--color-bg-muted);
}

@media (max-width: 768px) {
    body.page-admin-statistics .chart-row {
        grid-template-columns: 1fr;
    }

    body.page-admin-statistics .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media print {
    body.page-admin-statistics .section {
        box-shadow: none;
        border: 1px solid var(--color-border);
        page-break-inside: avoid;
    }

    body.page-admin-statistics .section.collapsed .section-body {
        display: block !important;
    }

    body.page-admin-statistics .chart-row {
        grid-template-columns: 1fr;
    }

    body.page-admin-statistics .chart-canvas {
        height: 240px;
    }

}

/* --- admin_kbe_assignment.php (page-admin-kbe-assignment) --- */

body.page-admin-kbe-assignment form {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin: 20px auto;
    width: 100%;
    max-width: 600px;
}

body.page-admin-kbe-assignment h3 {
    color: var(--color-text);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

body.page-admin-kbe-assignment .kbe-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
}

body.page-admin-kbe-assignment .vorschlag-container {
    background-color: var(--color-bg);
    padding: 20px;
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
    width: 100%;
}

body.page-admin-kbe-assignment .vorschlag-title {
    color: var(--color-text);
    font-weight: bold;
    margin-bottom: 15px;
}

body.page-admin-kbe-assignment input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

body.page-admin-kbe-assignment input[type="text"]:focus {
    border-color: var(--color-primary);
}

body.page-admin-kbe-assignment button,
body.page-admin-kbe-assignment input[type="submit"] {
    padding: 12px 20px;
    background-color: var(--color-nav);
    color: white;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 16px;
    width: auto;
    min-width: 200px;
    margin: 5px 0;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

body.page-admin-kbe-assignment button:hover,
body.page-admin-kbe-assignment input[type="submit"]:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

body.page-admin-kbe-assignment button[name="reset"] {
    background-color: var(--color-accent);
    margin-top: 15px;
}

body.page-admin-kbe-assignment button[name="reset"]:hover {
    background-color: var(--color-accent);
}

body.page-admin-kbe-assignment button.transfer {
    background-color: var(--color-primary);
    margin-bottom: 15px;
}

body.page-admin-kbe-assignment button.transfer:hover {
    background-color: var(--color-text);
}

body.page-admin-kbe-assignment .warning {
    color: var(--color-accent);
    text-align: center;
    margin: 15px 0;
    font-size: 1.1em;
}

body.page-admin-kbe-assignment .editable-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
}

body.page-admin-kbe-assignment .editable-field {
    position: relative;
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    padding: 10px;
    background-color: var(--color-white);
}

body.page-admin-kbe-assignment .betreuer-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: var(--color-text);
}

body.page-admin-kbe-assignment .betreuer-input:focus {
    border-color: var(--color-primary);
}

body.page-admin-kbe-assignment .dropzone {
    min-height: 40px;
    width: 100%;
    border: 1px dashed var(--color-primary);
    border-radius: var(--radius-small);
    margin-top: 5px;
    margin-bottom: 10px;
    padding: 5px;
    background-color: var(--color-bg);
}

body.page-admin-kbe-assignment .room-item {
    display: inline-block;
    padding: 5px 8px;
    margin: 3px;
    background-color: var(--color-primary);
    color: white;
    border-radius: var(--radius-default);
    cursor: move;
    font-size: 14px;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

body.page-admin-kbe-assignment .room-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.page-admin-kbe-assignment .room-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

body.page-admin-kbe-assignment .trash-container {
    position: absolute;
    right: -100px;
    top: 0;
    height: 100%;
    width: 90px;
    background-color: var(--color-danger);
    border-radius: var(--radius-default);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.3s;
    z-index: 10;
}

body.page-admin-kbe-assignment .trash-container.highlight {
    background-color: var(--color-danger);
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

body.page-admin-kbe-assignment .trash-icon {
    font-size: 48px;
    color: white;
    margin-bottom: 15px;
}

body.page-admin-kbe-assignment .trash-text {
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    max-width: 80px;
}

body.page-admin-kbe-assignment .add-kbe-container {
    display: flex;
    margin-top: 5px;
    gap: 5px;
}

body.page-admin-kbe-assignment .add-kbe-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    font-size: 14px;
}

body.page-admin-kbe-assignment .add-kbe-button {
    padding: 6px 10px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 14px;
    min-width: 60px;
}

body.page-admin-kbe-assignment .add-kbe-button:hover {
    background-color: var(--color-text);
}

body.page-admin-kbe-assignment input,
body.page-admin-kbe-assignment button {
    font-size: 16px;
    border-radius: var(--radius-default);
    padding: 12px 15px;
}

body.page-admin-kbe-assignment input,
body.page-admin-kbe-assignment textarea,
body.page-admin-kbe-assignment select,
body.page-admin-kbe-assignment button {
    -webkit-tap-highlight-color: transparent;
}

body.page-admin-kbe-assignment button,
body.page-admin-kbe-assignment input[type="submit"] {
    width: 100%;
    min-width: unset;
}

@media (max-width: 480px) {
    body.page-admin-kbe-assignment .betreuer-container {
        grid-template-columns: 1fr;
    }

    body.page-admin-kbe-assignment h3 {
        font-size: 1.2em;
    }

    body.page-admin-kbe-assignment .kbe-container {
        grid-template-columns: 1fr;
    }

    body.page-admin-kbe-assignment .room-item {
        font-size: 12px;
        padding: 4px 6px;
    }

}

@media (max-width: 768px) {
    body.page-admin-kbe-assignment .trash-container {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        height: 80px;
        margin: 10px 0 20px;
        flex-direction: row;
        gap: 15px;
    }

    body.page-admin-kbe-assignment .trash-container.highlight {
        transform: scale(1.02);
    }

    body.page-admin-kbe-assignment .trash-icon {
        margin-bottom: 0;
    }

    body.page-admin-kbe-assignment .betreuer-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    body.page-admin-kbe-assignment form {
        padding: 15px;
        margin: 10px auto;
    }

}

/* --- student_waiting_list.php (page-student-waiting-list) --- */

body.page-student-waiting-list .guest-banner {
    width: 100%;
    max-width: 1100px;
    margin: 12px auto 0;
    padding: 12px 16px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-default);
    color: var(--color-warning-text);
    text-align: center;
    box-sizing: border-box;
}

body.page-student-waiting-list .student-static-name {
    display: inline-block;
    padding: 8px 10px;
    background: var(--color-primary-soft);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-small);
    min-width: 120px;
    text-align: left;
    font-size: 14px;
}

body.page-student-waiting-list header h1,
body.page-student-waiting-list .header h1 {
    font-size: 30px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}

body.page-student-waiting-list .header-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

body.page-student-waiting-list .header-buttons button,
body.page-student-waiting-list .header-buttons a button {
    background-color: var(--color-white);
    color: var(--color-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-default);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.page-student-waiting-list .header-buttons button:hover {
    background-color: var(--color-border);
}

body.page-student-waiting-list .header-buttons a {
    text-decoration: none;
}

body.page-student-waiting-list .values-container {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background-color: var(--color-white);
    border-radius: var(--radius-default);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 1400px;
    margin: 20px auto;
    flex-wrap: wrap;
    gap: 15px;
}

body.page-student-waiting-list .value-box {
    width: calc(33.33% - 20px);
    padding: 20px;
    background-color: var(--color-primary);
    color: black;
    border-radius: var(--radius-default);
    text-align: center;
    margin: 0;
    flex: 0 0 calc(33.33% - 20px);
    min-width: 280px;
}

body.page-student-waiting-list .value-box h2,
body.page-student-waiting-list .tabelle7-box h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 600;
    color: inherit;
}

body.page-student-waiting-list .empty-list-message {
    color: var(--color-text-muted, #666);
    font-style: italic;
    border-bottom: none;
}

body.page-student-waiting-list .list-container {
    background-color: var(--color-border);
    padding: 10px;
    border-radius: var(--radius-default);
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.page-student-waiting-list .list-container ul {
    list-style-type: none;
    padding: 0;
}

body.page-student-waiting-list .list-container li {
    padding: 8px 5px;
    border-bottom: 1px solid var(--color-border);
    word-break: break-word;
}

body.page-student-waiting-list .list-container li:last-child {
    border-bottom: none;
}

body.page-student-waiting-list .highlighted-entry {
    background-color: var(--color-success-bg);
}

body.page-student-waiting-list .tabelle7-box {
    width: 95%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--color-primary);
    color: var(--color-text);
    border-radius: var(--radius-default);
    text-align: center;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

body.page-student-waiting-list .input-container {
    margin-top: 10px;
}

body.page-student-waiting-list .input-container input[type="text"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 5px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

body.page-student-waiting-list .input-container input[type="submit"] {
    background-color: var(--color-success);
    color: white;
    padding: 12px 15px;
    border: none;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
}

body.page-student-waiting-list .input-container input[type="submit"]:hover {
    background-color: var(--color-success-hover);
}

body.page-student-waiting-list .student-select {
    width: 100%;
    padding: 12px;
    margin-bottom: 5px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
}

body.page-student-waiting-list .student-select:focus {
    border-color: var(--color-primary);
}

body.page-student-waiting-list input,
body.page-student-waiting-list textarea,
body.page-student-waiting-list select,
body.page-student-waiting-list button,
body.page-student-waiting-list a {
    -webkit-tap-highlight-color: transparent;
}

body.page-student-waiting-list .input-container input[type="submit"],
body.page-student-waiting-list header button,
body.page-student-waiting-list header a button {
    padding-top: 12px;
    padding-bottom: 12px;
}

@media (max-width: 480px) {
    body.page-student-waiting-list header h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    body.page-student-waiting-list .header-buttons {
        flex-direction: column;
        max-width: 90%;
    }

    body.page-student-waiting-list .header-buttons div {
        width: 100%;
        margin: 5px 0;
    }

    body.page-student-waiting-list .value-box {
        min-width: 100%;
        flex: 0 0 100%;
        margin: 0 0 10px 0;
    }

    body.page-student-waiting-list .input-container input[type="text"] {
        width: 100%;
    }

    body.page-student-waiting-list .tabelle7-box {
        width: 95%;
        padding: 15px 10px;
    }

}

@media (max-width: 768px) {
    body.page-student-waiting-list .header-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    body.page-student-waiting-list .header-buttons div {
        flex: 1 1 auto;
        min-width: 130px;
        margin: 0 5px;
    }

    body.page-student-waiting-list .header-buttons button {
        width: 100%;
        padding: 8px 15px;
        font-size: 14px;
    }

    body.page-student-waiting-list .values-container {
        padding: 10px;
        width: 95%;
        gap: 10px;
    }

    body.page-student-waiting-list .value-box {
        min-width: 220px;
        flex: 0 0 calc(50% - 10px);
        padding: 15px 10px;
        margin: 0;
    }

}

/* --- student_user_data.php (page-student-user-data) --- */

/* --- student_kbe_assignment.php (page-student-kbe-assignment) --- */

body.page-student-kbe-assignment .guest-banner {
    max-width: 1200px;
    margin: 12px auto;
    padding: 12px 16px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-default);
    color: var(--color-warning-text);
    text-align: center;
}

body.page-student-kbe-assignment .student-static-name {
    display: inline-block;
    padding: 10px 12px;
    background: var(--color-primary-soft);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-default);
    min-width: 140px;
}

body.page-student-kbe-assignment header button,
body.page-student-kbe-assignment header a button {
    background-color: var(--color-white);
    color: var(--color-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-default);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
}

body.page-student-kbe-assignment header button:hover {
    background-color: var(--color-border);
}

body.page-student-kbe-assignment header a {
    text-decoration: none;
}

body.page-student-kbe-assignment h2 {
    color: var(--color-text);
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
}

body.page-student-kbe-assignment .form-group {
    margin-bottom: 15px;
}

body.page-student-kbe-assignment label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text);
}

body.page-student-kbe-assignment input[type="text"],
body.page-student-kbe-assignment select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-default);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

body.page-student-kbe-assignment input[type="text"]:focus,
body.page-student-kbe-assignment select:focus {
    border-color: var(--color-primary);
}

body.page-student-kbe-assignment button,
body.page-student-kbe-assignment input[type="submit"] {
    background-color: var(--color-nav);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
}

body.page-student-kbe-assignment button:hover,
body.page-student-kbe-assignment input[type="submit"]:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

body.page-student-kbe-assignment table {
    min-width: 600px;
}

body.page-student-kbe-assignment table th {
    position: sticky;
    top: 0;
    z-index: 10;
}

body.page-student-kbe-assignment input,
body.page-student-kbe-assignment textarea,
body.page-student-kbe-assignment select,
body.page-student-kbe-assignment button,
body.page-student-kbe-assignment a {
    -webkit-tap-highlight-color: transparent;
}

body.page-student-kbe-assignment input[type="submit"],
body.page-student-kbe-assignment button,
body.page-student-kbe-assignment select {
    padding-top: 12px;
    padding-bottom: 12px;
}

body.page-student-kbe-assignment header button,
body.page-student-kbe-assignment header a button {
    padding: 8px 15px;
    font-size: 14px;
}

body.page-student-kbe-assignment input[type="text"],
body.page-student-kbe-assignment select {
    padding: 10px;
}

body.page-student-kbe-assignment button,
body.page-student-kbe-assignment input[type="submit"] {
    width: 100%;
    margin-bottom: 10px;
}

body.page-student-kbe-assignment table th,
body.page-student-kbe-assignment table td {
    padding: 8px;
    font-size: 14px;
}

body.page-student-kbe-assignment header button,
body.page-student-kbe-assignment header a button {
    width: 100%;
}

body.page-student-kbe-assignment .behandlung-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

body.page-student-kbe-assignment .student-select {
    flex: 0 0 200px;
    min-width: 150px;
}

body.page-student-kbe-assignment .behandlung-input {
    flex: 1;
}

body.page-student-kbe-assignment .image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 15px;
    overflow: hidden;
}

body.page-student-kbe-assignment .image-container img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    body.page-student-kbe-assignment .form-group {
        margin-bottom: 10px;
    }

    body.page-student-kbe-assignment h2 {
        font-size: 1.2em;
    }

    body.page-student-kbe-assignment header div {
        flex-direction: column;
        gap: 5px;
    }

}

@media (max-width: 768px) {
    body.page-student-kbe-assignment header div {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    body.page-student-kbe-assignment .behandlung-container {
        flex-direction: column;
        gap: 5px;
    }

    body.page-student-kbe-assignment .student-select {
        flex: none;
        width: 100%;
    }

    body.page-student-kbe-assignment .behandlung-input {
        flex: none;
        width: 100%;
    }

}

/* --- zfa_xray_waiting_list.php (page-zfa-xray-waiting-list) --- */

body.page-zfa-xray-waiting-list header h1,
body.page-zfa-xray-waiting-list .header h1 {
    font-size: 30px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}

body.page-zfa-xray-waiting-list .table-container h3 {
    background-color: var(--color-primary);
    color: var(--color-text);
    padding: 10px;
    border-radius: var(--radius-default);
    font-size: 1.2em;
    margin-bottom: 15px;
}

body.page-zfa-xray-waiting-list .table-container li {
    padding: 10px;
    border-bottom: 1px solid var(--color-bg-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    font-size: 0.95em;
    word-break: break-word;
    gap: 8px;
    text-align: left;
}

body.page-zfa-xray-waiting-list .table-container li > .entry-content {
    flex: 1;
    padding-right: 5px;
}

body.page-zfa-xray-waiting-list .table-container li > .entry-time {
    min-width: 60px;
    text-align: right;
    white-space: nowrap;
    color: var(--color-text-muted);
}

body.page-zfa-xray-waiting-list .highlighted-entry {
    background-color: var(--color-success-bg);
    font-weight: bold;
}

body.page-zfa-xray-waiting-list .empty-list {
    color: var(--color-text-muted);
    padding: 20px 10px;
    margin: 0;
}

body.page-zfa-xray-waiting-list .button-group {
    display: inline-flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

body.page-zfa-xray-waiting-list .button-group form {
    display: inline-flex;
    margin: 0;
}

body.page-zfa-xray-waiting-list .button-group .btn-primary,
body.page-zfa-xray-waiting-list .button-group .btn-danger {
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: var(--radius-default);
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    width: auto;
    margin: 0;
}

body.page-zfa-xray-waiting-list input,
body.page-zfa-xray-waiting-list button,
body.page-zfa-xray-waiting-list a {
    -webkit-tap-highlight-color: transparent;
}

body.page-zfa-xray-waiting-list .nav-button,
body.page-zfa-xray-waiting-list .button-group .btn-primary,
body.page-zfa-xray-waiting-list .button-group .btn-danger {
    padding-top: 12px;
    padding-bottom: 12px;
}

body.page-zfa-xray-waiting-list .button-group .btn-primary,
body.page-zfa-xray-waiting-list .button-group .btn-danger {
    width: 100%;
}

@media (max-width: 600px) {
    body.page-zfa-xray-waiting-list header h1 {
        font-size: 20px;
    }

    body.page-zfa-xray-waiting-list .table-container li {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    body.page-zfa-xray-waiting-list .table-container li > .entry-content {
        flex: 1 1 100%;
        margin-bottom: 4px;
    }

    body.page-zfa-xray-waiting-list .table-container li > .entry-time {
        margin-bottom: 8px;
    }

    body.page-zfa-xray-waiting-list .button-group {
        width: 100%;
        justify-content: stretch;
    }

    body.page-zfa-xray-waiting-list .button-group form {
        flex: 1;
    }

}

/* --- index.php (page-index) --- */

body.page-index header h1 {
    font-size: 30px;
    font-weight: 600;
}

body.page-index main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.page-index .index-container {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin: 20px;
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    position: relative;
    outline: 10px solid var(--color-primary);
}

body.page-index .index-container h1 {
    font-size: 20px;
    color: var(--color-text-strong);
    margin-bottom: 15px;
}

body.page-index .index-button {
    display: inline-block;
    padding: 15px 30px;
    margin: 10px;
    font-size: 20px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #5D5D5D;
    background-color: var(--color-text, #5D5D5D);
    border-radius: 8px;
    border-radius: var(--radius-default, 8px);
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
}

body.page-index .index-button:hover {
    background-color: #e56536;
    background-color: var(--color-accent, #e56536);
    transform: translateY(-2px);
}

body.page-index .button-admin {
    background-color: #2C3E50;
    background-color: var(--color-nav, #2C3E50);
}

body.page-index .index-guide-link {
    margin: 16px 0 0;
    font-size: 15px;
}

body.page-index .index-guide-link a {
    color: var(--color-primary-hover, #3d7d8c);
    text-decoration: underline;
}

body.page-index .index-button.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

body.page-index .index-button.active {
    background-color: #e56536;
    background-color: var(--color-accent, #e56536);
}

@media (max-width: 480px) {
    body.page-index .index-button {
        font-size: 14px;
        padding: 10px 20px;
        width: 100%;
        margin: 5px 0;
    }

    body.page-index header h1 {
        font-size: 20px;
    }

    body.page-index .index-container {
        outline: 2px solid var(--color-primary);
        padding: 10px;
        margin: 10px 0;
    }

    body.page-index .index-container h1 {
        font-size: 18px;
        margin-bottom: 10px;
    }

}

@media (max-width: 768px) {
    body.page-index .index-button {
        font-size: 16px;
        padding: 12px 24px;
        width: calc(100% - 20px);
        margin: 10px;
    }

    body.page-index header h1 {
        font-size: 24px;
    }

    body.page-index .index-container {
        outline: 4px solid var(--color-primary);
        /* Adjust thickness for smaller screens */
                margin: 15px;
        padding: 15px;
    }

    body.page-index main {
        padding: 10px;
    }

}

@supports (-webkit-touch-callout: none) {
    body.page-index .index-button {
        padding-top: 16px;
        padding-bottom: 16px;
    }

}

/* --- student_login.php (page-student-login) --- */

body.page-student-login .form-group {
    margin-bottom: 20px;
    text-align: left;
}

body.page-student-login .form-group select,
body.page-student-login .form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-default);
    border: 1px solid var(--color-border);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

body.page-student-login .form-group select:focus,
body.page-student-login .form-group input[type="password"]:focus {
    border-color: var(--color-primary);
}

body.page-student-login .guest-separator::before,
body.page-student-login .guest-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 22%;
    height: 1px;
    background: var(--color-border);
}

body.page-student-login .btn-guest {
    background-color: var(--color-white);
    color: var(--color-nav);
    border: 2px solid var(--color-primary);
    padding: 12px 16px;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
    line-height: 1.3;
}

body.page-student-login input,
body.page-student-login select,
body.page-student-login button,
body.page-student-login a {
    -webkit-tap-highlight-color: transparent;
}

/* --- admin_login.php (page-admin-login) --- */

body.page-admin-login .login-container input[type="password"]:focus {
    border-color: var(--color-primary);
}

body.page-admin-login .guest-separator::before,
body.page-admin-login .guest-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 28%;
    height: 1px;
    background: var(--color-border);
}

body.page-admin-login .btn-guest {
    background-color: var(--color-white);
    color: var(--color-nav);
    border: 2px solid var(--color-primary);
    padding: 12px 20px;
    border-radius: var(--radius-default);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 44px;
}

body.page-admin-login input,
body.page-admin-login button,
body.page-admin-login a {
    -webkit-tap-highlight-color: transparent;
}

/* --- admin_instruction.php / student_instruction.php (page-guide) --- */

body.page-guide .guide-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    width: 100%;
}

body.page-guide .guide-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border-radius: 16px;
    padding: 36px 32px;
    color: var(--color-white);
    margin-bottom: 28px;
    box-shadow: 0 6px 20px rgba(118, 181, 197, 0.35);
}

body.page-guide .guide-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-white);
    text-align: left;
}

body.page-guide .guide-hero p {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 680px;
}

body.page-guide .guide-hero .badge {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}

body.page-guide .toc {
    background: var(--color-white);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    border-left: 4px solid var(--color-primary);
}

body.page-guide .toc h3 {
    color: var(--color-nav);
    font-size: 1rem;
    margin-bottom: 12px;
}

body.page-guide .toc-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px 16px;
}

body.page-guide .toc-list a {
    color: var(--color-primary-hover);
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    transition: color 0.2s;
}

body.page-guide .toc-list a:hover {
    color: var(--color-accent);
}

body.page-guide .toc-list a i {
    width: 18px;
    text-align: center;
    color: var(--color-primary);
}

body.page-guide .guide-section {
    background: var(--color-white);
    border-radius: var(--radius-card);
    padding: 28px 28px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

body.page-guide .guide-section h3 {
    color: var(--color-nav);
    font-size: 1.25rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-guide .guide-section h3 .section-icon {
    width: 36px;
    height: 36px;
    background: var(--color-primary-soft);
    border-radius: var(--radius-default);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

body.page-guide .guide-section .section-lead {
    color: var(--color-text-muted);
    margin-bottom: 18px;
    line-height: 1.55;
    padding-left: 46px;
}

body.page-guide .guide-section h4 {
    color: var(--color-text);
    font-size: 1rem;
    margin: 18px 0 10px;
}

body.page-guide .guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin: 12px 0;
}

body.page-guide .guide-table th {
    background: var(--color-primary-soft);
    color: var(--color-nav);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}

body.page-guide .guide-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-bg-muted);
    color: var(--color-text-strong);
    vertical-align: top;
}

body.page-guide .guide-table tr:last-child td {
    border-bottom: none;
}

body.page-guide .guide-table tr:hover td {
    background: var(--color-bg);
}

body.page-guide .steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 16px 0;
}

body.page-guide .step {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 20px;
}

body.page-guide .step:last-child {
    padding-bottom: 0;
}

body.page-guide .step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--color-primary-soft);
}

body.page-guide .step-num {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    z-index: 1;
}

body.page-guide .step-body h4 {
    margin: 0 0 4px;
    color: var(--color-nav);
}

body.page-guide .step-body p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}

body.page-guide .day-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

body.page-guide .day-flow-col {
    background: var(--color-bg);
    border-radius: 10px;
    padding: 16px;
    border-top: 3px solid var(--color-primary);
}

body.page-guide .day-flow-col h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin: 0 0 10px;
}

body.page-guide .day-flow-col ul {
    list-style: none;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

body.page-guide .day-flow-col ul li {
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

body.page-guide .day-flow-col ul li::before {
    content: '›';
    color: var(--color-primary);
    font-weight: 700;
}

body.page-guide .data-flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

body.page-guide .flow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

body.page-guide .flow-box {
    background: var(--color-primary-soft);
    color: var(--color-nav);
    border-radius: var(--radius-default);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

body.page-guide .flow-box.actor {
    background: var(--color-nav);
    color: var(--color-white);
}

body.page-guide .flow-box.file {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border: 1px solid var(--color-accent-soft);
    font-family: monospace;
    font-weight: 500;
    font-size: 0.8rem;
}

body.page-guide .flow-arrow {
    color: var(--color-primary);
    font-size: 1.1rem;
}

body.page-guide .info-box {
    background: var(--color-warning-bg);
    border-left: 4px solid var(--color-warning);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--color-warning-text);
    line-height: 1.5;
    margin-top: 16px;
}

body.page-guide .info-box i {
    margin-right: 8px;
    color: var(--color-warning);
}

body.page-guide .quick-ref {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

body.page-guide .quick-ref-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--color-bg);
    border-radius: var(--radius-default);
    padding: 12px 14px;
    font-size: 0.88rem;
}

body.page-guide .quick-ref-item i {
    color: var(--color-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

body.page-guide .quick-ref-item strong {
    color: var(--color-nav);
    display: block;
    margin-bottom: 2px;
}

body.page-guide .quick-ref-item span {
    color: var(--color-text-muted);
}

body.page-guide .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary-hover);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 20px;
    transition: color 0.2s;
}

body.page-guide .back-link:hover {
    color: var(--color-accent);
}

body.page-guide .category-example {
    background: var(--color-bg);
    border: 1px solid var(--color-primary-soft);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 14px 0;
}

body.page-guide .category-example-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-nav);
    margin-bottom: 12px;
}

body.page-guide .category-tree {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.page-guide .category-tree-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-strong);
}

body.page-guide .category-tree-item .level-badge {
    display: inline-block;
    min-width: 58px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: var(--radius-default);
    flex-shrink: 0;
}

body.page-guide .level-badge.l1 {
    background: var(--color-nav);
    color: var(--color-white);
}

body.page-guide .level-badge.l2 {
    background: var(--color-primary);
    color: var(--color-white);
}

body.page-guide .level-badge.l3 {
    background: var(--color-primary-soft);
    color: var(--color-nav);
    border: 1px solid var(--color-primary-soft);
}

body.page-guide .category-tree-item .level-desc {
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

body.page-guide .category-tree-item.l2 {
    padding-left: 20px;
}

body.page-guide .category-tree-item.l3 {
    padding-left: 40px;
}

body.page-guide .warning-box {
    background: var(--color-danger-bg);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--color-danger-text);
    line-height: 1.5;
    margin: 14px 0;
}

body.page-guide .warning-box i {
    margin-right: 8px;
    color: var(--color-accent);
}

body.page-guide .subsection-divider {
    border: none;
    border-top: 2px dashed var(--color-primary-soft);
    margin: 28px 0 22px;
}

body.page-guide .subsection-title {
    color: var(--color-nav);
    font-size: 1.05rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-guide .subsection-title i {
    color: var(--color-primary);
}

body.page-guide .student-day-flow .day-flow-col {
    border-top-color: var(--color-accent);
}

body.page-guide .student-day-flow .day-flow-col h4 {
    color: var(--color-accent);
}

body.page-guide .student-day-flow {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 700px) {
    body.page-guide .day-flow {
        grid-template-columns: 1fr;
    }

    body.page-guide .student-day-flow {
        grid-template-columns: 1fr;
    }

    body.page-guide .guide-hero {
        padding: 24px 20px;
    }

    body.page-guide .guide-section {
        padding: 20px 18px;
    }

    body.page-guide .guide-section .section-lead {
        padding-left: 0;
    }

}

@media (max-width: 900px) {
    body.page-guide .student-day-flow {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* --- admin_export_student_passwords.php (page-admin-export-passwords) --- */

body.page-admin-export-passwords .toolbar {
    max-width: 720px;
    margin: 0 auto 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-admin-export-passwords .toolbar button,
body.page-admin-export-passwords .toolbar a {
    font-family: system-ui, sans-serif;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: var(--radius-small);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

body.page-admin-export-passwords .btn-print {
    background: var(--color-nav);
    color: var(--color-white);
}

body.page-admin-export-passwords .btn-back {
    background: var(--color-primary);
    color: var(--color-white);
}

body.page-admin-export-passwords .sheet {
    max-width: 720px;
    margin: 0 auto;
    background: var(--color-white);
    padding: 36px 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

body.page-admin-export-passwords h1 {
    font-size: 22px;
    margin: 0 0 6px;
    font-weight: 700;
    text-align: center;
}

body.page-admin-export-passwords .meta {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

body.page-admin-export-passwords table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

body.page-admin-export-passwords th,
body.page-admin-export-passwords td {
    border: 1px solid var(--color-text-strong);
    padding: 8px 12px;
    text-align: left;
}

body.page-admin-export-passwords th {
    background: var(--color-bg-muted);
    font-weight: 700;
}

body.page-admin-export-passwords .empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 24px;
}

@media print {
    body.page-admin-export-passwords .toolbar {
        display: none !important;
    }

    body.page-admin-export-passwords .sheet {
        box-shadow: none;
        max-width: none;
        padding: 0;
    }

    body.page-admin-export-passwords th {
        background: var(--color-bg-muted) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

}

/* --- admin_clear_daily_assignments.php (page-admin-clear-daily) --- */

/* --- admin_update_supervisors.php (page-admin-update-supervisors) --- */

/* --- WP3 restored layout overrides (page-specific .container/.card/.header) --- */

body.page-student-profile .container,
body.page-admin-student-profile .container {
    max-width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
}

body.page-student-profile .card,
body.page-admin-student-profile .card,
body.page-admin-settings .card {
    width: 100%;
    flex: none;
    min-width: 0;
}

body.page-admin-settings .container {
    max-width: 1200px;
    flex-direction: column;
    flex-wrap: nowrap;
}

body.page-admin-waiting-list .container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    gap: 0; /* margins on cards handle spacing, as before */
    padding: 20px;
}

/* Parallel list columns (restored from pre-WP3 layout) */
body.page-admin-waiting-list .table-container {
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin: 10px;
    margin-top: 10px;
    width: 100%;
    max-width: 30%;
    flex: 0 0 calc(33.33% - 20px);
    text-align: center;
    box-sizing: border-box;
    overflow-x: visible;
}

@media (max-width: 1200px) {
    body.page-admin-waiting-list .container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    }
    body.page-admin-waiting-list .table-container {
    max-width: 45%;
    flex: 0 0 calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    body.page-admin-waiting-list .container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    }
    body.page-admin-waiting-list .table-container {
    width: 99%;
    max-width: 100%;
    margin: 10px auto;
    flex: 0 0 100%;
    }
}

body.page-admin-daily-list .container {
    flex: 1;
    justify-content: space-around;
    width: 100%;
    box-sizing: border-box;
}

body.page-admin-statistics .container {
    display: block;
}

body.page-admin-statistics .card {
    flex: none;
    min-width: 0;
}

body.page-admin-kbe-assignment .header {
    padding: 30px 15px;
    margin-bottom: var(--space-5);
    margin-left: -20px;
    margin-right: -20px;
}

body.page-student-user-data .container {
    max-width: 100%;
    flex: 1;
}

body.page-student-user-data .card {
    max-width: 720px;
    margin: 0 auto;
    flex: none;
    min-width: 0;
}

body.page-student-kbe-assignment .container {
    max-width: 1200px;
    display: block;
}

body.page-student-kbe-assignment .card {
    flex: none;
    min-width: 0;
}

body.page-zfa-xray-waiting-list .container {
    flex: 1;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

body.page-index header {
    display: block;
    text-align: center;
}

/* --- Weekplan (student + admin) --- */

body.page-student-weekplan .container,
body.page-admin-weekplan .container {
    max-width: 100%;
    display: block;
}

body.page-student-weekplan .weekplan-card,
body.page-admin-weekplan .weekplan-card {
    flex: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

body.page-student-weekplan .weekplan-intro,
body.page-admin-weekplan .weekplan-intro {
    margin-bottom: 16px;
}

body.page-student-weekplan .weekplan-picker,
body.page-admin-weekplan .weekplan-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}

body.page-student-weekplan .weekplan-picker label,
body.page-admin-weekplan .weekplan-picker label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

body.page-student-weekplan .weekplan-picker select,
body.page-admin-weekplan .weekplan-picker select {
    min-width: 220px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: var(--radius-default);
    background: #fff;
}

body.page-admin-weekplan .weekplan-print-btn {
    align-self: flex-end;
}

body.page-admin-weekplan .weekplan-print-heading {
    display: none;
}

body.page-admin-weekplan .weekplan-batch-form {
    margin-bottom: 16px;
}

body.page-admin-weekplan .weekplan-batch-label {
    display: block;
    margin: 6px 0;
}

body.page-student-weekplan .weekplan-limit-info {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #e8f2f5;
    border-radius: 6px;
    font-size: 0.95rem;
}

body.page-student-weekplan .weekplan-limit-info.is-limit-reached {
    background: #fff3e0;
    border: 1px solid #e0b36a;
}

body.page-student-weekplan .weekplan-limit-hint {
    margin-top: 4px;
    font-size: 0.8em;
    color: #a66;
    font-style: italic;
}

body.page-student-weekplan .weekplan-scroll,
body.page-admin-weekplan .weekplan-scroll {
    overflow: auto;
    max-height: calc(100vh - 260px);
    -webkit-overflow-scrolling: touch;
    border: 1px solid #d0d7db;
    border-radius: 4px;
}

body.page-student-weekplan .weekplan-grid,
body.page-admin-weekplan .weekplan-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

body.page-student-weekplan .weekplan-grid th,
body.page-student-weekplan .weekplan-grid td,
body.page-admin-weekplan .weekplan-grid th,
body.page-admin-weekplan .weekplan-grid td {
    border: 1px solid #d0d7db;
    padding: 6px;
    vertical-align: top;
    text-align: left;
}

body.page-student-weekplan .weekplan-grid thead th,
body.page-admin-weekplan .weekplan-grid thead th {
    background: #e8f2f5;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 3;
}

body.page-student-weekplan .weekplan-corner,
body.page-admin-weekplan .weekplan-corner {
    min-width: 118px;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 4;
    background: #e8f2f5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

body.page-student-weekplan .weekplan-daycell,
body.page-admin-weekplan .weekplan-daycell {
    background: #f7fafb;
    min-width: 110px;
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

body.page-student-weekplan tr.weekplan-day-start > th,
body.page-student-weekplan tr.weekplan-day-start > td,
body.page-admin-weekplan tr.weekplan-day-start > th,
body.page-admin-weekplan tr.weekplan-day-start > td {
    border-top: 2px solid #7a9aa5;
}

body.page-student-weekplan .weekplan-dayname,
body.page-admin-weekplan .weekplan-dayname {
    display: block;
    font-weight: 700;
}

body.page-student-weekplan .weekplan-daydate,
body.page-admin-weekplan .weekplan-daydate {
    display: block;
    font-size: 0.85em;
    color: #666;
    font-weight: 400;
}

body.page-student-weekplan .weekplan-halflabel,
body.page-admin-weekplan .weekplan-halflabel {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    font-weight: 600;
    color: #3a6d7a;
}

body.page-student-weekplan .weekplan-boxcell,
body.page-admin-weekplan .weekplan-boxcell {
    min-width: 130px;
}

body.page-student-weekplan .weekplan-part,
body.page-admin-weekplan .weekplan-part {
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

body.page-student-weekplan .weekplan-part:last-child,
body.page-admin-weekplan .weekplan-part:last-child {
    margin-bottom: 0;
}

body.page-student-weekplan .weekplan-part.is-free,
body.page-admin-weekplan .weekplan-part.is-free {
    background: #f4f7f8;
    border: 1px dashed #b7c5cb;
}

body.page-student-weekplan .weekplan-part.is-booked,
body.page-admin-weekplan .weekplan-part.is-booked {
    background: #fff6e5;
    border: 1px solid #e0c48a;
}

body.page-student-weekplan .weekplan-part.is-validated,
body.page-admin-weekplan .weekplan-part.is-validated {
    background: #e7f6ea;
    border: 1px solid #9dcbab;
}

body.page-student-weekplan .weekplan-part.is-own.is-booked {
    background: #e8f4fb;
    border-color: #8eb9d0;
}

body.page-student-weekplan .weekplan-part-label,
body.page-admin-weekplan .weekplan-part-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #567;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

body.page-student-weekplan .weekplan-student,
body.page-admin-weekplan .weekplan-student {
    font-weight: 600;
    margin-bottom: 2px;
    word-break: break-word;
}

body.page-student-weekplan .weekplan-note,
body.page-admin-weekplan .weekplan-note {
    font-size: 0.85em;
    color: #444;
    margin-bottom: 6px;
    word-break: break-word;
}

body.page-student-weekplan .weekplan-note-label,
body.page-admin-weekplan .weekplan-note-label {
    font-weight: 600;
    color: #555;
}

body.page-student-weekplan .weekplan-status,
body.page-admin-weekplan .weekplan-status {
    font-size: 0.8em;
    color: #555;
}

body.page-student-weekplan .weekplan-free-label,
body.page-admin-weekplan .weekplan-free-label {
    color: #889;
    font-style: italic;
}

body.page-student-weekplan .weekplan-note-label-wrap {
    display: block;
}

body.page-student-weekplan .weekplan-note-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 6px 8px;
    font-size: 0.85rem;
}

body.page-student-weekplan .btn-tiny,
body.page-admin-weekplan .btn-tiny {
    padding: 4px 10px;
    font-size: 0.8rem;
    line-height: 1.3;
}

body.page-student-weekplan .weekplan-book-form,
body.page-student-weekplan .weekplan-inline-form,
body.page-admin-weekplan .weekplan-inline-form {
    margin: 0;
}

@media (max-width: 700px) {
    body.page-student-weekplan .weekplan-picker,
    body.page-admin-weekplan .weekplan-picker {
        flex-direction: column;
        align-items: stretch;
    }

    body.page-student-weekplan .weekplan-picker select,
    body.page-admin-weekplan .weekplan-picker select {
        min-width: 0;
        width: 100%;
    }

    body.page-student-weekplan .weekplan-scroll,
    body.page-admin-weekplan .weekplan-scroll {
        max-height: calc(100vh - 220px);
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 6mm;
    }

    body.page-admin-weekplan .header,
    body.page-admin-weekplan .nav-container,
    body.page-admin-weekplan .weekplan-intro,
    body.page-admin-weekplan .weekplan-picker,
    body.page-admin-weekplan .weekplan-batch-form,
    body.page-admin-weekplan .weekplan-inline-form,
    body.page-admin-weekplan .weekplan-batch-label,
    body.page-admin-weekplan .weekplan-print-btn,
    body.page-admin-weekplan .weekplan-status,
    body.page-admin-weekplan .success-message,
    body.page-admin-weekplan .error-message {
        display: none !important;
    }

    body.page-admin-weekplan .weekplan-print-heading {
        display: block !important;
        margin-bottom: 4px;
    }

    body.page-admin-weekplan .weekplan-print-heading h2 {
        margin: 0 0 2px;
        font-size: 11pt;
        text-align: left;
    }

    body.page-admin-weekplan .weekplan-print-heading p {
        margin: 0;
        font-size: 8pt;
    }

    body.page-admin-weekplan .container,
    body.page-admin-weekplan .weekplan-card {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    body.page-admin-weekplan .weekplan-scroll {
        overflow: visible !important;
        max-height: none !important;
        border: none;
    }

    body.page-admin-weekplan .weekplan-grid {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        font-size: 7pt;
        line-height: 1.15;
    }

    body.page-admin-weekplan .weekplan-grid th,
    body.page-admin-weekplan .weekplan-grid td {
        padding: 2px;
        overflow: hidden;
        word-break: break-word;
        vertical-align: top;
    }

    body.page-admin-weekplan .weekplan-grid thead th,
    body.page-admin-weekplan .weekplan-corner,
    body.page-admin-weekplan .weekplan-daycell,
    body.page-admin-weekplan .weekplan-boxcell {
        position: static !important;
        box-shadow: none !important;
        z-index: auto !important;
        min-width: 0 !important;
        width: auto;
    }

    body.page-admin-weekplan .weekplan-corner,
    body.page-admin-weekplan .weekplan-daycell {
        width: 9%;
        font-size: 6.5pt;
    }

    body.page-admin-weekplan .weekplan-dayname {
        font-size: 7pt;
    }

    body.page-admin-weekplan .weekplan-daydate,
    body.page-admin-weekplan .weekplan-halflabel {
        font-size: 6pt;
        margin-top: 1px;
    }

    body.page-admin-weekplan .weekplan-part {
        padding: 2px;
        margin-bottom: 2px;
        border-radius: 2px;
        font-size: 6.5pt;
        overflow: hidden;
    }

    body.page-admin-weekplan .weekplan-part-label {
        font-size: 5.5pt;
        margin-bottom: 1px;
    }

    body.page-admin-weekplan .weekplan-student {
        font-size: 6.5pt;
        margin-bottom: 0;
    }

    body.page-admin-weekplan .weekplan-note {
        font-size: 6pt;
        margin-bottom: 0;
    }

    body.page-admin-weekplan .weekplan-free-label {
        font-size: 6pt;
    }

    body.page-admin-weekplan .weekplan-part,
    body.page-admin-weekplan .weekplan-grid thead th,
    body.page-admin-weekplan .weekplan-daycell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

body.page-admin-student-profile .quality-eval-wrap,
body.page-student-profile .quality-eval-wrap,
body.page-admin-student-profile .session-history-panel .quality-eval,
body.page-student-profile .session-history-panel .quality-eval {
    padding: 18px 16px 8px;
    background: #fff;
}

body.page-admin-student-profile .quality-half,
body.page-student-profile .quality-half {
    margin: 0 0 8px;
    font-weight: 650;
}

body.page-admin-student-profile .quality-dims,
body.page-student-profile .quality-dims {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    align-items: center;
}

body.page-admin-student-profile .quality-dim,
body.page-student-profile .quality-dim {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-admin-student-profile .quality-dim-label,
body.page-student-profile .quality-dim-label,
body.page-admin-student-profile .quality-total-label,
body.page-student-profile .quality-total-label {
    font-weight: 650;
}

body.page-admin-student-profile .quality-seg,
body.page-student-profile .quality-seg {
    display: flex;
    border: 1px solid #d9d3c8;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

body.page-admin-student-profile .quality-seg button,
body.page-student-profile .quality-seg button {
    width: 36px;
    height: 32px;
    border: 0;
    border-right: 1px solid #e4dfd6;
    background: #fff;
    color: #2a2a28;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

body.page-admin-student-profile .quality-seg button:last-child,
body.page-student-profile .quality-seg button:last-child {
    border-right: 0;
}

body.page-admin-student-profile .quality-seg button[aria-checked="true"],
body.page-student-profile .quality-seg button[aria-checked="true"] {
    background: #2a2a28;
    color: #fff;
}

body.page-admin-student-profile .quality-seg button:disabled,
body.page-student-profile .quality-seg button:disabled {
    cursor: progress;
}

body.page-admin-student-profile .quality-eval.is-readonly .quality-seg button:disabled,
body.page-student-profile .quality-eval.is-readonly .quality-seg button:disabled {
    cursor: default;
    opacity: 1;
}

body.page-admin-student-profile .quality-total-row,
body.page-student-profile .quality-total-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 24px;
    margin-top: 16px;
}

body.page-admin-student-profile .quality-total-label,
body.page-student-profile .quality-total-label {
    padding-top: 4px;
}

body.page-admin-student-profile .quality-scale,
body.page-student-profile .quality-scale {
    position: relative;
    flex: 1 1 280px;
    max-width: 520px;
    min-width: 240px;
    padding: 8px 18px 0;
}

body.page-admin-student-profile .quality-track,
body.page-student-profile .quality-track {
    position: relative;
    display: flex;
    gap: 4px;
    height: 14px;
}

body.page-admin-student-profile .quality-zone,
body.page-student-profile .quality-zone {
    display: block;
    height: 100%;
    border-radius: 999px;
}

body.page-admin-student-profile .quality-zone.z0,
body.page-student-profile .quality-zone.z0 {
    flex: 2.5;
    background: linear-gradient(90deg, #d9d9d9, #9a9a9a);
}

body.page-admin-student-profile .quality-zone.z1,
body.page-student-profile .quality-zone.z1 {
    flex: 2;
    background: linear-gradient(90deg, #8d8d8d, #5e5e5e);
}

body.page-admin-student-profile .quality-zone.z2,
body.page-student-profile .quality-zone.z2 {
    flex: 1.5;
    background: linear-gradient(90deg, #4a4a4a, #2a2a2a);
}

body.page-admin-student-profile .quality-thumb,
body.page-student-profile .quality-thumb {
    position: absolute;
    top: 50%;
    left: calc(var(--value) / 6 * 100%);
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #3a3a3a;
    color: #fff;
    font-weight: 700;
    line-height: 34px;
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.25);
}

body.page-admin-student-profile .quality-ticks,
body.page-student-profile .quality-ticks,
body.page-admin-student-profile .quality-bands,
body.page-student-profile .quality-bands {
    position: relative;
    height: 1.2rem;
}

body.page-admin-student-profile .quality-ticks,
body.page-student-profile .quality-ticks { margin-top: 12px; }

body.page-admin-student-profile .quality-bands,
body.page-student-profile .quality-bands {
    height: 2.2rem;
}

body.page-admin-student-profile .quality-ticks span,
body.page-student-profile .quality-ticks span,
body.page-admin-student-profile .quality-bands span,
body.page-student-profile .quality-bands span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    color: #5e5c56;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.15;
}

body.page-admin-student-profile .quality-bands span,
body.page-student-profile .quality-bands span {
    width: 6.5rem;
}

body.page-admin-student-profile .btn-validate-day:disabled,
body.page-admin-student-profile .btn-validate-point:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.page-admin-student-profile .procedure-half,
body.page-student-profile .procedure-half {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 10px;
}

body.page-admin-student-profile .procedure-half label,
body.page-student-profile .procedure-half label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
}

body.page-admin-student-profile .history-session .manual-session-assign {
    padding: 0 16px 16px;
}

body.page-admin-student-profile .manual-session-assign p {
    margin: 0 0 8px;
}

body.page-admin-student-profile .stat-card.quality-average {
    background: #8d8d8d;
    color: #fff;
}

body.page-admin-student-profile .stat-card.quality-average.is-low {
    background: linear-gradient(135deg, #e07a3d, #c4522a);
}

body.page-admin-student-profile .stat-card.quality-average.is-mid {
    background: linear-gradient(135deg, #3d9a62, #2f7d4e);
}

body.page-admin-student-profile .stat-card.quality-average.is-high {
    background: linear-gradient(135deg, #1f7a45, #145c32);
}

body.page-admin-student-profile .history-session,
body.page-student-profile .history-session {
    position: relative;
    margin: 18px 0 22px;
    padding-top: 8px;
    border: 2px solid #2f8f4e;
    border-radius: 10px;
    background: #fff;
}

body.page-admin-student-profile .history-session-flag,
body.page-student-profile .history-session-flag {
    position: absolute;
    top: -14px;
    right: 18px;
    min-width: 42px;
    height: 28px;
    padding: 0 10px;
    border-radius: 3px 3px 3px 0;
    background: #1f7a45;
    color: #fff;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

body.page-admin-student-profile .history-session-flag.is-empty,
body.page-student-profile .history-session-flag.is-empty {
    background: #d5d5d5;
    color: transparent;
}

body.page-admin-student-profile .history-session-flag::before,
body.page-student-profile .history-session-flag::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    border-top: 8px solid #145c32;
    border-left: 8px solid transparent;
}

body.page-admin-student-profile .history-session-flag.is-empty::before,
body.page-student-profile .history-session-flag.is-empty::before {
    border-top-color: #bdbdbd;
}

body.page-admin-student-profile .history-session-head,
body.page-student-profile .history-session-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 4px;
}

body.page-admin-settings .eval-required-form {
    display: inline-flex;
    margin-left: 12px;
}

body.page-admin-settings .eval-required-form label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
}



