/**
 * gestao_leitos.css — Estilos do módulo Gestão de Leitos
 * Versão: 2.0 — 03/03/2026
 */

/* ── Botão Click2Call de Ramal ───────────────────────────────────── */
.gl-btn-ramal {
    background: rgba(43,115,225,0.1);
    color: var(--gl-col-primary, #60a5fa);
    border: 1px solid rgba(43,115,225,0.3);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}
.gl-btn-ramal:hover {
    background: rgba(43,115,225,0.2);
    border-color: rgba(43,115,225,0.5);
}
.light-mode .gl-btn-ramal {
    background: rgba(43,115,225,0.05);
    color: #2563eb;
    border-color: rgba(43,115,225,0.2);
}
.light-mode .gl-btn-ramal:hover {
    background: rgba(43,115,225,0.15);
}

/* ── Container Principal ───────────────────────────────────────── */
.gl-container {
    padding: 0 1rem 2rem;
    width: 100%;
}

/* ── Header ────────────────────────────────────────────────────── */
.gl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.gl-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}

.gl-header-left i {
    font-size: 1.3rem;
    opacity: 0.7;
}

.gl-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Toggle Grid/Card ─────────────────────────────────────────── */
.gl-view-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.gl-view-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.gl-view-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

.gl-view-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.gl-view-btn i {
    font-size: 1rem;
}

/* ── Dropdowns Filtro ─────────────────────────────────────────── */
.gl-dropdowns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gl-multiselect-wrap {
    position: relative;
}

.gl-multiselect-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gl-multiselect-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Light mode — botão */
.light-mode .gl-multiselect-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

.light-mode .gl-multiselect-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.gl-multiselect-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.5rem;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    max-height: 280px;
    overflow-y: auto;
    color: #e2e8f0;
}

/* Light mode — panel */
.light-mode .gl-multiselect-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

.gl-multiselect-panel.open {
    display: block;
}

.gl-multiselect-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.15s;
}

.gl-multiselect-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.light-mode .gl-multiselect-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.gl-multiselect-item.selected {
    background: rgba(99, 102, 241, 0.15);
}

.light-mode .gl-multiselect-item.selected {
    background: rgba(99, 102, 241, 0.12);
}

.gl-multiselect-item input {
    accent-color: #6366f1;
    cursor: pointer;
}

.gl-dropdowns-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.25rem;
}

.light-mode .gl-dropdowns-sep {
    background: rgba(0, 0, 0, 0.1);
}

.gl-caret {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* ── Botão Novo Evento ────────────────────────────────────────── */
.gl-btn-new {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.gl-btn-new:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.gl-btn-new i {
    font-size: 1rem;
}

/* ── KPI Dashboard ────────────────────────────────────────────── */
.gl-dashboard {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    padding: 0 0 0.85rem;
    margin-bottom: 0.5rem;
}

.gl-kpi-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gl-kpi-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.gl-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(90deg, var(--kpi-accent, #6366f1), transparent);
    opacity: 0.6;
}

.gl-kpi-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.55;
    line-height: 1.3;
}

.gl-kpi-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary, #e2e8f0);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.gl-kpi-value small {
    font-size: 0.55em;
    font-weight: 600;
    opacity: 0.5;
}

.gl-kpi-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.gl-kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.gl-kpi-badge-ok {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.gl-kpi-badge-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.gl-kpi-badge-critical {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.gl-kpi-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0.55;
}

.gl-kpi-sub i {
    font-size: 0.85rem;
}

.gl-kpi-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.06;
    pointer-events: none;
}

@media (max-width: 1200px) {
    .gl-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gl-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gl-dashboard {
        grid-template-columns: 1fr;
    }
}

/* KPI Amostragem — clicável para gestor */
.gl-kpi-card-clickable {
    cursor: pointer;
}
.gl-kpi-card-clickable:hover {
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

/* Light mode KPI */
.light-mode .gl-kpi-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .gl-kpi-value {
    color: #1e293b;
}

/* ── Dropdown Colaborador no Detail ─────────────────────────── */
.gl-det-colab-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}
.light-mode .gl-det-colab-item:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}
.light-mode #glDetColabPanel {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
}
.light-mode #glDetColabSearch {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1e293b !important;
}
.light-mode .gl-det-colab-item {
    color: #1e293b !important;
}
.light-mode #glDetColabBtn {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1e293b !important;
}

