/* =========================================================
   ESTILOS GERAIS E VARIÁVEIS
   ========================================================= */
* {
    box-sizing: border-box;
}

:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #111827;
    --blue: #2563eb;
    --red: #dc2626;
    --green: #16a34a;
}

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-family: sans-serif;
}

/* Layout */
.chm-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.chm-card {
    background: var(--card);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

/* Cabeçalho do Card (título + botão) */
.chm-card .header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* Formulários */
.chm-card input, .chm-card select, .chm-card textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    background: transparent;
    color: var(--text);
}

/* =========================================================
   BOTÕES (CORRIGIDOS)
   ========================================================= */
.chm-btn, .chm-edit-btn, .chm-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

/* Botão de Adicionar Hóspede (Principal) */
.chm-btn {
    background-color: #2271b1 !important;
    color: #ffffff !important;
}

.chm-btn:hover {
    background-color: #135e96 !important;
    color: #ffffff !important;
}

.chm-edit-btn { background: var(--blue); color: #fff; }
.chm-delete-btn { background: var(--red); color: #fff; }

/* =========================================================
   STATUS E TABELAS
   ========================================================= */
.chm-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chm-status-active { background: rgba(22, 163, 74, .15); color: var(--green); }
.chm-status-future { background: rgba(37, 99, 235, .15); color: var(--blue); }
.chm-status-ended { background: rgba(107, 114, 128, .15); color: var(--muted); }

.chm-card table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.chm-card th { text-align: left; font-size: 13px; color: var(--muted); padding: 10px; }
.chm-card td { padding: 14px; background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.chm-card tr td:first-child { border-left: 1px solid var(--border); border-radius: 12px 0 0 12px; }
.chm-card tr td:last-child { border-right: 1px solid var(--border); border-radius: 0 12px 12px 0; }
.chm-card tr:hover td { background: rgba(37, 99, 235, .04); }

/* =========================================================
   RESPONSIVIDADE (MOBILE)
   ========================================================= */
@media (max-width: 768px) {
    .header-row { flex-direction: column; align-items: stretch; }
    
    #chm-mobile-table,
    #chm-mobile-table thead,
    #chm-mobile-table tbody,
    #chm-mobile-table th,
    #chm-mobile-table td,
    #chm-mobile-table tr {
        display: block !important;
        width: 100% !important;
    }

    #chm-mobile-table thead { display: none !important; }

    #chm-mobile-table tr {
        margin-bottom: 20px !important;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        padding: 15px !important;
        background: var(--card) !important;
    }

    #chm-mobile-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border: none !important;
        padding: 8px 0 !important;
    }

    #chm-mobile-table td::before {
        content: attr(data-label) !important;
        font-weight: bold !important;
        color: var(--muted) !important;
    }
}