/* --- ESTILOS ESPECÍFICOS PARA GRADE DE AULAS (schedule.css) --- */

.schedule-table {
    border-collapse: collapse; /* Mudar para collapse para bordas mais limpas */
    width: 100%;
    table-layout: fixed; /* Fixa as larguras das colunas */
}

.schedule-table th,
.schedule-table td {
    padding: 0.4rem; /* Reduzir um pouco o padding */
    height: 65px; /* Ajustar altura para um visual melhor */
    text-align: center;
    vertical-align: middle; /* Centraliza o conteúdo verticalmente */
    font-size: 0.85rem;
    border: 1px solid #e9ecef; /* Bordas mais suaves */
}

.schedule-table th {
    background-color: var(--theme-sidebar-hover-bg); /* Cor do tema para o cabeçalho */
    font-variant: small-caps;
    font-weight: bold;
    color: var(--theme-sidebar-active-text); /* Cor do texto do tema para o cabeçalho */
    white-space: nowrap; /* Evita quebra de linha nos dias */
}

.schedule-table td:first-child {
    width: 90px; /* Largura fixa e um pouco menor para a coluna de horário */
    font-weight: bold;
    background-color: #f8f9fa; /* Fundo neutro para horários */
    color: #6c757d; /* Cor mais suave para o texto do horário */
    border-right: 1px solid #dee2e6;
    font-size: 0.8rem; /* Reduzir um pouco o tamanho do horário */
}

/* Estilo para as células droppable quando um item está sobre elas */
.droppable-cell.ui-state-hover {
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1); /* Sombra clara */
    background-color: rgba(0, 0, 0, 0.03); /* Leve fundo para indicar drop */
}

/* Estilo para os itens arrastáveis na lista de atividades */
.activity-item {
    cursor: grab;
    margin-bottom: 5px;
    font-size: 0.85rem; /* Um pouco menor */
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    border-radius: 0.3rem; /* Bordas levemente arredondadas */
    transition: background-color 0.2s; /* Transição suave no hover */
}

.activity-item:hover {
    background-color: var(--theme-sidebar-hover-bg); /* Cor do tema no hover */
}

.activity-item .activity-badge {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    flex-shrink: 0; /* Impede que o badge encolha */
}

/* Estilo para os itens de aula agendados dentro da grade */
.scheduled-activity {
    min-height: 100%; /* Garante que o div ocupa toda a altura da célula */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer; /* Indica que é clicável para edição/remoção */
    padding: 0.2rem;
    border-radius: 0.25rem; /* Arredonda as bordas da aula agendada */
    overflow: hidden; /* Garante que o texto não vaze */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Sombra leve para destacar */
    font-size: 0.75rem; /* Texto menor dentro da célula */
    line-height: 1.2;
}

.scheduled-activity strong {
    font-weight: 600; /* Um pouco mais de peso */
}
.scheduled-activity span {
    font-size: 0.65rem; /* Texto ainda menor para o professor/aluno */
    opacity: 0.9;
}

