/* ============================================ */
/* CONFIGURAÇÃO GERAL */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* ============================================ */
/* CABEÇALHO PRINCIPAL */
/* ============================================ */
header {
    background: #0a3d62;
    color: white;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    align-items: center;
}

header h2 {
    margin: 0;
    font-size: 1.5rem;
}

nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 8px 15px;
    transition: all 0.3s;
}

nav button:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}

/* ============================================ */
/* CABEÇALHO DO PAINEL */
/* ============================================ */
.header-painel {
    background: linear-gradient(135deg, #0a3d62 0%, #1e5a7d 100%);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.painel-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.painel-logo-esquerda {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.logo-pequeno {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffd700;
    background: white;
    padding: 5px;
}

.logo-texto {
    color: white;
    font-size: 12px;
    margin-top: 5px;
    font-weight: bold;
}

.painel-imagem-central {
    flex: 1;
    text-align: center;
}

.imagem-central {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

.painel-imagem-direita {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.imagem-direita {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    background: white;
    padding: 5px;
}

.texto-direita {
    color: #ffd700;
    font-size: 11px;
    margin-top: 5px;
    text-align: center;
    font-weight: bold;
}

/* ============================================ */
/* SISTEMA DE TELAS */
/* ============================================ */

.tela {
    display: none !important;
    position: relative;
    z-index: 1;
}

.tela.ativa {
    display: block !important;
}

#cadastro.tela.ativa {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100vh !important;
    background: #f8f9fa !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000 !important;
}

#insercao.tela.ativa {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(10, 61, 98, 0.95) !important;
    z-index: 1000 !important;
    justify-content: center !important;
    align-items: center !important;
}

#home.tela.ativa,
#auth.tela.ativa,
#painel.tela.ativa,
#registros.tela.ativa {
    display: block !important;
    position: relative !important;
    background: transparent !important;
}

/* ============================================ */
/* HOME - MAPA e CARDS */
/* ============================================ */
.home {
    display: flex;
    flex-wrap: wrap;
}

.card-datafish {
    background: #0a3d62;
    color: white;
    padding: 20px;
    margin: 10px;
    border-radius: 10px;
    transition: transform 0.3s;
}

.card-datafish:hover {
    transform: translateY(-5px);
}

#map {
    width: 100%;
    max-width: 800px;
    height: 500px;
    margin: 20px auto;
    border-radius: 10px;
}

/* ============================================ */
/* LOGIN E CADASTRO */
/* ============================================ */
.card-auth {
    width: 280px;
    background: #cfcfcf;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #2e8b57;
    text-align: center;
    margin: auto;
}

.card-auth input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 10px;
    border: none;
}

.btn-entrar {
    background: #2f5fa7;
    border-radius: 15px;
    width: 100%;
    padding: 10px;
    color: white;
    border: none;
    cursor: pointer;
}

.cadastro-link {
    display: block;
    margin-top: 10px;
    color: #2f5fa7;
    text-decoration: none;
    cursor: pointer;
}

.logo {
    width: 100px;
    display: block;
    margin: 20px auto;
}

.cadastro-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 350px;
}

.cadastro-card input,
.cadastro-card select {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.cadastro-card button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #0a3d62;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* ============================================ */
/* PAINEL CENTRAL */
/* ============================================ */
.painel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 80px;
    gap: 40px;
}

.painel-card {
    width: 300px;
    background: #0c2d57;
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.3s;
}

.painel-card:hover {
    transform: scale(1.05);
}

.painel-titulo {
    background: #bfc4c9;
    color: black;
    padding: 8px;
    border-radius: 20px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* ============================================ */
/* TELA REGISTROS */
/* ============================================ */
.registros-container {
    max-width: 700px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.registros-container h2 {
    margin-bottom: 10px;
    color: #0a3d62;
}

.btn-novo {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-novo:hover {
    background: #218838;
    transform: scale(1.02);
}

#lista-registros {
    margin-top: 30px;
    list-style: none;
    padding: 0;
}

#lista-registros li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 12px 20px;
    margin: 8px 0;
    border-radius: 10px;
    border-left: 4px solid #0a3d62;
    transition: all 0.2s;
}

#lista-registros li:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.registro-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.registro-numero {
    font-weight: bold;
    color: #0a3d62;
    background: #e3f2fd;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.registro-data {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.registro-data i {
    color: #0a3d62;
    font-size: 12px;
}

.btn-editar {
    background: #0a3d62;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-editar:hover {
    background: #1e5a7d;
    transform: scale(1.02);
}

/* ============================================ */
/* TELA INSERÇÃO */
/* ============================================ */
.insercao-card {
    max-width: 550px;
    width: 100%;
    background: white;
    padding: 35px;
    border-radius: 25px;
    max-height: 90vh;
    overflow-y: auto;
}

.input-insercao {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
}

.botoes-insercao {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 35px;
}