/* ── Status Legend ───────────────────────────────────────────── */
.gl-status-legend {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.25rem 0;
    margin-bottom: 0.5rem;
}

.gl-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.7;
}

.gl-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════ */
/* ── VISÃO GRID ───────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════════ */
.gl-grid-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* O header do grid é gerado por divs — usar flex */
.gl-grid-header {
    display: block;
}

.gl-grid-header .gl-grid-row {
    display: flex;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.10));
    border-bottom: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 10px 10px 0 0;
}

.gl-grid-header .gl-grid-cell {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a5b4fc;
    padding: 0.65rem 0.75rem;
    white-space: nowrap;
    flex: 1;
    border-bottom: none;
}

/* Cabeçalho de grupo (evt1 / evt2) — agrupa sub-colunas */
.gl-grid-group-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px;
    border-left: 2px solid rgba(129, 140, 248, 0.3);
    padding-bottom: 0.4rem !important;
}

.gl-grid-group-header[data-group="evt2"] {
    border-left-color: rgba(167, 139, 250, 0.3);
}


/* Linhas de dados: flex */
.gl-grid-row {
    display: flex;
    align-items: stretch;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gl-grid-row .gl-grid-cell {
    flex: 1;
    display: flex;
    align-items: center;
    border-bottom: none;
}

.gl-grid-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.gl-grid-row-clickable {
    cursor: pointer;
}

.gl-grid-row-clickable:hover {
    background: rgba(99, 102, 241, 0.07);
}

.gl-grid-cell {
    padding: 0.4rem 0.75rem;
    vertical-align: middle;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.82rem;
}

.gl-grid-cell-leito {
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 80px;
}

/* Light mode grid */
.light-mode .gl-grid-header .gl-grid-cell {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.light-mode .gl-grid-row:hover {
    background: rgba(99, 102, 241, 0.04);
}

.light-mode .gl-grid-cell {
    color: #1e293b;
}

/* ── Botões de Ação no Grid ──────────────────────────────────── */
.gl-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    transition: all 0.15s;
    white-space: nowrap;
}

.gl-action-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.gl-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── VISÃO CARD — Kanban: bloco consolidado abaixo na linha 1043 ── */

/* Cards do Kanban */
.gl-kcard {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
}

.gl-kcard:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Card sendo arrastado */
.gl-kcard-dragging {
    opacity: 0.35;
    transform: scale(0.96);
    cursor: grabbing;
}

/* Coluna válida para soltar (hint antes de hover) */
.gl-kanban-col-body.gl-drop-hint {
    background: rgba(99, 102, 241, 0.06);
    border: 1px dashed rgba(99, 102, 241, 0.35);
    border-radius: 0 0 4px 4px;
    transition: background 0.15s;
}

/* Coluna sob o cursor com drop válido */
.gl-kanban-col-body.gl-drop-target {
    background: rgba(74, 222, 128, 0.12) !important;
    border: 2px dashed rgba(74, 222, 128, 0.6) !important;
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.2);
}

/* Coluna inválida ao arrastar */
.gl-kanban-col-body.gl-drop-invalid {
    background: rgba(239, 68, 68, 0.06) !important;
}


.gl-kcard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    gap: 8px;
}

.gl-kcard-bed {
    font-weight: 700;
    font-size: 0.82rem;
    word-break: break-word;
    flex: 1;
}

.gl-kcard-badge {
    padding: 1px 6px;
    border-radius: 99px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.gl-kcard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 2px;
}

.gl-card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    margin-top: 6px;
    padding: 0.3rem 0;
    border: none;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.gl-card-action-btn:hover {
    opacity: 1;
}

/* ── Toast ────────────────────────────────────────────────────── */
#gl-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.gl-toast-show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.gl-toast-success {
    background: #059669;
}

.gl-toast-error {
    background: #dc2626;
}

.gl-toast-warn {
    background: #d97706;
}

