/**
 * JamboIA Plan Users Design System
 * Modern, clean interface for users with purchased plans
 */

/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
    /* Brand Colors */
    --jambo-pink: #4860cb;
    --jambo-pink-light: #5d73d4;
    --jambo-blue: #00A3E0;
    --jambo-blue-light: #33B5E8;
    --jambo-orange: #F8A01A;
    --jambo-green: #10B981;
    --jambo-purple: #8B5CF6;
    --jambo-red: #EF4444;
    --jambo-yellow: #F59E0B;

    /* Background Colors */
    --bg-primary: #FAFBFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F3F4F6;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Border Colors */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
.jambo-plan-layout * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.jambo-plan-layout {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */
.jambo-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.jambo-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.jambo-sidebar-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}

.jambo-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.jambo-logo img {
    max-height: 36px;
    width: auto;
    max-width: 150px;
}

.jambo-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-blue));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    font-family: 'Space Grotesk', sans-serif;
}

.jambo-logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.jambo-logo-text span {
    color: var(--jambo-pink);
}

.jambo-sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.jambo-nav-section {
    margin-bottom: 24px;
}

.jambo-nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.jambo-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.jambo-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.jambo-nav-item.active {
    background: linear-gradient(135deg, rgba(72, 96, 203, 0.14), rgba(0, 163, 224, 0.14));
    color: var(--jambo-pink);
    font-weight: 600;
}

.jambo-nav-item.active i,
.jambo-nav-item.active svg {
    color: var(--jambo-pink);
}

.jambo-nav-item i,
.jambo-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.jambo-nav-item-badge {
    margin-left: auto;
    background: var(--jambo-pink);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.jambo-sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-light);
}

.jambo-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.jambo-user-card:hover {
    background: var(--bg-tertiary);
}

.jambo-user-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--jambo-blue), var(--jambo-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.jambo-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.jambo-user-info {
    min-width: 0;
    flex: 1;
}

.jambo-user-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jambo-user-role {
    font-size: 11px;
    line-height: 1.25;
    color: var(--text-muted);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.jambo-main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    max-width: 1400px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.jambo-page-header {
    margin-bottom: 32px;
}

.jambo-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.jambo-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.jambo-breadcrumb a:hover {
    color: var(--jambo-pink);
}

.jambo-breadcrumb i,
.jambo-breadcrumb svg {
    width: 14px;
    height: 14px;
}

.jambo-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 8px;
}

.jambo-page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.jambo-greeting {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
}

.jambo-greeting-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================
   BUTTONS
   ============================================ */
.jambo-btn {
    display: inline-flex;
    align-items: center;
    /* centrado tambien en botones a ancho completo (w-100): sin esto el
       contenido queda pegado a la izquierda y desentona con el resto */
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    /* los <button> nativos no heredan la fuente: igualar con los <a> */
    font-family: inherit;
    line-height: 1.2;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

/* Pildora de accion en filas de tabla: mismo ancho y texto centrado
   para que Editar/Desactivar/Eliminar formen una retícula uniforme. */
.jambo-btn-row-action {
    justify-content: center;
    min-width: 96px;
    font-size: 12px;
    padding: 6px 10px;
}

/* lucide sustituye <i data-lucide> por <svg>: dimensionar ambos */
.jambo-btn i,
.jambo-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.jambo-btn-primary {
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-pink-light));
    color: white;
}

.jambo-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 96, 203, 0.3);
    color: white;
}

.jambo-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.jambo-btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.jambo-btn-outline {
    background: transparent;
    color: var(--jambo-pink);
    border: 1px solid var(--jambo-pink);
}

.jambo-btn-outline:hover {
    background: var(--jambo-pink);
    color: white;
}

/* ============================================
   CARDS
   ============================================ */
.jambo-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.jambo-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jambo-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.jambo-card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.jambo-card-body {
    padding: 20px 24px;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.jambo-quick-actions {
    margin-bottom: 48px;
}

.jambo-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.jambo-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.jambo-section-title i,
.jambo-section-title svg {
    color: var(--jambo-pink);
}

.jambo-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.jambo-action-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.jambo-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent, var(--jambo-pink)), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.jambo-action-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.jambo-action-card:hover::before {
    opacity: 1;
}

