.ce-subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.ce-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.ce-filters label,
.ce-form-grid label,
.ce-textarea-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.ce-filters input,
.ce-filters select,
.ce-form-grid input,
.ce-form-grid select,
.ce-textarea-label textarea {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 40px;
    font-size: 0.88rem;
    font-family: inherit;
}

.ce-textarea-label textarea {
    resize: vertical;
    min-height: 88px;
}

.ce-btn-primary {
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.ce-btn-primary:hover {
    filter: brightness(1.05);
}

.ce-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.ce-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ce-form-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.ce-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.ce-chart-body {
    min-height: 240px;
}

#ceTable td:nth-child(5),
#ceTable th:nth-child(5) {
    white-space: normal;
    min-width: 260px;
}

.ce-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.ce-tag-leve {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

.ce-tag-grave {
    background: rgba(239, 68, 68, 0.16);
    color: #dc2626;
}

.ce-tag-medio {
    background: rgba(234, 179, 8, 0.18);
    color: #a16207;
}

.ce-user-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.ce-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ce-edit-btn,
.ce-delete-btn {
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ce-edit-btn {
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.ce-edit-btn:hover {
    background: rgba(37, 99, 235, 0.18);
}

.ce-delete-btn {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.ce-delete-btn:hover {
    background: rgba(239, 68, 68, 0.18);
}

#ceFormPanel.is-editing {
    border: 1px solid rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* Cabeçalho ordenável */
.ce-th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

.ce-th-sort:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.14);
}

.ce-th-sort.is-active {
    color: var(--text-primary);
}

.ce-sort-icon {
    font-size: 0.7rem;
    margin-left: 6px;
    opacity: 0.4;
}

.ce-th-sort.is-active .ce-sort-icon {
    opacity: 1;
    color: #2563eb;
}

/* Histórico: rolagem própria com cabeçalho fixo */
.ce-historico-scroll {
    max-height: 620px;
    overflow: auto;
}

/* Zebra + hover mais visível no histórico */
#ceTable tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.06);
}

#ceTable tbody tr:hover {
    background: rgba(37, 99, 235, 0.08);
}

#ceTable tbody td {
    vertical-align: middle;
}

/* "Lançado por" vazio mais discreto */
#ceTable tbody td:nth-child(9) {
    color: var(--text-secondary);
}

.ce-historico-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ce-historico-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #cbd5e1);
    background: #fff;
    color: var(--text-primary, #0f172a);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}

.ce-historico-actions .btn-secondary:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}

.ce-th-check,
.ce-td-check {
    width: 36px;
    text-align: center;
}

.ce-th-check input,
.ce-td-check input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 1200px) {
    .ce-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ce-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .ce-filters,
    .ce-form-grid {
        grid-template-columns: 1fr;
    }
    .ce-form-actions .ce-btn-primary {
        width: 100%;
    }
}
