/* ═══════════════════════════════════════════════════════════════
   Centro Cirúrgico – Estilos
   ═══════════════════════════════════════════════════════════════ */

/* ─── Board ──────────────────────────────────────────────────── */
#view-centro-cirurgico {
    padding: 1.5rem;
}

#view-centro-cirurgico .cc-board-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── Botão Toggle Ocultar Finalizados ───────────────────────── */
.cc-toggle-finished-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #94a3b8);
}

.cc-toggle-finished-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.cc-toggle-finished-btn.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.cc-toggle-finished-btn.active:hover {
    background: rgba(239, 68, 68, 0.25);
}

body:not(.dark-theme) .cc-toggle-finished-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

body:not(.dark-theme) .cc-toggle-finished-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

body:not(.dark-theme) .cc-toggle-finished-btn.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

#cc-kanban-board {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#cc-kanban-board>div {
    flex: 1;
    min-width: 240px;
}

/* ─── Column ─────────────────────────────────────────────────── */
.cc-column {
    background: var(--card-bg, rgba(30, 41, 59, 0.6));
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    min-height: 350px;
    max-height: calc(100vh - 160px);
}

.cc-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cc-column-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-column-count {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

/* ─── Filtros por coluna ─────────────────────────────────────── */
.cc-column-filters {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.6rem;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.12);
}

.cc-filter-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #94a3b8);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 28px;
}

.cc-filter-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cc-filter-btn.active {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

/* ─── Card List ──────────────────────────────────────────────── */
.cc-card-list {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

.cc-card-list::-webkit-scrollbar {
    width: 4px;
}

.cc-card-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ─── Card ────────────────────────────────────────────────────── */
.cc-card {
    background: #fff;
    color: #1e293b;          /* Fixo — não herda o branco do tema escuro */
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-left: 5px solid #c6efce;
    border-right: 5px solid #c6efce;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    animation: ccCardEnter 0.3s ease-out;
}

.cc-card * {
    /* Garante que nenhum elemento interno herde a cor do tema */
    color: inherit;
}

.cc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cc-card-finished {
    opacity: 0.7;
    border-left-color: #d1d5db !important;
    border-right-color: #d1d5db !important;
}

@keyframes ccCardEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Status Ribbon ──────────────────────────────────────────── */
.cc-card-status {
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ─── Card Body ──────────────────────────────────────────────── */
.cc-card-body {
    padding: 0.5rem 0.65rem;
}

.cc-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.cc-card-sala {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #475569;
}

.cc-card-sala strong {
    color: #1e293b;
    font-weight: 700;
}

.cc-sala-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    margin-left: 2px;
}

.cc-card-hora {
    font-size: 0.72rem;
    color: #ef4444;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ─── Times Row ──────────────────────────────────────────────── */
.cc-card-times {
    display: flex;
    gap: 6px;
}

.cc-time-box {
    flex: 1;
    border-radius: 8px;
    padding: 4px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.cc-time-activity {
    background: #c6efce;
    color: #166534;
}

.cc-time-total {
    background: #e2e8f0;
    color: #334155;
}

.cc-time-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.cc-time-value {
    font-size: 0.82rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
}

/* ─── Tema Claro ─────────────────────────────────────────────── */
body:not(.dark-theme) .cc-column {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
}

body:not(.dark-theme) .cc-column-filters {
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body:not(.dark-theme) .cc-filter-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

body:not(.dark-theme) .cc-filter-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

body:not(.dark-theme) .cc-filter-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.3);
}

.light-mode #view-centro-cirurgico .cc-board-title {
    color: #1e293b;
}

/* ─── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    #view-centro-cirurgico {
        padding: 0.75rem;
    }

    #view-centro-cirurgico .cc-board-title {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    #cc-kanban-board {
        flex-direction: column;
    }

    #cc-kanban-board>div {
        min-width: 100%;
    }

    .cc-column {
        min-height: 200px;
        max-height: calc(100vh - 120px);
    }

    .cc-column-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .cc-column-filters {
        padding: 0.35rem 0.5rem;
        gap: 3px;
    }

    .cc-filter-btn {
        font-size: 0.75rem;
        padding: 3px 6px;
        min-width: 26px;
        min-height: 24px;
    }

    /* Cards */
    .cc-card-status {
        padding: 3px 8px;
        font-size: 0.6rem;
    }

    .cc-card-body {
        padding: 0.4rem 0.5rem;
    }

    .cc-card-sala {
        font-size: 0.7rem;
    }

    .cc-sala-value {
        font-size: 0.8rem;
    }

    .cc-card-hora {
        font-size: 0.65rem;
    }

    .cc-time-box {
        padding: 3px 4px;
    }

    .cc-time-label {
        font-size: 0.5rem;
    }

    .cc-time-value {
        font-size: 0.75rem;
    }

    /* Toggle Finished Button */
    .cc-toggle-finished-btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }
}

@media (max-width: 480px) {
    #view-centro-cirurgico {
        padding: 0.5rem;
    }

    .cc-column-header {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }

    .cc-card-times {
        gap: 4px;
    }

    .cc-time-value {
        font-size: 0.7rem;
    }

    .cc-card-list {
        padding: 0.35rem;
        gap: 0.35rem;
    }
}