@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Urbanist:wght@500;600;700&display=swap');

@property --glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-gradient {
  0% { --glow-angle: 0deg; }
  100% { --glow-angle: 360deg; }
}

:root {
    /* TOKENS NUEVOS (Manifiesto V1.1) */
    --fondo-base:       #f0f0f1;
    --superficie:       #ffffff;
    --superficie-suave: #fafafa;
    --borde:            #eaeaea;
    --texto-fuerte:     #1a1a1a;
    --texto-leve:       #8a8a8a;
    --texto-muy-leve:   #b5b5b3;
    --verde-wa:         #00C853;
    --verde-wa-hover:   #1eab53;
    --brillo-1:         #facc15;
    --brillo-2:         #fb923c;
    --brillo-3:         #f87171;
    --sombra-suave:     0 10px 40px -10px rgba(0, 0, 0, 0.04);
    --sombra-elevada:   0 24px 48px -12px rgba(0, 0, 0, 0.06);
    --sombra-pastilla:  0 8px 24px rgba(0, 0, 0, 0.05);
    --radio-xl:         32px;
    --radio-lg:         24px;
    --radio-md:         16px;
    --radio-sm:         10px;
    --radio-pastilla:   9999px;

    /* ALIASING LEGACY (Mantiene viva la app actual con los colores nuevos) */
    --font-display: 'Urbanist', system-ui, sans-serif;
    --font-body:    'Urbanist', system-ui, sans-serif;
    --bg-base:      var(--fondo-base);
    --panel:        var(--superficie);
    --panel-soft:   var(--superficie-suave);
    --border:       var(--borde);
    --text-main:    var(--texto-fuerte);
    --text-muted:   var(--texto-leve);
    --text-light:   var(--texto-muy-leve);
    --accent:       var(--verde-wa);
    --accent-hover: var(--verde-wa-hover);
    --shadow-soft:  var(--sombra-suave);
    --shadow-float: var(--sombra-elevada);
    --shadow-pill:  var(--sombra-pastilla);
    --radius-xl:    var(--radio-xl);
    --radius-lg:    var(--radio-lg);
    --radius-md:    var(--radio-md);
    --radius-sm:    var(--radio-sm);
    --radius-pill:  var(--radio-pastilla);
    --glow-1:       var(--brillo-1);
    --glow-2:       var(--brillo-2);
    --glow-3:       var(--brillo-3);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    font-weight: 400;
    margin: 0; padding: 0; line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; position: relative;
}

h1, h2, h3, h4 { 
    font-family: var(--font-display); 
    margin: 0; font-weight: 600; color: #1a1a1a; letter-spacing: -0.02em; line-height: 1.2; 
}
p { margin: 0 0 1rem 0; color: var(--text-muted); font-weight: 400; }

.glass-card {
    background: var(--panel);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; position: relative;
    border: none;
}
.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
}

.btn {
    font-family: var(--font-display);
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px; border-radius: var(--radius-pill);
    font-weight: 600; text-decoration: none; border: none; cursor: pointer;
    transition: all 0.2s ease; font-size: 0.95rem; letter-spacing: 0.01em;
}



.btn-primary { 
    --glow-intensity: 0.5; 
    --glow-size: 12px; 
    position: relative;
    color: #000;
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
                conic-gradient(from var(--glow-angle, 0deg), var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-2), var(--glow-1)) border-box;
    animation: rotate-gradient 3s linear infinite;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1); 
    z-index: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    isolation: isolate;
}

.btn-primary::before {
    display: block;
    content: "";
    position: absolute;
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 0;
    inset: 0;
    background: #fff;
    border-radius: inherit;
    z-index: -1;
}

.btn-primary::after {
    content: ""; 
    position: absolute; 
    z-index: -2;
    top: -2px;
    right: -2px;
    bottom: -2px;
    left: -2px;
    inset: -2px;
    background: conic-gradient(from var(--glow-angle, 0deg), var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-2), var(--glow-1));
    filter: blur(var(--glow-size)); 
    opacity: 0; 
    border-radius: inherit; 
    animation: rotate-gradient 3s linear infinite;
    transition: opacity 0.3s ease;
}

.btn-primary:hover { 
    background: linear-gradient(#fff, #fff) padding-box,
                conic-gradient(from var(--glow-angle, 0deg), var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-2), var(--glow-1)) border-box;
    transform: translateY(-1px); 
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); 
}

.btn-primary:hover::after { 
    opacity: var(--glow-intensity); 
}


.btn-accent { 
    background: var(--accent); color: #fff; 
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.2); 
}
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25); transform: translateY(-1px); }