/* ── Modal Detalhe + Linha do Tempo ──────────────────────────── */
.gl-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 8000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.gl-detail-overlay.open {
    display: flex;
}

.gl-detail-modal {
    background: var(--gl-modal-bg, #1e293b);
    border: 1px solid var(--gl-modal-border, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    color: var(--gl-modal-text, #e2e8f0);
}

.gl-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 1rem;
    transition: background 0.15s;
}

.gl-detail-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.gl-detail-header {
    padding: 1.25rem 1.5rem 0.75rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.gl-detail-body {
    padding: 1rem 1.5rem;
    flex: 1;
    background: var(--gl-modal-bg, #1e293b);
    color: var(--gl-modal-text, #e2e8f0);
}

.gl-detail-footer {
    padding: 0.75rem 1.5rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--gl-modal-border, rgba(255, 255, 255, 0.08));
    background: var(--gl-modal-bg, #1e293b);
}

/* Botão cancelar do detalhe */
.gl-detail-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--gl-modal-border, rgba(255, 255, 255, 0.15));
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gl-modal-text, #e2e8f0);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.gl-detail-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.gl-detail-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.gl-detail-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ── Timeline Horizontal ─────────────────────────────────────── */
.gl-timeline-section {
    padding: 1rem 0 0.5rem;
    background: var(--gl-modal-bg, #1e293b);
    color: var(--gl-modal-text, #e2e8f0);
}

.gl-timeline {
    position: relative;
    padding: 2rem 0 1.2rem;
    /* espaço extra em baixo para data */
}

.gl-timeline-track {
    position: relative;
    width: 100%;
    height: 60px;
}

.gl-timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gl-timeline-line, rgba(255, 255, 255, 0.1));
    transform: translateY(-50%);
}

.gl-timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gl-timeline-label-top {
    position: absolute;
    bottom: 28px;
    text-align: center;
    white-space: nowrap;
}

.gl-timeline-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    z-index: 1;
}

/* Horário + data abaixo do dot */
.gl-timeline-time {
    position: absolute;
    top: 22px;
    text-align: center;
    white-space: nowrap;
}

.gl-timeline-time-hm {
    font-size: 0.65rem;
    font-family: monospace;
    font-weight: 700;
    opacity: 0.85;
    display: block;
}

.gl-timeline-time-date {
    font-size: 0.58rem;
    opacity: 0.5;
    display: block;
    margin-top: 1px;
}

/* ── Light Mode — modal e timeline ──────────────────────────────── */
.light-mode {
    --gl-modal-bg: #ffffff;
    --gl-modal-border: rgba(0, 0, 0, 0.1);
    --gl-modal-text: #1e293b;
    --gl-timeline-line: rgba(0, 0, 0, 0.12);
}

.light-mode .gl-detail-modal {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.light-mode .gl-detail-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.light-mode .gl-detail-actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.light-mode .gl-detail-cancel-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .gl-timeline-dot {
    border-color: rgba(0, 0, 0, 0.15);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .gl-grid-container {
        font-size: 0.75rem;
    }
}

/* ══════════════════════════════════════════════════════════════ */
/* ── MODAL NOVO EVENTO + MODAL DETALHES ───────────────────────── */
/* ══════════════════════════════════════════════════════════════ */
.gl-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.gl-modal-overlay.open {
    display: flex;
}

.gl-modal {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: glModalIn 0.2s ease;
}

@keyframes glModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gl-modal-header {
    padding: 1.1rem 1.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gl-modal-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
}

.gl-modal-title i {
    color: #818cf8;
}

.gl-modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 1.1rem;
    transition: background 0.15s;
}

.gl-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.light-mode .gl-modal-close {
    background: rgba(0, 0, 0, 0.06);
    color: #1e293b;
}

.light-mode .gl-modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.gl-modal-body {
    padding: 1.1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gl-modal-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gl-modal-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.gl-modal-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    color: #e2e8f0;
    font-size: 0.84rem;
    width: 100%;
    transition: border-color 0.15s;
}

.gl-modal-input:focus {
    outline: none;
    border-color: #6366f1;
}

.gl-modal-input option {
    background: #1e293b;
    color: #e2e8f0;
}

.gl-modal-footer {
    padding: 0.75rem 1.5rem 1.1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gl-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.gl-modal-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.gl-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

.gl-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.gl-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Botão Agendar Higienização */
.gl-modal-btn-schedule {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.gl-modal-btn-schedule:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    filter: brightness(1.08);
}

/* Botão Enviar agora */
.gl-modal-btn-send-now {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.gl-modal-btn-send-now:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
    filter: brightness(1.1);
}

/* Card de info do leito no sub-modal de agendamento */
.gl-schedule-bed-info {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #a5b4fc;
}

/* Feedback de confirmação de agendamento */
.gl-schedule-info {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    color: #6ee7b7;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

/* Light mode — botão agendar + sub-modal */
.light-mode .gl-schedule-bed-info {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.light-mode .gl-schedule-info {
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
}

/* Input datetime-local no tema escuro */
input[type="datetime-local"].gl-modal-input {
    color-scheme: dark;
}

.light-mode input[type="datetime-local"].gl-modal-input {
    color-scheme: light;
}



/* Modal Detalhes — área de ações (footer) */
.gl-detail-actions {
    padding: 0.75rem 1.5rem 1.1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--gl-modal-border, rgba(255, 255, 255, 0.08));
    background: var(--gl-modal-bg, #1e293b);
}

/* ══════════════════════════════════════════════════════════════ */
/* ── CARD VIEW — Estilo Nutrição ──────────────────────────────── */
/* ══════════════════════════════════════════════════════════════ */

/* Container principal: ocupa todo espaço vertical disponível */
.gl-cards-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    /* sem espaço entre grupos */
    overflow: hidden;
    align-items: stretch;
    height: calc(100vh - 295px);
    /* subtrai: topbar + toolbar + KPIs + padding */
}

/* Cada grupo ocupa metade igual da largura e toda a altura */
.gl-kanban-group {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

/* Borda única entre grupos (direita no primeiro, esquerda no segundo) */
.gl-kanban-group:first-child {
    border-radius: 14px 0 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-right: none;
}

.gl-kanban-group:last-child {
    border-radius: 0 14px 14px 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* Caso tenha apenas 1 grupo */
.gl-kanban-group:only-child {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.gl-kanban-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

/* Linha horizontal de colunas — ocupa o restante da altura */
.gl-kanban {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 0;
}

/* Coluna individual: expande igualmente para preencher o container */
.gl-kanban-col {
    flex: 1 1 0;
    /* divide o espaço igualmente entre todas as colunas */
    min-width: 150px;
    /* mínimo para legibilidade */
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 0;
}

.gl-kanban-col:last-child {
    border-right: none;
}

/* Header da coluna com cor de fundo sólida */
.gl-kanban-col-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.gl-kanban-col-header i {
    font-size: 1rem;
}

.gl-kanban-badge {
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.85);
}

/* Body da coluna: ocupa todo o espaço restante com scroll vertical */
.gl-kanban-col-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    overflow-y: auto;
    /* scroll apenas se não couber */
    min-height: 0;
    background: rgba(255, 255, 255, 0.015);
}


/* Card individual */
.gl-kcard {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
}

.gl-kcard:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.gl-kcard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
    gap: 8px;
}

.gl-kcard-bed {
    font-weight: 800;
    font-size: 0.85rem;
    word-break: break-word;
    flex: 1;
}

.gl-kcard-badge {
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

/* Timer badges — igual ao Nutrição (fundo colorido) */
.gl-kcard-timers {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.gl-kcard-timer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    min-width: 60px;
    flex: 1;
}

.gl-kcard-timer-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-bottom: 1px;
}

.gl-kcard-timer-value {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.gl-kcard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    opacity: 0.55;
    margin-top: 4px;
}

.gl-card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    margin-top: 7px;
    padding: 0.32rem 0;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}

.gl-card-action-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* Light mode ajustes */
.light-mode .gl-modal {
    background: #f8fafc;
}

.light-mode .gl-modal-title {
    color: #1e293b;
}

.light-mode .gl-modal-input {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

.light-mode .gl-modal-input option {
    background: #fff;
    color: #1e293b;
}

.light-mode .gl-kcard {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ── Select de Retenção — coluna FINALIZADO ─────────────────────────── */
.gl-finished-retention-select {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 4px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}

.gl-finished-retention-select:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.gl-finished-retention-select option {
    background: #1e293b;
    color: #e2e8f0;
}

.light-mode .gl-finished-retention-select {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.2);
    color: #1e293b;
}

.light-mode .gl-finished-retention-select option {
    background: #fff;
    color: #1e293b;
}

/* ── Botões de Reordenação de Cards (Seta Cima/Baixo) ─────── */
.gl-reorder-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.95rem;
}

.gl-reorder-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.light-mode .gl-reorder-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

.light-mode .gl-reorder-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.2);
}

/* ── Toggle Switch de Módulo (On/Off) ─────────────────────────────── */
.gl-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}
.gl-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.gl-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .3s;
    border-radius: 34px;
}
.light-mode .gl-slider {
    background-color: rgba(0,0,0,0.2);
}
.gl-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    border-radius: 50%;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
}
input:checked + .gl-slider {
    background-color: #3b82f6;
}
input:checked + .gl-slider:before {
    transform: translateX(16px);
}