.jambo-action-card.primary {
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-pink-light));
    border: none;
    color: white;
}

.jambo-action-card.primary .jambo-action-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.jambo-action-card.primary .jambo-action-title,
.jambo-action-card.primary .jambo-action-desc {
    color: white;
}

.jambo-action-card.primary .jambo-action-desc {
    opacity: 0.9;
}

.jambo-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: transform var(--transition-normal);
}

.jambo-action-card:hover .jambo-action-icon {
    transform: scale(1.1);
}

.jambo-action-icon.pink {
    background: rgba(72, 96, 203, 0.1);
    color: var(--jambo-pink);
}

.jambo-action-icon.blue {
    background: rgba(0, 163, 224, 0.1);
    color: var(--jambo-blue);
}

.jambo-action-icon.orange {
    background: rgba(248, 160, 26, 0.1);
    color: var(--jambo-orange);
}

.jambo-action-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.jambo-action-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.jambo-action-icon.slate {
    background: rgba(100, 116, 139, 0.1);
    color: #64748B;
}

.jambo-action-icon i,
.jambo-action-icon svg {
    width: 24px;
    height: 24px;
}

.jambo-action-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.jambo-action-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   STATS CARDS
   ============================================ */
.jambo-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.jambo-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
}

.jambo-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.jambo-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jambo-stat-label i,
.jambo-stat-label svg {
    width: 16px;
    height: 16px;
}

.jambo-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
    margin-bottom: 8px;
}

.jambo-stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.jambo-stat-change.positive {
    color: #10B981;
}

.jambo-stat-change.negative {
    color: #EF4444;
}

.jambo-stat-change i,
.jambo-stat-change svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   KPI CARDS
   ============================================ */
.jambo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.jambo-kpi-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-fast);
}

.jambo-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.jambo-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.jambo-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jambo-kpi-icon i,
.jambo-kpi-icon svg {
    width: 22px;
    height: 22px;
}

.jambo-kpi-icon.pink { background: rgba(72, 96, 203, 0.1); color: var(--jambo-pink); }
.jambo-kpi-icon.blue { background: rgba(0, 163, 224, 0.1); color: var(--jambo-blue); }
.jambo-kpi-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--jambo-green); }
.jambo-kpi-icon.orange { background: rgba(248, 160, 26, 0.1); color: var(--jambo-orange); }
.jambo-kpi-icon.purple { background: rgba(139, 92, 246, 0.1); color: var(--jambo-purple); }
.jambo-kpi-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--jambo-red); }
.jambo-kpi-icon.yellow { background: rgba(245, 158, 11, 0.1); color: var(--jambo-yellow); }

.jambo-kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}

.jambo-kpi-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--jambo-green);
}

.jambo-kpi-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--jambo-red);
}

.jambo-kpi-trend i,
.jambo-kpi-trend svg {
    width: 14px;
    height: 14px;
}

.jambo-kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
    margin-bottom: 4px;
}

.jambo-kpi-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   GUIDE SECTION
   ============================================ */
.jambo-guide-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 40px;
}

.jambo-guide-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.jambo-guide-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--jambo-blue), var(--jambo-pink));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.jambo-guide-icon i,
.jambo-guide-icon svg {
    width: 28px;
    height: 28px;
}

.jambo-guide-intro h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
}

.jambo-guide-intro p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 600px;
}

.jambo-guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.jambo-step-card {
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    position: relative;
}

.jambo-step-number {
    position: absolute;
    top: -12px;
    left: 20px;
    width: 28px;
    height: 28px;
    background: var(--jambo-pink);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.jambo-step-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 4px;
}

.jambo-step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.jambo-step-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--jambo-pink);
    text-decoration: none;
    transition: gap var(--transition-fast);
}

.jambo-step-link:hover {
    gap: 10px;
}

.jambo-step-link i,
.jambo-step-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   ACTIVITY SECTION
   ============================================ */
.jambo-activity-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 28px;
}

