/* ═══════════════════════════════════════════
   Agenda de Reuniones — Estilos principales
   ═══════════════════════════════════════════ */

:root {
    --primary:       #4f46e5;
    --primary-dark:  #4338ca;
    --primary-light: #eef2ff;
    --danger:        #ef4444;
    --danger-light:  #fef2f2;
    --success:       #22c55e;
    --gray-50:       #f9fafb;
    --gray-100:      #f3f4f6;
    --gray-200:      #e5e7eb;
    --gray-400:      #9ca3af;
    --gray-600:      #4b5563;
    --gray-700:      #374151;
    --gray-900:      #111827;
    --radius:        10px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow:        0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.15);
    --transition:    .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Topbar ─────────────────────────────── */
.topbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-900);
}

.back-link {
    display: flex;
    align-items: center;
    color: var(--primary);
    padding: .25rem;
    border-radius: 6px;
    transition: background var(--transition);
}
.back-link:hover { background: var(--primary-light); }

.topbar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .875rem;
    color: var(--gray-600);
}

.online-users {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--gray-600);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: .2rem .65rem;
    white-space: nowrap;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(34,197,94,.25);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
    50%       { box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
}

/* ── Admin: panel en línea ──────────────── */
.online-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.online-panel-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    font-size: .9rem;
    color: var(--gray-700);
}

.online-panel-count {
    margin-left: auto;
    font-size: .8rem;
    color: var(--gray-400);
}

.online-panel-empty {
    font-size: .85rem;
    color: var(--gray-400);
    padding: .25rem 0;
}

.online-panel-list {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.online-panel-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: .3rem .75rem .3rem .4rem;
    font-size: .82rem;
}

.online-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.online-panel-name {
    font-weight: 500;
    color: var(--gray-700);
}

.online-panel-time {
    color: var(--gray-400);
    font-size: .75rem;
}

.presence-empty {
    color: var(--gray-400);
    font-style: italic;
}

.online-dot--off {
    background: var(--gray-300);
    box-shadow: none;
    animation: none;
}

.presence-name {
    font-weight: 500;
    color: var(--gray-700);
}

.presence-sep {
    color: var(--gray-400);
    margin: 0 .1rem;
}

.online-dot-sm {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    margin-right: .3rem;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(34,197,94,.2);
}

/* ── Container ──────────────────────────── */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ── Buttons ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}
.btn:disabled { opacity: .6; cursor: default; }

.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: .35rem;
    border-radius: 6px;
    color: var(--gray-400);
    transition: background var(--transition), color var(--transition);
    display: flex;
    align-items: center;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-icon-danger:hover { background: var(--danger-light); color: var(--danger); }

/* ── Forms ──────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .75rem;
}
.form-group:last-child { margin-bottom: 0; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.required { color: var(--danger); }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
    padding: .6rem .85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: .9rem;
    color: var(--gray-900);
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    font-family: inherit;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

/* ── Alerts ─────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 1rem;
}
.alert-error   { background: var(--danger-light); color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Auth pages ─────────────────────────── */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-logo {
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: .25rem;
}

.auth-sub {
    color: var(--gray-400);
    font-size: .875rem;
    margin-bottom: 1.75rem;
}

.auth-form { text-align: left; }
.auth-form .form-group { margin-bottom: 1rem; }

.auth-footer {
    margin-top: 1.5rem;
    font-size: .85rem;
    color: var(--gray-400);
}
.auth-footer a { color: var(--primary); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Dashboard ──────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.meetings-grid {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.meeting-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    border: 1.5px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
}
.meeting-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.meeting-date-badge {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    padding: .5rem .75rem;
    text-align: center;
    min-width: 58px;
    flex-shrink: 0;
}
.meeting-date-badge .day   { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.meeting-date-badge .month { display: block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.meeting-date-badge .year  { display: block; font-size: .65rem; color: var(--gray-400); margin-top: .1rem; }

.meeting-info { flex: 1; min-width: 0; }
.meeting-info h3 {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .2rem;
}
.meeting-time, .meeting-meta {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--gray-400);
    margin-right: .75rem;
}

.meeting-arrow {
    font-size: 1.5rem;
    color: var(--gray-400);
    flex-shrink: 0;
}

/* ── Empty state ────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
}
.empty-state svg { margin-bottom: 1rem; opacity: .4; }
.empty-state p { margin-bottom: 1.25rem; font-size: .95rem; }

/* ── Meeting hero ───────────────────────── */
.meeting-hero {
    background: white;
    border-radius: var(--radius);
    padding: 1.75rem;
    border: 1.5px solid var(--gray-200);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}
.meeting-hero-info { flex: 1; }
.meeting-hero-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .6rem;
}
.meeting-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    margin-bottom: .75rem;
}
.meeting-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    color: var(--gray-600);
}
.oraciones-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .6rem;
}

.oracion-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #fdf4ff;
    border: 1px solid #e9d5ff;
    color: #6b21a8;
    font-size: .8rem;
    padding: .25rem .65rem;
    border-radius: 20px;
}
.oracion-badge strong { font-weight: 600; }