/* ── Toggle Switch de Prioridade ─────────────────────────────── */
.gl-priority-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.55rem 0;
}

.gl-priority-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gl-modal-text, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.gl-priority-label i {
    color: #f59e0b;
    font-size: 1rem;
}

/* O input real fica oculto */
.gl-priority-toggle-input {
    display: none;
}

/* Track do toggle */
.gl-priority-track {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gl-priority-toggle-input:checked+.gl-priority-track {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* Bolinha do toggle */
.gl-priority-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gl-priority-toggle-input:checked+.gl-priority-track::after {
    transform: translateX(20px);
}

/* Light mode toggle */
.light-mode .gl-priority-track {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.12);
}

.light-mode .gl-priority-label {
    color: #1e293b;
}

/* ── Ícone de Prioridade nos Cards / Grid ───────────────────── */
.gl-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 99px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.gl-priority-badge i {
    font-size: 0.75rem;
}

/* Card com prioridade: borda âmbar + animação sutil */
.gl-kcard-priority {
    border-color: rgba(245, 158, 11, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2), 0 2px 8px rgba(245, 158, 11, 0.15);
}

/* Linha do grid com prioridade */
.gl-grid-row-priority {
    border-left-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.04);
}

/* Pulso no ícone de prioridade */
@keyframes gl-priority-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.gl-priority-icon-pulse {
    animation: gl-priority-pulse 2s ease-in-out infinite;
    color: #f59e0b;
}