.jambo-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.jambo-activity-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.jambo-activity-link {
    font-size: 13px;
    color: var(--jambo-pink);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.jambo-activity-link i,
.jambo-activity-link svg {
    width: 16px;
    height: 16px;
}

.jambo-activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jambo-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.jambo-activity-item:hover {
    background: var(--bg-primary);
}

.jambo-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jambo-activity-icon.chat {
    background: rgba(72, 96, 203, 0.1);
    color: var(--jambo-pink);
}

.jambo-activity-icon.agent {
    background: rgba(0, 163, 224, 0.1);
    color: var(--jambo-blue);
}

.jambo-activity-icon.user {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.jambo-activity-icon.doc {
    background: rgba(248, 160, 26, 0.1);
    color: var(--jambo-orange);
}

.jambo-activity-icon i,
.jambo-activity-icon svg {
    width: 20px;
    height: 20px;
}

.jambo-activity-content {
    flex: 1;
}

.jambo-activity-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.jambo-activity-text strong {
    font-weight: 600;
}

.jambo-activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   TABLES
   ============================================ */
.jambo-table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.jambo-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jambo-table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.jambo-table {
    width: 100%;
    border-collapse: collapse;
}

.jambo-table thead {
    background: var(--bg-tertiary);
}

.jambo-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jambo-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

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

.jambo-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ============================================
   BADGES
   ============================================ */
.jambo-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.jambo-badge-primary { background: rgba(72, 96, 203, 0.1); color: var(--jambo-pink); }
.jambo-badge-success { background: rgba(16, 185, 129, 0.1); color: var(--jambo-green); }
.jambo-badge-info { background: rgba(0, 163, 224, 0.1); color: var(--jambo-blue); }
.jambo-badge-warning { background: rgba(248, 160, 26, 0.1); color: var(--jambo-orange); }
.jambo-badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--jambo-red); }

/* ============================================
   FORMS
   ============================================ */
.jambo-form-group {
    margin-bottom: 20px;
}

.jambo-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.jambo-form-label span {
    color: #EF4444;
}

.jambo-form-input,
.jambo-form-select,
.jambo-form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.jambo-form-input:focus,
.jambo-form-select:focus,
.jambo-form-textarea:focus {
    outline: none;
    border-color: var(--jambo-pink);
    box-shadow: 0 0 0 3px rgba(72, 96, 203, 0.1);
}

.jambo-form-textarea {
    resize: vertical;
    min-height: 120px;
}

.jambo-search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.jambo-search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
}

.jambo-search-box input:focus {
    outline: none;
    border-color: var(--jambo-pink);
    box-shadow: 0 0 0 3px rgba(72, 96, 203, 0.1);
}

/* lucide sustituye <i data-lucide> por <svg>: capturar ambos */
.jambo-search-box i,
.jambo-search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

/* ============================================
   CHATBOT FLOATING
   ============================================ */
.jambo-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.jambo-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-blue));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(72, 96, 203, 0.4);
    transition: all var(--transition-fast);
}

/* lucide sustituye <i data-lucide> por <svg>: icono en blanco sobre el degradado */
.jambo-chatbot-toggle i,
.jambo-chatbot-toggle svg {
    color: #fff;
    width: 26px;
    height: 26px;
}

.jambo-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(72, 96, 203, 0.5);
}

.jambo-chatbot-toggle i,
.jambo-chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.jambo-chatbot-toggle .close-icon {
    display: none;
}

.jambo-chatbot-toggle.active .chat-icon {
    display: none;
}

.jambo-chatbot-toggle.active .close-icon {
    display: block;
}

.jambo-chatbot-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: jamboSlideUp 0.3s ease;
}

.jambo-chatbot-window.active {
    display: flex;
}

@keyframes jamboSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jambo-chatbot-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-blue));
    color: white;
}

.jambo-chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jambo-chatbot-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.jambo-chatbot-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.jambo-chatbot-info p {
    font-size: 12px;
    opacity: 0.9;
}

.jambo-chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-top: 4px;
}

.jambo-chatbot-status .dot {
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    animation: jamboPulse 2s infinite;
}

@keyframes jamboPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.jambo-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jambo-chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.jambo-chat-message.bot {
    align-self: flex-start;
}

.jambo-chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.jambo-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
}