.btn-salvar, .btn-voltar {
    padding: 12px 35px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.btn-salvar {
    background: linear-gradient(135deg, #0a3d62, #1e5a7d);
    color: white;
}

.btn-voltar {
    background: #6c757d;
    color: white;
}

.btn-novo-registro,
.btn-meu-painel,
.btn-ver-registros {
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.btn-novo-registro:hover,
.btn-meu-painel:hover,
.btn-ver-registros:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#mensagem-sucesso,
#botoes-navegacao {
    animation: fadeInUp 0.5s ease-out;
}

/* ============================================ */
/* DASHBOARD */
/* ============================================ */
.section {
    display: none !important;
}

.section.active {
    display: block !important;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-navbar {
    background: #0a3d62 !important;
}

.dashboard-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

#dashboard-content .table {
    font-size: 14px;
}

#dashboard-content .table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

#dashboard-content .table td {
    vertical-align: middle;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

#dashboard-content .form-control,
#dashboard-content .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
}

#dashboard-content .form-control:focus,
#dashboard-content .form-select:focus {
    border-color: #0a3d62;
    box-shadow: 0 0 0 0.2rem rgba(10,61,98,0.25);
}

.badge {
    font-weight: 500;
    padding: 5px 10px;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.toast {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-header {
    border-radius: 10px 10px 0 0;
}

/* ============================================ */
/* RESPONSIVIDADE */
/* ============================================ */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
    }
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .painel-header-container {
        flex-direction: column;
    }
    
    #lista-registros li {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .registro-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-editar {
        width: 100%;
        max-width: 150px;
    }
    
    .cadastro-card {
        width: 90%;
        margin: 20px;
    }
    
    .status-otimo { background-color: #d4edda; color: #155724; }
    .status-bom { background-color: #d1ecf1; color: #0c5460; }
    .status-alerta { background-color: #fff3cd; color: #856404; }
    .status-critico { background-color: #f8d7da; color: #721c24; }
    
    .indicador-card {
        transition: transform 0.2s;
        cursor: pointer;
    }
    
    .indicador-card:hover {
        transform: translateY(-5px);
    }
    
    .indicador-valor {
        font-size: 1.8rem;
        font-weight: bold;
    }
    
    .indicador-label {
        font-size: 0.8rem;
        color: #6c757d;
    }
/* FORÇAR VISIBILIDADE DOS CARDS DA RAÇÃO */
#racao-section .row {
    display: flex !important;
    flex-wrap: wrap !important;
}

#racao-section .col-md-4 {
    display: block !important;
    flex: 0 0 auto !important;
    width: 33.33333333% !important;
}

#racao-section .card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#racao-section .card-header {
    display: block !important;
}

#racao-section .card-body {
    display: block !important;
}

#racao-section form {
    display: block !important;
}

#racao-section .mb-3 {
    display: block !important;
    margin-bottom: 1rem !important;
}

#racao-section input,
#racao-section select,
#racao-section textarea,
#racao-section button {
    display: block !important;
    width: 100% !important;
}
/* ============================================ */
/* FORÇAR VISIBILIDADE DOS CARDS DA RAÇÃO */
/* ============================================ */

#racao-section .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: -15px !important;
    margin-left: -15px !important;
}

#racao-section .col-md-4 {
    display: block !important;
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}

#racao-section .card {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    word-wrap: break-word !important;
    background-color: #fff !important;
    background-clip: border-box !important;
    border: 1px solid rgba(0,0,0,.125) !important;
    border-radius: 0.25rem !important;
    margin-bottom: 1rem !important;
}

#racao-section .card-header {
    padding: 0.75rem 1.25rem !important;
    margin-bottom: 0 !important;
    background-color: rgba(0,0,0,.03) !important;
    border-bottom: 1px solid rgba(0,0,0,.125) !important;
}

#racao-section .card-body {
    flex: 1 1 auto !important;
    padding: 1.25rem !important;
}

#racao-section .form-control,
#racao-section .form-select {
    display: block !important;
    width: 100% !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: #212529 !important;
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
}

#racao-section .btn {
    display: inline-block !important;
    font-weight: 400 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border-radius: 0.25rem !important;
}

#racao-section .btn-primary {
    color: #fff !important;
    background-color: #007bff !important;
    border-color: #007bff !important;
}

#racao-section .btn-warning {
    color: #212529 !important;
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
}

#racao-section .btn-danger {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

#racao-section .mb-3 {
    margin-bottom: 1rem !important;
}

/* Garantir que a tabela apareça */
#tabela-estoque-racao {
    width: 100% !important;
    margin-bottom: 1rem !important;
    background-color: transparent !important;
}

#tabela-estoque-racao th,
#tabela-estoque-racao td {
    padding: 0.75rem !important;
    vertical-align: top !important;
    border-top: 1px solid #dee2e6 !important;
}

#tabela-estoque-racao thead th {
    vertical-align: bottom !important;
    border-bottom: 2px solid #dee2e6 !important;
}
}