/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body { 
    font-family: Arial, sans-serif; 
    background-color: #f4f6f9; 
    color: #333;
    padding: 15px; 
    line-height: 1.5;
}

/* ==========================================================================
   2. ESTRUTURA DO CONTAINER
   ========================================================================== */
.container { 
    max-width: 900px; 
    width: 100%;
    background: #ffffff; 
    padding: 20px; 
    border-radius: 8px; 
    margin: 10px auto; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); 
}

h1, h2 { 
    color: #1e7e34;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* ==========================================================================
   3. COMPONENTES DE BOTÕES
   ========================================================================== */
.btn-verde { 
    background-color: #28a745; 
    color: white; 
    border: none; 
    padding: 10px 18px; 
    border-radius: 5px; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-block; 
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s ease;
}

.btn-verde:hover { 
    background-color: #218838; 
}

.btn-vermelho { 
    background-color: #dc3545; 
    color: white; 
    border: none; 
    padding: 10px 18px; 
    border-radius: 5px; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-block; 
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s ease;
}

.btn-vermelho:hover { 
    background-color: #c82333; 
}

/* ==========================================================================
   4. NAVEGAÇÃO E BARRAS DE TOPO
   ========================================================================== */
.nav-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 2px solid #e9ecef; 
    padding-bottom: 15px; 
    margin-bottom: 20px; 
}

/* ==========================================================================
   5. FORMULÁRIOS
   ========================================================================== */
.form-group { 
    margin-bottom: 15px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 6px; 
    font-weight: bold; 
}

.form-group input[type="text"], 
.form-group input[type="email"], 
.form-group input[type="password"], 
.form-group input[type="date"], 
.form-group input[type="file"], 
.form-group select, 
.form-group textarea { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

/* ==========================================================================
   6. TABELAS (VISÃO WEB)
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Permite rolagem horizontal se necessário */
    margin-top: 15px;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
}

table, th, td { 
    border: 1px solid #dee2e6; 
    padding: 12px 10px; 
    text-align: left; 
}

th { 
    background-color: #f8f9fa; 
    color: #495057;
}

/* ==========================================================================
   7. ADAPTAÇÕES PARA TELA DE CELULAR (RESPONSIVIDADE)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 15px;
    }

    /* Botoes ocupam 100% da largura no celular */
    .btn-verde, .btn-vermelho {
        width: 100%;
        margin-bottom: 8px;
    }

    /* Ajuste da barra superior */
    .nav-bar {
        flex-direction: column;
        align-items: stretch;
    }

    /* Transformação da Tabela em Cards no Celular */
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    /* Esconde o cabeçalho original da tabela */
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr { 
        margin-bottom: 15px;
        border: 1px solid #ced4da;
        border-radius: 6px;
        background: #fff;
        padding: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 45%; 
        text-align: right;
    }
    
    td:last-child {
        border-bottom: 0;
    }

    /* Insere o rótulo da coluna antes do valor no formato de Card */
    td:before { 
        position: absolute;
        top: 12px;
        left: 10px;
        width: 40%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #495057;
    }

    /* Labels automáticos para a tabela de demandas da recepção */
    td:nth-of-type(1):before { content: "ID"; }
    td:nth-of-type(2):before { content: "Solicitante"; }
    td:nth-of-type(3):before { content: "Telefone"; }
    td:nth-of-type(4):before { content: "Atendimento"; }
    td:nth-of-type(5):before { content: "Status"; }
    td:nth-of-type(6):before { content: "Ações"; }
}