.jambo-chat-message.bot .jambo-message-avatar {
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-blue));
    color: white;
}

.jambo-chat-message.user .jambo-message-avatar {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.jambo-message-content {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
}

.jambo-chat-message.bot .jambo-message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.jambo-chat-message.user .jambo-message-content {
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-pink-light));
    color: white;
    border-bottom-right-radius: 4px;
}

.jambo-quick-questions {
    padding: 0 20px 16px;
}

.jambo-quick-questions-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.jambo-quick-questions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.jambo-quick-question-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.jambo-quick-question-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--jambo-pink);
    color: var(--jambo-pink);
}

.jambo-chatbot-input {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

.jambo-chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.jambo-chatbot-input input:focus {
    outline: none;
    border-color: var(--jambo-pink);
}

.jambo-chatbot-input button {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, var(--jambo-pink), var(--jambo-pink-light));
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
}

.jambo-chatbot-input button:hover {
    transform: scale(1.05);
}

.jambo-chatbot-input button i,
.jambo-chatbot-input button svg {
    width: 20px;
    height: 20px;
}

/* Typing indicator */
.jambo-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.jambo-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: jamboTyping 1.4s infinite;
}

.jambo-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.jambo-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes jamboTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ============================================
   MODALS
   ============================================ */
.jambo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.jambo-modal-overlay.active {
    display: flex;
}

.jambo-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    /* Cabecera y pie fijos, scroll solo en el cuerpo; hidden ademas evita
       que la barra de scroll pise las esquinas redondeadas. */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: jamboModalSlideIn 0.3s ease;
}

/* Algunos modales envuelven cuerpo y pie en un <form>: debe dejar pasar el flex. */
.jambo-modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.jambo-modal-header,
.jambo-modal-footer {
    flex-shrink: 0;
}

@keyframes jamboModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.jambo-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jambo-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
}

.jambo-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.jambo-modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.jambo-modal-close i,
.jambo-modal-close svg {
    width: 20px;
    height: 20px;
}

.jambo-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.jambo-modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes jamboFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jambo-animate-in {
    animation: jamboFadeInUp 0.5s ease forwards;
}

.jambo-animate-in:nth-child(1) { animation-delay: 0.05s; }
.jambo-animate-in:nth-child(2) { animation-delay: 0.1s; }
.jambo-animate-in:nth-child(3) { animation-delay: 0.15s; }
.jambo-animate-in:nth-child(4) { animation-delay: 0.2s; }
.jambo-animate-in:nth-child(5) { animation-delay: 0.25s; }
.jambo-animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1400px) {
    .jambo-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .jambo-stats-row,
    .jambo-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .jambo-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

    .jambo-sidebar.open {
        transform: translateX(0);
    }

    .jambo-main-content {
        margin-left: 0;
        padding: 24px 20px;
    }

    .jambo-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 24px;
    }

    .jambo-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .jambo-actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .jambo-stats-row,
    .jambo-kpi-grid {
        grid-template-columns: 1fr;
    }

    .jambo-guide-steps {
        grid-template-columns: 1fr;
    }

    .jambo-chatbot-window {
        width: calc(100vw - 48px);
        height: 70vh;
        right: -12px;
    }
}

@media (max-width: 480px) {
    .jambo-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   USER DROPDOWN
   ============================================ */
.jambo-user-dropdown {
    position: relative;
}

.jambo-user-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    margin-bottom: 8px;
    display: none;
}

.jambo-user-dropdown-menu.active {
    display: block;
}

.jambo-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
}

.jambo-user-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.jambo-user-dropdown-item.danger {
    color: var(--jambo-red);
}

.jambo-user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--jambo-red);
}

.jambo-user-dropdown-item i,
.jambo-user-dropdown-item svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   TABS
   ============================================ */
.jambo-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-lg);
    width: fit-content;
    border: 1px solid var(--border-light);
}

.jambo-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.jambo-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.jambo-tab.active {
    background: var(--bg-primary);
    color: var(--jambo-pink);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.jambo-tab i,
.jambo-tab svg {
    width: 16px;
    height: 16px;
}

.jambo-tab-content {
    animation: jamboFadeIn 0.3s ease;
}

@keyframes jamboFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   INPUT ALIAS (jambo-input = jambo-form-input)
   ============================================ */
.jambo-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
    font-family: inherit;
    color: var(--text-primary);
}

