/* DESIGN PREMIUM DO CALENDÁRIO */
.calendar-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Card de Filtros */
.filters-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--laranja-caixa);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.filters-card select {
    width: 100%;
    padding: 11px 38px 11px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--borda);
    background-color: #fff;
    color: var(--texto);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300366D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filters-card .form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--azul-caixa);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.filters-card select:focus {
    outline: none;
    border-color: var(--azul-caixa);
    box-shadow: 0 0 0 3px rgba(var(--primaria-escura-rgb), 0.14);
}

/* Controles do Mês */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 2px solid var(--fundo);
    box-shadow: var(--shadow-sm);
}

.calendar-controls .month-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--azul-caixa);
    text-transform: uppercase;
}

.calendar-controls .nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-nav {
    background: var(--fundo);
    border: 1px solid var(--borda);
    color: var(--azul-caixa);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    background: var(--azul-caixa);
    color: white;
    border-color: var(--azul-caixa);
    transform: scale(1.05);
}

.btn-today {
    background: var(--fundo);
    border: 1px solid var(--borda);
    color: var(--azul-caixa);
    min-height: 36px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-today:hover {
    background: var(--azul-claro);
    color: white;
    border-color: var(--azul-caixa);
}

.btn-danger {
    background: var(--perigo);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    gap: 6px;
    transition: background 0.2s, transform 0.15s;
}

.btn-danger:hover {
    background: #b52030;
    transform: translateY(-1px);
}

/* Container do Grid */
.calendar-grid-container {
    background: white;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 15px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    position: relative;
    min-height: 400px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 6px;
    min-width: 800px; /* Garante usabilidade no horizontal do mobile */
}

/* Cabe├ºalho dos Dias da Semana */
.weekday-header {
    text-align: center;
    padding: 8px 0;
    font-weight: 700;
    color: var(--texto-secundario);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--fundo);
}

.weekday-header:nth-child(7n), .weekday-header:nth-child(7n+1) {
    color: #ef4444; /* Vermelho suave para fins de semana */
}

/* C├®lula do Dia */
.day-cell {
    background: var(--fundo-sutil);
    border: 1px solid var(--fundo);
    border-radius: var(--radius-sm);
    min-height: 100px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
}

.day-cell.active-clickable {
    cursor: pointer;
}

.day-cell.active-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--azul-claro);
    background: #ffffff;
    z-index: 2;
}

.day-cell.other-month {
    opacity: 0.35;
    background: var(--fundo-hover) !important;
    cursor: not-allowed;
    pointer-events: none;
}

.day-number {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--texto);
    align-self: flex-end;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.day-cell.today {
    background: #f0fdf4;
    border: 2px solid var(--sucesso);
}

.day-cell.today .day-number {
    background: var(--sucesso);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 900;
}

/* Badges de Folhas */
.sheet-badges-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
    flex-grow: 1;
    justify-content: flex-start;
}

.sheet-badge {
    background: var(--azul-caixa);
    color: white;
    font-size: 0.72rem;
    padding: 4px 6px;
    border-radius: 6px;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    gap: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
}

.sheet-badge.positive {
    background: var(--sucesso);
}

.sheet-badge.negative {
    background: var(--perigo);
}

.sheet-badge .colab-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    font-size: 0.65rem;
    opacity: 0.95;
}

.sheet-badge .colab-name-short {
    display: none;
}

.sheet-badge .sheet-val {
    font-size: 0.72rem;
}

.sheet-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.repasse-micro-dot {
    font-size: 0.7rem;
    line-height: 1;
    padding: 1px 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}
.repasse-micro-dot.ok {
    color: #bbf7d0;
}
.repasse-micro-dot.erro {
    color: #fecaca;
    animation: pulseAlerta 1.4s infinite;
}
.repasse-micro-dot.ressalva {
    color: #fef08a;
}
.repasse-micro-dot.alerta {
    color: #fed7aa;
}
.repasse-micro-dot.pendente {
    color: #bae6fd;
}