/* Cores de fundo para os tipos de serviço no card de atividades e na grade */
/* Ajustadas para melhor contraste ou tonalidade */
.scheduled-activity.bg-warning, .activity-badge.bg-warning { background-color: #ffda6a !important; color: #333 !important; } /* Amarelo mais suave */
.scheduled-activity.bg-info, .activity-badge.bg-info { background-color: #74d9f6 !important; color: #333 !important; } /* Azul claro mais suave */
.scheduled-activity.bg-success, .activity-badge.bg-success { background-color: #82e0aa !important; color: #333 !important; } /* Verde claro mais suave */
.scheduled-activity.bg-danger, .activity-badge.bg-danger { background-color: #f7a8b8 !important; color: #333 !important; } /* Rosa claro mais suave */

/* Estilos para o helper do draggable (a cópia que é arrastada) */
.ui-draggable-dragging {
    opacity: 0.8;
    border: 1px dashed #666;
    background-color: #f8f9fa; /* Fundo mais neutro para o arrasto */
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    width: auto !important; /* Força a largura para auto */
    min-width: 120px; /* Reduzir um pouco o min-width */
    max-width: 180px; /* Reduzir um pouco o max-width */
}
.ui-draggable-dragging .activity-badge {
    display: inline-block; /* Mantém o badge visível durante o arrasto */
    margin-right: 0.5rem;
}

/* Ocultar células da tabela que estão sendo "mescladas" por um rowspan */
.schedule-table td[rowspan][style*="display: none"] {
    display: none !important;
}

/* Altura fixa para a coluna de atividades para melhor alinhamento */
#activity-list.list-group {
    max-height: calc(100vh - 280px); /* Ajuste conforme necessário para o seu layout */
    overflow-y: auto; /* Adiciona scroll se a lista for muito longa */
}

/* Garante que modais fiquem acima de elementos em tela cheia */
.modal {
    z-index: 1050 !important; /* Valor padrão do Bootstrap para modais é 1050, mas garantir com !important */
}

.modal-backdrop {
    z-index: 1040 !important; /* Valor padrão do Bootstrap para o backdrop é 1040 */
}

/* Adicional: Garante que o card em fullscreen tenha um z-index elevado */
.card:-webkit-full-screen,
.card:-moz-full-screen,
.card:-ms-fullscreen,
.card:fullscreen {
    z-index: 9999 !important; /* Um valor alto para o elemento em fullscreen */
    background-color: var(--theme-content-bg); /* Garante que o fundo seja consistente */
    display: flex; /* Para centralizar o conteúdo se necessário */
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.schedule-prof-grid th,
.schedule-prof-grid td {
    text-align: center;
    vertical-align: top;
    min-width: 138px;
}

.grid-toolbar {
    border: 1px solid #e1e8f5;
    border-radius: 10px;
    background: linear-gradient(180deg, #f9fbff 0%, #f5f8ff 100%);
    padding: 12px;
    margin: 0 0 12px 0;
}

.grid-view-switch .btn {
    min-width: 62px;
}

.grid-toolbar .form-label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #425069;
    text-transform: uppercase;
}

.grid-types-panel {
    border: 1px solid #d8e2f3;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    min-height: 100%;
}

.grid-type-item {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.grid-type-item:last-child {
    margin-bottom: 0;
}

/* Chips horizontais (faixa «Tipos de aula») */
.grid-type-chip.grid-type-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    white-space: nowrap;
}

.grid-type-chip.grid-type-item span {
    pointer-events: none;
}

.schedule-prof-grid {
    border: 1px solid #d8e2f3;
    border-radius: 10px;
    overflow: hidden;
}

.schedule-prof-grid thead th {
    background: #f5f8ff;
    border-color: #d8e2f3;
    position: sticky;
    top: 0;
    z-index: 2;
}

.schedule-prof-grid .day-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
    align-items: center;
}

.schedule-prof-grid .day-head small {
    font-weight: 600;
    color: #5f6b7a;
}

.schedule-prof-grid th.current-day-head {
    background: #e8f1ff;
    box-shadow: inset 0 -2px 0 #2f7df6;
}

.schedule-prof-grid .time-col {
    width: 118px;
    font-weight: 700;
    white-space: nowrap;
    background: #f8f9fa;
    color: #253247;
    position: sticky;
    left: 0;
    z-index: 1;
}

.schedule-prof-grid tbody tr:not(.schedule-slot-expand) {
    height: 34px;
}

/* Linha do painel «Neste horário»: altura pelo conteúdo, não pela grade (66px) */
.schedule-prof-grid tbody tr.schedule-slot-expand {
    height: auto;
}

.schedule-prof-cell {
    cursor: pointer;
    min-height: 32px;
    background: #fff;
    transition: background-color .15s ease;
    padding: 0;
    border-color: #e5ebf5;
}

.schedule-prof-cell.merged-cell {
    position: relative;
    padding: 0 !important;
    vertical-align: stretch;
    overflow: hidden;
}

.schedule-prof-cell:hover {
    background: #f1f6ff;
}

.schedule-prof-cell.current-day-cell:not(.merged-cell) {
    background: #f6faff;
}

.schedule-prof-cell.drop-hover {
    background: #eaf2ff !important;
    outline: 2px dashed #87a7df;
    outline-offset: -3px;
}

.schedule-prof-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    height: 100%;
    padding: 0;
}

.schedule-prof-cell.merged-cell > .schedule-prof-items {
    position: absolute;
    inset: 0;
    display: flex;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Dois cartões na pré-visualização: empilhar com altura mínima (lista completa no modal). */
.schedule-prof-cell.merged-cell > .schedule-prof-items.schedule-prof-items--many {
    overflow: visible;
    justify-content: flex-start;
    align-items: stretch;
}

.schedule-prof-items--many .schedule-prof-item.merged {
    flex: 0 0 auto;
    min-height: 44px;
    height: auto;
    max-height: none;
}

.schedule-prof-items--many .schedule-prof-item:not(.merged) {
    flex: 0 0 auto;
    min-height: 40px;
    height: auto;
    max-height: none;
}

.schedule-prof-items--many .schedule-prof-item strong,
.schedule-prof-items--many .schedule-prof-item small {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
}

.schedule-prof-cell:not(.merged-cell) > .schedule-prof-items.schedule-prof-items--many {
    overflow: visible;
    padding: 4px;
}

.schedule-prof-item {
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    overflow: hidden;
}

.schedule-prof-item.merged {
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 10px;
    margin: 0;
    box-shadow: none;
}

.schedule-prof-item strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 2px;
}

.schedule-prof-item small {
    display: block;
    opacity: .9;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 10px;
}

.text-bg-purple {
    background-color: #6f42c1 !important;
    color: #fff !important;
}

.schedule-prof-grid tbody tr:nth-child(even) .schedule-prof-cell:not(.merged-cell) {
    background: #fcfdff;
}

.schedule-prof-grid tbody tr.current-hour-row .schedule-prof-cell:not(.merged-cell) {
    background: #eef5ff;
}

.schedule-prof-grid .time-col.current-hour-time {
    background: #dfeeff;
    color: #1f4f99;
}

.schedule-prof-grid .schedule-prof-cell.current-hour-cell {
    box-shadow: inset 0 0 0 2px #2f7df6;
    background: #e4f0ff !important;
}

.schedule-prof-month-grid {
    border: 1px solid #d8e2f3;
    border-radius: 10px;
    overflow: hidden;
}

.schedule-prof-month-grid th {
    background: #f5f8ff;
    border-color: #d8e2f3;
    text-align: center;
    font-weight: 700;
}

.schedule-prof-month-grid td {
    border-color: #e5ebf5;
    vertical-align: top;
    width: 14.285%;
    height: 140px;
    background: #fff;
}

.schedule-month-cell {
    cursor: pointer;
    padding: 6px;
}

.schedule-month-cell:hover {
    background: #f4f8ff;
}

.schedule-month-day {
    font-size: 12px;
    font-weight: 700;
    color: #253247;
    margin-bottom: 4px;
}

.month-today {
    box-shadow: inset 0 0 0 2px #2f7df6;
    background-color: #f3f8ff !important;
}

.month-day-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #2f7df6;
    color: #fff;
}

.schedule-month-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
}