/* Badge de alerta "havia prioridade" no modal finalizado */
.gl-priority-was-set {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 0.75rem;
}

.gl-priority-was-set i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════ */
/* ── COLABORADORES ────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════════ */

/* Botão do header */
.gl-btn-colab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.gl-btn-colab:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
    filter: brightness(1.08);
}

/* Painel principal — sempre no maior tamanho possível, ocupando quase a tela inteira */
.gl-colab-panel {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    width: 98vw;
    max-width: 1800px;
    height: 96vh;
    max-height: 96vh;
    overflow: hidden; /* Corta o scroll da tela toda */
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    animation: glModalIn 0.2s ease;
    color: #e2e8f0;
}

/* Formulário */
.gl-colab-form {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: none;
}

/* Listagem maximizada — oculta o formulário para dar mais espaço vertical à tabela */
.gl-colab-panel.gl-colab-list-maximized .gl-colab-form {
    display: none;
}

.gl-colab-form-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #38bdf8;
    margin-bottom: 0.75rem;
}

/* Toggle Ausente */
.gl-colab-ausente-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    user-select: none;
}
.gl-colab-ausente-wrap:hover {
    background: rgba(239, 68, 68, 0.1);
}
.gl-colab-ausente-wrap input[type="checkbox"] {
    display: none;
}
.gl-colab-ausente-track {
    width: 32px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
}
.gl-colab-ausente-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.gl-colab-ausente-wrap input[type="checkbox"]:checked ~ .gl-colab-ausente-track {
    background: #ef4444;
}
.gl-colab-ausente-wrap input[type="checkbox"]:checked ~ .gl-colab-ausente-track .gl-colab-ausente-thumb {
    transform: translateX(14px);
}
.gl-colab-ausente-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fca5a5;
    transition: color 0.3s;
}
.gl-colab-ausente-wrap input[type="checkbox"]:checked ~ .gl-colab-ausente-label {
    color: #ef4444;
}
.light-mode .gl-colab-ausente-wrap {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.3);
}
.light-mode .gl-colab-ausente-track {
    background: #cbd5e1;
}
.light-mode .gl-colab-ausente-label {
    color: #ef4444;
}

