/* ============================================================
   --- BASE E ESTRUTURA ---
   ============================================================ */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f4f7f6; 
    margin: 0; 
    padding: 15px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.wrapper { 
    width: 100%; 
    max-width: 800px; 
}

.container { 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
    width: 100%; 
    box-sizing: border-box; 
}

h2 { 
    text-align: center; 
    color: #333; 
    margin-top: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px;
}

/* ============================================================
   --- MENU DA PÁGINA INICIAL ---
   ============================================================ */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.menu-item i {
    font-size: 40px;
    color: #007bff;
    margin-bottom: 15px;
}

.menu-item span {
    font-weight: bold;
    font-size: 16px;
}

.stats {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* ============================================================
   --- FORMULÁRIOS E INPUTS ---
   ============================================================ */
.form-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
}

.form-group { 
    flex: 1; 
    min-width: 150px; 
}

label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
    color: #555;
}

input, select, .custom-select { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 16px; 
    background-color: #fff;
}

/* ============================================================
   --- BOTÕES ---
   ============================================================ */
.btn { 
    padding: 10px 15px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    color: white; 
    font-weight: bold; 
    text-decoration: none; 
    display: inline-block; 
    text-align: center; 
    transition: 0.2s; 
    font-size: 14px; 
}

.btn-save { background: #28a745; width: 100%; font-size: 16px; padding: 14px; margin-top: 10px; }
.btn-save:hover { background: #218838; }

.btn-edit { background: #007bff; }
.btn-del { background: #dc3545; }
.btn-cancel { background: #6c757d; width: 100%; margin-top: 10px; }

.btn-disabled { 
    background-color: #ccc !important; 
    color: #666 !important;
    cursor: not-allowed !important; 
    pointer-events: none !important; 
    opacity: 0.5;
}

/* ============================================================
   --- TABELAS ---
   ============================================================ */
table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

th, td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #eee; 
}

th { background-color: #007bff; color: white; }
tr:hover { background-color: #f9f9f9; }

.acoes-container { display: flex; gap: 5px; }

/* ============================================================
   --- IMAGENS E BADGES ---
   ============================================================ */
.foto-lista { 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 1px solid #ddd; 
}

.badge { 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: bold; 
    display: inline-block; 
}

.st-2 { background: #fff3cd; color: #856404; } /* Incompleto */
.st-1 { background: #d4edda; color: #155724; } /* Ativo */
.st-0 { background: #f8d7da; color: #721c24; } /* Inativo */

/* ============================================================
   --- SWITCH DESLIZANTE ---
   ============================================================ */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #28a745; }
input:checked + .slider:before { transform: translateX(18px); }

/* ============================================================
   --- MENSAGENS E FILTROS ---
   ============================================================ */
.alert { padding: 15px; border-radius: 4px; margin-bottom: 15px; text-align: center; }
.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.alphabet-filter { 
    display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; 
    margin: 15px 0; background: #fff; padding: 10px; border-radius: 8px; width: 100%;
}
.alphabet-filter a { text-decoration: none; padding: 5px 10px; background: #eee; color: #333; border-radius: 4px; font-weight: bold; font-size: 13px; }
.alphabet-filter a.active { background: #007bff; color: #fff; }

/* ============================================================
   --- RESPONSIVIDADE MOBILE ---
   ============================================================ */
@media (max-width: 600px) {
    .form-row { flex-direction: column; }
    table, thead, tbody, th, td, tr { display: block; width: 100%; }
    thead tr { display: none; } 
    
    tr { 
        margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; 
        padding: 10px; background: #fff; box-sizing: border-box; 
    }
    
    td { text-align: center; border: none; padding: 8px 0; position: relative; }
    
    td[data-label="Foto"] .foto-lista { width: 80px; height: 80px; margin: 0 auto; }
    
    td[data-label]:not([data-label="Foto"]):not([data-label="Ações"])::before {
        display: block;
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #007bff;
        margin-bottom: 5px;
    }
    
    .acoes-container { flex-direction: column; gap: 8px; width: 100%; }
    .acoes-container .btn { width: 100%; padding: 12px; }

    /* Ajuste para o Menu da Home no Mobile */
    .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .menu-item { padding: 20px 10px; }
    .menu-item i { font-size: 30px; }
}
