html,
body {
    min-height: 100%;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--mud-palette-background);
}

body {
    margin: 0;
}

a {
    color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: 0;
}

.validation-message {
    color: var(--mud-palette-error);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header > div,
.page-header-actions {
    min-width: 0;
}

.page-header-actions {
    align-items: center;
}

.page-kicker {
    color: var(--mud-palette-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.surface-card {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
}

.mobile-data-table {
    width: 100%;
}

.mobile-data-table .mud-table-container {
    width: 100%;
    overflow-x: auto;
}

.mobile-data-table .mud-table-cell {
    min-width: 0;
    overflow-wrap: anywhere;
}

.student-task-card .mud-card-content {
    height: 100%;
    display: grid;
    align-content: space-between;
}

.student-task-card-header,
.student-task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.student-task-card .mud-typography {
    overflow-wrap: anywhere;
}

.untis-upload-panel {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
}

.untis-upload-panel input[type="file"] {
    width: 100%;
    color: var(--mud-palette-text-primary);
}

.untis-import-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.untis-error-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    color: var(--mud-palette-error);
}

.untis-error-list li + li {
    margin-top: 0.35rem;
}

.about-note-list {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    color: var(--mud-palette-text-secondary);
}

.about-note-list li + li {
    margin-top: 0.45rem;
}

.help-step-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.help-step-card .mud-card-content {
    min-height: 12rem;
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.help-step-card .mud-typography {
    overflow-wrap: anywhere;
}

.help-step-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.help-step-card-header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 0.55rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, var(--mud-palette-primary) 10%);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-width: 9rem;
}

.user-status {
    display: inline-flex;
    align-items: center;
    min-width: 4.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.user-status-active {
    color: #065f46;
    background: rgba(16, 185, 129, 0.16);
}

.user-status-inactive {
    color: #92400e;
    background: rgba(245, 158, 11, 0.18);
}

.user-status-deleted {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.16);
}

.admin-user-layout {
    align-items: flex-start;
}

.admin-user-filter-bar {
    align-items: center;
    margin-bottom: 1rem;
}

.admin-user-sort-direction {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.admin-user-name-cell {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.admin-user-name-cell strong,
.admin-user-name-cell small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-user-name-cell small {
    color: var(--mud-palette-text-secondary);
    font-size: 0.76rem;
}

.admin-user-actions {
    min-width: 8.5rem;
}

.admin-user-editor {
    position: sticky;
    top: 5.5rem;
}

.admin-user-editor-actions {
    justify-content: flex-end;
}

.assessment-template-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.assessment-template-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.criteria-editor-list,
.criteria-detail-list {
    display: grid;
    gap: 0.75rem;
}

.criteria-editor-row,
.criteria-detail-row {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.85rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
}

.criteria-editor-row-header,
.criteria-detail-row,
.criteria-detail-metrics {
    display: flex;
    align-items: center;
}

.criteria-editor-row-header,
.criteria-detail-row {
    justify-content: space-between;
    gap: 0.75rem;
}

.criteria-required-cell {
    display: flex;
    align-items: center;
}

.criteria-detail-metrics {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    color: var(--mud-palette-text-secondary);
    font-size: 0.82rem;
}

.assessment-template-empty-state {
    min-height: 18rem;
    justify-content: center;
}

.ai-criteria-panel {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 1rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 94%, var(--mud-palette-secondary) 6%);
}

.ai-criteria-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.ai-suggestion-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ai-suggestion-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.85rem;
    background: var(--mud-palette-surface);
}

.teacher-table-header,
.teacher-section-header,
.teacher-document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.teacher-table-header,
.teacher-section-header {
    margin-bottom: 1rem;
}

.teacher-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.statistics-filter-card {
    margin-bottom: 1rem;
}

.statistics-filter-bar {
    display: grid;
    grid-template-columns: minmax(16rem, 0.35fr) minmax(18rem, 0.45fr) 1fr;
    gap: 1rem;
    align-items: start;
}

.teacher-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.teacher-stat-card .mud-card-content {
    display: grid;
    gap: 0.35rem;
    min-height: 10rem;
}

.teacher-stat-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.student-progress-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 1rem;
    align-items: stretch;
}

