:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ========== LOGIN ========== */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-card .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.login-card .logo i {
    font-size: 2rem;
}

.login-card h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-card > p {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ========== FORM ELEMENTS ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--gray-700);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row.checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.checkbox input {
    width: auto;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-wrapper input[type='color'] {
    width: 48px;
    height: 40px;
    padding: 2px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ========== BUTTONS ========== */
.btn-primary, .btn-secondary, .btn-danger, .btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-logout {
    background: transparent;
    color: var(--gray-400);
    padding: 0.5rem;
    width: 100%;
    justify-content: flex-start;
}

.btn-logout:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* ========== LAYOUT ========== */
#main-app {
    display: flex;
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-header .logo i {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
}

.top-bar h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
}

.user-info i {
    font-size: 1.5rem;
    color: var(--gray-400);
}

.page {
    padding: 2rem;
    max-width: 1200px;
}

/* ========== DASHBOARD ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-icon.blue { background: var(--primary); }
.stat-icon.green { background: var(--success); }
.stat-icon.purple { background: #8b5cf6; }
.stat-icon.orange { background: var(--warning); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-info p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.section-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.section-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}

.recent-item .info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.recent-item .name {
    font-weight: 500;
    font-size: 0.9375rem;
}

.recent-item .meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.recent-item .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* ========== BOTS GRID ========== */
.page-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.bot-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.bot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bot-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    flex-shrink: 0;
}

.bot-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.bot-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.bot-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bot-card .status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.bot-card .status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.bot-card .status.inactive::before {
    background: var(--gray-400);
}

.bot-card .actions {
    display: flex;
    gap: 0.5rem;
}

