* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1a0d1f;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.login-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: white;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: white;
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: white;
    top: 50%;
    right: -75px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.login-logo i {
    font-size: 56px;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.login-header h1 {
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
}

.login-form {
    margin-top: 8px;
}

.login-page .form-group {
    margin-bottom: 28px;
}

.login-page .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: 0.3px;
}

.login-page .form-group label i {
    display: none; /* Ocultar iconos del label */
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
    transition: all 0.3s;
    top: 50%;
    transform: translateY(-50%);
}

.login-page .form-group input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f9fafb;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.login-page .form-group input:hover {
    border-color: #d1d5db;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.login-page .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.login-page .form-group input:focus ~ .input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.login-page .form-group input::placeholder {
    color: #9ca3af;
    font-weight: 400;
    opacity: 0.7;
}

.login-page .form-group input:not(:placeholder-shown) ~ .input-icon {
    color: var(--primary-color);
}

.login-submit {
    margin-top: 32px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit i {
    transition: transform 0.3s;
}

.login-submit:hover i {
    transform: translateX(4px);
}

.login-page .error-message {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive para login */
@media (max-width: 480px) {
    .login-box {
        padding: 36px 24px;
        border-radius: 20px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .login-logo i {
        font-size: 48px;
        width: 72px;
        height: 72px;
    }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Navbar */
.navbar {
    background-color: var(--dark-bg);
    color: white;
    padding: 0;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 28px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Templates */
.templates-list {
    display: grid;
    gap: 20px;
}

.template-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.template-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.template-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.template-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--success-color);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.template-actions {
    display: flex;
    gap: 8px;
}

/* Send Container */
.send-container {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 32px;
    background: var(--light-bg);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    padding: 14px 28px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
    display: none;
    animation: fadeInContent 0.3s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    display: block;
}

.send-form {
    max-width: 700px;
    margin: 0 auto;
}

.send-form .form-group {
    margin-bottom: 24px;
}

.send-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.send-form input[type="text"],
.send-form input[type="email"],
.send-form select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.send-form input[type="text"]:focus,
.send-form input[type="email"]:focus,
.send-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.send-form small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.send-form input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: var(--light-bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-form input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.data-table th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
}

.data-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    background: white;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--light-bg);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Estilos específicos para tabla de actividades */
.activity-table {
    border-radius: 12px;
    overflow: hidden;
}

.activity-row {
    border-left: 4px solid transparent;
}

.activity-row:hover {
    border-left-color: var(--primary-color);
}

.activity-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-badge-create {
    background: #d1fae5;
    color: #065f46;
}

.activity-badge-update {
    background: #dbeafe;
    color: #1e40af;
}

.activity-badge-delete {
    background: #fee2e2;
    color: #991b1b;
}

.activity-badge-send {
    background: #fef3c7;
    color: #92400e;
}

.activity-badge-default {
    background: #e5e7eb;
    color: #374151;
}

.data-table tbody tr:hover {
    background-color: var(--light-bg);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-enviado {
    background-color: #d1fae5;
    color: #065f46;
}

.status-rebotado {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pendiente {
    background-color: #fef3c7;
    color: #92400e;
}

.history-controls {
    margin-bottom: 20px;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-large {
    max-width: 1000px;
    width: 95%;
}

/* Modal de consola con tamaño fijo */
#consoleModal .modal-content {
    height: 85vh;
    max-height: 85vh;
}

.modal-header {
    padding: 28px 32px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2 i {
    font-size: 28px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: white;
}

/* Modal body de consola con scroll */
#consoleModal .modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* El scroll estará en el console-output */
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--light-bg);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive */
/* Consola de envío */
.console-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.console-stats > div {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

#console-output {
    background: #1a1a1a;
    color: #00ff00;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Editor WYSIWYG Styles */
#editor-container-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

#editor-container {
    height: 100%;
}

#editor-container .ql-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    height: 100%;
    border: none;
    border-top: 1px solid var(--border-color);
}

#editor-container .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    background: var(--light-bg);
    border-radius: 8px 8px 0 0;
}

#editor-container .ql-toolbar .ql-custom {
    border: none;
    cursor: pointer;
    display: inline-block;
    padding: 4px 8px;
    margin: 0 2px;
}

#editor-container .ql-toolbar .ql-custom:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

#editor-container .ql-editor {
    min-height: 450px;
    padding: 20px;
}

#editor-container .ql-editor.ql-blank::before {
    font-style: normal;
    color: var(--text-secondary);
}

#template-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Estilos para el editor de imágenes */
#image-editor-container {
    max-width: 100%;
    max-height: 500px;
    overflow: auto;
}

#image-editor-container img {
    max-width: 100%;
    display: block;
}

/* Estilos para Cropper */
.cropper-container {
    max-width: 100%;
}

.cropper-view-box {
    outline: 2px solid var(--primary-color);
    outline-offset: -1px;
}

.cropper-face {
    background-color: rgba(99, 102, 241, 0.1);
}

.cropper-line {
    background-color: var(--primary-color);
}

/* Modal de Sesión Expirada - Estilos especiales */
#sessionExpiredModal .modal-content {
    max-width: 450px;
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#sessionExpiredModal .modal-header {
    padding: 40px 24px 0 24px;
}

#sessionExpiredModal .modal-body {
    padding: 20px 24px 40px 24px;
}

#sessionExpiredModal .modal-body p {
    line-height: 1.6;
}

#sessionExpiredModal #goToLoginBtn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
}

/* Estilos para la consola de envío */
#consoleModal .console-stats {
    flex-shrink: 0; /* No se encoge */
    margin-bottom: 20px;
}

#consoleModal #console-output {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #1a1a1a;
}

#consoleModal #console-output::-webkit-scrollbar {
    width: 8px;
}

#consoleModal #console-output::-webkit-scrollbar-track {
    background: #1a1a1a;
}

#consoleModal #console-output::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

#consoleModal #console-output::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Estilos para imágenes interactivas en el editor */
.image-wrapper {
    display: inline-block;
    position: relative;
    margin: 5px;
}

.image-wrapper:hover {
    outline: 2px dashed var(--primary-color);
    outline-offset: 2px;
}

.image-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
}

.image-delete-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.image-resize-handle {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background: #6366f1;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}

.image-resize-handle:hover {
    transform: scale(1.2);
    background: #4f46e5;
}

.interactive-image {
    cursor: move;
    position: relative;
    max-width: 100%;
    height: auto;
}

/* Permitir que el editor muestre HTML con estilos inline */
#editor-container .ql-editor {
    overflow: visible;
}

#editor-container .ql-editor * {
    max-width: 100%;
}

#editor-container .ql-editor img {
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 16px;
    }

    .nav-menu {
        flex-wrap: wrap;
        margin-top: 12px;
    }

    .main-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .console-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Pagination ellipsis */
.pagination span {
    display: inline-flex;
    align-items: center;
    padding: 8px 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Nav link icons */
.nav-link i {
    margin-right: 6px;
    font-size: 14px;
}

/* Animación para nuevas actividades */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