.jambo-input:focus {
    outline: none;
    border-color: var(--jambo-pink);
    box-shadow: 0 0 0 3px rgba(72, 96, 203, 0.1);
}

.jambo-input::placeholder {
    color: var(--text-muted);
}

textarea.jambo-input {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   DRIVER SELECTION (for database config)
   ============================================ */
.driver-option input:checked + div {
    border-color: var(--jambo-pink);
    background: rgba(72, 96, 203, 0.05);
}

.driver-option:hover div {
    border-color: var(--border-medium);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spin {
    animation: jamboSpin 1s linear infinite;
}

@keyframes jamboSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   PAGE TITLE WITH ICON
   ============================================ */
.jambo-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jambo-page-title i,
.jambo-page-title svg {
    color: var(--jambo-pink);
}

/* ============================================
   PAGINATION (Bootstrap markup, themed)
   ============================================ */
.jambo-plan-layout .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.jambo-plan-layout .pagination .page-item {
    display: inline-flex;
}

.jambo-plan-layout .pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.jambo-plan-layout .pagination .page-link:hover {
    border-color: var(--jambo-pink);
    color: var(--jambo-pink);
}

.jambo-plan-layout .pagination .page-item.active .page-link {
    background: var(--jambo-pink);
    border-color: var(--jambo-pink);
    color: #fff;
}

.jambo-plan-layout .pagination .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* SweetAlert2 dialogs must sit ABOVE jambo modals (.jambo-modal-overlay is z-index 2000).
   Otherwise a confirmation opened from inside a modal — e.g. removing a user/group from an
   agent — renders behind the modal and is invisible until you close it. */
.swal2-container {
    z-index: 100000 !important;
}

/* ============================================
   ALERTS, PROGRESS, PAGINATION
   Shared by the integration pages (SharePoint, Salesforce, Azure AD) and any
   page that renders server or AJAX feedback inline.
   ============================================ */
.jambo-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
}
.jambo-alert > i[data-lucide], .jambo-alert > svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.jambo-alert ul { margin: 6px 0 0; padding-left: 18px; }
.jambo-alert p { margin: 4px 0 0; }
.jambo-alert code { background: rgba(0, 0, 0, 0.06); padding: 1px 5px; border-radius: 4px; }
.jambo-alert-info { background: rgba(0, 163, 224, 0.08); color: #0b6f96; border-color: rgba(0, 163, 224, 0.25); }
.jambo-alert-success { background: rgba(16, 185, 129, 0.08); color: #047857; border-color: rgba(16, 185, 129, 0.25); }
.jambo-alert-warning { background: rgba(248, 160, 26, 0.1); color: #9a5b00; border-color: rgba(248, 160, 26, 0.3); }
.jambo-alert-danger { background: rgba(239, 68, 68, 0.08); color: #b91c1c; border-color: rgba(239, 68, 68, 0.25); }

.jambo-badge-secondary { background: var(--bg-tertiary); color: var(--text-muted); }

.jambo-progress {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}
.jambo-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--jambo-pink), var(--jambo-blue));
    transition: width 0.3s ease;
}
.jambo-progress-bar.indeterminate { width: 40%; animation: jamboProgressSlide 1.2s ease-in-out infinite; }
@keyframes jamboProgressSlide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.jambo-progress-lg { height: 22px; }
.jambo-progress-lg .jambo-progress-bar { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }

.jambo-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 12px; list-style: none; padding: 0; }
.jambo-pagination .page-link {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-secondary);
}
.jambo-pagination a.page-link:hover { background: var(--bg-tertiary); }
.jambo-pagination .page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }

.jambo-table th.sortable { cursor: pointer; user-select: none; }
.jambo-table-compact th { padding: 10px 14px; }
.jambo-table-compact td { padding: 10px 14px; font-size: 13px; }

/* Two-state helpers used by the integration pages' scripts */
.d-none { display: none !important; }
.jambo-btn:disabled { opacity: 0.6; cursor: not-allowed; }
