body {
    min-height: 100vh;
}

.min-vh-75 {
    min-height: 75vh;
}

.label-meta {
    margin-bottom: 0.35rem;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cattedra-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cattedra-chip-list-vertical {
    align-items: stretch;
    flex-direction: column;
}

.cattedra-chip-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(9rem, 1fr));
}

.cattedra-chip-list-grid .cattedra-chip-wide {
    grid-template-columns: 2.5rem minmax(0, 1fr) 3.25rem;
    width: 100%;
    min-width: 0;
    padding: 0.35rem 0.4rem;
}

.cattedra-chip {
    display: inline-grid;
    grid-template-rows: auto auto auto;
    gap: 0.12rem;
    min-width: 7.75rem;
    max-width: 9.5rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    padding: 0.42rem 0.5rem;
    color: #212529;
    font-size: 0.78rem;
    line-height: 1.2;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.cattedra-chip:hover {
    filter: brightness(0.96);
    color: #212529;
}

.cattedra-chip-wide {
    grid-template-columns: 3.5rem minmax(6rem, 1fr) 4rem;
    grid-template-rows: auto;
    max-width: none;
    min-width: 16rem;
}

.cattedra-chip-classe {
    font-weight: 700;
}

.cattedra-chip-ls {
    background-color: #cfe2ff;
    border-color: #9ec5fe;
}

.cattedra-chip-lsa {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
}

.cattedra-chip-ll {
    background-color: #f8d7da;
    border-color: #f1aeb5;
}

.cattedra-chip-les {
    background-color: #fff3cd;
    border-color: #ffe69c;
}

.cattedra-chip-altro {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.cattedre-matrice-materia {
    min-width: 9.375rem;
}

.cattedre-matrice-classe {
    min-width: 11.25rem;
}

.cattedre-matrice .form-select-sm {
    font-size: 0.8rem;
}

.cattedre-matrice-scroll {
    max-height: 75vh;
}

.cattedre-matrice-classi-materie {
    min-width: 100%;
}

.cattedre-matrice-classi-materie th,
.cattedre-matrice-classi-materie td {
    min-width: 12rem;
    max-width: 13.25rem;
}

.cattedre-matrice-classi-materie .cattedre-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 9rem;
    background: #fff;
    box-shadow: 1px 0 0 #dee2e6;
}

.cattedre-matrice-classi-materie thead .cattedre-sticky-col {
    z-index: 4;
    background: #f8f9fa;
}

.cattedre-matrice-classi-materie thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8f9fa;
}

.cattedre-matrice-classe-header {
    min-width: 9rem;
}

.cattedre-matrice-materia-col {
    min-width: 12rem;
    max-width: 13.25rem;
}

.cattedre-matrice-cell {
    border-left: 0.35rem solid transparent;
    padding: 0.32rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cattedre-matrice-classi-materie .form-select-sm {
    min-height: 1.8rem;
    padding-top: 0.18rem;
    padding-bottom: 0.18rem;
    font-size: 0.72rem;
}

.cattedre-cell-empty {
    background-color: #f8f9fa;
    color: #adb5bd;
    text-align: center;
}

.cattedre-cell-stack {
    display: grid;
    gap: 0.18rem;
}

.cattedre-cell-assignment .small {
    line-height: 1.15;
}

.cattedre-cell-assignment-extra {
    border-top: 1px solid rgba(33, 37, 41, 0.12);
    margin-top: 0.2rem;
    padding-top: 0.2rem;
}

.cattedre-cell-assignment-potenziamento .form-select-sm {
    min-height: 1.65rem;
    background-color: rgba(255, 255, 255, 0.72);
    font-size: 0.69rem;
}

.cattedre-cell-unassigned {
    background-color: #fff5f5;
    border-left-color: #dc3545;
}

.cattedre-cell-partial {
    box-shadow: inset 0 0 0 2px rgba(220, 53, 69, 0.16);
}

.cattedre-cell-unassigned .form-select {
    border-color: #dc3545;
    background-color: #fffafa;
}

.cattedre-cell-fuori-dipartimento {
    box-shadow: inset 0 0 0 2px rgba(33, 37, 41, 0.18);
}

.cattedre-compact-list {
    font-size: 0.82rem;
}

.cattedre-compact-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.55rem 0.85rem;
}

.cattedre-compact-class {
    position: sticky;
    left: 0;
    align-self: stretch;
    background: #fff;
}

.cattedre-compact-assignments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    min-width: 0;
}

.cattedre-compact-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.22rem;
    max-width: 15rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background: #fff;
    padding: 0.16rem 0.32rem;
    color: #212529;
    line-height: 1.18;
    white-space: nowrap;
}

.cattedre-compact-subject {
    color: #495057;
    font-weight: 700;
}

.cattedre-compact-kind {
    color: #b35c00;
    font-weight: 700;
}

.cattedre-compact-chip-empty {
    border-color: #f1aeb5;
    background: #fff5f5;
    color: #b02a37;
}

.cattedre-compact-chip-pot {
    border-style: dashed;
    background: #fff8e8;
}

