/* =========================================
   🎨 ESTILO MOBILE FIRST (DEFINITIVO)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--dark);
    margin: 0;
    padding: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1000px; margin: 0 auto; width: 100%; }
a { text-decoration: none; transition: 0.2s; }

/* TÍTULOS */
h1 { font-size: 1.5rem; text-align: center; color: var(--dark); margin-bottom: 20px; }
h2 { font-size: 1.3rem; color: var(--dark); margin-bottom: 15px; }

/* CARDS */
.card, .box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 25px;
    width: 100%;
    overflow: hidden;
}
.box { max-width: 500px; margin: 0 auto; }

/* FORMULÁRIOS */
label { font-size: 0.85rem; font-weight: 600; color: var(--gray); margin-bottom: 8px; display: block; text-transform: uppercase; }
input, select {
    width: 100%; padding: 12px 15px; border: 2px solid #e5e7eb; border-radius: 10px;
    font-size: 16px; background-color: #f9fafb; height: 50px; margin-bottom: 0;
    font-family: 'Poppins', sans-serif;
}
input:focus, select:focus { outline: none; border-color: var(--primary); background-color: #fff; }

.form-row { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 15px; }
.form-row > div { flex: 1; min-width: 100%; }

/* BOTÕES GERAIS */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 20px; height: 50px; font-weight: 600; font-size: 0.95rem;
    border-radius: 50px; border: none; cursor: pointer; text-transform: uppercase;
    width: 100%; margin-bottom: 10px; transition: transform 0.1s;
}
.btn:active { transform: scale(0.98); }

/* CORES */
.btn-primary { background-color: var(--primary); color: white; }
.btn-success { background-color: var(--success); color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-warning { background-color: var(--warning); color: #fff; }
.btn-info { background-color: #06b6d4; color: white; }
.btn-back { background: white; border: 2px solid #e5e7eb; color: var(--gray); }

/* --- DESKTOP (PC) --- */
@media (min-width: 769px) {
    .form-row > div { min-width: auto; }
    .btn { width: auto; margin-bottom: 0; }
    
    table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
    th { text-align: left; padding: 15px; color: var(--gray); font-size: 0.8rem; text-transform: uppercase; }
    td { background: #fff; padding: 15px; border-top: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
    td:first-child { border-left: 1px solid #f3f4f6; border-radius: 10px 0 0 10px; }
    td:last-child { border-right: 1px solid #f3f4f6; border-radius: 0 10px 10px 0; text-align: right; }
    
    .actions-cell { display: flex; gap: 5px; justify-content: flex-end; }
    .actions-cell .btn { height: 35px; font-size: 0.75rem; padding: 0 15px; }
}

/* --- MOBILE (CELULAR) - AQUI ESTÁ A CORREÇÃO --- */
@media (max-width: 768px) {
    /* Esconde cabeçalho da tabela */
    thead { display: none; }
    
    /* Linha vira Cartão */
    tr {
        display: block; background: white; border: 1px solid #e5e7eb;
        border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    }
    
    td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 12px 20px; border-bottom: 1px solid #f3f4f6; text-align: right; font-size: 0.95rem;
    }
    
    td:before {
        content: attr(data-label); font-weight: 700; color: var(--gray);
        font-size: 0.8rem; text-transform: uppercase; margin-right: 15px; text-align: left;
    }

    /* Título do Evento */
    td[data-label="Evento"] {
        background-color: #f9fafb; flex-direction: column; align-items: flex-start;
        padding: 15px 20px; border-bottom: 2px solid #e5e7eb;
    }
    td[data-label="Evento"]:before { display: none; }
    
    /* --- AQUI É A MÁGICA DOS BOTÕES LADO A LADO --- */
    td:last-child {
        display: block; /* Remove o display:grid antigo que estava bugando */
        padding: 15px;
        background: #fff;
        border-bottom: none;
    }

    .actions-cell {
        display: flex !important;      /* Força Flexbox */
        flex-direction: row !important;/* Força Linha Horizontal */
        gap: 10px;                     /* Espaço entre eles */
        width: 100%;
    }

    /* Estilo dos botões dentro da célula de ação */
    .actions-cell .btn {
        flex: 1;             /* Cada botão ocupa 50% */
        width: auto !important;
        margin: 0 !important; /* Remove margem de baixo */
        height: 45px;
        font-size: 0.8rem;    /* Fonte um pouco menor pra caber */
        padding: 0 5px;       /* Padding menor pra não quebrar texto */
        white-space: nowrap;  /* Impede o texto de quebrar linha */
    }
}

/* MODAL */
.modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.modal-content { background-color: #fff; margin: 15vh auto; padding: 30px; border-radius: 16px; width: 90%; max-width: 400px; text-align: center; position: relative; animation: subir 0.3s ease-out; }
@keyframes subir { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close { position: absolute; top: 15px; right: 20px; color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.success-screen { padding: 10px; }
.qr-code { width: 100%; max-width: 180px; height: auto; }