/* Toggle Execução */
.gl-colab-execucao-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    user-select: none;
}
.gl-colab-execucao-wrap:hover {
    background: rgba(34, 197, 94, 0.1);
}
.gl-colab-execucao-wrap input[type="checkbox"] {
    display: none;
}
.gl-colab-execucao-track {
    width: 32px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
}
.gl-colab-execucao-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.gl-colab-execucao-wrap input[type="checkbox"]:checked ~ .gl-colab-execucao-track {
    background: #22c55e;
}
.gl-colab-execucao-wrap input[type="checkbox"]:checked ~ .gl-colab-execucao-track .gl-colab-execucao-thumb {
    transform: translateX(14px);
}
.gl-colab-execucao-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #86efac;
    transition: color 0.3s;
}
.gl-colab-execucao-wrap input[type="checkbox"]:checked ~ .gl-colab-execucao-label {
    color: #22c55e;
}
.light-mode .gl-colab-execucao-wrap {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.3);
}
.light-mode .gl-colab-execucao-track {
    background: #cbd5e1;
}
.light-mode .gl-colab-execucao-label {
    color: #22c55e;
}

/* Toggles compactos do cabeçalho do form de Colaboradores (módulos + status) —
   mesmo padrão visual dos toggles acima, porém menores e em linha que quebra
   item a item (flex-wrap), evitando que o texto de cada toggle quebre em si. */
