/* Admin specific styles */

body {
    align-items: flex-start;
    padding: 0;
    margin: 0;
}

#loginSection {
    margin: 10vh auto;
}

.form-input {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.password-group {
    position: relative;
}

#password {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.75);
}

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.dashboard-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 40px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e0f2fe 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.sidebar-user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    word-break: break-all;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-pill {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-btn.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.btn-danger,
.btn-secondary,
.btn-success,
.btn-sm-danger {
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 14px;
    border-radius: 12px;
    width: 100%;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 10px 20px;
    border-radius: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-success:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.btn-sm-danger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm-danger {
    background: transparent;
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
}

.btn-sm-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Content */
.content {
    flex-grow: 1;
    padding: 48px;
    overflow-y: auto;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.tab-content.hidden {
    display: none;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
}

.reception-admin-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.reception-panel {
    padding: 24px;
}

.reception-panel-full {
    grid-column: 1 / -1;
}

.reception-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.reception-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.reception-textarea {
    min-height: 140px;
    resize: vertical;
}

.reception-table-link {
    color: #93c5fd;
    text-decoration: none;
    word-break: break-all;
}

.reception-table-link:hover {
    text-decoration: underline;
}

.reception-add-table-btn {
    min-width: 180px;
}

.reception-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reception-modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    color: #e2e8f0;
}

.reception-table-modal-content {
    max-width: 860px;
}

.prompt-filter-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.prompt-filter-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.35);
}

.prompt-filter-item input[type="checkbox"] {
    margin-top: 4px;
    transform: scale(1.15);
}

.prompt-filter-copy {
    min-width: 0;
}

.prompt-filter-copy strong {
    display: block;
    color: #f8fafc;
}

.prompt-filter-copy small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
}

.prompt-filter-copy p {
    margin: 6px 0 0;
    color: #cbd5e1;
}

.reception-visual-editor {
    margin-top: 14px;
}

.reception-canvas-preview {
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.9)),
        #0f172a;
}

.reception-canvas-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(245, 158, 11, 0.18), transparent 24%),
        radial-gradient(circle at 82% 74%, rgba(59, 130, 246, 0.18), transparent 28%);
    pointer-events: none;
}

.reception-block-video {
    z-index: 10;
    color: #93c5fd;
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.14);
}

.reception-block-qr {
    z-index: 30;
    color: #fde68a;
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.16);
}

.reception-block-active {
    z-index: 20;
    color: #bbf7d0;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.16);
}

.reception-block-copy {
    z-index: 20;
    color: #bbf7d0;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.16);
}

@media (max-width: 900px) {
    .reception-list-header {
        flex-direction: column;
    }

    .reception-actions-row {
        flex-direction: column;
    }

    .reception-actions-row > * {
        width: 100%;
    }
}

.tab-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.message-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.risk-legend {
    display: flex;
    gap: 14px;
    margin: 6px 0 10px;
    color: #cbd5e1;
    font-size: 0.86rem;
    align-items: center;
}

.risk-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    vertical-align: middle;
}

.risk-yellow {
    background: #facc15;
}

.risk-red {
    background: #ef4444;
}

.risk-none {
    display: none;
}

.mobile-tip {
    margin: -10px 0 14px;
    color: #93c5fd;
    font-size: 0.9rem;
}

#messageSearch {
    min-width: 240px;
    padding: 12px 14px;
}

.form-select {
    background-color: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 12px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    /* Custom arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat, repeat;
    background-position: right .7em top 50%, 0 0;
    background-size: .65em auto, 100%;
    padding-right: 2.5em;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Table container */
.table-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.messages-card-list {
    display: none;
    gap: 12px;
}

.message-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
}

.message-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-card-id {
    color: #94a3b8;
    font-size: 0.78rem;
}

.message-card-text {
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.45;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-card-meta {
    color: #94a3b8;
    font-size: 0.82rem;
}

.message-card-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.message-card-actions .btn-success,
.message-card-actions .btn-sm-danger {
    min-height: 42px;
    padding: 10px 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td:nth-child(2) {
    white-space: normal;
    min-width: 300px;
    color: #e2e8f0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-pendiente {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-publicado {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-eliminado {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Forms Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-group.compact {
    grid-column: span 1;
}

.form-group.color-compact {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group.color-compact input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.form-group.color-compact label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group.full-width {
    grid-column: span 2;
}

.config-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-state-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: rgba(59, 130, 246, 0.1);
    color: #bfdbfe;
    font-size: 0.82rem;
    font-weight: 600;
}

.config-layout {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(520px, 1.35fr);
    gap: 16px;
    align-items: start;
}

.config-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 18px;
}

.config-card h3 {
    margin: 0 0 4px;
    color: #f8fafc;
    font-size: 1.05rem;
}

.config-card-desc {
    margin: 0 0 14px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.config-lock-hint {
    display: block;
    margin-top: 6px;
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 600;
}

#qrToggleGroup.is-locked {
    opacity: 0.72;
}

#photosToggleGroup.is-locked,
#messagesToggleGroup.is-locked,
#labelToggleGroup.is-locked,
#qrToolsCard.is-locked {
    opacity: 0.72;
}