.cattedre-docente-0 { background-color: #eef5ff; border-left-color: #0d6efd; }
.cattedre-docente-1 { background-color: #eefaf4; border-left-color: #198754; }
.cattedre-docente-2 { background-color: #fff8e8; border-left-color: #f0ad00; }
.cattedre-docente-3 { background-color: #f5f0ff; border-left-color: #6f42c1; }
.cattedre-docente-4 { background-color: #fff0f4; border-left-color: #d63384; }
.cattedre-docente-5 { background-color: #edfafa; border-left-color: #0aa2c0; }
.cattedre-docente-6 { background-color: #f4f7ed; border-left-color: #6c8f18; }
.cattedre-docente-7 { background-color: #fff2ed; border-left-color: #fd7e14; }
.cattedre-docente-8 { background-color: #f1f3f5; border-left-color: #495057; }
.cattedre-docente-9 { background-color: #eff7ff; border-left-color: #3d8bfd; }
.cattedre-docente-10 { background-color: #f1fbef; border-left-color: #20c997; }
.cattedre-docente-11 { background-color: #fff0ef; border-left-color: #dc3545; }
.cattedre-docente-12 { background-color: #f1f0ff; border-left-color: #5c7cfa; }
.cattedre-docente-13 { background-color: #fdf2ff; border-left-color: #ae3ec9; }

.todo-list {
    display: grid;
    gap: 1rem;
}

.todo-sheet-filters {
    border: 1px solid #e9ecef;
    border-radius: 0.35rem;
    background: #fff;
    padding: 0.85rem;
}

.todo-sheet {
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    background: #fff;
    overflow: hidden;
}

.todo-sheet-head,
.todo-sheet-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(9rem, 13rem) 7.5rem 4.5rem;
    gap: 0.75rem;
    align-items: center;
}

.todo-sheet-head {
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.55rem 0.85rem;
    text-transform: uppercase;
}

.todo-sheet-row {
    border-bottom: 1px solid #edf0f2;
    padding: 0.65rem 0.85rem;
}

.todo-sheet-row:last-child {
    border-bottom: 0;
}

.todo-sheet-row:hover {
    background: #fbfcfd;
}

.todo-sheet-row.is-overdue {
    background: #fff8f8;
}

.todo-sheet-row.is-today {
    background: #fffdf4;
}

.todo-sheet-main {
    display: grid;
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start;
}

.todo-sheet-symbol {
    color: #495057;
    font-size: 1.15rem;
    line-height: 1.2;
    text-align: center;
}

.todo-sheet-title {
    color: #212529;
    font-weight: 600;
    text-decoration: none;
}

.todo-sheet-title:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.todo-sheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    color: #6c757d;
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.todo-sheet-person,
.todo-sheet-date {
    font-size: 0.9rem;
}

.todo-sheet-actions {
    text-align: right;
}

.todo-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: 1.25rem;
    border: 1px solid #dee2e6;
    border-left: 0.35rem solid #6c757d;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(33, 37, 41, 0.05);
    padding: 1.15rem;
}

.todo-item-overdue {
    border-left-color: #dc3545;
}

.todo-item-today {
    border-left-color: #ffc107;
}

.todo-item-soon {
    border-left-color: #0dcaf0;
}

.todo-priority-urgente {
    background: #fff8f8;
}

.todo-priority-alta {
    background: #fffdf7;
}

.todo-title-link {
    color: #1d3557;
    text-decoration: none;
}

.todo-title-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.todo-meta-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.todo-status-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #6c757d;
}

.todo-status-active {
    background: #0d6efd;
}

.todo-status-waiting {
    background: #ffc107;
}

.todo-status-danger {
    background: #dc3545;
}

.todo-status-done {
    background: #198754;
}

.todo-status-muted {
    background: #6c757d;
}

.todo-status-badge {
    align-self: flex-start;
}

.todo-description,
.todo-update p {
    color: #212529;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.todo-description {
    margin-top: 0.85rem;
}

.todo-update {
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
    padding-top: 0.9rem;
}

.todo-item-side {
    display: grid;
    align-content: start;
    gap: 1rem;
    border-left: 1px solid #e9ecef;
    padding-left: 1.25rem;
}

.todo-date {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e7f1ff;
    color: #084298;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
}

.todo-date-overdue {
    background: #f8d7da;
    color: #842029;
}

.todo-date-today {
    background: #fff3cd;
    color: #664d03;
}

.todo-link-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    margin-top: 0.85rem;
    color: #6c757d;
    font-size: 0.88rem;
}

.todo-people {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.todo-person {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 999px;
    background: #f8f9fa;
    color: #343a40;
    font-size: 0.86rem;
    line-height: 1.2;
    padding: 0.25rem 0.6rem;
}

.todo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.todo-empty {
    border: 1px dashed #adb5bd;
    border-radius: 0.5rem;
    background: #fff;
    padding: 2rem;
}

.todo-timeline {
    display: grid;
    gap: 1rem;
}

.todo-timeline-item {
    border-left: 0.2rem solid #dee2e6;
    padding-left: 0.85rem;
}

.circolare-body {
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

@media (max-width: 767.98px) {
    .todo-sheet-head {
        display: none;
    }

    .todo-sheet-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
        align-items: start;
    }

    .todo-sheet-actions {
        text-align: left;
    }

    .todo-item {
        grid-template-columns: 1fr;
    }

    .todo-item-side {
        border-left: 0;
        border-top: 1px solid #e9ecef;
        padding-left: 0;
        padding-top: 1rem;
    }
}