.student-progress-chart {
    min-height: 18rem;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(4.25rem, 1fr);
    gap: 0.75rem;
    align-items: end;
    overflow-x: auto;
    padding: 0.75rem 0.25rem 0.25rem;
}

.student-progress-bar-item {
    min-width: 4.25rem;
    display: grid;
    grid-template-rows: 1.4rem 12rem 1.5rem;
    gap: 0.35rem;
    justify-items: center;
    align-items: end;
}

.student-progress-bar-value,
.student-progress-bar-label {
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.student-progress-bar-track {
    width: 100%;
    height: 12rem;
    display: flex;
    align-items: end;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.25rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, var(--mud-palette-primary) 10%);
}

.student-progress-bar-fill {
    width: 100%;
    min-height: 0.25rem;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--mud-palette-primary), var(--mud-palette-success));
}

.student-progress-month-list {
    display: grid;
    gap: 0.5rem;
    align-content: start;
}

.student-progress-month-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
}

.student-progress-month-row strong {
    white-space: nowrap;
}

.competence-filter-card {
    margin-bottom: 1rem;
}

.competence-filter-bar {
    display: grid;
    grid-template-columns: minmax(16rem, 0.35fr) 1fr;
    gap: 1rem;
    align-items: start;
}

.competence-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: start;
}

.competence-student-card {
    position: sticky;
    top: 5.5rem;
}

.competence-detail-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.competence-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.competence-card .mud-card-content {
    display: grid;
    gap: 0.45rem;
    min-height: 9.5rem;
}

.competence-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.competence-card-header .mud-typography {
    overflow-wrap: anywhere;
}

.competence-history-chart {
    min-height: 16rem;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(4.5rem, 1fr);
    gap: 0.75rem;
    align-items: end;
    overflow-x: auto;
    padding: 0.75rem 0.25rem 0.25rem;
}

.competence-history-item {
    min-width: 4.5rem;
    display: grid;
    grid-template-rows: 1.4rem 10rem 1.5rem;
    gap: 0.35rem;
    justify-items: center;
    align-items: end;
}

.competence-history-value,
.competence-history-label {
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.competence-history-track {
    width: 100%;
    height: 10rem;
    display: flex;
    align-items: end;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.25rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, var(--mud-palette-secondary) 10%);
}

.competence-history-fill {
    width: 100%;
    min-height: 0.25rem;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--mud-palette-secondary), var(--mud-palette-success));
}

.teacher-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(520px, 0.9fr);
    gap: 1.25rem;
    align-items: start;
    min-width: 0;
}

.teacher-detail-main,
.teacher-answer-list,
.teacher-document-list,
.teacher-score-list {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.teacher-review-card {
    position: sticky;
    top: 5.5rem;
    width: 100%;
    min-width: 0;
}

.teacher-detail-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.teacher-detail-field,
.teacher-answer-row,
.teacher-document-row,
.teacher-score-row {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.85rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
}

.teacher-detail-field {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.teacher-detail-field span {
    color: var(--mud-palette-text-secondary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.teacher-detail-field strong,
.teacher-score-copy {
    min-width: 0;
    overflow-wrap: anywhere;
}

.teacher-answer-row {
    display: grid;
    gap: 0.35rem;
}

.teacher-document-row,
.teacher-score-row {
    min-width: 0;
}

.teacher-score-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 160px minmax(240px, 2fr);
    align-items: start;
    gap: 16px;
    width: 100%;
}

.teacher-score-copy {
    padding-top: 0.35rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.teacher-score-inputs {
    display: contents;
}

.teacher-score-inputs .mud-input-control {
    margin-top: 0;
    width: 100%;
    min-width: 0;
}

.teacher-points-control {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.teacher-no-points-message {
    display: flex;
    align-items: center;
    min-height: 3.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    color: var(--mud-palette-text-secondary);
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, var(--mud-palette-primary) 8%);
    font-size: 0.82rem;
    line-height: 1.25;
}

.teacher-comment-input {
    width: 100%;
    min-width: 0;
}

.submission-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    padding: 0.22rem 0.6rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.submission-status-reviewed {
    color: #065f46;
    background: rgba(16, 185, 129, 0.16);
}

.submission-status-submitted {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.16);
}

.submission-status-open {
    color: #92400e;
    background: rgba(245, 158, 11, 0.18);
}

.auth-page {
    min-height: calc(100vh - 9rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card-wrap {
    width: min(100%, 460px);
}

.auth-card-wrap.auth-card-wide {
    width: min(100%, 720px);
}

.auth-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--mud-palette-surface) 96%, transparent), color-mix(in srgb, var(--mud-palette-primary) 7%, var(--mud-palette-surface))),
        var(--mud-palette-surface);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.16);
}