@keyframes pulseAlerta {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Alertas e Status */
.missing-badge {
    background: rgba(220, 53, 69, 0.06);
    border: 1px dashed rgba(220, 53, 69, 0.35);
    color: var(--perigo);
    font-size: 0.68rem;
    padding: 3px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin-top: auto;
}

.sunday-cell {
    background: rgba(0,0,0,0.015) !important;
}

.sunday-label {
    font-size: 0.62rem;
    color: var(--texto-secundario);
    font-style: italic;
    text-align: center;
    margin-top: auto;
}

/* Spinner */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: var(--radius-md);
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid var(--fundo);
    border-top: 4px solid var(--azul-caixa);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

/* ===== FOLHA DE CAIXA VISUAL (MODAL) ===== */
.folha-header-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
    margin-bottom: 15px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--fundo-sutil) 0%, var(--fundo-hover) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--borda);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.folha-header-info .fh-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}
.folha-header-info .fh-lbl {
    font-weight: 800;
    color: var(--azul-caixa);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.folha-header-info .fh-val {
    font-weight: 700;
    color: var(--texto);
}

.folha-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    border: 1px solid var(--borda-forte);
    background-color: white;
    grid-auto-rows: 38px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm), 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 15px;
}
.folha-grid .fc {
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--borda-sutil);
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--texto);
    transition: background-color 0.15s ease;
}

/* Efeito hover de linha elegante */
.folha-grid:hover .fc {
    /* Adiciona sutil destaque visual */
}

.folha-grid .fc1 {
    border-right: 1px solid var(--borda-forte);
    justify-content: flex-start;
    padding-left: 12px;
    font-size: 0.72rem;
    font-weight: 750;
    color: #475569;
    text-transform: uppercase;
    background-color: var(--fundo-sutil); /* Diferencia a coluna de labels para um look premium */
}
.folha-grid .fc2 { 
    border-right: 1px solid var(--borda-forte); 
}

.folha-grid .fc-header {
    background-color: var(--azul-caixa);
    color: white !important;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 2.5px solid var(--laranja-caixa) !important;
    letter-spacing: 0.8px;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
}
.folha-grid .fc-header.fc1 { 
    border-right-color: rgba(255,255,255,0.25) !important; 
    background-color: var(--azul-caixa) !important;
    color: white !important;
}
.folha-grid .fc-header.fc2 { 
    border-right-color: rgba(255,255,255,0.25) !important; 
}

.folha-grid .fc-gray {
    background-color: var(--fundo-hover);
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.folha-grid .fc-span2 {
    grid-row: span 2;
    border-right: 1px solid var(--borda-forte);
    justify-content: flex-start;
    padding-left: 12px;
    font-size: 0.72rem;
    font-weight: 750;
    color: #475569;
    text-transform: uppercase;
    background-color: var(--fundo-sutil);
}

/* SALDO STYLING PREMIUM */
.folha-grid .fc-saldo-lbl {
    background-color: var(--fundo-hover);
    color: var(--azul-caixa);
    font-weight: 900;
    font-size: 0.88rem;
    border-top: 2px solid var(--borda-forte);
    border-bottom: none;
    letter-spacing: 0.5px;
}
.folha-grid .fc-saldo-val {
    grid-column: span 2;
    border-top: 2px solid var(--borda-forte);
    border-bottom: none;
    font-size: 1.15rem;
    font-weight: 900;
}

/* Classes dinâmicas para Saldo */
.folha-grid .fc-saldo-lbl.saldo-positivo,
.folha-grid .fc-saldo-val.saldo-positivo {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
}
.folha-grid .fc-saldo-lbl.saldo-negativo,
.folha-grid .fc-saldo-val.saldo-negativo {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
}

.folha-grid .fc-no-bb { 
    border-bottom: none !important; 
}

.folha-resumo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.folha-resumo .fr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--borda);
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}
.folha-resumo .fr-item .fr-lbl {
    font-weight: 700;
    color: var(--texto-secundario);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
}
.folha-resumo .fr-item .fr-val {
    font-weight: 850;
    color: var(--texto);
}
.folha-resumo .fr-comissao {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(var(--primaria-escura-rgb), 0.02) 0%, rgba(var(--primaria-escura-rgb), 0.06) 100%);
    border-color: rgba(var(--primaria-escura-rgb), 0.25);
}
.folha-resumo .fr-comissao .fr-lbl { 
    color: var(--azul-caixa); 
}
.folha-resumo .fr-comissao .fr-val { 
    color: var(--azul-caixa); 
    font-size: 0.95rem;
}