.btn-outline { 
    background: transparent; border: 1px solid var(--border); color: var(--text-main); 
}
.btn-outline:hover { background: var(--panel-soft); border-color: #d4d4d4; }

.btn-ghost { background: transparent; color: var(--text-muted); padding: 8px 16px; font-weight: 400; }
.btn-ghost:hover { background: rgba(0,0,0,0.03); color: #1a1a1a; }

.nav-wrapper { position: fixed; top: 20px; left: 0; width: 100%; z-index: 1000; display: flex; justify-content: center; padding: 0 20px; box-sizing: border-box; }
.nav-pill {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(20px);
    padding: 12px 24px; border-radius: var(--radius-pill);
    box-shadow: var(--shadow-pill);
    width: 100%; max-width: 1000px; border: none;
}
.nav-logo { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; text-decoration: none; color: #1a1a1a;
letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-family: var(--font-display); text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: #1a1a1a; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.section { padding: 120px 0; scroll-margin-top: 120px; }

.hero { text-align: center; padding-top: 180px; padding-bottom: 80px; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 600; margin-bottom: 24px; max-width: 900px; margin-inline: auto; color: #1a1a1a; }
.hero h1 span { color: var(--accent); font-weight: 500; }
.hero p { font-size: 1.2rem; font-weight: 300; max-width: 700px; margin: 0 auto 40px auto; line-height: 1.6; }
.hero-actions { display: flex; justify-content: center; gap: 16px; }

.bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 40px; }
.bento-item h3 { font-size: 1.4rem; font-weight: 500; margin-bottom: 8px; color: #1a1a1a; }
.bento-item ul { list-style: none; padding: 0; margin: 24px 0 0 0; }
.bento-item ul li { position: relative; padding-left: 28px; margin-bottom: 12px; color: var(--text-muted); font-weight: 300; }
.bento-item ul li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 500; }

.metric-label {font-size: 1.2rem;}
.metric-val {}
.metric-desc {font-size: 1.2rem;}

.stats-strip { background: var(--panel); color: #1a1a1a; border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); padding: 40px; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px; text-align: center; margin: 60px 0; }
.stat-box h4 { font-size: 3rem; font-weight: 600; color: #1a1a1a; margin: 0 0 4px 0; letter-spacing: -0.03em; }
.stat-box span { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 24px; margin-top: 40px; align-items: start; }
.price-card { position: relative; border-radius: var(--radius-xl); }
.price-card.featured { border: 1px solid var(--accent); }
.badge-featured { position: absolute; top: -14px; right: 32px; background: #1a1a1a; color: white; padding: 6px 16px; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.05em; z-index: 10; }
.price-val { font-size: 3.5rem; font-weight: 600; margin: 20px 0; color: #1a1a1a; letter-spacing: -0.04em; }
.price-val span { font-size: 1rem; color: var(--text-muted); font-weight: 400; letter-spacing: normal; }

.app-container { 
    display: flex; 
    min-height: 100vh; 
    padding: 16px; 
    box-sizing: border-box; 
    gap: 16px; 
    background: var(--bg-base);
}

.sidebar-pill {
    width: 280px;
    background: var(--panel-soft); 
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    display: flex; 
    flex-direction: column; 
    position: sticky; 
    top: 16px; 
    height: calc(100vh - 32px);
    box-sizing: border-box;
    border: none;
}

.sidebar-logo { 
    font-family: var(--font-display);
    font-size: 1.9rem; 
    font-weight: 600; 
    color: #1a1a1a; 
    text-decoration: none; 
    margin-bottom: 40px; 
    padding-left: 16px; 
    letter-spacing: -0.02em;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-left: 16px;
}

.menu-toggle { display: none; }

.sidebar-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    flex: 1; 
}

.nav-item {
    font-family: var(--font-display);
    display: flex; 
    align-items: center; 
    gap: 16px; 
    padding: 14px 16px; 
    border-radius: var(--radius-pill);
    color: var(--text-muted); 
    text-decoration: none; 
    font-weight: 400; 
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.nav-item svg { 
    width: 20px; 
    height: 20px; 
    stroke: currentColor; 
    fill: none; 
    stroke-width: 1.5; 
    stroke-linecap: round; 
    stroke-linejoin: round; 
}

.nav-item:hover { 
    background: #efefec; 
    color: var(--text-main); 
}

.nav-item.active { 
    position: relative;
    color: #1a1a1a; 
    font-weight: 500;
    border: 1px solid transparent;
    background: linear-gradient(var(--panel), var(--panel)) padding-box,
                conic-gradient(from var(--glow-angle, 0deg), var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-2), var(--glow-1)) border-box;
    animation: rotate-gradient 3s linear infinite;
    box-shadow: var(--shadow-pill); 
    z-index: 1;
}
.nav-item.active::before { display: none; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
    background: var(--panel);
    border-radius: var(--radius-xl);
    padding: 32px 40px;
    box-shadow: var(--shadow-soft);
}

.topbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 0 24px 0; 
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.topbar-title h2 { 
    font-size: 1.8rem; 
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 4px 0; 
    letter-spacing: -0.03em;
}

.topbar-title p { margin: 0; font-size: 1.1rem; font-weight: 300; color: var(--text-muted); }

.user-profile { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: transparent; 
    padding: 4px;
}

.avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background: var(--accent); 
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 500; 
    font-size: 1rem; 
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 500; font-size: 1.1rem; color: #1a1a1a; line-height: 1; margin-bottom: 4px;}
.user-tier { font-size: 0.95rem; color: var(--text-muted); font-weight: 400; }

.view-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 1024px) {
    .app-container { flex-direction: column; padding: 0; gap: 0; }
    .main-content { padding: 24px 20px; border-radius: 0; box-shadow: none; }
    .sidebar-pill { width: 100%; height: auto; position: relative; top: 0; padding: 20px; border-right: none; border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; border-radius: 0; z-index: 100; }
    .sidebar-header { flex-direction: row; margin-bottom: 0; padding-left: 0; }
    .sidebar-logo { padding-left: 0; margin-bottom: 0; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-main); padding: 0; margin: 0; }
    .menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block;}
    .sidebar-nav { display: none; flex-direction: column; width: 100%; padding: 16px 0 0 0; }
    .sidebar-footer { display: none; width: 100%; padding: 16px 0 0 0; margin-top: 16px; border-top: 1px solid var(--border); }
    .sidebar-pill.menu-open .sidebar-nav { display: flex; }
    .sidebar-pill.menu-open .sidebar-footer { display: block; }
    .topbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 24px; }
    .user-profile { align-self: center; max-width: 100%; width: auto; background: transparent; border: none; box-shadow: none; padding: 0; margin-left: auto; }
}
@media (max-width: 768px) {
    .user-profile .avatar, .user-profile .user-info { display: none !important; }
    .topbar-title h2 { font-size: 1.4rem; }
    .topbar-title p { font-size: 0.95rem; }
    .lang-desktop-only { border-right: none; margin-right: 0; padding-right: 0; display: flex !important; }
}

.form-group { margin-bottom: 24px; text-align: left; }
.form-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; font-weight: 400; color: var(--text-muted); margin-bottom: 8px; text-transform: none; letter-spacing: normal; }
.form-control, .input-glass, .textarea-glass, .input-copy-lg, .input-promo { width: 100%; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; font-family: inherit; font-size: 0.95rem; font-weight: 400; color: var(--text-main); transition: all 0.2s ease; box-sizing: border-box; outline: none; }
.form-control:focus, .input-glass:focus, .textarea-glass:focus, .input-copy-lg:focus, .input-promo:focus { border-color: var(--text-main); box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }
.textarea-glass { resize: vertical; min-height: 120px; }
.rule-input-group { display: flex; gap: 12px; align-items: stretch; margin-bottom: 32px; }
.input-glass {flex: 1; margin: 0; border-radius: var(--radius-md); background: #fff;}

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: 10000; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.modal-overlay.active { display: flex; }
.modal-content { background: #fff; width: 100%; max-width: 440px; border-radius: var(--radius-xl); padding: 48px 40px; text-align: center; box-shadow: var(--shadow-float); border: 1px solid var(--border); animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; position: relative; box-sizing: border-box; }
.modal-content.large { max-width: 750px; text-align: left; padding: 48px; max-height: 90vh; display: flex; flex-direction: column; }
.btn-close-modal { position: absolute; top: 24px; right: 24px; background: transparent; border: none; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 50; }
.btn-close-modal svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; }
.btn-close-modal:hover { color: #1a1a1a; background: var(--bg-base); border-radius: 50%; }

@keyframes modalIn { from { transform: scale(0.97) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-icon-wrap { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px auto; }
.modal-icon-wrap.danger { background: #fff1f2; color: #e11d48; }
.modal-icon-wrap.info { background: #eff6ff; color: #2563eb; }
.modal-icon-wrap.warning { background: #fefce8; color: #ca8a04; }
.modal-title { font-size: 1.5rem; color: #1a1a1a; margin-bottom: 12px; font-weight: 500; letter-spacing: -0.02em; }
.modal-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 32px; font-weight: 300; line-height: 1.6; }
.modal-title-editorial { font-size: 1.8rem; text-align: left; margin-bottom: 24px; }

.icon-lg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-md { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; stroke: currentColor; fill: currentColor; }

.svg-24 { width: 24px; height: 24px; }
.svg-18 { width: 18px; height: 18px; }
.svg-no-stroke { stroke: none; }
.svg-fill { fill: currentColor; }
.mr-sm { margin-right: 8px; }

.alert-box { border-radius: var(--radius-md); margin-bottom: 24px; display: flex; gap: 12px; font-weight: 400; border: 1px solid var(--borde); background: var(--superficie); padding: 16px 20px; align-items: center; box-shadow: var(--sombra-suave); color: var(--texto-fuerte); }
.alert-danger .alert-icon { stroke: var(--texto-fuerte); }
.alert-warning .alert-icon { stroke: var(--texto-fuerte); }
.alert-info .alert-icon { stroke: var(--texto-fuerte); }
.alert-success .alert-icon { stroke: var(--verde-wa); }
.alert-icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }

.alert-bot-status { align-items: center; padding: 24px; justify-content: space-between; flex-wrap: wrap; }
.alert-bot-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.alert-bot-title { margin: 0; font-size: 1.2rem; color: inherit; font-weight: 500; }
.alert-bot-desc { font-size: 1.1rem; opacity: 0.85; display: block; font-weight: 300; }
.btn-bot-toggle { padding: 10px 24px; }
.m-0 { margin: 0; }

.promo-banner { background: #fff; border: 1px solid var(--border); color: #1a1a1a; padding: 20px 24px; border-radius: var(--radius-lg); margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; box-shadow: var(--shadow-soft); }
.promo-title { margin: 0 0 4px 0; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
.promo-subtitle { font-size: 1.1rem; color: var(--text-muted); font-weight: 300; }
.promo-actions { display: flex; gap: 8px; }
.input-promo { padding: 10px 14px; width: 280px; font-weight: 400; cursor: copy; background: var(--panel-soft); border-radius: var(--radius-sm); border: 1px solid var(--border); color: #1a1a1a; }

.badge-subtle { font-size: 0.75rem; font-weight: 500; color: var(--texto-leve); background: var(--fondo-base); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--borde); }
.badge-active { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--texto-fuerte); background: transparent; padding: 4px 0; border-radius: 0; border: none; }

.dot-pulse { width: 6px; height: 6px; background: var(--verde-wa); border-radius: 50%; animation: pulseDot 2.5s infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); } 60% { box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); } }

.tabs-wrapper { margin-bottom: 32px; display: flex; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.tab-badge { margin-left: 8px; font-weight: 500; padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; background: var(--bg-base); border: 1px solid var(--border); }
.chat-list { display: flex; flex-direction: column; gap: 16px; }
.inbox-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.inbox-col-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inbox-col-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-phone { font-weight: 500; font-size: 1.05rem; color: #1a1a1a; letter-spacing: -0.01em; }
.chat-name { font-size: 0.9rem; font-weight: 300; color: var(--text-muted); }
.chat-summary { margin: 16px 0 0 0; color: #1a1a1a; font-size: 0.95rem; line-height: 1.5; padding: 16px; background: var(--panel-soft); border-radius: var(--radius-md); border: 1px solid var(--border); }
.text-attention { color: #e11d48; font-weight: 500; margin-right: 6px; }
.btn-dark { background: #1a1a1a; color: white; }
.btn-dark:hover { background: #000; transform: translateY(-1px); }
.nav-logout { color: var(--text-muted) !important; transition: all 0.2s ease !important; }
.nav-logout:hover { color: #e11d48 !important; background: #fff1f2 !important; }
.p-chat { padding: 24px; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }

.rule-list { display: flex; flex-direction: column; gap: 12px; }
.rule-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 0.95rem; background: var(--panel-soft); border-radius: var(--radius-md); border: 1px dashed var(--border); }
.rule-card { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.02); gap: 16px; transition: all 0.2s ease; }
.rule-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.rule-content-wrap { display: flex; align-items: center; gap: 16px; flex: 1; }
.rule-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; transition: all 0.2s; }
.rule-dot.active { background: var(--accent); }
.rule-dot.inactive { background: var(--border); }
.rule-text { font-weight: 400; font-size: 1rem; transition: all 0.2s; }
.rule-text.active { color: #1a1a1a; }
.rule-text.inactive { color: var(--text-light); text-decoration: line-through; }
.rule-actions { display: flex; gap: 8px; align-items: center; }
.btn-rule-toggle { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-md); height: 100%; font-weight: 500; }
.btn-rule-delete { padding: 8px; font-size: 0.85rem; color: var(--text-light); background: transparent; border: none; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; transition: all 0.2s; cursor: pointer; }
.btn-rule-delete svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn-rule-delete:hover { background: #fff1f2; color: #e11d48; }

.locked-state-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; text-align: center; max-width: 500px; margin: 0 auto; background: transparent; border: none; box-shadow: none; }
.icon-circle-xl { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; flex-shrink: 0; }
.icon-circle-xl.indigo { background: #eff6ff; color: #2563eb; }
.locked-title { font-size: 1.6rem; font-weight: 500; margin-bottom: 12px; color: #1a1a1a; letter-spacing: -0.02em; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.ml-sm { margin-left: 8px; }

.ref-container { display: flex; flex-direction: column; gap: 24px; }
.p-xl { padding: 48px; }
.icon-circle-lg { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; flex-shrink: 0; }
.icon-circle-lg.indigo { background: #eff6ff; color: #2563eb; }
.ref-title { font-size: 1.8rem; margin-bottom: 12px; font-weight: 500; color: #1a1a1a; letter-spacing: -0.02em; }
.ref-desc { max-width: 600px; margin: 0 auto 32px auto; font-size: 1.2rem; color: var(--text-muted); line-height: 1.6; font-weight: 300; }
.ref-actions-row { display: flex; justify-content: center; align-items: stretch; gap: 12px; flex-wrap: wrap; }
.btn-xl { padding: 16px 24px; font-size: 1rem; }
.btn-white-bordered { background: #fff; border: 1px solid var(--border); color: #1a1a1a; font-weight: 500; }
.btn-white-bordered:hover { background: var(--panel-soft); }

.error-page-body { background: var(--bg-base); margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-card { background: #fff; border: 1px solid var(--border); padding: 60px 40px; border-radius: var(--radius-xl); text-align: center; max-width: 500px; width: 90%; box-shadow: var(--shadow-float); }
.error-code { font-size: 6rem; font-weight: 500; color: var(--text-light); margin: 0 0 16px 0; line-height: 1; letter-spacing: -0.05em; }
.error-title { font-size: 1.6rem; font-weight: 500; color: #1a1a1a; margin: 0 0 16px 0; letter-spacing: -0.02em; }
.error-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 32px 0; font-weight: 300; }

.auth-wrapper { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: var(--bg-base); }
.auth-card { width: 100%; max-width: 420px; text-align: center; padding: 48px 40px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-float); }
.auth-logo { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; color: #1a1a1a; text-decoration: none; margin-bottom: 12px; display: inline-block; letter-spacing: -0.04em; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 32px; font-size: 0.95rem; font-weight: 300; line-height: 1.5; }
.auth-alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 24px; font-weight: 400; font-size: 0.9rem; text-align: left; border: 1px solid transparent; }
.auth-alert-error { background: #fff1f2; color: #be123c; border-color: #ffe4e6; }
.auth-alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.btn-social-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.btn-social { width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 1rem; font-weight: 500; border-radius: var(--radius-md); transition: all 0.2s; }
.btn-social svg { width: 22px !important; height: 22px !important; flex-shrink: 0; }
.btn-google { background: #fff; border: 1px solid var(--border); color: #1a1a1a; }
.btn-google:hover { background: var(--panel-soft); border-color: #d4d4d4; }
.btn-facebook-auth { background: #1877f2; border: 1px solid #1877f2; color: white; }
.btn-facebook-auth:hover { background: #166fe5; }
.btn-facebook-auth svg { fill: white; }
.auth-divider { display: flex; align-items: center; margin: 24px 0; color: var(--text-light); font-size: 0.85rem; font-weight: 300; text-transform: none; letter-spacing: normal; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { padding: 0 16px; }
.form-footer-link { display: block; margin-top: 32px; color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 400; }
.form-footer-link span { color: #1a1a1a; font-weight: 500; }
.form-footer-link:hover span { text-decoration: underline; }
.forgot-link { float: right; font-size: 0.8rem; color: var(--text-muted); text-decoration: none; font-weight: 400; text-transform: none; letter-spacing: normal; }
.forgot-link:hover { color: #1a1a1a; }
.btn-auth-submit { width: 100%; height: 48px; font-size: 1rem; margin-top: 8px; border-radius: var(--radius-md); }

.docs-container { display: flex; flex-direction: column; gap: 24px; max-width: 900px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.docs-empty { grid-column: 1 / -1; text-align: center; padding: 60px; color: var(--text-muted); font-size: 0.95rem; background: var(--panel-soft); border-radius: var(--radius-lg); border: 1px dashed var(--border); }
.doc-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; padding-bottom: 64px; border: 1px solid var(--border); cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; gap: 16px; position: relative; height: 260px; box-sizing: border-box; overflow: hidden; box-shadow: var(--shadow-soft); }
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
/*.doc-card .btn-delete-doc { opacity: 0; pointer-events: none; }*/
.doc-card:hover .btn-delete-doc { opacity: 1; pointer-events: auto; }
.btn-delete-doc { position: absolute; top: 12px; right: 12px; z-index: 20; background: transparent; border: none; color: var(--text-light); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.btn-delete-doc svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.btn-delete-doc:hover { background: #fff1f2; color: #e11d48; transform: scale(1.1); }
.doc-card-header { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 4px; }
.doc-icon { width: 48px; height: 48px; background: var(--panel-soft); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--border); }
.doc-icon svg { width: 24px; height: 24px; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.doc-title { font-weight: 500; font-size: 1.05rem; color: #1a1a1a; width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; letter-spacing: -0.01em; }
.doc-body { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; font-weight: 300; text-align: left; flex: 1; -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%); mask-image: linear-gradient(180deg, #000 40%, transparent 100%); overflow: hidden; }
.doc-footer { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px 24px; background: #fff; font-size: 0.75rem; font-weight: 500; color: var(--text-light); z-index: 10; border-top: 1px solid var(--border); }

.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }
.mb-2xl { margin-bottom: 40px; }

.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mt-2xl { margin-top: 40px; }

.planes-wrapper { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; padding-bottom: 40px; }

.panel-pricing-grid { 
    display: flex; 
    flex-direction: row; 
    gap: 32px; 
    margin-top: 40px; 
    justify-content: center; 
    align-items: stretch; 
}

@media (max-width: 768px) {
    .panel-pricing-grid {
        flex-direction: column;
        align-items: center;
    }
}

.panel-price-card { 
    position: relative; 
    overflow: visible !important; 
    box-sizing: border-box !important;
    flex: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.panel-price-card.featured { 
    border: 2px solid transparent !important;
    background: linear-gradient(#fff, #fff) padding-box,
                conic-gradient(from var(--glow-angle, 0deg), var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-2), var(--glow-1)) border-box !important;
    animation: rotate-gradient 3s linear infinite;
}

.panel-price-card .btn {
    width: 100%;
    max-width: 290px;
    margin: 24px auto 0 auto;
    box-sizing: border-box !important;
}

.panel-price-card .btn-outline {
    border: 1px solid #94a3b8 !important;
    background: transparent !important;
    color: var(--text-main) !important;
}

/* Selector Dinámico de Cantidad (Zero Inline CSS) */
.checkout-qty-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 290px;
    margin: 24px auto 0 auto;
}

.checkout-qty-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--superficie);
    overflow: hidden;
}

.checkout-qty-btn {
    background: var(--panel-soft);
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.checkout-qty-btn:hover {
    background: #e2e8f0;
}

.checkout-qty-input {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 12px 0;
    outline: none;
    -moz-appearance: textfield;
}

.checkout-qty-input::-webkit-outer-spin-button,
.checkout-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.checkout-qty-wrapper .btn {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.heading-xl { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.03em; color: var(--text-main); margin-bottom: 12px; }
.planes-subtitle { max-width: 600px; margin: 0 auto; }
.saldo-box { display: inline-block; padding: 20px 40px; margin-top: 24px; border: 1px solid var(--accent); background: rgba(37, 211, 102, 0.05); border-radius: var(--radius-lg); }
.saldo-box-val { font-size: 2.5rem; font-weight: 700; color: var(--text-main); line-height: 1; }
.saldo-box-lbl { font-size: 1.1rem; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.block { display: block; }
.bg-panel-soft { background: var(--panel-soft); }

.plan-card-wrap { display: flex; flex-direction: column; height: 100%; flex: 1; min-width: 300px; max-width: 400px; }
.plan-card-body { flex: 1; display: flex; flex-direction: column; }
.plan-card-single { grid-column: 1 / -1; max-width: 500px; margin: 0 auto; width: 100%; }
.badge-active-plan { background: var(--accent); color: #fff; }

.plan-list { list-style: none; padding: 0; margin: 0 0 24px 0; display: flex; flex-direction: column; gap: 12px; color: var(--text-muted); font-weight: 300; flex: 1; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list-icon { margin-top: 2px; flex-shrink: 0; }
.plan-disclaimer { background: var(--panel-soft); padding: 12px; border-radius: var(--radius-sm); margin-bottom: 24px; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

.plan-val-0 { font-size: 3rem; margin: 16px 0; font-weight: 600; color: var(--text-main); letter-spacing: -0.04em; }
.plan-val-0 span { font-size: 1rem; color: var(--text-muted); font-weight: 500; letter-spacing: normal; }

/* --- ESTRUCTURA BURBUJAS MULTIMEDIA (Fortune 500) --- */
.chat-media-card { background: var(--superficie-suave); border: 1px solid var(--borde); border-radius: var(--radio-md); padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 340px; width: 100%; box-sizing: border-box; }
.chat-media-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chat-media-icon-box { width: 40px; height: 40px; border-radius: var(--radio-sm); background: var(--fondo-base); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--borde); }
.chat-media-icon { width: 20px; height: 20px; stroke: var(--texto-fuerte); fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.chat-media-details { display: flex; flex-direction: column; min-width: 0; }
.chat-media-title { font-size: 0.95rem; font-weight: 600; color: var(--texto-fuerte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.chat-media-subtitle { font-size: 0.75rem; color: var(--texto-leve); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-top: 2px;}
.chat-audio-wave svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Botones circulares de acción lateral */
.chat-media-action { width: 36px; height: 36px; border-radius: 50%; background: var(--superficie); border: 1px solid var(--borde); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--texto-leve); transition: all 0.2s ease; flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.chat-media-action:hover { color: var(--texto-fuerte); border-color: var(--texto-leve); transform: translateY(-1px); }
.chat-media-action svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Pastilla Horizontal Nativa de Audio (Capa 1 variante) */
.chat-audio-pill { display: flex; align-items: center; gap: 12px; background: var(--superficie-suave); border-radius: var(--radio-pastilla); padding: 8px 16px 8px 8px; max-width: 320px; border: 1px solid var(--borde); width: 100%; box-sizing: border-box; }
.chat-audio-play { width: 36px; height: 36px; border-radius: 50%; background: var(--verde-wa); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform 0.2s ease; box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3); }
.chat-audio-play:hover { transform: scale(1.05); }
.chat-audio-play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; margin-left: 2px; }
.chat-audio-wave { flex: 1; height: 24px; color: var(--texto-muy-leve); display: flex; align-items: center; overflow: hidden; opacity: 0.5; }
.chat-audio-time { font-size: 0.8rem; color: var(--texto-leve); font-weight: 500; flex-shrink: 0; }

/* Capa 3: Transcripción / Notas del Agente (<details> nativo) */
.chat-ia-quote { margin-top: 8px; }
.chat-ia-quote summary { font-size: 0.85rem; font-weight: 600; color: var(--texto-leve); cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px; list-style: none; transition: color 0.2s; }
.chat-ia-quote summary:hover { color: var(--texto-fuerte); }
.chat-ia-quote summary::-webkit-details-marker { display: none; }
.chat-ia-quote summary::before { content: '›'; font-size: 1.2rem; line-height: 1; transition: transform 0.2s; }
.chat-ia-quote[open] summary::before { transform: rotate(90deg); }
.chat-ia-quote-content { margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--borde); font-size: 0.9rem; font-style: italic; color: var(--texto-leve); line-height: 1.5; white-space: pre-wrap; font-weight: 300; }

/* Capa 4: Disclaimer */
.chat-disclaimer { font-size: 0.75rem; color: var(--texto-muy-leve); font-style: italic; margin-top: 6px; font-weight: 300; }

.heading-md { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.02em; color: #1a1a1a; }
.text-body { font-size: 1.1rem; line-height: 1.6; font-weight: 300; }
.text-label { font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.text-value { font-weight: 500; font-size: 0.95rem; color: #1a1a1a; }
.text-helper { font-size: 0.95rem; font-weight: 400; }
.text-link { text-decoration: none; font-weight: 500; color: #1a1a1a; border-bottom: 1px solid var(--border); padding-bottom: 2px; transition: border-color 0.2s; }
.text-link:hover { border-color: #1a1a1a; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-muted { color: var(--text-muted); }
.text-main { color: #1a1a1a; }
.text-accent { color: var(--accent); }
.icon-red { color: #e11d48; stroke: currentColor; fill: none; }
.icon-green { color: #15803d; stroke: currentColor; fill: none; }
.icon-blue { color: #2563eb; stroke: currentColor; fill: none; }
.icon-slate { color: var(--text-muted); stroke: currentColor; fill: none; }

.hidden { display: none !important; }
.flex-between-end { display: flex; justify-content: space-between; align-items: flex-end; }
.flex-center { display: flex; align-items: center; justify-content: center; }

.p-card { padding: 32px; background: #fff; border-radius: var(--radius-xl); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }

.progress-container { width: 100%; height: 12px; background: var(--panel-soft); border-radius: var(--radius-pill); border: 1px solid var(--border); overflow: hidden; display: flex; }
.progress-track { background: transparent; display: flex; height: 100%; transition: width 0.5s ease; width: 0; }
.progress-fill { background: #1a1a1a; transition: width 0.5s ease; height: 100%; width: 0;}
.progress-locked { flex: 1; background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 10px, #e5e7eb 10px, #e5e7eb 20px); opacity: 0.5; position: relative; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--border); cursor: help; }
.progress-icon-wrap { background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 0 0 1px var(--border); display: flex; align-items: center; justify-content: center; }

.dropzone { border: 1px dashed var(--text-light); border-radius: var(--radius-lg); padding: 48px; text-align: center; background: var(--panel-soft); cursor: pointer; transition: all 0.2s ease; position: relative; }
.dropzone.dragover { border-color: #1a1a1a; background: #fff; transform: scale(1.01); }
.dz-icon-wrap { width: 56px; height: 56px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px auto; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.dz-title { margin: 0 0 8px 0; font-size: 1.1rem; font-weight: 500; color: #1a1a1a; }
.dz-subtitle { margin: 0; font-size: 0.9rem; font-weight: 300; }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.spinner-md { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: #1a1a1a; border-radius: 50%; margin: 0 auto 16px auto; animation: spin 1s linear infinite; }

.btn-danger { background: #fff; color: #e11d48; border: 1px solid #fecdd3; box-shadow: 0 1px 2px rgba(225, 29, 72, 0.05); }
.btn-danger:hover { background: #fff1f2; transform: translateY(-1px); }

.flex-gap { display: flex; gap: 12px; justify-content: center; }
.w-full { width: 100%; }

.editorial-content { font-family: 'Georgia', serif; font-size: 1.05rem; line-height: 1.8; color: #333; white-space: pre-wrap; overflow-y: auto; padding-right: 16px; flex: 1; }
.editorial-content::-webkit-scrollbar { width: 4px; }
.editorial-content::-webkit-scrollbar-track { background: transparent; }
.editorial-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.editorial-content::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
.editorial-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-family: 'Inter', sans-serif; font-size: 0.9rem; }
.editorial-content th, .editorial-content td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; }
.editorial-content th { background: var(--panel-soft); font-weight: 500; color: #1a1a1a; }

.settings-wrap { display: flex; flex-direction: column; gap: 24px; max-width: 800px; }
.status-card { display: flex; align-items: center; justify-content: space-between; padding: 20px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--border); flex-wrap: wrap; gap: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.status-info-group { display: flex; align-items: center; gap: 16px; }
.status-indicator { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.active { background: #15803d; }

.icon-circle-md { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-circle-md.success { background: #f0fdf4; color: #15803d; }

.empty-setup-box { display: flex; flex-direction: column; align-items: flex-start; padding: 24px; background: var(--panel-soft); border-radius: var(--radius-lg); border: 1px dashed var(--border); }
.btn-facebook { background-color: #1877f2; color: #fff; height: 48px; gap: 12px; border-radius: var(--radius-md); font-size: 0.95rem; font-weight: 500; border: none; }
.btn-facebook:hover { background-color: #166fe5; }
.loader-meta-row { align-items: center; gap: 12px; margin-top: 16px; }
.spinner-meta { width: 20px; height: 20px; margin: 0; border: 2px solid var(--border); border-top-color: #1877f2; border-radius: 50%; animation: spin 1s linear infinite; }

.btn-fit { width: fit-content; }
.px-lg { padding: 12px 24px; }
.text-success { color: #15803d; }
.text-danger { color: #e11d48; }
.text-slate { color: #333; line-height: 1.7; font-weight: 300; }
.no-scroll { overflow: hidden !important; }
.fw-bold { font-weight: 500 !important; }

.paywall-info-box { background: var(--panel-soft); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; text-align: left; }
.paywall-list { margin: 0; padding-left: 20px; }

.onboard-card { padding: 48px 40px; text-align: center; max-width: 500px; margin: 0 auto; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-float); border-radius: var(--radius-xl); }
.onboard-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px auto; background: var(--panel-soft); border: 1px solid var(--border); }
.onboard-icon svg { width: 32px; height: 32px; stroke: #1a1a1a; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.onboard-title { font-size: 1.6rem; margin-bottom: 12px; color: #1a1a1a; font-weight: 500; }
.onboard-desc { font-size: 1rem; color: var(--text-muted); margin-bottom: 32px; font-weight: 300; line-height: 1.6; }
.btn-onboard { font-size: 1rem; padding: 14px 32px; }
.onboard-status { margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #15803d; font-weight: 500; font-size: 0.85rem; }
.onboard-status svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.onboard-link { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; text-decoration: none; display: inline-block; margin-top: 24px; border-bottom: 1px solid transparent; transition: all 0.2s; }
.onboard-link:hover { color: #1a1a1a; border-color: #1a1a1a; }

.nav-locked { opacity: 0.4; pointer-events: none; }
.h-auto { height: auto !important; }
.justify-center { justify-content: center; }

.selector-idioma{position:relative;display:inline-flex;align-items:center}
.control-idioma{position:absolute;opacity:0;width:0;height:0;pointer-events:none}
.btn-idioma{display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:500;color:var(--text-main);padding:6px 14px;border-radius:var(--radius-pill);font-size:0.95rem;transition:all .2s ease;user-select:none;background:var(--superficie);border:1px solid var(--border);box-shadow:0 1px 2px rgba(0,0,0,0.05)}
.btn-idioma:hover,.control-idioma:focus+.btn-idioma{background:var(--bg-base)}
.btn-idioma svg{width:16px;height:16px;stroke:var(--text-main);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.menu-idiomas{position:absolute;top:100%;left:50%;margin-top:8px;background:var(--superficie);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--sombra-elevada);padding:8px;display:flex;flex-direction:column;gap:2px;min-width:135px;opacity:0;visibility:hidden;transform:translate(-50%,-5px);transition:all .2s ease;z-index:1001}
.selector-idioma:hover .menu-idiomas,.control-idioma:checked~.menu-idiomas{opacity:1;visibility:visible;transform:translate(-50%,0)}
.item-idioma{text-decoration:none;color:var(--text-muted);font-size:0.95rem;padding:8px 12px;border-radius:var(--radio-sm);transition:all .2s ease}
.item-idioma:hover,.item-idioma:focus{color:var(--text-main);background:var(--bg-base)}
.item-idioma--activo{color:var(--text-main);font-weight:600}
.lang-auth-wrap{margin-top:24px;display:flex;justify-content:center;border-top:1px solid var(--border);padding-top:16px}
.lang-auth-wrap .menu-idiomas{top:auto;bottom:100%;margin-top:0;margin-bottom:8px;transform:translate(-50%,5px)}
.lang-auth-wrap .selector-idioma:hover .menu-idiomas,.lang-auth-wrap .control-idioma:checked~.menu-idiomas{transform:translate(-50%,0)}
.lang-mobile-only{display:none;margin-bottom:12px;justify-content:center;padding:8px 0}
.lang-desktop-only{display:flex;align-items:center;margin-right:16px;border-right:1px solid var(--border);padding-right:16px}

@keyframes bubbleGrow {
    0% { opacity: 0; transform: translateY(12px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-enter-anim {
    animation: bubbleGrow 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity; /* Optimización GPU */
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes cardSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}
.card-enter-anim { animation: cardSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.card-leave-anim { animation: cardSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; pointer-events: none; }

.auth-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}
.auth-accordion.expanded {
    max-height: 600px;
    opacity: 1;
    pointer-events: auto;
    margin-bottom: 24px;
}
.auth-legal-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 24px 0 0 0;
    font-weight: 400;
}
.auth-legal-text .text-link {
    font-size: inherit;
}

.modal-hard-lock {
    background: var(--bg-base);
    backdrop-filter: blur(10px);
}
.modal-hard-lock .modal-content {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.chat-hub-body {
    margin: 0; padding: 0; overflow: hidden; height: 100vh; background: var(--bg-base);
}

.chat-hub-layout {
    display: flex; height: 100vh; width: 100%;
}

.chat-hub-sidebar {
    width: 35%; min-width: 320px; max-width: 450px; background: #fff;
    border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 10;
}

.chat-hub-header {
    padding: 16px 20px; display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--border); background: #fff;
}

.chat-hub-title { font-size: 1.25rem; font-weight: 600; margin: 0; }

.chat-hub-filters {
    padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--panel-soft);
}

.chat-hub-list {
    flex: 1; overflow-y: auto; padding: 12px; margin: 0; list-style: none;
    display: flex; flex-direction: column; gap: 8px;
}

.hub-item {
    padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid transparent;
    cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; gap: 6px;
}
.hub-item:hover { background: var(--bg-base); }
.hub-item.active { background: #eff6ff; border-color: #bfdbfe; }
.hub-item-top { display: flex; justify-content: space-between; align-items: center; }
.hub-item-name { font-weight: 600; font-size: 1rem; color: #1a1a1a; }
.hub-item-time { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.hub-item-phone { font-size: 0.85rem; color: var(--text-muted); font-weight: 300; }

.hub-indicator-paused { width: 10px; height: 10px; background: #ef4444; border-radius: 50%; box-shadow: 0 0 0 3px #fee2e2; }
.hub-indicator-active { width: 10px; height: 10px; background: var(--verde-wa); border-radius: 50%; }

.skeleton-chat {
    height: 70px; border-radius: var(--radius-md);
    background: linear-gradient(90deg, #f0f0f1 25%, #f8f8f8 50%, #f0f0f1 75%);
    background-size: 200% 100%; animation: skeletonLoading 1.5s infinite;
}
@keyframes skeletonLoading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.toggle-filter {
    display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
}
.toggle-filter input { display: none; }
.toggle-slider {
    position: relative; width: 36px; height: 20px; background-color: var(--text-light);
    border-radius: 20px; transition: 0.3s; flex-shrink: 0;
}
.toggle-slider::before {
    content: ""; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px;
    background-color: white; border-radius: 50%; transition: 0.3s;
}
.toggle-filter input:checked + .toggle-slider { background-color: #ef4444; }
.toggle-filter input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-label { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: 0.3s; }
.toggle-filter input:checked ~ .toggle-label { color: #ef4444; font-weight: 600; }

.chat-hub-main {
    flex: 1; display: flex; flex-direction: column; background: var(--bg-base); position: relative; min-width: 0;
}

.chat-hub-empty-state {
    flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: var(--text-muted); text-align: center; padding: 24px;
}

.chat-hub-active-area {
    flex: 1; display: flex; flex-direction: column; height: 100%;
}

.chat-active-header {
    background: #fff; padding: 16px 24px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid var(--border); z-index: 5; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.chat-active-name { font-size: 1.15rem; font-weight: 600; margin: 0; color: #1a1a1a; }
.chat-active-phone { font-size: 0.9rem; color: var(--text-muted); font-weight: 300; }

.chat-active-history {
    flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px;
}

.chat-active-footer {
    background: #fff; padding: 16px 24px; border-top: 1px solid var(--border);
}

.chat-send-form {
    display: flex; gap: 16px; align-items: flex-end;
}
.chat-input {
    flex: 1; resize: none; border-radius: var(--radius-md); padding: 14px 16px; border: 1px solid var(--border);
    background: var(--panel-soft); font-family: var(--font-body); font-size: 0.95rem; color: var(--text-main);
    outline: none; transition: all 0.2s ease;
}
.chat-input:focus { border-color: #1a1a1a; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }
.chat-input:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-send { height: 50px; padding: 0 24px; flex-shrink: 0; }

.bubble { max-width: 75%; padding: 12px 16px; border-radius: 12px; font-size: 0.95rem; line-height: 1.5; position: relative; color: #1a1a1a; font-weight: 400; word-wrap: break-word; }
.bubble-cliente { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.bubble-bot { background: #f0fdf4; align-self: flex-end; border-bottom-right-radius: 4px; border: 1px solid #bbf7d0; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.bubble-humano { background: #eff6ff; align-self: flex-end; border-bottom-right-radius: 4px; border: 1px solid #bfdbfe; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }

.bubble-media-header { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.bubble-code { font-family: monospace; background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; border: 1px solid rgba(0,0,0,0.05); word-break: break-all; }
.bubble del { opacity: 0.7; }

.bubble-time { font-size: 0.7rem; color: var(--text-muted); display: block; text-align: right; margin-top: 4px; }
.bubble-status-icon { display: inline-block; margin-left: 6px; vertical-align: middle; }
.bubble-status-icon.incierto { color: #f59e0b; }
.bubble-status-icon.enviado { color: #9ca3af; }
.bubble-status-icon.fallido { color: #ef4444; }

.bubble-optimistic { opacity: 0.6; pointer-events: none; }
.fade-out-anim { animation: fadeOut 0.4s ease forwards; pointer-events: none; }
.bootloader-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--bg-base);
}
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.bubble-status-icon.pendiente { color: var(--text-light); }

.panel-footer-flex{margin-top:auto;padding-top:24px;border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px}
.footer-links{display:flex;gap:16px;flex-wrap:wrap}
.footer-links a,.footer-links button,.chat-footer-links a,.chat-footer-links button,.auth-floating-links a,.auth-floating-links button{font-size:0.85rem;color:var(--text-muted);text-decoration:none;background:transparent;border:none;padding:0;cursor:pointer;font-family:inherit}
.footer-links a:hover,.footer-links button:hover,.chat-footer-links a:hover,.chat-footer-links button:hover,.auth-floating-links a:hover,.auth-floating-links button:hover{color:var(--text-main)}
.footer-copy{font-size:0.85rem;color:var(--text-light)}
.chat-sidebar-footer{background:#fff;padding:16px 24px;border-top:1px solid var(--border);display:flex;flex-direction:column;justify-content:center;gap:8px;min-height:83px;box-sizing:border-box}
.chat-footer-links{display:flex;gap:12px;flex-wrap:wrap}
.chat-footer-copy{display:flex;justify-content:space-between;align-items:center;font-size:0.8rem;color:var(--text-light)}
.chat-footer-firm{font-weight:600;letter-spacing:0.05em}
.auth-floating-footer{margin-top:20px;display:flex;flex-direction:column;align-items:center;gap:8px;width:100%}
.auth-floating-links{display:flex;gap:16px;flex-wrap:wrap;justify-content:center}
.auth-floating-copy{font-size:0.82rem;color:var(--text-light);text-align:center}

.cky-consent-container{position:fixed;bottom:24px;left:24px;z-index:99999;width:100%;max-width:420px;font-family:inherit}
.cky-consent-bar{background-color:#fff;border:1px solid var(--border);border-radius:12px;padding:24px;box-shadow:0 10px 40px rgba(0,0,0,0.08)}
.cky-title{font-size:1.15rem;font-weight:600;color:var(--text-main);margin:0 0 8px 0}
.cky-notice-des p{font-size:0.9rem;color:var(--text-muted);line-height:1.5;margin:0 0 24px 0}
.cky-notice-btn-wrapper{display:flex;flex-wrap:wrap;gap:8px;justify-content:stretch}
.cky-btn{flex:1;padding:10px 16px;font-size:0.9rem;font-weight:500;border-radius:8px;cursor:pointer;transition:all .2s ease;font-family:inherit;text-align:center}
.cky-btn-customize,.cky-btn-reject{background:transparent;border:1px solid var(--border);color:var(--text-main)}
.cky-btn-customize:hover,.cky-btn-reject:hover{border-color:#ccc;background:#f9f9f9}
.cky-btn-accept{background:var(--accent);border:1px solid var(--accent);color:#fff}
.cky-btn-accept:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
@media (max-width:480px){.cky-consent-container{bottom:0;left:0;max-width:100%}.cky-consent-bar{border-radius:16px 16px 0 0;border:bottom:none;border-left:none;border-right:none}.cky-notice-btn-wrapper{flex-direction:column}}
.cky-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.6);z-index:99999998;display:none;backdrop-filter:blur(3px)}
.cky-modal.cky-modal-open~.cky-overlay,.cky-overlay[style*="display: block"]{display:block !important}
.cky-hide{display:none !important}
.cky-modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;max-width:700px;max-height:90vh;background:#fff;z-index:99999999;border-radius:16px;box-shadow:0 24px 64px rgba(0,0,0,0.2);visibility:hidden;opacity:0;transition:visibility 0s,opacity .2s ease;display:flex;flex-direction:column;font-family:inherit}
.cky-modal.cky-modal-open{visibility:visible;opacity:1}
.cky-preference-center{display:flex;flex-direction:column;overflow:hidden;max-height:90vh}
.cky-preference-header{display:flex;justify-content:space-between;align-items:center;padding:24px;border-bottom:1px solid var(--border)}
.cky-preference-title{font-size:1.25rem;font-weight:700;margin:0;color:var(--text-main)}
.cky-btn-close{background:transparent;border:none;cursor:pointer;padding:8px;opacity:0.5;transition:opacity .2s}
.cky-btn-close:hover{opacity:1}
.cky-preference-body-wrapper{padding:24px;overflow-y:auto;flex:1}
.cky-preference-content-wrapper p,.cky-dma-content-wrapper p{font-size:0.95rem;color:var(--text-muted);line-height:1.6;margin:0 0 16px 0}
.cky-show-desc-btn,.cky-policy{color:var(--accent);background:transparent;border:none;padding:0;cursor:pointer;font-weight:600;text-decoration:underline}
.cky-accordion{border:1px solid var(--border);border-radius:8px;margin-bottom:12px;overflow:hidden}
.cky-accordion-header-wrapper{cursor:pointer;padding:16px;background:#fafafa}
.cky-accordion-header{display:flex;justify-content:space-between;align-items:center}
.cky-accordion-btn{background:none;border:none;font-weight:600;font-size:1.05rem;color:var(--text-main);cursor:pointer;padding:0}
.cky-accordion-header-des{margin-top:8px;font-size:0.9rem;color:var(--text-muted)}
.cky-always-active{color:var(--accent);font-weight:600;font-size:0.85rem;background:rgba(37,211,102,0.1);padding:4px 10px;border-radius:20px}
.cky-accordion-body{display:none;padding:16px;background:#fff;border-top:1px solid var(--border)}
.cky-accordion.cky-accordion-active .cky-accordion-body{display:block}
.cky-audit-table{background:#f9f9f9;padding:16px;border-radius:8px;border:1px solid var(--border)}
.cky-cookie-des-table{list-style:none;padding:0;margin:0}
.cky-cookie-des-table li{display:flex;flex-direction:column;margin-bottom:12px;border-bottom:1px dashed #ccc;padding-bottom:12px;font-size:0.9rem}
.cky-cookie-des-table li:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}
.cky-cookie-des-table li div:first-child{font-weight:600;color:var(--text-main);margin-bottom:4px}
.cky-empty-cookies-text{font-size:0.9rem;color:var(--text-light);margin:0;font-style:italic}
.cky-switch{display:flex;align-items:center}
.cky-switch input[type="checkbox"]{-webkit-appearance:none;appearance:none;width:44px;height:24px;background:#d0d5d2;border-radius:24px;position:relative;cursor:pointer;outline:none;transition:background .3s ease;margin:0}
.cky-switch input[type="checkbox"]::before{content:"";position:absolute;width:20px;height:20px;background:#fff;border-radius:50%;top:2px;left:2px;transition:transform .3s ease;box-shadow:0 2px 4px rgba(0,0,0,0.2)}
.cky-switch input[type="checkbox"]:checked{background:var(--accent)}
.cky-switch input[type="checkbox"]:checked::before{transform:translateX(20px)}
.cky-footer-wrapper{padding:20px 24px;border-top:1px solid var(--border);background:#fff;border-radius:0 0 16px 16px}
.cky-prefrence-btn-wrapper{display:flex;gap:12px;justify-content:flex-end;flex-wrap:wrap}
.cky-btn-preferences{background:transparent;border:1px solid var(--accent);color:var(--accent)}
.cky-btn-preferences:hover{background:rgba(37,211,102,0.05)}
@media (max-width:600px){.cky-modal{width:100%;height:100vh;max-height:100vh;border-radius:0}.cky-footer-wrapper{border-radius:0}.cky-prefrence-btn-wrapper{flex-direction:column}.cky-prefrence-btn-wrapper .cky-btn{width:100%}}
.cky-btn-revisit-wrapper{display:none !important}
div[data-cky-tag="detail-powered-by"]{display:flex;align-items:center;justify-content:center;padding:16px;font-size:0.8rem;color:var(--text-muted);background:#fafafa;border-radius:0 0 16px 16px;border-top:1px solid var(--border)}
div[data-cky-tag="detail-powered-by"] a{display:flex;align-items:center;margin-left:6px}
div[data-cky-tag="detail-powered-by"] img{height:14px;opacity:0.6;transition:opacity .2s ease}
div[data-cky-tag="detail-powered-by"] a:hover img{opacity:1}


.chat-active-info-wrap{display:flex;align-items:center;gap:12px}
.btn-chat-back{display:none;padding:6px;margin-left:-6px;color:var(--text-main);border:none !important;background:transparent !important;box-shadow:none !important;border-radius:50%}
@media (max-width:768px){
    .chat-hub-sidebar{width:100%;max-width:100%;border-right:none}
    .chat-hub-main{display:none;width:100%;position:absolute;top:0;left:0;height:100%;z-index:20;background:var(--bg-base)}
    .chat-mobile-active .chat-hub-sidebar{display:none}
    .chat-mobile-active .chat-hub-main{display:flex}
    .btn-chat-back{display:flex;align-items:center;justify-content:center}
    .chat-active-header{flex-direction:column;align-items:flex-start;gap:16px;padding:16px 20px}
    .chat-active-info-wrap{width:100%}
    .chat-active-actions{width:100%}
    .chat-active-actions .btn{width:100%;justify-content:center}
}
@media (max-width:520px){
    .rule-card,.status-card,.status-info-group{flex-direction:column;align-items:flex-start;gap:16px}
    .rule-content-wrap{width:100%;align-items:flex-start}
    .rule-actions{width:100%;justify-content:flex-end}
    .status-card > div:last-child{width:100%;justify-content:stretch}
    .status-card > div:last-child .btn{flex:1}
    .chat-media-card{flex-direction:column;align-items:stretch;max-width:100%}
}