.meeting-hero-notes {
    font-size: .875rem;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: .6rem .85rem;
    border-radius: 8px;
    margin-top: .5rem;
}
.meeting-hero-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .meeting-hero { flex-direction: column; }
    .meeting-hero-actions { flex-direction: row; flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; }
}

/* ── Punto cards ────────────────────────── */
.puntos-list { display: flex; flex-direction: column; gap: 1.1rem; }

.punto-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: box-shadow var(--transition), transform var(--transition);
}

/* Colores de acento rotativos según posición */
.punto-card:nth-child(4n+1) { border-left-color: #4f46e5; }
.punto-card:nth-child(4n+2) { border-left-color: #0ea5e9; }
.punto-card:nth-child(4n+3) { border-left-color: #10b981; }
.punto-card:nth-child(4n+4) { border-left-color: #f59e0b; }

.punto-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.11);
    transform: translateY(-1px);
}

.punto-header {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.1rem .85rem;
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(to right, rgba(249,250,251,.8), white);
}

.punto-num {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: .1rem;
}

.punto-card:nth-child(4n+1) .punto-num { background: #4f46e5; }
.punto-card:nth-child(4n+2) .punto-num { background: #0ea5e9; }
.punto-card:nth-child(4n+3) .punto-num { background: #10b981; }
.punto-card:nth-child(4n+4) .punto-num { background: #f59e0b; }

.punto-title-wrap { flex: 1; min-width: 0; }
.punto-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: .4rem;
    line-height: 1.4;
}

.punto-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .55rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 500;
}
.badge-time   { background: #fef3c7; color: #92400e; }
.badge-person { background: #f0fdf4; color: #166534; }

.punto-actions {
    display: flex;
    gap: .25rem;
    flex-shrink: 0;
}

.punto-body { padding: .75rem 1.1rem 1rem; }

/* ── Rich text editor ───────────────────── */
.richtext-wrap {
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative; /* para cursores remotos */
}
.richtext-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}

.richtext-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: .35rem .5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.rt-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: .25rem .38rem;
    border-radius: 5px;
    color: var(--gray-600);
    font-size: .8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    transition: background var(--transition), color var(--transition);
}
.rt-btn:hover      { background: var(--gray-200); color: var(--gray-900); }
.rt-btn-active     { background: var(--primary-light); color: var(--primary); }
.rt-btn b, .rt-btn i, .rt-btn u { font-family: Georgia, serif; font-size: .85rem; }

.rt-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: var(--gray-200);
    margin: 0 .2rem;
    flex-shrink: 0;
}

.rt-indicator {
    margin-left: auto;
    font-size: .72rem;
    color: var(--success);
    white-space: nowrap;
}

.richtext-area {
    min-height: 80px;
    max-height: 400px;
    overflow-y: auto;
    padding: .6rem .8rem;
    font-size: .875rem;
    color: var(--gray-900);
    font-family: inherit;
    line-height: 1.6;
    outline: none;
}
.richtext-area:empty::before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    pointer-events: none;
}
.richtext-area ul, .richtext-area ol {
    padding-left: 1.4em;
    margin: .3em 0;
}
.richtext-area li { margin: .15em 0; }
.richtext-area b, .richtext-area strong { font-weight: 700; }

/* ── Modal richtext (sin border propio, usa el del wrap) ── */
#modalEditor.richtext-area {
    min-height: 100px;
    max-height: 220px;
}

.decision-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .4rem;
    display: block;
}

.save-indicator {
    font-size: .75rem;
    color: var(--success);
    display: block;
    min-height: 18px;
    margin-top: .3rem;
}

.add-punto-btn-wrap {
    text-align: center;
    margin-top: 1.5rem;
}

/* ── Modal ──────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
    padding: 0 .25rem;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--gray-900); }

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

/* ── Admin table ────────────────────────── */
.admin-table-wrap {
    background: white;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.admin-table th {
    background: var(--gray-50);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-600);
    border-bottom: 1.5px solid var(--gray-200);
}

.admin-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }

.text-mono { font-family: monospace; color: var(--gray-600); }
.text-muted { color: var(--gray-400); }

.badge-you {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 20px;
    margin-left: .4rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.role-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}
