.impedimentos-page {
    display: grid;
    gap: 18px;
}

.imp-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    background: #f7f9fb;
    border: 1px solid #e0e6eb;
    border-radius: 14px;
}

.imp-context-year {
    display: grid;
    gap: 2px;
}

.imp-context-year span,
.imp-professor-load span {
    color: #758493;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.imp-context-year strong {
    font-size: 18px;
}

.imp-period-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    background: #eef2f5;
    border-radius: 12px;
}

.imp-period-tabs a {
    padding: 8px 16px;
    border-radius: 9px;
    color: #52616d;
    text-decoration: none;
    font-weight: 600;
}

.imp-period-tabs a.active {
    background: #fff;
    color: #1f5f91;
    box-shadow: 0 2px 8px rgba(25, 58, 84, .10);
}

.imp-professor-bar {
    display: grid;
    grid-template-columns: minmax(330px, 1fr) auto auto;
    gap: 16px;
    align-items: end;
    padding: 16px;
    background: #fff;
    border: 1px solid #dfe6ec;
    border-radius: 15px;
}

.imp-professor-select {
    display: grid;
    gap: 6px;
}

.imp-professor-select label {
    font-weight: 700;
    color: #415565;
}

.imp-professor-nav {
    display: flex;
    gap: 7px;
}

.button.disabled {
    opacity: .45;
    pointer-events: none;
}

.imp-professor-load {
    min-width: 118px;
    display: grid;
    justify-items: end;
    gap: 1px;
}

.imp-professor-load strong {
    font-size: 24px;
    line-height: 1;
    color: #225f8e;
}

.imp-professor-load small {
    color: #74818b;
}

.imp-grid-card,
.imp-preferences-card {
    margin-top: 16px;
    padding: 20px;
    background: #fff;
    border: 1px solid #dfe6ec;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(17, 46, 70, .04);
}

.imp-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 10px;
}

.imp-card-heading h2 {
    margin: 3px 0 0;
    font-size: 19px;
}

.imp-card-heading h2 small {
    margin-left: 6px;
    color: #71808b;
    font-weight: 500;
    font-size: 13px;
}

.imp-kicker {
    color: #748390;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.imp-help {
    margin: 0 0 14px;
    color: #647480;
    line-height: 1.5;
}

.imp-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.imp-legend span {
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
}

.legend-livre {
    background: #fff;
    border-color: #d7dfe5 !important;
    color: #6c7984;
}

.legend-nao-pode {
    background: #fde4e4;
    border-color: #f2bcbc !important;
    color: #a52c2c;
}

.legend-evitar {
    background: #e8eefb;
    border-color: #c6d4ef !important;
    color: #375f9b;
}

.legend-quer {
    background: #e3f6e7;
    border-color: #b9e3c2 !important;
    color: #28723a;
}

.legend-precisa {
    background: #fff1c9;
    border-color: #ead18a !important;
    color: #805f0e;
}

.imp-warning {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff7e7;
    border: 1px solid #efd8a8;
    color: #72531b;
}

.imp-grid-scroll {
    overflow-x: auto;
}

.imp-grid {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 5px;
}

.imp-grid th {
    color: #455866;
    font-size: 13px;
}

.imp-grid thead th {
    padding: 7px 8px;
    text-align: center;
}

.imp-grid tbody th {
    width: 118px;
    padding: 8px;
    border-radius: 10px;
    background: #f5f7f9;
    text-align: center;
}

.imp-grid tbody th small {
    display: block;
    margin-top: 3px;
    color: #7c8993;
    font-weight: 400;
}

.imp-grid td {
    min-width: 118px;
}

.imp-cell {
    width: 100%;
    min-height: 48px;
    padding: 8px 7px;
    border-radius: 10px;
    border: 1px solid #d6dee4;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease;
}

.imp-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 9px rgba(29, 56, 77, .10);
}

.imp-cell.estado-livre {
    background: #fff;
    color: #687985;
}

.imp-cell.estado-nao_pode {
    background: #fde4e4;
    border-color: #efb2b2;
    color: #a32828;
}

.imp-cell.estado-evitar {
    background: #e8eefb;
    border-color: #bdcdea;
    color: #355f9d;
}

.imp-cell.estado-quer {
    background: #e3f6e7;
    border-color: #b5dfbe;
    color: #2a703b;
}

.imp-cell.estado-precisa {
    background: #fff1c9;
    border-color: #e6cb7a;
    color: #805f0b;
}

.imp-grid-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.button-danger-outline {
    border: 1px solid #dfa8a8;
    background: #fff;
    color: #a33c3c;
}

.imp-preferences-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.imp-preferences-grid small,
.imp-daily-limits p {
    display: block;
    margin-top: 4px;
    color: #7a8791;
}

.imp-check-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.imp-check-group > label {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 40px;
}

.imp-daily-limits {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e4e9ed;
}

.imp-daily-limits h3 {
    margin: 3px 0 0;
    font-size: 16px;
}

.imp-daily-limits p {
    margin: 3px 0 12px;
}

.imp-daily-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    gap: 12px;
}

.imp-observation {
    margin-top: 16px;
}

.imp-observation textarea {
    width: 100%;
    resize: vertical;
}

.imp-sticky-save {
    position: sticky;
    bottom: 12px;
    z-index: 6;
    margin-top: 16px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid #dbe3e9;
    border-radius: 14px;
    box-shadow: 0 7px 24px rgba(20, 48, 72, .12);
    backdrop-filter: blur(6px);
}

.imp-sticky-save > div {
    display: grid;
    gap: 2px;
}

.imp-sticky-save span {
    color: #7b8790;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.imp-empty {
    padding: 26px;
    border: 1px dashed #cbd5dc;
    border-radius: 16px;
    background: #fafcfd;
}

.imp-empty h2 {
    margin-top: 0;
}

@media (max-width: 980px) {
    .imp-professor-bar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .imp-professor-load {
        justify-items: start;
    }

    .imp-preferences-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .imp-daily-grid {
        grid-template-columns: repeat(3, minmax(90px, 1fr));
    }
}

@media (max-width: 700px) {
    .imp-context {
        flex-direction: column;
        align-items: stretch;
    }

    .imp-period-tabs {
        width: 100%;
    }

    .imp-period-tabs a {
        flex: 1;
        text-align: center;
    }

    .imp-card-heading {
        flex-direction: column;
    }

    .imp-legend {
        justify-content: flex-start;
    }

    .imp-preferences-grid,
    .imp-daily-grid {
        grid-template-columns: 1fr;
    }

    .imp-sticky-save {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }
}