.schedule-month-item {
    border-radius: 6px;
    font-size: 10px;
    padding: 4px 6px;
    line-height: 1.25;
    cursor: pointer;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
}

.schedule-month-line1 {
    display: block;
    font-weight: 600;
}

.schedule-month-line2 {
    display: block;
    opacity: 0.92;
    font-size: 9px;
    margin-top: 2px;
    font-weight: 500;
}

.schedule-month-more {
    font-size: 10px;
    color: #60708a;
    font-weight: 600;
}

.month-empty {
    background: #f8faff !important;
}

.month-blocked {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(130, 145, 169, 0.1),
        rgba(130, 145, 169, 0.1) 8px,
        rgba(255, 255, 255, 0.65) 8px,
        rgba(255, 255, 255, 0.65) 16px
    ) !important;
}

.schedule-month-blocked-label {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #6c7a91;
    text-transform: uppercase;
}

/* --- Grade por professor: toolbar (padrão formulários), tipos em faixa, detalhe inline --- */

.schedule-hero-bar {
    background: linear-gradient(165deg, #eef6ff 0%, #f5f9ff 48%, #ffffff 100%);
    border: 1px solid rgba(var(--ui-accent-rgb), 0.12);
    border-radius: 0.65rem;
    box-shadow: 0 6px 28px rgba(37, 50, 71, 0.06);
    padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
    .schedule-hero-bar {
        padding: 0.85rem 1.25rem;
    }
}

.schedule-form-toolbar .form-label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #425069;
    text-transform: uppercase;
}