.auth-card-content {
    padding: 2rem;
}

.auth-heading {
    margin-bottom: 1.5rem;
}

.auth-title {
    font-weight: 800;
}

.auth-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.auth-link-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.5rem;
}

.auth-submit {
    height: 46px;
    border-radius: 8px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 1.25rem;
    align-items: stretch;
}

.dashboard-hero.dashboard-hero-solo {
    grid-template-columns: minmax(0, 1fr);
}

.hero-panel {
    min-height: 280px;
    padding: 2rem;
    border-radius: 8px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(16, 185, 129, 0.92)),
        #2563eb;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.dashboard-welcome {
    min-height: 22rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 2rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 94%, var(--mud-palette-primary) 6%);
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-metric-card .mud-card-content {
    display: grid;
    gap: 0.35rem;
    min-height: 9rem;
}

.admin-dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.admin-dashboard-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    margin-top: 1rem;
}

.admin-dashboard-chart-card-wide {
    grid-column: 1 / -1;
}

.admin-chart-card .mud-card-content {
    display: grid;
    gap: 1rem;
}

.admin-chart-list {
    display: grid;
    gap: 0.75rem;
}

.admin-chart-row {
    display: grid;
    grid-template-columns: minmax(8rem, 0.24fr) minmax(0, 1fr) minmax(6.5rem, 0.16fr);
    gap: 0.75rem;
    align-items: center;
}

.admin-chart-label {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
}

.admin-chart-track {
    height: 0.9rem;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, var(--mud-palette-primary) 10%);
}

.admin-chart-fill {
    width: calc(var(--bar-size, 0) * 100%);
    height: 100%;
    min-width: 0;
    border-radius: 7px;
}

.admin-chart-fill-grade {
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-secondary));
}

.admin-chart-fill-rate {
    background: linear-gradient(90deg, var(--mud-palette-info), var(--mud-palette-success));
}

.admin-chart-fill-average {
    background: linear-gradient(90deg, var(--mud-palette-warning), var(--mud-palette-success));
}

.admin-chart-value {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-secondary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
}

.admin-chart-value small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.dashboard-filter-bar {
    display: grid;
    grid-template-columns: minmax(16rem, 0.3fr) minmax(14rem, 0.25fr) 1fr;
    gap: 1rem;
    align-items: start;
}

.dashboard-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-list {
    display: grid;
    gap: 0.75rem;
}

.dashboard-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.85rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
}

.ai-evaluation-panel {
    display: grid;
    gap: 0.75rem;
}

.ai-evaluation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.ai-evaluation-list {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.85rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
}

.ai-evaluation-list ul {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}

.ai-evaluation-list p {
    margin: 0.5rem 0 0;
}

.ai-criteria-suggestion-list {
    display: grid;
    gap: 0.75rem;
}

.ai-criteria-suggestion-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 0.85rem;
}

.ai-criteria-suggestion-row strong {
    white-space: nowrap;
}