.config-grid-2,
.config-grid-3,
.config-grid-4 {
    display: grid;
    gap: 12px;
}

.config-grid-1 {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.config-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.config-toggle-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-card-layout {
    grid-column: 1 / -1;
    grid-row: auto;
    padding: 14px;
}

@media (max-width: 1360px) {
    .config-layout {
        grid-template-columns: 1fr;
    }

    .config-card-layout {
        grid-column: 1;
        grid-row: auto;
    }
}

.config-card-layout .visual-editor-container {
    margin-top: 0;
    grid-column: auto;
}

.config-feedback-row {
    display: flex;
    justify-content: flex-end;
}

#configFeedback {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 12000;
    min-width: 220px;
    max-width: min(420px, calc(100vw - 28px));
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#configFeedback.feedback.success {
    border: 1px solid rgba(34, 197, 94, 0.45);
    background: rgba(22, 101, 52, 0.88);
    color: #dcfce7;
}

#configFeedback.feedback.error {
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: rgba(127, 29, 29, 0.9);
    color: #fee2e2;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.35);
}

.switch-text {
    color: #e2e8f0;
    font-size: 0.92rem;
    font-weight: 600;
}

.switch-control {
    position: relative;
    width: 50px;
    height: 28px;
    display: inline-flex;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.45);
    transition: 0.2s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #0f172a;
    transition: 0.2s ease;
}

.switch-control input:checked + .switch-slider {
    background: rgba(16, 185, 129, 0.75);
    border-color: rgba(16, 185, 129, 0.9);
}

.switch-control input:checked + .switch-slider::before {
    transform: translateX(22px);
    background: #f0fdf4;
}

.switch-control input:focus-visible + .switch-slider {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 24px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar-header {
        margin-bottom: 0;
    }

    nav {
        flex-direction: row;
        width: 100%;
        margin-top: 20px;
        margin-bottom: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .nav-btn {
        white-space: nowrap;
    }

    .sidebar-footer {
        width: 100%;
        border-top: none;
        padding-top: 0;
    }

    .content {
        padding: 24px;
    }

    .message-toolbar {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 5;
        background: rgba(2, 6, 23, 0.9);
        padding: 10px;
        border: 1px solid var(--card-border);
        border-radius: 12px;
    }

    #messageSearch {
        width: 100%;
        min-width: 0;
    }

    #bulkApproveBtn,
    #filterState {
        width: 100%;
    }

    #tab-mensajes .table-container {
        display: none;
    }

    .messages-card-list {
        display: grid;
    }

    .mobile-tip {
        margin-top: 8px;
    }

    .risk-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .config-topbar {
        width: 100%;
        justify-content: space-between;
    }

    .config-grid-2,
    .config-grid-3,
    .config-grid-4 {
        grid-template-columns: 1fr;
    }

    .config-layout {
        grid-template-columns: 1fr;
    }

    .config-toggle-grid {
        grid-template-columns: 1fr;
    }

    .config-card-layout {
        grid-column: 1;
        grid-row: auto;
    }

    .switch-row {
        width: 100%;
    }

    #configFeedback {
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
        left: 12px;
        max-width: none;
        min-width: 0;
    }

    .user-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .words-grid {
        grid-template-columns: 1fr;
    }

    .event-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #userEventFilter {
        width: 100%;
        min-width: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }
}

/* Visual Editor Canvas */
.visual-editor-container {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.canvas-preview {
    position: relative;
    background: #000;
    margin: 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    overflow: hidden;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;
    height: auto;
    border-radius: 12px;
}

.draggable-block {
    position: absolute;
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: move;
    touch-action: none;
    user-select: none;
    box-sizing: border-box;
    overflow: hidden;
    text-align: center;
    backdrop-filter: blur(4px);
}

.draggable-block .block-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    pointer-events: none;
}