.gl-colab-toggle-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.gl-colab-toggle-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
    white-space: nowrap;
}
.gl-colab-toggle-mini:hover {
    background: rgba(255, 255, 255, 0.08);
}
.gl-colab-toggle-mini input[type="checkbox"] {
    display: none;
}
.gl-colab-toggle-mini-track {
    flex-shrink: 0;
    width: 26px;
    height: 15px;
    background: var(--track-off, rgba(148, 163, 184, 0.3));
    border-radius: 20px;
    position: relative;
    display: block;
    transition: background 0.3s;
}
.gl-colab-toggle-mini-thumb {
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.gl-colab-toggle-mini input[type="checkbox"]:checked ~ .gl-colab-toggle-mini-track {
    background: var(--track-on, #22c55e);
}
.gl-colab-toggle-mini input[type="checkbox"]:checked ~ .gl-colab-toggle-mini-track .gl-colab-toggle-mini-thumb {
    transform: translateX(11px);
}
.gl-colab-toggle-mini-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.3s;
    white-space: nowrap;
}
.gl-colab-toggle-mini input[type="checkbox"]:checked ~ .gl-colab-toggle-mini-label {
    color: #f1f5f9;
}
.light-mode .gl-colab-toggle-mini {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}
.light-mode .gl-colab-toggle-mini-track {
    background: var(--track-off, #cbd5e1);
}
.light-mode .gl-colab-toggle-mini-label {
    color: #475569;
}
.light-mode .gl-colab-toggle-mini input[type="checkbox"]:checked ~ .gl-colab-toggle-mini-label {
    color: #0f172a;
}

/* Layout foto + campos lado a lado */
.gl-colab-form-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Área da foto */
.gl-colab-foto-area {
    width: 112px;
    height: 112px;
    border-radius: 12px;
    border: 2px dashed rgba(56,189,248,0.4);
    background: rgba(56,189,248,0.06);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}

.gl-colab-foto-area:hover {
    border-color: #38bdf8;
    background: rgba(56,189,248,0.12);
}

.gl-colab-foto-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

#glColabFotoPlaceholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #38bdf8;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

#glColabFotoPlaceholder i {
    font-size: 1.8rem;
    opacity: 0.7;
}

/* Grid de campos (ao lado da foto) */
.gl-colab-fields {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Avatar na tabela — com foto */
.gl-colab-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Avatar sem foto — SVG person animado */
.gl-colab-avatar-person {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: glAvatarPulse 2.8s ease-in-out infinite;
}

@keyframes glAvatarPulse {
    0%, 100% { filter: drop-shadow(0 0 0px #6366f1); transform: scale(1); }
    50%       { filter: drop-shadow(0 0 6px #8b5cf6); transform: scale(1.06); }
}

/* SVG person no placeholder da área de foto */
.gl-colab-person-placeholder {
    animation: glPersonFloat 3s ease-in-out infinite;
    opacity: 0.85;
}

@keyframes glPersonFloat {
    0%, 100% { transform: translateY(0px);   opacity: 0.75; }
    50%       { transform: translateY(-5px);  opacity: 1;    }
}

.light-mode .gl-colab-foto-area {
    border-color: rgba(14,165,233,0.35);
    background: rgba(14,165,233,0.05);
}



.gl-colab-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gl-colab-field label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

/* Listas de Múltipla Seleção (Prédios e Andares) */
.gl-multi-checkbox-list {
    background: rgba(15,23,42,0.4);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    height: 110px;
    min-height: 60px;
    max-height: 70vh;
    resize: vertical;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
}
.gl-multi-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    /* Evita que um item pequeno esmague; deixa eles em blocos contidos */
    flex: 0 0 auto;
}
.gl-multi-checkbox-item:hover {
    background: rgba(255,255,255,0.05);
}
.gl-multi-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}
.gl-multi-checkbox-label {
    font-size: 0.8rem;
    color: #e2e8f0;
    user-select: none;
}
.light-mode .gl-multi-checkbox-list {
    background: rgba(248,250,252,0.8);
    border-color: #cbd5e1;
}
.light-mode .gl-multi-checkbox-item:hover {
    background: #f1f5f9;
}
.light-mode .gl-multi-checkbox-label {
    color: #475569;
}

.gl-colab-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0.75rem 0 0.25rem;
}

/* Seção de listagem */
.gl-colab-list-section {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0; /* Ajuda o Flexbox a calcular rolagem interna */
}

.gl-colab-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.gl-colab-list-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Campo de busca */
.gl-colab-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    flex: 1;
    max-width: 320px;
}

.gl-colab-search-wrap i {
    color: #64748b;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.gl-colab-search {
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 0.84rem;
    width: 100%;
}

.gl-colab-search::placeholder { color: #475569; }

/* Tabela */
.gl-colab-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
    max-height: 80vh;
    resize: vertical;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.gl-colab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.gl-colab-table thead tr {
    background: rgba(255,255,255,0.04);
}

.gl-colab-table th {
    padding: 0.55rem 0.9rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #1e293b; /* Fundo opaco para esconder linhas rolando atrás */
}

.gl-colab-table td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}

.gl-colab-row {
    cursor: pointer;
    transition: background 0.12s;
}

.gl-colab-row:hover {
    background: rgba(56,189,248,0.07);
}

.gl-colab-row-selected {
    background: rgba(56,189,248,0.12);
}

.gl-colab-row-selected td:first-child {
    box-shadow: inset 3px 0 0 #38bdf8;
}

.gl-colab-row:last-child td { border-bottom: none; }

/* Badge matrícula */
.gl-colab-matricula {
    display: inline-block;
    background: rgba(99,102,241,0.18);
    color: #a5b4fc;
    border-radius: 6px;
    padding: 1px 8px;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: monospace;
}

/* Botão excluir na linha */
.gl-colab-del-btn {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 6px;
    color: #f87171;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.gl-colab-del-btn:hover {
    background: rgba(239,68,68,0.25);
    transform: scale(1.05);
}

/* Barra de ações em lote */
.gl-colab-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(56,189,248,0.08);
    border: 1px solid rgba(56,189,248,0.25);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #7dd3fc;
}

/* Linha de campo no modal de edição em lote */
.gl-bulk-field-row {
    display: grid;
    grid-template-columns: 20px 130px 1fr;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.gl-bulk-field-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #38bdf8;
}
.gl-bulk-field-row span {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
}
.gl-bulk-field-row select,
.gl-bulk-field-row input[type="text"] {
    opacity: 0.55;
}
.gl-bulk-field-row:has(input[type="checkbox"]:checked) select,
.gl-bulk-field-row:has(input[type="checkbox"]:checked) input[type="text"] {
    opacity: 1;
}

/* Linha de campo com sub-conteúdo (listas de Ala/Andar) no modal de edição em lote */
.gl-bulk-field-row-multi {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: start;
    gap: 10px;
}
.gl-bulk-field-row-multi > input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #38bdf8;
}
.gl-bulk-field-row-multi span {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
}
.gl-bulk-field-row-multi > div {
    opacity: 0.55;
}
.gl-bulk-field-row-multi:has(> input[type="checkbox"]:checked) > div {
    opacity: 1;
}