/* Admin - Edição Rápida */
.fc-admin-editable { cursor: pointer; position: relative; transition: background 0.15s; }
.fc-admin-editable::after { content: '✏️'; position: absolute; top: 2px; right: 3px; font-size: 0.52rem; color: var(--laranja-caixa); opacity: 0; transition: opacity 0.15s; }
@media (hover: hover) and (pointer: fine) {
    .fc-admin-editable:hover { background: rgba(255,130,0,0.09) !important; outline: 1px dashed var(--laranja-caixa); }
    .fc-admin-editable:hover::after { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
    .fc-admin-editable::after { opacity: 0.72; }
}
.fc-editing { background: rgba(var(--primaria-escura-rgb),0.06) !important; outline: 2px solid var(--azul-caixa) !important; border-radius: 3px; }

/* Destaque para campos preenchidos por IA */
.fc-val-auto {
    background-color: #f0fdf4 !important;
    color: #166534 !important;
    font-weight: 800 !important;
}
.fc-val-auto::after {
    content: ' ⚡';
    font-size: 0.65rem;
    color: #16a34a;
}

/* ===== NAVEGAÇÃO ENTRE FOLHAS (SWIPE / SETAS) ===== */
.folha-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px 10px;
    background: linear-gradient(135deg, var(--fundo-sutil) 0%, var(--fundo-hover) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--borda-sutil);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    user-select: none;
}

.btn-folha-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--azul-caixa);
    background: white;
    border: 1px solid var(--borda-forte);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
}

.btn-folha-nav:hover:not(:disabled) {
    background: var(--azul-caixa);
    color: white;
    border-color: var(--azul-caixa);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(var(--primaria-escura-rgb), 0.15);
}

.btn-folha-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--fundo-hover);
    color: #94a3b8;
    border-color: #e2e8f0;
}

.folha-nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    flex: 1;
}

.folha-nav-pos {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--azul-caixa);
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.folha-nav-hint {
    font-size: 0.62rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== CHIPS DE OPERADORAS DO MESMO DIA ===== */
.chips-operadoras-dia-container {
    margin-top: 4px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--fundo-sutil);
    border-radius: var(--radius-md);
    border: 1px solid var(--borda-sutil);
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.chips-dia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.chips-dia-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--azul-caixa);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.chips-dia-hint {
    font-size: 0.62rem;
    font-weight: 600;
    color: #64748b;
}
.chips-dia-scroll {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
}
.chip-operadora {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 750;
    background: white;
    color: var(--texto);
    border: 1.5px solid var(--borda-forte);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}
.chip-operadora:hover {
    border-color: var(--azul-caixa);
    background: #f0f9ff;
    color: var(--azul-caixa);
    transform: translateY(-1px);
}
.chip-operadora.active {
    background: var(--azul-caixa) !important;
    color: white !important;
    border-color: var(--azul-caixa) !important;
    box-shadow: 0 2px 5px rgba(var(--primaria-escura-rgb), 0.28);
}
.chip-operadora .chip-term {
    font-size: 0.68rem;
    font-family: monospace;
    padding: 1px 5px;
    border-radius: 10px;
    background: var(--fundo-hover);
    color: #475569;
}
.chip-operadora.active .chip-term {
    background: rgba(255, 255, 255, 0.22);
    color: white;
}

/* Botões Flutuantes Grandes nas Laterais (Desktop) */
.folha-desktop-arrow {
    display: none;
    background: white;
    color: var(--azul-caixa);
    border: 1.5px solid var(--borda-forte);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    flex-shrink: 0;
    z-index: 1010;
}

.folha-desktop-arrow:hover:not(:disabled) {
    background: var(--azul-caixa);
    color: white;
    border-color: var(--azul-caixa);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(var(--primaria-escura-rgb), 0.25);
}

.folha-desktop-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

@media (min-width: 681px) {
    #detail-modal {
        gap: 16px;
        align-items: center;
    }
    #detail-modal .hub-modal-content {
        margin: auto 0;
    }
    .folha-desktop-arrow {
        display: flex;
        align-self: center;
        position: sticky;
        top: calc(50vh - 24px);
    }
}