.role-admin { background: #fef3c7; color: #92400e; }
.role-user  { background: var(--gray-100); color: var(--gray-600); }

.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    color: var(--gray-700);
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-note {
    font-size: .8rem;
    color: var(--gray-400);
    background: var(--gray-50);
    padding: .5rem .75rem;
    border-radius: 6px;
    margin-top: .25rem;
}

/* ── Presencia de usuarios (Google Docs style) ── */
.presence-chips-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.presence-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px 3px 3px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    cursor: default;
    user-select: none;
    animation: chipIn .15s ease;
}
.presence-chip-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    flex-shrink: 0;
}
@keyframes chipIn {
    from { opacity: 0; transform: scale(.8); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Cursor remoto (posición exacta en el texto) ─── */
.remote-cursor-wrap {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    top: 0; left: 0;          /* se sobreescribe con JS */
    transform: translateY(0); /* evita subpíxel blur */
}
.remote-cursor-line {
    width: 2px;
    height: 1.15em;
    position: absolute;
    top: 0; left: 0;
    border-radius: 1px;
    animation: remoteCursorBlink 1.1s ease-in-out infinite;
}
.remote-cursor-label {
    position: absolute;
    bottom: calc(100% + 1px);
    left: 0;
    color: white;
    font-size: 0.63rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px 3px 3px 0;
    white-space: nowrap;
    line-height: 1.7;
}
@keyframes remoteCursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

/* ── Indicador de tipeo en tiempo real ─── */
.typing-indicator {
    min-height: 1.25rem;
    font-size: 0.78rem;
    color: var(--primary);
    font-style: italic;
    padding: 0.15rem 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.typing-indicator:empty { min-height: 0; padding: 0; }
.typing-dots {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}
.typing-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
    30%            { transform: translateY(-4px); opacity: 1; }
}

/* ── Print (desde meeting.php directo) ─── */
@media print {
    .topbar, .meeting-hero-actions, .punto-actions,
    .add-punto-btn-wrap, .btn, .modal-overlay { display: none !important; }
    body { background: white; }
    .container { padding: 1rem; }
    .meeting-hero { box-shadow: none; border: 1px solid #ccc; }
    .punto-card { box-shadow: none !important; transform: none !important; border: 1px solid #ccc; border-left: 3px solid #999; page-break-inside: avoid; }
    .decision-area { border: none; resize: none; min-height: unset; }
    .typing-indicator { display: none !important; }
    .punto-responsables { display: none !important; }
}

/* ── Responsables asignados al punto ── */
.punto-responsables {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
    color: #6b7280;
    font-size: .8rem;
}
.resp-chip {
    display: inline-flex;
    align-items: center;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    border-radius: 20px;
    padding: .15rem .65rem;
    font-size: .78rem;
    font-weight: 500;
}

/* ── Badge de fecha de conclusión ── */
.badge-date {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* ── Selector de usuarios (modal) ── */
.user-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .35rem;
    max-height: 160px;
    overflow-y: auto;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: .5rem;
    background: #fafafa;
}
.user-check-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    color: #374151;
    transition: background .12s;
    user-select: none;
}
.user-check-label:hover { background: #f3f4f6; }
.user-check-label.is-checked {
    background: #ede9fe;
    color: #5b21b6;
    font-weight: 500;
}
.user-check-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #4f46e5;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Secciones del cuerpo del punto ── */
.campo-section {
    margin-bottom: 1rem;
}
.campo-section:last-child { margin-bottom: 0; }

.campo-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    margin-bottom: .4rem;
}

.campo-decision {
    border-top: 1px solid #f3f4f6;
    padding-top: .85rem;
}

/* ── Archivos adjuntos ── */
.archivos-section {
    border-top: 1px solid #f3f4f6;
    padding-top: .75rem;
    margin-top: .5rem;
}

.archivos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.archivos-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.archivo-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: .82rem;
    color: #374151;
}

.archivo-item svg { flex-shrink: 0; color: #6b7280; }

.archivo-nombre {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-archivo-ver {
    flex-shrink: 0;
    padding: .2rem .6rem;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.btn-archivo-ver:hover { background: #ddd6fe; }

.btn-upload-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .7rem;
    background: white;
    border: 1.5px dashed #d1d5db;
    border-radius: 6px;
    font-size: .8rem;
    color: #6b7280;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.btn-upload-label:hover { border-color: #4f46e5; color: #4f46e5; }
.btn-upload-label.uploading { opacity: .6; pointer-events: none; }

/* ── Archivos adjuntos — sección destacada ── */
.archivos-section {
    border-top: none !important;
    margin-top: .75rem !important;
    padding-top: 0 !important;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid #c4b5fd;
    border-radius: 10px;
    padding: .65rem .75rem !important;
}

.archivos-header {
    margin-bottom: .4rem;
}

.archivos-header .campo-label {
    color: #5b21b6;
    font-weight: 700;
}

.archivos-list:empty + .btn-upload-label,
.archivos-list:empty { margin-top: 0; }

/* ── Visor de archivos (modal casi pantalla completa) ── */
.viewer-overlay {
    padding: .4rem !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

.viewer-modal {
    background: #1a1a2e;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    overflow: hidden;
}

.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;          /* nunca se comprime — la X siempre visible */
    min-height: 46px;
}

.viewer-title {
    font-size: .9rem;
    color: #e2e8f0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
    flex: 1;
}

.viewer-header .modal-close {
    color: #94a3b8;
    background: transparent;
    border: none;
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 .25rem;
}
.viewer-header .modal-close:hover { color: white; }

.viewer-body {
    flex: 1;
    min-height: 0;           /* clave: permite que flex child se encoja */
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
}

.viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