/* Light Mode */
.light-mode .gl-colab-panel {
    background: #f8fafc;
    color: #1e293b;
}

.light-mode .gl-colab-search-wrap {
    background: #fff;
    border-color: rgba(0,0,0,0.12);
}

.light-mode .gl-colab-search { color: #1e293b; }

.light-mode .gl-colab-table thead tr { background: rgba(0,0,0,0.03); }

.light-mode .gl-colab-table th { color: #94a3b8; border-bottom-color: rgba(0,0,0,0.08); background: #f8fafc; }

.light-mode .gl-colab-table td { border-bottom-color: rgba(0,0,0,0.05); }

.light-mode .gl-colab-row:hover { background: rgba(14,165,233,0.05); }

.light-mode .gl-colab-table-wrap { border-color: rgba(0,0,0,0.08); }

/* Seleção de Colaborador (List Buttons) */
.gl-colab-list-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 6px;
}
.light-mode .gl-colab-list-select {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
}
.gl-colab-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.gl-colab-radio-item:hover {
    background: rgba(255,255,255,0.08);
}
.light-mode .gl-colab-radio-item {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.light-mode .gl-colab-radio-item:hover {
    background: #f1f5f9;
}
.gl-colab-radio-item input[type="radio"] {
    display: none;
}
.gl-colab-radio-item.selected {
    background: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
}
.light-mode .gl-colab-radio-item.selected {
    background: #e0f2fe;
    border-color: #38bdf8;
}
.gl-colab-radio-lbl {
    font-size: 0.85rem;
    font-weight: 600;
    flex: 1;
}
.gl-badge-execucao {
    background: #22c55e;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}
.gl-priority-range {
    flex: 1;
    cursor: pointer;
    accent-color: #fca5a5;
    height: 6px;
    background: #334155;
    border-radius: 8px;
    appearance: none;
    outline: none;
}
.gl-priority-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fca5a5;
    cursor: pointer;
    transition: transform 0.1s;
}
.gl-priority-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.light-mode .gl-priority-range {
    background: #cbd5e1;
}
.light-mode .gl-priority-range::-webkit-slider-thumb {
    background: #ef4444;
}

/* Sidebar Equipe Operacional - Light Mode */
.light-mode .gl-equipe-sidebar {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-header {
    color: #1e293b !important;
    border-bottom-color: #f1f5f9 !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-header i {
    color: #0ea5e9 !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-header #glEquipeSortBtn {
    color: #64748b !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-header #glEquipeSortBtn:hover {
    color: #0f172a !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-header #glEquipeCount {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-item {
    background-color: #f8fafc !important;
    color: #334155 !important;
    border-top: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-item:hover {
    background-color: #f1f5f9 !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-item-idle {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 4px solid #22c55e !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-item-busy {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
    border: 1px solid #fde68a !important;
    border-left: 4px solid #eab308 !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-item-busy .gl-equipe-item-info {
    background: rgba(0,0,0,0.08) !important;
}

.light-mode .gl-equipe-sidebar .gl-equipe-item-info {
    background: #f1f5f9 !important;
}