/* Animações de Transição de Folha */
@keyframes folhaSlideInRight {
    from { opacity: 0.4; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes folhaSlideInLeft {
    from { opacity: 0.4; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.folha-anim-next {
    animation: folhaSlideInRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.folha-anim-prev {
    animation: folhaSlideInLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile adaptions */
@media (max-width: 768px) {
    .calendar-wrapper.container {
        padding: 0 4px !important;
    }
    .filters-card {
        padding: 10px 12px;
        margin-bottom: 10px;
        gap: 8px;
        grid-template-columns: 1fr 1fr;
    }
    .filters-card .form-group label {
        font-size: 0.68rem;
        font-weight: 800;
        color: var(--azul-caixa);
        text-transform: uppercase;
        margin-bottom: 3px;
        display: block;
        white-space: nowrap;
    }
    .filters-card .lbl-prefixo {
        display: none;
    }
    .filters-card select {
        padding: 8px 26px 8px 10px;
        font-size: 0.82rem;
        background-position: right 9px center;
    }
    .calendar-controls {
        padding: 10px 12px;
        gap: 6px;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }
    .calendar-controls .month-title {
        font-size: 0.96rem;
        white-space: nowrap;
        letter-spacing: -0.3px;
    }
    #cal-sync-badge {
        white-space: nowrap !important;
        font-size: 0.62rem !important;
        padding: 2px 6px !important;
        flex-shrink: 0;
    }
    .calendar-controls .nav-buttons {
        gap: 4px;
        flex-shrink: 0;
    }
    .btn-nav {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .btn-today {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    .calendar-grid-container {
        padding: 8px 3px !important;
        overflow-x: hidden !important; /* Nunca cortar lateralmente em mobile! */
        min-height: 380px; /* Evita colapso: o overlay de loading usa height:100% deste container */
    }
    .calendar-grid {
        min-width: 0 !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 3px !important;
    }
    .weekday-header {
        font-size: 0.68rem;
        padding: 4px 0;
        font-weight: 800;
    }
    .day-cell {
        min-height: 70px;
        padding: 3px 2px;
        border-radius: 4px;
    }
    .day-number {
        font-size: 0.75rem;
        font-weight: 800;
    }
    .day-cell.today .day-number {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
    .sheet-badges-container {
        gap: 2px;
        margin-top: 2px;
    }
    .sheet-badge {
        padding: 2px 3px;
        border-radius: 4px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 2px;
        box-shadow: none;
    }
    .sheet-badge .colab-name {
        display: none;
    }
    /* Quando o filtro está em "Todos os Colaboradores", exibe o primeiro nome curto no mobile */
    .calendar-grid.modo-todos .sheet-badge {
        flex-direction: column;
        align-items: stretch;
        gap: 0px;
        padding: 2px 3px;
    }
    .calendar-grid.modo-todos .sheet-badge .sheet-badge-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1px;
    }
    .calendar-grid.modo-todos .sheet-badge .colab-name {
        display: inline-block;
        font-size: 0.5rem;
        font-weight: 800;
        letter-spacing: -0.2px;
        line-height: 1.05;
        opacity: 0.92;
        max-width: 100%;
    }
    .calendar-grid.modo-todos .sheet-badge .colab-name-full {
        display: none;
    }
    .calendar-grid.modo-todos .sheet-badge .colab-name-short {
        display: inline;
    }
    .sheet-badge .sheet-val {
        font-size: 0.6rem;
        text-align: center;
        font-weight: 900;
        letter-spacing: -0.2px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sheet-badge.negative .repasse-micro-dot.ok {
        color: #ffffff;
    }
    .repasse-micro-dot {
        font-size: 0.55rem;
        padding: 0;
    }
    .missing-badge {
        font-size: 0.5rem;
        padding: 2px 1px;
        white-space: nowrap;
        letter-spacing: -0.2px;
    }
    .missing-badge i {
        display: none;
    }
    .sunday-label {
        font-size: 0.52rem;
    }
    .folha-header-info {
        grid-template-columns: 1fr;
    }
    .folha-resumo {
        grid-template-columns: 1fr;
    }
    .folha-resumo .fr-comissao {
        grid-column: span 1;
    }

    /* Modal de detalhe da folha — scroll completo em mobile */
    #detail-modal.hub-modal-overlay {
        align-items: flex-start !important;
        padding: 10px !important;
    }
    #detail-modal .hub-modal-content {
        max-height: 90vh !important;
        max-height: 90dvh !important;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-lg) !important;
        margin-top: 10px;
        display: block !important;
    }
    .folha-grid {
        grid-auto-rows: 34px;
    }
}
