:root {
    --bg-body: #f3f6fd;
    --sidebar-bg: #ffffff;
    --accent-blue: #0061ff;
    --accent-telegram: #0088cc;
    --text-main: #2d3748;
    --text-muted: #718096;
    --white: #ffffff;
    --border-radius: 16px;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-preview: 0 12px 30px rgba(0,0,0,0.15);
}

body, html {
    margin: 0; padding: 0; height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow: hidden;
}

.app-container { display: flex; height: 100vh; width: 100%; }

/* BARRA LATERAL */
.sidebar {
    width: 320px; 
    background-color: var(--sidebar-bg);
    border-right: 1px solid #e2e8f0;
    display: flex; 
    flex-direction: column;
    padding: 24px; 
    box-sizing: border-box;
    height: 100vh;
}

.logo {
    font-weight: 800; font-size: 1.2rem; color: #1a202c;
    margin-bottom: 25px; display: flex;
    align-items: center; justify-content: center; gap: 12px;
    flex-shrink: 0;
}
.logo img { width: 30px; height: 30px; }

.event-box {
    background: #f8fafc; padding: 15px; border-radius: 12px;
    margin-bottom: 25px; border: 1px solid #edf2f7;
    flex-shrink: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.select-custom {
    width: 100%; padding: 10px; border-radius: 8px;
    border: 1px solid #e2e8f0; font-size: 0.85rem;
    background-color: white;
}
.btn-new-event {
    width: 100%; background: var(--white); border: 1px dashed var(--accent-blue);
    color: var(--accent-blue); padding: 8px; border-radius: 8px;
    font-size: 0.8rem; font-weight: 700; cursor: pointer;
}

.preview-outer-container {
    flex: 1;
    display: flex;
    align-items: center; 
    justify-content: center;
    min-height: 0;
    margin-bottom: 20px;
    padding: 20px; 
    overflow: hidden;
}

.preview-wrapper {
    background: var(--white);
    padding: 12px;
    border-radius: 15px;
    box-shadow: var(--shadow-preview);
    border: 1px solid #f0f0f0;
    max-height: 100%;
    max-width: 90%; 
    aspect-ratio: 1 / 2; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    flex-shrink: 1;
}

.img-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 1;
    min-height: 0;
}

.qr-container {
    background: white;
    padding: 4px; 
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #f1f1f1;
    width: 100%;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    flex-shrink: 1;
    min-height: 0;
}
.qr-img { width: 100%; height: 100%; object-fit: contain; }

.profile-section {
    margin-top: auto; padding-top: 15px;
    border-top: 1px solid #edf2f7; display: flex;
    align-items: center; gap: 10px;
    flex-shrink: 0;
}
.profile-img { width: 35px; height: 35px; border-radius: 50%; background: #cbd5e1; }

/* ÁREA PRINCIPAL */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    padding: 25px; overflow-y: auto;
    max-width: 1400px; width: 90%; margin: 0 auto;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 25px; }
.stat-card { background: var(--white); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--shadow-card); display: flex; align-items: center; gap: 12px; }
.icon-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

.content-card { background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow-card); padding: 24px; display: flex; flex-direction: column; margin-bottom: 25px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; gap: 20px; }
.search-input { flex: 1; padding: 10px 15px; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 0.85rem; outline: none; }
.table-responsive { max-height: 380px; overflow-y: auto; }

table { width: 100%; border-collapse: collapse; }
thead th { position: sticky; top: 0; background: white; z-index: 5; }
th { text-align: left; padding: 12px; color: var(--text-muted); font-size: 0.7rem; border-bottom: 1px solid #edf2f7; text-transform: uppercase; }
td { padding: 14px 12px; border-bottom: 1px solid #edf2f7; font-size: 0.8rem; }

.btn-telegram { background-color: var(--accent-telegram); color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.7rem; }
.badge { padding: 4px 8px; border-radius: 6px; font-size: 0.65rem; font-weight: 700; }
.bg-success { background: #e6fffa; color: #319795; }
.bg-warning { background: #fffaf0; color: #dd6b20; }

.extra-functions-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    width: 100%;
}
.btn-function {
    background: var(--white); border: 1px solid #e2e8f0;
    padding: 18px 10px; border-radius: var(--border-radius);
    cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: var(--text-muted); font-size: 0.85rem; font-weight: 700;
    box-shadow: var(--shadow-card);
}
.btn-function span { font-size: 1.5rem; }
.btn-function:hover { transform: translateY(-3px); border-color: var(--accent-blue); color: var(--accent-blue); }