/* ==========================================
   RESET GLOBAL
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    background: #f3f3f3;
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   TIPOGRAFIA
========================================== */
h1, h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 14px;
    color: #333;
}

p {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ==========================================
   LINKS
========================================== */
a {
    color: #2E7D32;
    font-weight: bold;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #1B5E20;
}


/* ==========================================
   INPUTS / SELECTS / TEXTAREA
========================================== */
input,
select,
textarea {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 1px solid #bbb;
    border-radius: 10px;
    background: #fff;
    font-size: 16px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.35);
}
/* ==========================================
   BOTÕES
========================================== */
.btn, a.btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 15px;
    border-radius: 12px;
    border: none;

    background: #2E7D32;
    color: #fff !important;

    font-size: 18px;
    cursor: pointer;
    text-align: center;
    letter-spacing: .3px;
    text-decoration: none !important;

    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
}

.btn:hover, a.btn:hover {
    background: #1B5E20;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.3);
}

.btn:active, a.btn:active {
    background: #0D3B16;
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ==========================================
   ALERTAS
========================================== */
.alert {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 16px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}

/* ==========================================
   CONTAINER PADRÃO
========================================== */
.container {
    width: 92%;
    max-width: 860px;
    margin: 35px auto;
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 0 14px rgba(0,0,0,0.12);
}

/* ==========================================
   LOGIN / REGISTER / FORM BOX
========================================== */
.login-container {
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box {
    width: 380px;
    max-width: 100%;

    /* ❌ REMOVE ISSO NO DESKTOP */
    max-height: none;
    overflow: visible;

    background: #fff;
    padding: 28px 24px;
    border-radius: 16px;
    box-shadow: 0 0 14px rgba(0,0,0,0.12);
    animation: fadeIn 0.45s ease;
}


/* Scroll interno elegante */
.login-box::-webkit-scrollbar {
    width: 6px;
}

.login-box::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
}

/* ==========================================
   PASSWORD TOGGLE (se usar)
========================================== */
.password-wrapper {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    user-select: none;
}

/* ==========================================
   REGISTER / FOOTER LINK
========================================== */
.register-link {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    font-size: 16px;
    text-align: center;
}
/* ==========================================
   TABELAS
========================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    margin-top: 20px;

    border-collapse: separate;
    border-spacing: 0;

    /* borda + 3D */
    background: #fff;
    border-radius: 14px;
    overflow: hidden;

    box-shadow:
        0 18px 35px rgba(0,0,0,0.18),
        0 6px 14px rgba(0,0,0,0.12);

    /* 🔑 controle real de largura */
    table-layout: fixed;
}

/* ================= HEADER ================= */
table th {
    background: linear-gradient(
        180deg,
        #2E7D32 0%,
        #1B5E20 100%
    );

    padding: 14px;
    color: #fff;
    font-size: 15px;
    text-align: left;

    border-right: 1px solid rgba(255,255,255,0.25);
}

table th:last-child {
    border-right: none;
}

/* ================= BODY ================= */
table td {
    padding: 12px;
    font-size: 14px;
    vertical-align: middle;

    /* linhas horizontais */
    border-bottom: 1px solid #e0e0e0;

    /* linhas verticais */
    border-right: 1px solid #e0e0e0;
}

table td:last-child {
    border-right: none;
}

/* remove borda inferior da última linha (evita sinal estranho) */
tbody tr:last-child td {
    border-bottom: none;
}

/* Hover moderno */
tbody tr:hover {
    background: #f6fbf6;
}

/* ================= CONTROLE DE LARGURA ================= */

/* Nome → ocupa todo espaço livre */
table th:nth-child(1),
table td:nth-child(1) {
    width: auto;
    white-space: nowrap;
}

/* Aniversário → largura exata */
table th:nth-child(2),
table td:nth-child(2) {
    width: 130px;
    white-space: nowrap;
}

/* Bairro → compacto */
table th:nth-child(3),
table td:nth-child(3) {
    width: 120px;
    white-space: nowrap;
}

/* Ações → só ícones */
table th:nth-child(4),
table td:nth-child(4) {
    width: 90px;
    white-space: nowrap;
}

/* ==========================================
   NOME — DESKTOP VS MOBILE
========================================== */

/* Desktop: mostra nome completo */
.nome-desktop {
    display: inline;
}

/* Desktop: esconde primeiro nome */
.nome-mobile {
    display: none;
}

/* ==========================================
   ANIMAÇÃO
========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nome-mobile { display:none; }
.nome-desktop { display:inline; }


/* HEADER */
.avisos-header {
    background:#b71c1c;
    color:#fff;
    padding:12px 14px;
    border-radius:14px;
    text-align:center;
    font-size:20px;
    font-weight:bold;
    margin-bottom:14px;
}

/* FORM */
.form-create {
    background:#fff;
    border-radius:14px;
    padding:16px;
    margin-bottom:20px;
}

