/* style.css */

h1,h2{
    margin-top: 0; 
    margin-bottom: 10; 
}

h1{
    font-size: 1.6rem; 
}

h2{
    font-size: 1.2rem; 
}

.grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2rem; 
}

.box { 
    background: white; 
    padding: 1.5rem; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
}

.form-group { 
    margin-bottom: 1rem; 
}

.fase-container { 
    /*background: #fdfdfd; */
    background: #f8fafc;
    border: 1px solid #e2e8f0; 
    padding: 1rem; 
    border-radius: 6px; 
    margin-bottom: 1rem; 
}

.fase-title { 
    font-weight: bold; 
    color: #2b579a; 
    margin-bottom: 0.5rem; 
    display: flex; 
    justify-content: space-between; 
}

.datas-row { 
    display: flex; 
    gap: 0.5rem; 
    margin-top: 0.5rem; 
}

.datas-row div { 
    flex: 1; 
}

label { 
    display: block; 
    font-size: 0.8rem; 
    font-weight: bold; 
    color: #555; 
    margin-bottom: 0.2rem; 
}

textarea, select, input { 
    width: 100%; 
    padding: 0.5rem; 
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-family: inherit; 
    font-size: 0.9rem; 
}

button { 
    padding: 0.7rem; 
    background: #2b579a; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    width: 100%; 
    font-size: 1rem; 
}

button:hover { 
    background: #1e3d6b; 
}

.card { 
    border-left: 5px solid #ccc; 
    padding: 1rem; 
    margin-bottom: 1rem; 
    background: #fff; 
    border-radius: 4px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
}

.status-valido { 
    border-left-color: #28a745; 
}

.status-violado { 
    border-left-color: #dc3545; 
    background-color: #fff5f5; 
}

.badge { 
    float: right; 
    padding: 0.25rem 0.5rem; 
    font-size: 0.75rem; 
    font-weight: bold; 
    border-radius: 4px; 
    color: white; 
}

.bg-success { 
    background-color: #28a745; 
}

.bg-danger { 
    background-color: #dc3545; 
}

.fase-exibicao { 
    background: #f8fafc; 
    padding: 0.8rem; 
    border-radius: 4px; 
    margin-top: 0.5rem; 
    border-left: 4px solid #64748b; 
    font-size: 0.9rem; 
    transition: 0.3s; 
    /*white-space: pre-wrap; */
}

/* Nova classe exclusiva para o texto do usuário */
.texto-conteudo {
    white-space: pre-wrap;
    margin: 0.5rem 0; /* Dá um respiro visual entre o título e as datas */
    word-break: break-word; /* Garante que palavras muito longas não quebrem o layout mobile */
}

.fase-exibicao small { 
    color: #64748b; 
    font-weight: bold; 
    display: block; 
    margin-bottom: 0.3rem; 
}

.fase-atrasada { 
    border-left-color: #dc3545; 
    background-color: #fff5f5; 
}

.fase-atrasada small { 
    color: #dc3545; 
}

.alerta-atraso { 
    color: #dc3545; 
    font-weight: bold; 
    font-size: 0.75rem; 
    float: right; 
}

/* Adicione estas regras ao final do seu style.css existente */

.form-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-cancelar {
    background: #64748b;
    display: none; /* Escondido por padrão, aparece apenas na edição */
}

.btn-cancelar:hover {
    background: #475569;
}

/* Painel de botões dentro do Card do Ciclo */
.card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-action {
    width: auto;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-edit {
    background: #eab308;
}

.btn-edit:hover {
    background: #ca8a04;
}

.btn-delete {
    background: #ef4444;
}

.btn-delete:hover {
    background: #dc2626;
}

/* =========================================
   RESPONSIVIDADE E INVERSÃO DE ORDEM (UX)
   ========================================= */
@media (max-width: 768px) {
    .grid { 
        display: flex; 
        flex-direction: column; 
    }
    
    /* O painel de Monitoramento sobe para o topo */
    .box-list { 
        order: 1; 
        margin-bottom: 1rem;
    }
    
    /* O Formulário desce para baixo */
    .box-form { 
        order: 2; 
    }
}

/* =========================================
   ESTILOS DO ACCORDION (COLAPSÁVEL)
   ========================================= */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 0.5rem;
    user-select: none; /* Evita selecionar o texto ao clicar rápido */
}

.card-header h4 {
    margin: 0;
    color: #1e3d6b;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accordion-icon {
    font-size: 0.8rem;
    color: #64748b;
    transition: transform 0.3s ease;
}

/* O corpo do card fica escondido por padrão */
.card-body {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #cbd5e1;
}

/* Classe que o JavaScript adicionará para exibir o conteúdo */
.card-body.open {
    display: block;
}

/* Gira a setinha quando o accordion está aberto */
.card-body.open ~ .card-header .accordion-icon,
.open-icon {
    transform: rotate(180deg);
}

.cabecalho-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* =========================================
   DESTAQUE DA FASE ATUAL
   ========================================= */
.fase-destaque {
    border-left-width: 6px;
    border-left-color: #3b82f6 !important; /* Azul vibrante */
    background-color: #eff6ff !important; /* Fundo azul muito suave */
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.1);
}

.fase-destaque small {
    color: #1d4ed8 !important;
}

.badge-atual {
    background-color: #3b82f6;
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   FUNCIONALIDADES PREMIUM
   ========================================= */
.header-monitoramento {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;*/
}

.header-monitoramento h2 {
    /*margin: 0;*/
}

.btn-premium {
    background: #fbbf24; /* Dourado */
    color: #78350f; /* Marrom escuro para contraste */
    border: 1px solid #f59e0b;
    width: auto;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 20px; /* Bordas arredondadas para parecer um "Pill" */
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
}

.btn-premium:hover {
    background: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

/* =========================================
   PAINEL DE FILTROS SELETIVOS
   ========================================= */
.box-filtros {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 200px;
}

.filtro-grupo label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filtro-grupo input, .filtro-grupo select {
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}

.filtro-grupo input:focus, .filtro-grupo select:focus {
    border-color: #3b82f6;
}

.btn-secundario {
    background: #64748b;
    color: white;
    border: none;
    padding: 0.55rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background 0.2s;
    height: 38px;
}

.btn-secundario:hover {
    background: #475569;
}

.btn-premium-small {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
    width: 150px;
}

.btn-premium-small:hover {
    background-color: #fef3c7;
    border-color: #f59e0b;
}