.schedule-form-toolbar .form-control,
.schedule-form-toolbar .form-select {
    border-radius: 9px;
    border-color: rgba(0, 0, 0, 0.14);
}

.schedule-form-toolbar .form-control:focus,
.schedule-form-toolbar .form-select:focus {
    border-color: var(--ui-accent);
    box-shadow: none;
}

.schedule-f-group {
    display: flex;
    flex-direction: column;
}

.schedule-toolbar-line {
    row-gap: 0.65rem;
}

.schedule-nav-btn {
    min-width: 2.35rem;
    border-radius: 0.45rem !important;
}

.schedule-period-label {
    font-size: clamp(0.85rem, 1.1vw, 1.05rem);
    font-weight: 600;
    color: #1a2740;
    line-height: 1.35;
}

.grid-view-switch .btn {
    min-width: 3.75rem;
}

/* Referência: largura confortável, alinhada aos demais forms */
.schedule-f-ref {
    min-width: 10.5rem;
    max-width: 12.5rem;
}

/*
 * Grade + «Tipos de aula»: CSS Grid garante a mesma altura das duas colunas no desktop
 * (evita falha do flex row/col Bootstrap com col-lg-auto).
 */
.schedule-calendar-split {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

@media (min-width: 992px) {
    .schedule-calendar-split {
        grid-template-columns: minmax(0, 1fr) 11.75rem;
    }

    /* Vista mês: lateral oculto — uma coluna ocupa 100% */
    .schedule-calendar-split.schedule-calendar-split--full {
        grid-template-columns: minmax(0, 1fr);
    }
}

.schedule-calendar-split-main {
    min-width: 0;
}

.schedule-calendar-split-sidebar {
    width: 100%;
    min-height: 0;
}

.schedule-types-sidebar {
    width: 100%;
}

/* Moldura alinhada a .schedule-prof-grid (borda #d8e2f3, cantos 10px); ocupa toda a célula do grid */
.schedule-types-lateral-shell {
    border: 1px solid #d8e2f3;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    min-height: 100%;
    height: 100%;
}

/* Faixa de título + dica curta */
.schedule-types-lateral-head {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: #f5f8ff;
    border-bottom: 1px solid #d8e2f3;
    padding: 0.4rem 0.35rem;
    text-align: center;
}

.schedule-types-lateral-head-main {
    margin: 0;
    font-weight: 700;
    font-size: 0.8125rem;
    color: #253247;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.schedule-types-lateral-head-hint {
    margin: 0;
    font-size: 0.625rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.schedule-types-lateral-body {
    flex: 1 1 auto;
    padding: 10px;
    min-height: 0;
    background: #fff;
}

/* Chips no lateral: retângulos suaves (não pílula) */
.schedule-types-lateral-shell .schedule-types-chips .grid-type-chip.grid-type-item {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 12px;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.schedule-workspace {
    width: 100%;
}

.schedule-grid-scroll {
    border-radius: 0.5rem;
    border: 1px solid #e5ebf5;
    background: #fff;
}

.schedule-density-more {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.25;
}

/* Linha expansível dentro da tabela da semana */
tr.schedule-slot-expand > td.schedule-slot-expand-cell {
    border-top: none !important;
    vertical-align: top;
}

.schedule-inline-expand-card {
    background: #fafcff;
}

/* Lista anexo: barra de título baixa; padding definido aqui (evita .card-header alto do Bootstrap) */
.schedule-inline-expand-card--compact .schedule-inline-expand-head.card-header {
    border-radius: 0;
    padding: 0.3rem 1rem;
    min-height: 0;
    --bs-card-cap-padding-y: 0.3rem;
    --bs-card-cap-padding-x: 1rem;
}

.schedule-inline-expand-card--compact .schedule-inline-expand-head.card-header h6 {
    font-size: 0.9375rem;
    line-height: 1.25;
}

.schedule-inline-expand-card.rounded-3 > .schedule-inline-expand-head.card-header:first-child {
    border-top-left-radius: var(--bs-border-radius-lg, 0.5rem);
    border-top-right-radius: var(--bs-border-radius-lg, 0.5rem);
}

.schedule-inline-expand-card--compact .schedule-inline-expand-table-wrap {
    padding: 1rem 1rem 0.75rem;
}

.schedule-inline-expand-card--compact .schedule-inline-expand-foot {
    padding: 0.5rem 1rem 0.75rem;
    line-height: 1.45;
    font-size: 0.8125rem;
}

.schedule-inline-expand-card--compact .schedule-inline-list-table {
    --bs-table-cell-padding-y: 0.42rem;
    --bs-table-cell-padding-x: 0.55rem;
    font-size: 0.875rem;
    line-height: 1.35;
    margin-bottom: 0;
    border-collapse: collapse;
}

/* Cabeçalho de colunas: mesma altura de linha que o corpo (padding-y + line-height idênticos) */
.schedule-inline-expand-card--compact .schedule-inline-list-table thead th,
.schedule-inline-expand-card--compact .schedule-inline-list-table tbody td {
    padding: 0.42rem 0.55rem !important;
    line-height: 1.35 !important;
    vertical-align: middle;
    font-size: 0.875rem;
}

.schedule-inline-expand-card--compact .schedule-inline-list-table thead th {
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    border-bottom: 1px solid #dee2e6;
}

.schedule-inline-expand-card--compact .schedule-inline-list-table tbody tr {
    height: auto;
}

.schedule-inline-expand-card--compact .schedule-inline-list-table .btn-sm {
    padding: 0.28rem 0.55rem;
    font-size: 0.8125rem;
    line-height: 1.25;
}

.schedule-inline-table:not(.schedule-inline-list-table) {
    font-size: 0.95rem;
}

.schedule-inline-table:not(.schedule-inline-list-table) th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.schedule-inline-table td {
    vertical-align: middle;
}

.schedule-month-expand-holder {
    max-width: 100%;
}

/* --- Grade por professor: padrão leads-hub (proporcional ao cadastro de leads) --- */

.schedule-grid-page {
    margin-top: -0.5rem;
}

.schedule-grid-page .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.2rem;
    text-transform: none;
    letter-spacing: normal;
}

.schedule-grid-page .form-control-sm,
.schedule-grid-page .form-select-sm {
    font-size: 0.8125rem;
    border-radius: 0.25rem;
    border-color: var(--bs-border-color, #dee2e6);
}

.schedule-grid-page .schedule-grid-filters {
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 0.55rem 0.75rem 0.65rem;
}

.schedule-grid-page .schedule-grid-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.schedule-grid-page .schedule-grid-filters-title {
    font-size: 0.8125rem;
    color: #6c757d;
    font-weight: 600;
}

.schedule-grid-page .schedule-grid-filters-sub {
    font-size: 0.68rem;
    line-height: 1.2;
    color: #adb5bd;
}

.schedule-grid-page .schedule-grid-filters .form-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.schedule-grid-page .schedule-grid-filters #grid-filtros-limpar {
    white-space: nowrap;
    flex-shrink: 0;
}

.schedule-grid-page .schedule-grid-filters .select2-container {
    width: 100% !important;
}

.schedule-grid-page .card {
    overflow: visible;
}

/*
 * Botões da linha de filtros (Hoje, < >, Mês/Semana/Dia): tamanho natural de
 * botão sm — o padding define a altura (sem height fixo herdado da combo) e o
 * rótulo fica centralizado horizontal e verticalmente.
 */
.schedule-grid-page .schedule-grid-filters .btn.leads-btn,
.schedule-grid-page .schedule-grid-filters .btn.leads-btn-icon,
.schedule-grid-page .schedule-grid-period-nav .btn.leads-btn,
.schedule-grid-page .schedule-grid-period-nav .btn.leads-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0.25rem 0.6rem !important;
    line-height: 1.5 !important;
}

/* Botões de ícone (< >): quadrado proporcional à altura dos botões de texto */
.schedule-grid-page .schedule-grid-filters .btn.leads-btn-icon,
.schedule-grid-page .schedule-grid-period-nav .btn.leads-btn-icon {
    width: auto !important;
    min-width: calc(1.17rem + 0.5rem + 2px) !important;
    max-width: none !important;
    min-height: calc(1.17rem + 0.5rem + 2px) !important;
    padding: 0.25rem 0.4rem !important;
}

/* Legenda discreta no rodapé da grade: marcador pequeno + texto neutro */
.schedule-grid-page .schedule-grid-legend {
    gap: 0.35rem 0.85rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.schedule-legend-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6c7a91;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.schedule-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: #495057;
    line-height: 1.3;
    white-space: nowrap;
}

.schedule-legend-dot {
    display: inline-block;
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* O marcador herda só o fundo das classes de cor (sem texto/padding) */
.schedule-legend-dot[class*="text-bg-"] {
    color: transparent !important;
    font-size: 0;
}

/* Cabeçalho do intervalo: período centralizado entre as setas de navegação */
.schedule-grid-page .schedule-grid-period-nav {
    min-height: 0;
}

.schedule-grid-page .schedule-period-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #253247;
    line-height: 1.3;
    min-width: 15rem;
    max-width: 100%;
}

.schedule-grid-page .grid-view-switch .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.schedule-grid-page .schedule-nav-btn {
    flex-shrink: 0;
}

.schedule-grid-page .schedule-prof-grid th,
.schedule-grid-page .schedule-prof-grid td {
    min-width: 0;
}

.schedule-grid-page .schedule-prof-grid tbody tr:not(.schedule-slot-expand) {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
}

.schedule-grid-page .schedule-prof-grid tbody tr:not(.schedule-slot-expand) > td {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    vertical-align: middle;
}

.schedule-grid-page .schedule-prof-grid .time-col {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    font-size: 0.72rem;
}

.schedule-grid-page .schedule-prof-grid thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.schedule-grid-page .schedule-prof-item {
    padding: 4px 6px;
    font-size: 10px;
    border-radius: 6px;
    box-shadow: none;
}

.schedule-grid-page .schedule-prof-item strong {
    font-size: 10px;
    line-height: 1.15;
}

.schedule-grid-page .schedule-prof-item small {
    font-size: 9px;
    line-height: 1.15;
}

.schedule-grid-page .schedule-prof-grid {
    width: 100%;
    table-layout: fixed;
}

.schedule-grid-page .schedule-prof-month-grid td {
    height: 110px;
}

/* Com muitas aulas no dia, o conteúdo transbordava sobre as células vizinhas.
   O excesso já é tratado pelo botão «+N mais». */
.schedule-grid-page .schedule-month-items {
    overflow: hidden;
}

/* Chip compacto de 1 linha (mês): hora · aluno · professor, com ellipsis */
.schedule-month-item--compact {
    padding: 2px 6px;
}

.schedule-month-item--compact .schedule-month-compact-line {
    display: block;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Opções dos dropdowns Select2 proporcionais ao controle sm
   (!important necessário: style.css força padding/fonte globais nas opções) */
.schedule-grid-select2-drop .select2-results__option {
    padding: 3px 8px !important;
    font-size: 0.78rem !important;
    line-height: 1.45 !important;
    min-height: 0 !important;
}

.schedule-grid-select2-drop .select2-search--dropdown .select2-search__field {
    padding: 3px 6px;
    font-size: 0.8125rem;
}

.schedule-grid-page .schedule-grid-scroll {
    overflow-x: hidden;
}

.schedule-grid-page .schedule-prof-cell--blank {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

.schedule-grid-page .schedule-prof-cell.merged-cell {
    height: 1px;
    padding: 0 !important;
    vertical-align: top;
    position: relative;
    overflow: visible;
}

.schedule-grid-page .schedule-prof-cell.merged-cell > .schedule-prof-items {
    position: absolute;
    inset: 0;
    padding: 3px;
    box-sizing: border-box;
    overflow: hidden !important;
    overflow-y: hidden !important;
    display: flex;
    align-items: stretch;
}

.schedule-grid-page .schedule-prof-item.merged {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    border-radius: 8px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.schedule-grid-page .schedule-prof-item.merged strong,
.schedule-grid-page .schedule-prof-item.merged small {
    white-space: normal;
    line-height: 1.25;
    overflow: hidden;
}

.schedule-grid-page .schedule-prof-item-time {
    font-weight: 700;
    opacity: 1;
}

.schedule-grid-page .schedule-grid-empty-row .time-col {
    background: #f8f9fa;
    vertical-align: middle;
}

.schedule-grid-page .schedule-grid-empty-row .schedule-prof-cell.schedule-grid-empty,
.schedule-grid-page .schedule-prof-month-grid .schedule-grid-empty-row td.schedule-grid-empty {
    min-height: 96px;
    vertical-align: middle;
    background: #fff;
    border-color: #e5ebf5;
}

.schedule-grid-page .schedule-grid-empty {
    font-size: 0.9rem;
}

#schedule-grid-modal .modal-dialog {
    max-width: 900px;
    width: calc(100% - 2rem);
}

#schedule-grid-modal.grid-modal-readonly .form-control:disabled,
#schedule-grid-modal.grid-modal-readonly .form-select:disabled {
    background-color: #e9ecef;
    color: #495057;
    opacity: 1;
    cursor: not-allowed;
}

#schedule-grid-modal.grid-modal-readonly .form-check-input:disabled {
    opacity: 0.55;
}

.schedule-prof-bands {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.schedule-prof-band {
    border: 1px solid #e5ebf5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.schedule-prof-band-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.75rem;
    background: #f6f3ff;
    border-bottom: 1px solid #ece6f8;
}

.schedule-prof-band-name {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #2a1650;
}

.schedule-prof-band-meta {
    font-size: 0.72rem;
    color: #6c7a91;
    font-weight: 600;
}

.schedule-prof-item.mod-on { background: #2563eb; color: #fff; }
.schedule-prof-item.mod-hb { background: #16a34a; color: #fff; }
.schedule-prof-item.mod-pr { background: #eab308; color: #1f2937; }
.schedule-prof-item.mod-ah { background: #c4b5fd; color: #2e1064; }
.schedule-prof-item.mod-ic { background: #7c3aed; color: #fff; }
.schedule-prof-item.mod-unknown { background: #6c757d; color: #fff; }

.schedule-month-item.mod-on { background: #2563eb; color: #fff; }
.schedule-month-item.mod-hb { background: #16a34a; color: #fff; }
.schedule-month-item.mod-pr { background: #eab308; color: #1f2937; }
.schedule-month-item.mod-ah { background: #c4b5fd; color: #2e1064; }
.schedule-month-item.mod-ic { background: #7c3aed; color: #fff; }

.schedule-legend-dot.mod-on { background: #2563eb; }
.schedule-legend-dot.mod-hb { background: #16a34a; }
.schedule-legend-dot.mod-pr { background: #eab308; }
.schedule-legend-dot.mod-ah { background: #c4b5fd; }
.schedule-legend-dot.mod-ic { background: #7c3aed; }

.schedule-item-sigla,
.schedule-item-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}

.schedule-item-sigla {
    background: rgba(255, 255, 255, 0.28);
}

.schedule-item-tag {
    background: rgba(0, 0, 0, 0.18);
}

.schedule-prof-item.mod-pr .schedule-item-sigla,
.schedule-prof-item.mod-ah .schedule-item-sigla {
    background: rgba(0, 0, 0, 0.12);
}

.schedule-prof-item.mod-pr .schedule-item-tag,
.schedule-prof-item.mod-ah .schedule-item-tag {
    background: rgba(0, 0, 0, 0.14);
}

.schedule-prof-band-alert {
    margin: 0 0.75rem 0.6rem;
    font-size: 0.82rem;
}

.schedule-prof-band-alert .schedule-conflict-block + .schedule-conflict-block {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(146, 64, 14, 0.35);
}

.schedule-inline-conflict {
    background: #fff8eb;
    border-top: 1px solid #f3d19e;
}

.schedule-conflict-suggest .badge {
    font-weight: 600;
    color: #334155;
}

.schedule-prof-cell--conflict {
    background: #fef2f2;
}

.schedule-prof-item.is-conflict {
    box-shadow: inset 0 0 0 2px #dc2626;
}

.schedule-item-conflict-flag {
    display: inline-block;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #dc2626;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
}

.schedule-grid-page .schedule-grid-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.schedule-legend-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.schedule-legend-tag {
    display: inline-flex;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef1f6;
    color: #334155;
}

@media (max-width: 575.98px) {
    .schedule-grid-page .leads-page-actions {
        width: 100%;
    }

    .schedule-grid-page .leads-page-actions .leads-btn:not(.leads-btn-icon) {
        flex: 1 1 auto;
    }
}