:root {
    --bg: #f8fafc;
    --text: #111827;
    --secondary: #647084;
    --accent: #2b5aff;
    --border: rgba(17, 24, 39, .08);
    --success: #087f5b;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
a { color: inherit; }
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 0 0, #2b5aff14, transparent 55%), radial-gradient(ellipse at 100% 80%, #8c2bff0c, transparent 60%); }
.topbar { padding: 22px 4vw; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); background: #ffffff80; backdrop-filter: blur(20px); }
.brand { text-decoration: none; font-weight: 800; font-size: 25px; letter-spacing: -1px; display: flex; align-items: baseline; }
.brand > span { color: var(--accent); }
.brand small { font-size: 9px; letter-spacing: 2px; margin-left: 14px; color: var(--secondary); }
.connection { font-size: 11px; color: var(--success); border: 1px solid #087f5b20; border-radius: 30px; padding: 6px 10px; background: #ecfdf5; white-space: nowrap; }
.connection.offline { color: #92400e; background: #fffbeb; border-color: #f59e0b30; }
main { max-width: 1600px; padding: 32px 4vw; margin: auto; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow { font-size: 9px; letter-spacing: 1.7px; font-weight: 700; color: var(--secondary); margin: 0 0 8px; }
h1 { font-size: clamp(24px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.18; margin: 0; font-weight: 750; }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.025em; margin: 0; }
p { color: var(--secondary); font-size: 14px; }
.identity { font-size: 12px; color: var(--secondary); text-align: right; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr); gap: 22px; align-items: start; }
.panel { padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: #ffffffc7; box-shadow: 0 6px 30px #11182703; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tag { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.tag.muted { color: var(--secondary); text-align: right; }
.meeting { min-height: 490px; display: flex; flex-direction: column; background: linear-gradient(145deg, #ffffffcf, #f1f5ffb0); }
.meeting-center { margin: auto; padding: 32px 8%; text-align: center; max-width: 620px; }
.meeting-symbol { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 24px; border-radius: 22px; color: var(--accent); background: white; border: 1px solid #2b5aff12; box-shadow: 0 10px 40px #2b5aff12; font-size: 24px; }
.meeting h2 { font-size: clamp(22px, 2.4vw, 30px); }
.meeting-center .btn-primary { margin: 10px 0; }
.meeting-footer { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--secondary); padding-top: 14px; border-top: 1px solid var(--border); }
.tools { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.attendance-number { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.attendance-number strong { font-size: 48px; font-weight: 750; letter-spacing: -3px; line-height: 1; }
.attendance-number span { font-size: 11px; color: var(--secondary); }
progress { display: block; width: 100%; height: 7px; appearance: none; border: 0; border-radius: 10px; background: #edf0f5; }
progress::-webkit-progress-bar { background: #edf0f5; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; transition: width .3s; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 10px; }
.caption { font-size: 11px; line-height: 1.6; }
.attendance-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--secondary); font-size: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.btn-primary, .btn-outline { display: inline-flex; justify-content: center; align-items: center; gap: 10px; border-radius: 10px; padding: 11px 18px; font-weight: 600; font-size: 13px; text-decoration: none; border: 1px solid transparent; transition: background .2s, transform .2s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2248d0; transform: translateY(-1px); }
.btn-outline { border-color: var(--border); background: white; color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.icon-button { border: 1px solid var(--border); background: white; border-radius: 10px; min-width: 36px; min-height: 36px; font-size: 24px; line-height: 1; color: var(--accent); }
.text-button { border: 0; background: transparent; color: var(--secondary); text-decoration: underline; font-size: 12px; padding: 8px; }
.poll { border-top: 1px solid var(--border); padding: 18px 0; }
.poll:first-child { border-top: none; padding-top: 0; }
.poll:last-child { padding-bottom: 0; }
.poll h3 { font-size: 14px; margin: 6px 0 14px; overflow-wrap: anywhere; }
.poll .poll-status { font-size: 10px; color: var(--secondary); }
.poll-option { display: block; width: 100%; padding: 10px 12px; margin: 7px 0; border-radius: 9px; border: 1px solid var(--border); background: #f8fafc; text-align: left; font-size: 12px; overflow-wrap: anywhere; color: var(--text); }
button.poll-option:hover { border-color: var(--accent); background: #eef2ff; }
.poll-option.selected { border-color: var(--accent); color: var(--accent); }
.poll-option progress { margin-top: 7px; height: 4px; }
.poll .btn-outline { font-size: 11px; margin-top: 8px; padding: 7px 10px; }
.empty { text-align: center; padding: 24px 4px; font-size: 12px; }
.attendees-panel { grid-column: 1 / -1; }
.search-label { margin-top: 18px; }
.table-scroll { overflow-x: auto; margin-top: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { color: var(--secondary); font-weight: 500; }
td, th { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
td small { display: block; color: var(--secondary); overflow-wrap: anywhere; }
.review-actions { display: flex; gap: 6px; }
.review-actions button { font-size: 11px; padding: 7px 10px; }
.notice { padding: 14px 18px; border: 1px solid #f59e0b40; border-radius: 12px; color: #92400e; background: #fffbeb; margin-bottom: 20px; font-size: 13px; }
.page-footer { padding: 8px 4vw 24px; color: var(--secondary); font-size: 11px; display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 8px; }
dialog { border: 1px solid var(--border); border-radius: 22px; background: #fff; color: var(--text); padding: 30px; width: min(460px, calc(100% - 28px)); max-height: calc(100dvh - 28px); box-shadow: 0 24px 80px #11182726; }
dialog::backdrop { background: #11182745; backdrop-filter: blur(8px); }
dialog h2 { font-size: 25px; margin-top: 10px; }
dialog p { font-size: 12px; }
label { display: block; font-size: 12px; color: var(--secondary); font-weight: 600; margin: 16px 0 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; padding: 11px 12px; color: var(--text); font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #2b5aff14; background: white; }
textarea { resize: vertical; }
.check-label { display: flex; gap: 10px; font-size: 11px; font-weight: 400; align-items: flex-start; line-height: 1.5; }
.check-label input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent); }
form > .btn-primary { width: 100%; margin-top: 12px; }
form > .text-button { display: block; margin: 10px auto 0; }
.form-error { color: #b91c1c; margin: 8px 0; }
body.embedded .topbar { padding: 14px 18px; }
body.embedded main { padding: 20px 18px; }
body.embedded .workspace-grid { grid-template-columns: 1fr; }
body.embedded .intro { margin-bottom: 18px; }
body.embedded h1 { font-size: 23px; }
body.embedded .meeting { min-height: auto; }
body.embedded .meeting-center { padding: 12px 0; }
body.embedded .meeting-symbol, body.embedded .meeting-footer, body.embedded .intro .eyebrow { display: none; }
body.embedded .meeting h2 { font-size: 19px; }
body.embedded .meeting .caption { margin-bottom: 0; }
body.embedded .panel { padding: 18px; border-radius: 15px; }
.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.switch-label input[type="checkbox"] {
    appearance: none;
    width: 32px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.2s;
    margin: 0;
}
.switch-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch-label input[type="checkbox"]:checked {
    background: #5aba47;
}
.switch-label input[type="checkbox"]:checked::after {
    transform: translateX(14px);
}
.btn-danger {
    background: transparent;
    color: #c92127;
    border: 1px solid #c92127;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover {
    background: #c92127;
    color: white;
}

/* Dropdown para acciones de encuesta */
.poll-actions-dropdown {
    position: relative;
    display: inline-block;
}
.poll-actions-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
    color: #5d5d5d;
}
.poll-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 10;
    padding: 8px;
    border: 1px solid #e2e8f0;
}
.poll-actions-menu.show {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.poll-actions-menu > * {
    width: 100%;
    justify-content: space-between;
}

/* Acordeón para encuestas */
.poll-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    user-select: none;
}
.poll-accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}
.poll-accordion-toggle {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #5d5d5d;
    transition: transform 0.2s;
}
.poll-accordion-content {
    display: none;
    margin-top: 10px;
}
.poll.expanded .poll-accordion-content {
    display: block;
}
.poll.expanded .poll-accordion-toggle {
    transform: rotate(180deg);
}

.tag.error {
    background: #fef2f2;
    color: #c92127;
}

/* Tabs y Dashboard Admin */
.admin-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}
.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #718096;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}
.tab-btn:hover { color: #2d3748; }
.tab-btn.active {
    color: #2b6cb0;
    border-bottom-color: #2b6cb0;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.summary-cards .card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}
.summary-cards .card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.summary-cards .card .number {
    margin: 0;
    font-size: 2.5rem;
    font-weight: bold;
    color: #2b6cb0;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.report-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.report-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    text-align: center;
    color: #2d3748;
}
.pie-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}
.chart-legend {
    width: 100%;
    font-size: 0.85rem;
}
.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #edf2f7;
}
.legend-item:last-child { border-bottom: none; }
.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
    display: inline-block;
    flex-shrink: 0;
}
.legend-label {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4a5568;
}

@media (max-width: 992px) {
    .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); gap: 16px; }
    .panel { padding: 20px; }
}
@media (max-width: 680px) {
    .workspace-grid { grid-template-columns: 1fr; }
    .topbar { padding: 16px 5vw; }
    .brand small { display: none; }
    main { padding: 24px 5vw; }
    .intro { align-items: flex-start; flex-direction: column; gap: 10px; }
    .identity { text-align: left; }
    .meeting { min-height: 300px; }
    .meeting-center { padding: 16px 0; }
    .meeting-symbol { width: 48px; height: 48px; margin-bottom: 16px; border-radius: 16px; }
    .section-heading { flex-wrap: wrap; }
    dialog { padding: 24px; }
    input, select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