.bot-card .actions button {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bot-card .actions button:hover {
    background: var(--gray-50);
    color: var(--primary);
}

/* ========== EDITOR ========== */
.editor-tabs {
    display: flex;
    gap: 0.25rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--gray-50);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.editor-form {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.editor-form .form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ========== ITEMS LIST ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 320px;
    margin-right: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.search-box button {
    padding: 0.5rem 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.item-card .content {
    flex: 1;
    min-width: 0;
}

.item-card .content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
}

.item-card .content p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-card .meta {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.item-card .actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.item-card .actions button {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card .actions button:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.item-card .actions button.delete:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* ========== CONVERSATIONS ========== */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: white;
    min-width: 180px;
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.conversation-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conversation-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.conversation-card .info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.conversation-card .info .name {
    font-weight: 500;
    font-size: 0.9375rem;
}

.conversation-card .info .preview {
    font-size: 0.8125rem;
    color: var(--gray-500);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-card .meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.conversation-card .meta .source {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.conversation-card .meta .date {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

/* ========== CONVERSATION DETAIL ========== */
.conversation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.conversation-header .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.conversation-info {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.conversation-info p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.conversation-info strong {
    color: var(--gray-800);
}

.conv-messages {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.msg-bubble {
    max-width: 80%;
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.msg-bubble.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-bubble.assistant {
    align-self: flex-start;
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
}

.msg-bubble .time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ========== LEADS ========== */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    background: var(--gray-50);
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.table-container td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table-container tr:hover td {
    background: var(--gray-50);
}

.table-container .actions button {
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 0.8125rem;
}

.table-container .actions button:hover {
    color: var(--primary);
}

/* ========== EMBED ========== */
.code-block {
    background: var(--gray-900);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1rem 0;
    position: relative;
}

.code-block pre {
    color: #e5e7eb;
    font-family: 'Mono', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-block button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 2rem;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
}

/* ========== LEADS CONFIG ========== */
.leads-container {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lead-field-row {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 0.8fr 0.5fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.lead-field-row input, .lead-field-row select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.lead-field-row button {
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: var(--danger);
    cursor: pointer;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    .main-content {
        margin-left: 0;
    }
    #main-app {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .conversation-info {
        grid-template-columns: 1fr;
    }
    .table-container {
        overflow-x: auto;
    }
}

/* ========== UTILITIES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 0.875rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =====================================================================
   LIQUID GLASS - capa visual (sobrescribe los estilos de arriba)
   ===================================================================== */
:root {
    --glass-bg: linear-gradient(150deg, rgba(255,255,255,.62), rgba(255,255,255,.34));
    --glass-bg-strong: linear-gradient(150deg, rgba(255,255,255,.78), rgba(255,255,255,.5));
    --glass-border: rgba(255,255,255,.7);
    --glass-blur: blur(26px) saturate(180%);
    --glass-shadow: inset 0 1.5px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(255,255,255,.25), 0 10px 34px rgba(30,41,99,.14), 0 2px 8px rgba(30,41,99,.06);
    --accent-glass: linear-gradient(145deg, rgba(59,111,246,.95), rgba(99,102,241,.78));
    --accent-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 8px 20px rgba(79,70,229,.32);
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;
}

body {
    background: #dfe6ff;
    background-attachment: fixed;
    color: var(--gray-900);
    position: relative;
    overflow-x: hidden;
}
/* Fondo aurora: el vidrio necesita color detras para refractar */
body::before, body::after {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}
body::before {
    width: 62vmax; height: 62vmax;
    left: -18vmax; top: -22vmax;
    background: radial-gradient(circle, rgba(99,102,241,.75), rgba(99,102,241,0) 66%);
    animation: aurora-a 22s ease-in-out infinite alternate;
}
body::after {
    width: 58vmax; height: 58vmax;
    right: -20vmax; bottom: -24vmax;
    background: radial-gradient(circle, rgba(236,72,153,.55), rgba(34,211,238,.35) 45%, rgba(34,211,238,0) 68%);
    animation: aurora-b 26s ease-in-out infinite alternate;
}
@keyframes aurora-a { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes aurora-b { to { transform: translate(-12vmax, -8vmax) scale(1.1); } }

.screen { background: transparent; }

/* ---------- Superficies de vidrio ---------- */
.login-card, .sidebar, .top-bar, .stat-card, .section-card, .bot-card, .editor-tabs,
.editor-form, .item-card, .conversation-card, .conversation-info, .conv-messages,
.table-container, .leads-container, .modal, .search-box input, .filters select {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* ---------- Login ---------- */
#login-screen {
    background: transparent;
    padding: 1.5rem;
}
.login-card {
    max-width: 440px;
    padding: 2.5rem 2.25rem;
    border-radius: 34px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(255,255,255,.5), rgba(255,255,255,.22));
    box-shadow: inset 0 2px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(255,255,255,.3), 0 30px 80px rgba(30,41,99,.28), 0 6px 20px rgba(30,41,99,.1);
    animation: glass-rise .7s cubic-bezier(.22,1.2,.36,1);
}
.login-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(80% 35% at 15% -4%, rgba(255,255,255,.75), transparent 62%);
}
.login-card > * { position: relative; }
@keyframes glass-rise { from { opacity: 0; transform: translateY(26px) scale(.95); } to { opacity: 1; transform: none; } }

.login-card .logo {
    color: var(--gray-900);
    letter-spacing: -.02em;
}
.login-card .logo i {
    width: 56px; height: 56px;
    border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: var(--accent-glass);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: var(--accent-shadow);
}
.login-card h2 { font-size: 1.75rem; letter-spacing: -.02em; color: var(--gray-900); }
.login-card > p { color: var(--gray-600); }
.login-card .btn-primary, .login-card .btn-secondary { width: 100%; margin-top: .25rem; }
.divider { color: var(--gray-600); }
.divider::before, .divider::after { background: rgba(255,255,255,.75); }

/* ---------- Formularios ---------- */
.form-group label { color: var(--gray-700); font-weight: 600; }
.form-group input, .form-group textarea, .form-group select,
.search-box input, .filters select, .lead-field-row input, .lead-field-row select {
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 14px;
    box-shadow: inset 0 2px 5px rgba(30,41,99,.08), inset 0 1px 0 rgba(255,255,255,.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus,
.search-box input:focus, .filters select:focus {
    background: rgba(255,255,255,.85);
    border-color: rgba(99,102,241,.55);
    box-shadow: 0 0 0 4px rgba(99,102,241,.2), inset 0 1px 3px rgba(30,41,99,.05);
    outline: none;
}
.form-actions { border-top-color: rgba(255,255,255,.6); }
.editor-form .form-group small { color: var(--gray-600); }
.editor-form code { background: rgba(255,255,255,.6); padding: 1px 6px; border-radius: 6px; font-size: .78rem; }

/* ---------- Botones ---------- */
.btn-primary, .btn-secondary, .btn-danger, .btn-logout {
    border-radius: 999px;
    padding: .7rem 1.35rem;
    font-weight: 600;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, background .2s;
}
.btn-primary {
    background: var(--accent-glass);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: var(--accent-shadow);
    text-shadow: 0 1px 1px rgba(0,0,0,.18);
}
.btn-primary:hover { background: var(--accent-glass); transform: translateY(-2px) scale(1.02); box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 12px 26px rgba(79,70,229,.4); }
.btn-primary:active, .btn-secondary:active, .btn-danger:active { transform: scale(.96); }
.btn-secondary {
    background: linear-gradient(150deg, rgba(255,255,255,.75), rgba(255,255,255,.4));
    border: 1px solid rgba(255,255,255,.85);
    color: var(--gray-800);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 3px 10px rgba(30,41,99,.08);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: linear-gradient(150deg, rgba(255,255,255,.95), rgba(255,255,255,.6)); transform: translateY(-2px); }
.btn-danger {
    background: linear-gradient(150deg, rgba(254,226,226,.85), rgba(254,202,202,.5));
    border: 1px solid rgba(255,255,255,.8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 3px 10px rgba(239,68,68,.12);
}
.btn-danger:hover { background: linear-gradient(150deg, rgba(254,226,226,1), rgba(252,165,165,.6)); transform: translateY(-2px); }
.btn-logout { border-radius: 14px; color: var(--gray-600); }
.btn-logout:hover { background: rgba(254,226,226,.7); color: var(--danger); }
.btn-close { border-radius: 50%; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.8); transition: transform .25s, background .2s; }
.btn-close:hover { background: #fff; transform: rotate(90deg); }

/* ---------- Layout principal ---------- */
.sidebar {
    margin: 14px;
    height: calc(100vh - 28px);
    width: 252px;
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255,255,255,.58), rgba(255,255,255,.26));
}
.sidebar-header, .sidebar-footer { border-color: rgba(255,255,255,.55); }
.sidebar-header { padding: 1.4rem 1.5rem 1.1rem; }
.sidebar-header .logo { color: var(--gray-900); letter-spacing: -.02em; }
.sidebar-header .logo i {
    width: 40px; height: 40px;
    border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    background: var(--accent-glass);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: var(--accent-shadow);
}
.nav-item { border-radius: 16px; color: var(--gray-700); border: 1px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.55); color: var(--gray-900); transform: translateX(3px); }
.nav-item.active {
    color: #fff;
    background: var(--accent-glass);
    border-color: rgba(255,255,255,.5);
    box-shadow: var(--accent-shadow);
    text-shadow: 0 1px 1px rgba(0,0,0,.15);
}

.main-content { margin-left: 280px; }
.top-bar {
    margin: 14px 18px 0 4px;
    padding: .9rem 1.5rem;
    border-radius: 24px;
    top: 14px;
}
.top-bar h1 { letter-spacing: -.02em; }
.user-info { color: var(--gray-700); font-weight: 500; }
.user-info i { color: #6366f1; }
.page { padding: 1.5rem 18px 2rem 4px; }

/* ---------- Dashboard ---------- */
.stat-card, .section-card, .bot-card, .editor-form { border-radius: var(--radius-lg); }
.stat-card { transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s; }
.stat-card:hover, .bot-card:hover { transform: translateY(-5px) scale(1.01); }
.stat-icon {
    border-radius: 16px;
    width: 52px; height: 52px;
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: inset 0 1.5px 0 rgba(255,255,255,.6), 0 8px 18px rgba(30,41,99,.18);
}
.stat-icon.blue   { background: linear-gradient(145deg, #3b82f6, #6366f1cc); }
.stat-icon.green  { background: linear-gradient(145deg, #10b981, #34d399cc); }
.stat-icon.purple { background: linear-gradient(145deg, #8b5cf6, #d946efcc); }
.stat-icon.orange { background: linear-gradient(145deg, #f59e0b, #fb7185cc); }
.stat-info h3 { letter-spacing: -.03em; }
.stat-info p, .section-card h3 { color: var(--gray-600); }

.recent-item, .lead-field-row {
    background: rgba(255,255,255,.45);
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
    transition: background .2s, transform .25s;
}
.recent-item:hover { background: rgba(255,255,255,.7); transform: translateX(3px); }
.recent-item .meta, .bot-card p, .item-card .content p, .conversation-card .info .preview { color: var(--gray-600); }
.recent-item .badge, .conversation-header .badge, .badge {
    background: rgba(99,102,241,.16);
    color: #4338ca;
    border: 1px solid rgba(255,255,255,.7);
}

/* ---------- Bots ---------- */
.bot-card { transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s; }
.bot-card:hover { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), 0 22px 46px rgba(30,41,99,.2); }
.bot-avatar {
    background: var(--accent-glass);
    color: #fff;
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: var(--accent-shadow);
}
.bot-card .actions button, .item-card .actions button, .table-container .actions button {
    background: rgba(255,255,255,.6);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 12px;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), background .2s, color .2s;
}
.bot-card .actions button:hover, .item-card .actions button:hover, .table-container .actions button:hover { background: #fff; transform: scale(1.12); }

/* ---------- Editor ---------- */
.editor-tabs { border-radius: 999px; padding: .4rem; }
.tab-btn { border-radius: 999px; color: var(--gray-700); transition: background .2s, color .2s, transform .25s; }
.tab-btn:hover { background: rgba(255,255,255,.6); }
.tab-btn.active {
    background: var(--accent-glass);
    border: 1px solid rgba(255,255,255,.5);
    box-shadow: var(--accent-shadow);
    color: #fff;
}
.tab-content.active { animation: glass-fade .35s ease; }
@keyframes glass-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.search-box button { background: var(--accent-glass); border-radius: 50%; width: 38px; border: 1px solid rgba(255,255,255,.5); box-shadow: var(--accent-shadow); }

/* ---------- Listas, conversaciones, tablas ---------- */
.item-card, .conversation-card, .conversation-info { border-radius: 20px; }
.conversation-card:hover { border-color: rgba(255,255,255,.95); transform: translateY(-2px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), 0 14px 30px rgba(30,41,99,.16); }
.conversation-card .meta .source { background: rgba(255,255,255,.7); }
.conversation-info p { color: var(--gray-700); }
.conv-messages { border-radius: 26px; }
.msg-bubble { border-radius: 20px; }
.msg-bubble.user {
    background: var(--accent-glass);
    border: 1px solid rgba(255,255,255,.45);
    box-shadow: var(--accent-shadow);
    border-bottom-right-radius: 6px;
}
.msg-bubble.assistant {
    background: linear-gradient(150deg, rgba(255,255,255,.85), rgba(255,255,255,.5));
    border: 1px solid rgba(255,255,255,.85);
    box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(30,41,99,.08);
    border-bottom-left-radius: 6px;
}
.table-container { border-radius: 24px; }
.table-container th { background: rgba(255,255,255,.4); border-bottom-color: rgba(255,255,255,.7); color: var(--gray-700); }
.table-container td { border-bottom-color: rgba(255,255,255,.55); }
.table-container tr:hover td { background: rgba(255,255,255,.5); }
.code-block {
    background: linear-gradient(150deg, rgba(15,23,42,.82), rgba(30,27,75,.7));
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 14px 34px rgba(30,41,99,.22);
}
.empty-state { color: var(--gray-600); }

/* ---------- Modal y avisos ---------- */
.modal-overlay {
    background: rgba(30,27,75,.28);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: glass-fade .25s ease;
}
.modal { border-radius: 30px; background: linear-gradient(155deg, rgba(255,255,255,.8), rgba(255,255,255,.55)); animation: glass-rise .45s cubic-bezier(.22,1.2,.36,1); }
.modal-header { border-bottom-color: rgba(255,255,255,.65); }
.toast {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.55);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 14px 34px rgba(30,41,99,.25);
}
.toast.success { background: rgba(16,185,129,.82); }
.toast.error   { background: rgba(239,68,68,.82); }
.toast.info    { background: rgba(79,70,229,.82); }

/* El boton de menu y el fondo oscuro solo existen en telefono */
.menu-btn, .sidebar-overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    html { -webkit-text-size-adjust: 100%; }
    button, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
    .screen { min-height: 100dvh; }

    /* Menu: barra lateral que se desliza desde la izquierda con el boton de la barra superior */
    #main-app { display: block; }
    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; right: auto;
        width: min(290px, 84vw); height: auto; margin: 0;
        border-radius: 0 28px 28px 0; z-index: 60;
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
        transform: translateX(-105%); visibility: hidden;
        transition: transform .3s cubic-bezier(.32,.72,0,1), visibility 0s linear .3s;
        overflow-y: auto; overscroll-behavior: contain;
    }
    .menu-open .sidebar { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.32,.72,0,1), visibility 0s; }
    .sidebar-nav { padding: .75rem; }
    .nav-item { min-height: 48px; font-size: 1rem; }
    .nav-item:hover { transform: none; }
    .sidebar-overlay {
        display: block; position: fixed; inset: 0; z-index: 50;
        background: rgba(15, 23, 42, .45);
        -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        opacity: 0; pointer-events: none; transition: opacity .3s;
    }
    .menu-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .menu-open { overflow: hidden; }
    .menu-btn {
        display: inline-flex; align-items: center; justify-content: center; flex: none;
        width: 44px; height: 44px; margin: -4px .6rem -4px -.4rem; border-radius: 14px;
        border: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.55);
        color: var(--gray-800); font-size: 1.1rem; cursor: pointer;
    }
    .top-bar h1 { flex: 1; min-width: 0; }

    .main-content { margin-left: 0; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
    .top-bar {
        margin: 8px 10px 0; padding: .7rem 1rem; border-radius: 20px;
        top: calc(8px + env(safe-area-inset-top));
    }
    .top-bar h1 { font-size: 1.05rem; }
    .user-info span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page { padding: 1rem 10px 1rem; }

    /* Dashboard */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
    .stat-card { padding: .9rem; gap: .65rem; }
    .stat-icon { width: 42px; height: 42px; flex: none; }
    .section-card { padding: 1.1rem; }
    .recent-item { gap: .5rem; }
    .recent-item .info { min-width: 0; }

    /* Bots */
    .page-header .btn-primary { width: 100%; }
    .bots-grid { grid-template-columns: 1fr; gap: 1rem; }
    .bot-card { padding: 1.1rem; }

    /* Editor */
    .editor-tabs { border-radius: 24px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .editor-tabs::-webkit-scrollbar { display: none; }
    .tab-btn { min-height: 42px; flex: none; }
    .editor-form { padding: 1.1rem; }
    .search-box { max-width: none; margin-right: 0; width: 100%; }
    .item-card { padding: .9rem; }
    .lead-field-row { grid-template-columns: 1fr 1fr; }

    /* Campos: 16px evita el zoom automatico de iOS y 44px es un buen area tactil */
    .form-group input, .form-group textarea, .form-group select,
    .search-box input, .filters select, .lead-field-row input, .lead-field-row select {
        font-size: 16px; min-height: 44px;
    }
    .btn-primary, .btn-secondary, .btn-danger { min-height: 44px; }
    .bot-card .actions button, .item-card .actions button, .table-container .actions button { min-width: 40px; min-height: 40px; }
    .lead-field-row button { min-height: 44px; }

    /* Conversaciones y leads */
    .filters { flex-direction: column; }
    .filters select { width: 100%; min-width: 0; }
    .conversation-header { flex-wrap: wrap; gap: .5rem; }
    .conv-messages { padding: 1rem; max-height: none; }
    .msg-bubble { max-width: 90%; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-container table { min-width: 560px; }

    /* Codigo para embeber */
    .code-block { padding: 1rem; }
    .code-block button { position: static; width: 100%; min-height: 40px; margin-bottom: .75rem; }

    /* Ventanas emergentes como hoja desde abajo */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
        max-width: none; max-height: 92dvh; border-radius: 26px 26px 0 0;
        animation: sheet-up .3s ease;
    }
    .modal-header { padding: 1rem 1.1rem; }
    .modal-body { padding: 1.1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); }
    .btn-close { width: 40px; height: 40px; }

    /* Avisos */
    .toast {
        left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom));
        text-align: center; padding: .85rem 1.1rem;
    }

    /* Inicio de sesion */
    #login-screen { padding: 1rem; }
    .login-card { padding: 1.75rem 1.25rem; border-radius: 26px; }
}
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
    .lead-field-row { grid-template-columns: 1fr; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Sin raton: nada de efectos hover que se quedan pegados al tocar */
@media (hover: none) {
    .stat-card:hover, .bot-card:hover, .recent-item:hover, .nav-item:hover { transform: none; }
    .bot-card .actions button:hover, .item-card .actions button:hover, .table-container .actions button:hover { transform: none; }
    .btn-close:hover { transform: none; }
}

/* ---------- Accesibilidad / respaldo ---------- */
@media (prefers-reduced-motion: reduce) {
    body::before, body::after, .login-card, .modal, .tab-content.active { animation: none; }
    .stat-card, .bot-card, .btn-primary, .btn-secondary, .nav-item { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .login-card, .sidebar, .top-bar, .stat-card, .section-card, .bot-card, .editor-tabs, .editor-form,
    .item-card, .conversation-card, .conversation-info, .conv-messages, .table-container, .leads-container, .modal {
        background: rgba(248,250,255,.97);
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
}

/* ========== PROSPECCION (Sergio) ========== */
.pros-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.pros-tabs::-webkit-scrollbar { display: none; }
.pros-tab { flex: none; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--gray-200); background: white; color: var(--gray-600); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.pros-tab:hover { background: var(--gray-50); }
.pros-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.pros-content { display: none; }
.pros-content.active { display: block; }
.pros-switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
  background: white; border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-400); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.pros-switch.on { border-left-color: var(--success); }
.pros-switch h3 { font-size: 1.05rem; color: var(--gray-900); }
.pros-switch p { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.2rem; }
.pros-switch button { flex: none; }
.pros-stats { margin-bottom: 1.25rem; }
.pros-acc { display: grid; grid-template-columns: 1fr 120px auto; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--gray-100); }
.pros-acc b, .pros-log b { display: block; font-size: 0.875rem; color: var(--gray-800); word-break: break-all; }
.pros-acc small, .pros-log small, .pros-sub { display: block; font-size: 0.75rem; color: var(--gray-500); margin-top: 0.1rem; }
.pros-acc em { font-style: normal; font-weight: 700; font-size: 0.85rem; color: var(--gray-700); }
.pros-meter { height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.pros-meter span { display: block; height: 100%; background: var(--success); border-radius: 999px; }
.pros-log { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0; border-bottom: 1px solid var(--gray-100); }
.pros-log .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 0.4rem; flex: none; }
.pros-log .dot.ok { background: var(--success); } .pros-log .dot.bad { background: var(--danger); }
.pros-note { font-size: 0.8rem; color: var(--gray-500); margin: 0.75rem 0; line-height: 1.5; }
.pros-warn { font-size: 0.85rem; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 0.5rem 0.75rem; margin: 0.5rem 0; }
.pros-empty { color: var(--gray-400); font-size: 0.875rem; padding: 0.75rem 0; }
.pros-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.pros-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pros-toolbar input[type=search] { flex: 1 1 220px; min-width: 0; padding: 0.6rem 0.8rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font: inherit; font-size: 0.9rem; }
.pros-toolbar select { padding: 0.6rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font: inherit; background: white; }
.pros-file { cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.pros-muted { color: var(--gray-400); font-style: italic; }
.pros-row-actions { white-space: nowrap; }
.pros-row-actions .fa-whatsapp { color: #16a34a; }
.pros-pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.85rem; color: var(--gray-500); }
.pros-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.st-blue { background: #dbeafe; color: #1d4ed8; } .st-indigo { background: #e0e7ff; color: #4338ca; }
.st-green { background: #dcfce7; color: #15803d; } .st-red { background: #fee2e2; color: #b91c1c; }
.st-orange { background: #ffedd5; color: #c2410c; } .st-gray { background: var(--gray-100); color: var(--gray-600); }
.pros-mail { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.pros-mail .subj { padding: 0.75rem 1rem; font-weight: 700; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.pros-mail pre { margin: 0; padding: 1rem; white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; line-height: 1.55; color: var(--gray-800); max-height: 55vh; overflow: auto; }
.pros-help ul { margin: 0.5rem 0 0 1.1rem; display: grid; gap: 0.4rem; font-size: 0.875rem; color: var(--gray-600); line-height: 1.5; }
.pros-help { margin-bottom: 1rem; }
.pros-acc-list { display: grid; gap: 1rem; }
.pros-acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.pros-acc-head b { display: block; word-break: break-all; }
.pros-acc-head small { color: var(--gray-500); font-size: 0.8rem; }
#pros-settings h3 { margin: 1.25rem 0 0.75rem; font-size: 0.95rem; }
#pros-settings h3:first-child { margin-top: 0; }
.pros-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--gray-700); }
@media (max-width: 640px) {
  .pros-switch { flex-direction: column; align-items: stretch; }
  .pros-acc { grid-template-columns: 1fr auto; }
  .pros-acc .pros-meter { grid-column: 1 / -1; grid-row: 2; }
  .pros-toolbar > * { flex: 1 1 100%; }
}