.admin-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 1100px) {
    .teacher-detail-layout {
        grid-template-columns: 1fr;
    }

    .teacher-review-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .page-header-actions {
        width: 100%;
        align-items: stretch;
    }

    .dashboard-hero,
    .ai-evaluation-grid,
    .help-step-grid,
    .metric-grid,
    .dashboard-metric-grid,
    .admin-dashboard-metric-grid,
    .admin-dashboard-chart-grid,
    .dashboard-filter-bar,
    .statistics-filter-bar,
    .competence-filter-bar,
    .competence-layout,
    .competence-card-grid,
    .student-progress-layout,
    .teacher-stat-grid,
    .dashboard-two-column,
    .untis-import-result-grid,
    .assessment-template-layout,
    .teacher-detail-layout,
    .teacher-detail-fields,
    .auth-two-column {
        grid-template-columns: 1fr;
    }

    .admin-user-sort-direction {
        justify-content: flex-start;
    }

    .admin-user-editor {
        position: static;
    }

    .assessment-template-card-header,
    .ai-suggestion-row,
    .ai-criteria-suggestion-row,
    .criteria-detail-row,
    .dashboard-list-row,
    .student-task-card-header,
    .student-task-card-footer,
    .teacher-section-header,
    .teacher-section-actions,
    .teacher-document-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .mobile-primary-action,
    .mobile-secondary-action,
    .mobile-table-action,
    .page-header-actions .mud-button-root,
    .page-header > .mud-button-root,
    .teacher-section-actions .mud-button-root,
    .teacher-document-row .mud-button-root,
    .dashboard-list-row .mud-button-root,
    .student-task-card-footer .mud-button-root {
        width: 100%;
    }

    .admin-user-editor-actions {
        align-items: stretch;
        flex-direction: column !important;
    }

    .teacher-document-row,
    .dashboard-list-row,
    .student-task-card-footer,
    .teacher-section-actions {
        width: 100%;
        align-items: stretch;
    }

    .teacher-document-row > div,
    .dashboard-list-row > div,
    .student-task-card-footer > div {
        width: 100%;
    }

    .mobile-data-table .mud-table-container {
        overflow-x: visible;
    }

    .mobile-data-table .mud-table-root {
        border-collapse: separate;
        border-spacing: 0 0.75rem;
    }

    .mobile-data-table .mud-table-head {
        display: none;
    }

    .mobile-data-table .mud-table-body .mud-table-row {
        display: block;
        overflow: hidden;
        border: 1px solid var(--mud-palette-lines-default);
        border-radius: 8px;
        background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary) 4%);
    }

    .mobile-data-table .mud-table-cell {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.85rem;
        width: 100%;
        padding: 0.75rem;
        border-bottom: 1px solid var(--mud-palette-lines-default);
        text-align: right;
    }

    .mobile-data-table .mud-table-cell:last-child {
        border-bottom: 0;
    }

    .mobile-data-table .mud-table-cell::before {
        content: attr(data-label);
        flex: 0 0 42%;
        max-width: 10rem;
        color: var(--mud-palette-text-secondary);
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0;
        line-height: 1.3;
        text-align: left;
        text-transform: uppercase;
    }

    .mobile-data-table .mud-table-cell > * {
        min-width: 0;
    }

    .mobile-data-table .mud-table-cell .mud-button-root {
        align-self: stretch;
        width: 100%;
    }

    .criteria-detail-metrics {
        justify-content: flex-start;
    }

    .auth-page {
        min-height: calc(100vh - 7rem);
        padding: 1rem 0;
    }

    .auth-card-content {
        padding: 1.25rem;
    }

    .teacher-review-card {
        position: static;
    }

    .competence-student-card {
        position: static;
    }

    .admin-dashboard-chart-card-wide {
        grid-column: auto;
    }

    .admin-chart-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .admin-chart-value {
        text-align: left;
    }

    .teacher-score-row {
        grid-template-columns: 1fr;
    }

    .teacher-score-inputs {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
        min-width: 0;
    }

    .teacher-points-input,
    .teacher-comment-input {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .page-header-actions {
        flex-direction: column !important;
    }

    .page-header-actions .mud-button-root {
        width: 100%;
    }

    .dashboard-welcome {
        min-height: auto;
        padding: 1.25rem;
    }

    .dashboard-metric-card .mud-card-content,
    .teacher-stat-card .mud-card-content,
    .competence-card .mud-card-content {
        min-height: auto;
    }

    .mobile-data-table .mud-table-cell {
        align-items: stretch;
        flex-direction: column;
        gap: 0.45rem;
        text-align: left;
    }

    .mobile-data-table .mud-table-cell::before {
        flex: 0 0 auto;
        max-width: none;
    }

    .submission-status {
        width: max-content;
        min-width: 0;
    }

    .auth-card-content {
        padding: 1rem;
    }
}