.block-preview-message {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
    text-wrap: balance;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.block-preview-label {
    color: #facc15;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-align: center;
    text-wrap: balance;
}

.block-preview-image {
    border-radius: 12px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.65), transparent 20%),
        linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(168, 85, 247, 0.92));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.block-preview-qr {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    width: min(88%, 180px);
    aspect-ratio: 1 / 1;
    background: white;
    padding: 6px;
    border-radius: 10px;
}

.block-preview-qr-image {
    width: min(88%, 180px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    border-radius: 10px;
}

.block-preview-qr span {
    background: #0f172a;
    border-radius: 2px;
    opacity: 0.92;
}

.block-preview-qr span:nth-child(2n),
.block-preview-qr span:nth-child(5n) {
    opacity: 0.15;
}

.draggable-block .block-label-text {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 2;
    font-size: 0.62rem;
    background: rgba(2, 6, 23, 0.72);
    padding: 3px 6px;
    border-radius: 999px;
}

.draggable-block:hover {
    background: rgba(59, 130, 246, 0.25);
}

.draggable-block.active {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.15);
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.3);
    z-index: 100 !important;
}

#block-message {
    z-index: 20;
    color: #60a5fa;
    border-color: #3b82f6;
}

#block-qr {
    z-index: 10;
    color: #fbbf24;
    border-color: #f59e0b;
}

#block-label {
    z-index: 15;
    color: #34d399;
    border-color: #10b981;
}

.block-label-text {
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* User Management Table */
.user-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.user-table th,
.user-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.user-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.user-table tr:last-child td {
    border-bottom: none;
}

.user-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.words-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.words-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
}

.words-card h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1rem;
}

.words-card p {
    margin: 6px 0 12px;
    color: #94a3b8;
    font-size: 0.86rem;
}

.event-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.event-stat-item {
    border: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.35);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-stat-item span {
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.event-stat-item strong {
    color: #f8fafc;
    font-size: 1.1rem;
}

.words-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.words-table th,
.words-table td {
    border-bottom: 1px solid var(--card-border);
    padding: 8px;
}

.words-table th {
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-align: left;
}

.word-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 8px 10px;
    font-family: inherit;
}

.word-remove {
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fda4af;
    background: rgba(127, 29, 29, 0.3);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
}

#userEventFilter {
    min-width: 220px;
}

.superadmin-notice {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.1);
    color: #dbeafe;
    font-size: 0.95rem;
}

.superadmin-notice strong {
    color: #93c5fd;
}

.role-playbook {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.45);
}

.role-playbook h4 {
    margin-bottom: 0.6rem;
    color: #e2e8f0;
}

.role-playbook ul {
    margin: 0;
    padding-left: 18px;
    color: #cbd5e1;
    line-height: 1.55;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: white;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

.btn-sm-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.btn-sm-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Ayuda & Onboarding Styles */
.ayuda-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.ayuda-intro {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ayuda-intro h3 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 800;
}

.ayuda-intro p {
    color: #a1a1aa;
    font-size: 1.1rem;
    line-height: 1.6;
}

.ayuda-timeline {
    position: relative;
    margin-left: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.ayuda-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #3b82f6, #10b981);
}

.ayuda-step {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ayuda-step:nth-child(1) {
    animation-delay: 0.1s;
}

.ayuda-step:nth-child(2) {
    animation-delay: 0.2s;
}

.ayuda-step:nth-child(3) {
    animation-delay: 0.3s;
}

.ayuda-step:nth-child(4) {
    animation-delay: 0.4s;
}

.ayuda-step:nth-child(5) {
    animation-delay: 0.5s;
}

.step-num {
    position: absolute;
    left: -19px;
    top: 0;
    width: 40px;
    height: 40px;
    background: #0f172a;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 2;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.ayuda-step:last-child .step-num {
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.step-content {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.8);
}

.step-content h4 {
    color: #e2e8f0;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.step-content p {
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

.step-content strong {
    color: #fbbf24;
}

.step-content em {
    color: #a78bfa;
    font-style: normal;
    font-weight: 600;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Technical Specs Section */
.ayuda-tech-specs {
    margin-top: 4rem;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 12px;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    animation: fadeIn 0.8s ease-out;
}

.ayuda-tech-specs .tech-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ayuda-tech-specs .tech-icon svg {
    width: 24px;
    height: 24px;
}

.ayuda-tech-specs .tech-content h4 {
    color: #e2e8f0;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.ayuda-tech-specs .tech-content p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.ayuda-tech-specs .tech-content ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #94a3b8;
}

.ayuda-tech-specs .tech-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ayuda-tech-specs .tech-content strong {
    color: #a78bfa;
}

.ayuda-tech-specs .tech-content em {
    color: #e2e8f0;
    font-style: italic;
}