.form-create select,
.form-create textarea {
    width:100%;
    padding:12px;
    border-radius:10px;
    border:1px solid #ccc;
    font-size:16px;
    margin-bottom:12px;
}

.form-create textarea {
    min-height:90px;
    resize:vertical;
}

.btn-create {
    width:100%;
    background:#2e7d32;
    color:#fff;
    padding:14px;
    border-radius:12px;
    font-size:16px;
    font-weight:bold;
    border:none;
    cursor:pointer;
}

.btn-create:hover { background:#1b5e20; }

/* AVISOS */
.aviso-box {
    padding:16px;
    border-radius:12px;
    margin-bottom:14px;
    font-size:17px;
    line-height:1.5;
}

.aviso-visitante {
    background:#e8f5e9;
    border-left:6px solid #2e7d32;
}

.aviso-oracao {
    background:#f0f0f0;
    border-left:6px solid #757575;
}

.aviso-importante {
    background:#fdecea;
    border-left:6px solid #d32f2f;
}

/* AÇÕES */
.aviso-actions {
    text-align:right;
    margin-top:10px;
}

.aviso-actions form {
    display:inline;
}

.btn-edit {
    font-size:14px;
    font-weight:bold;
    color:#333;
    text-decoration:none;
    margin-right:10px;
}

.btn-delete {
    font-size:14px;
    font-weight:bold;
    color:#d32f2f;
    background:none;
    border:none;
    cursor:pointer;
}

.btn-edit:hover,
.btn-delete:hover {
    text-decoration:underline;
}

/* AVISO VAZIO */
.aviso-empty {
    text-align:center;
    padding:18px;
    background:#e0e0e0;
    border-radius:12px;
    font-size:16px;
    color:#666;
}

/* BOTÃO SAIR FLUTUANTE (PEQUENO) */
.btn-logout-float {
    position: fixed;
    bottom: 16px;
    right: 16px;

    background: #d32f2f;
    color: #fff;

    padding: 6px 10px;
    border-radius: 8px;

    font-size: 14px;
    font-weight: bold;
    text-decoration: none;

    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 999;
}

.btn-logout-float:hover {
    background: #b71c1c;
}

/* ==========================================
   RESPONSIVO (MOBILE) — FIX DEFINITIVO
========================================== */
@media (max-width: 768px) {

    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .login-container {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        box-sizing: border-box;
    }

    .login-box {
        width: 100%;
        max-width: 100%;
        padding: 22px 18px;
        box-sizing: border-box;
        overflow: visible;
    }

    input,
    select,
    textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px;
        padding: 14px;
    }

    /* ==============================
       FIX REAL DO INPUT DATE
    ============================== */
    input[type="date"] {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        clip-path: inset(0 0 0 0);
        appearance: none;
        -webkit-appearance: none;
    }

    input[type="date"]::-webkit-calendar-picker-indicator {
        opacity: 1;
        margin: 0;
        padding: 0;
    }

    /* ==============================
       TABELA — MOBILE SEM SCROLL
    ============================== */

    /* remove scroll horizontal */
    .table-responsive {
        overflow-x: hidden;
    }

    table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    table th,
    table td {
        white-space: nowrap;
    }

    /* ESCONDE BAIRRO (3ª coluna) */
    table th:nth-child(3),
    table td:nth-child(3) {
        display: none;
    }

    /* Nome → maior espaço */
    table th:nth-child(1),
    table td:nth-child(1) {
        width: auto;
    }

    /* Aniversário → compacto */
    table th:nth-child(2),
    table td:nth-child(2) {
        width: 120px;
        text-align: center;
    }

    /* Ações → ícones */
    table th:nth-child(4),
    table td:nth-child(4) {
        width: 80px;
        text-align: center;
    }
	
	/* ==============================
     MOBILE — SOMENTE PRIMEIRO NOME
    ============================== */

    /* Nome nunca quebra linha */
    .col-nome {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobile: esconde nome completo */
    .col-nome .nome-desktop {
        display: none;
    }

    /* Mobile: mostra só o primeiro nome */
    .col-nome .nome-mobile {
        display: inline;
        margin-left: 4px;
    }
   
	.nome-desktop { display:none; }
    .nome-mobile { display:inline; }

    .top-buttons a {
        flex:1;
        font-size:14px;
        padding:12px 8px;
    }
    .btn-editar {
        padding: 4px 6px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
    }
    
	.container { padding:16px; }
    .avisos-header { font-size:18px; }
    .aviso-box { font-size:16px; }
}


/* ==========================================
   UTILS
========================================== */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }


/* ==========================================
   AJUSTE AUTOMÁTICO QUANDO HÁ BOTÕES NO TOPO
========================================== */

/* padrão: centralizado */
.login-container {
    min-height: 100svh;
    align-items: center;
}

/* se existir .top-buttons na página */
body:has(.top-buttons) .login-container {
    min-height: calc(100svh - 80px);
    align-items: flex-start;
    padding-top: 20px;
}