/* ==========================================================================
   REMAIA - PLATAFORMA SAAS WHATSAPP BUSINESS AI
   Línea Gráfica Moderna Inspirada en Dashboard Dark Sidebar + Light Canvas
   Tipografía: Montserrat | Acento: Volt / Electric Lime (#d2f829)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Tipografía */
    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sidebar Obsidian Dark */
    --sb-bg: #111317;
    --sb-card: #1c1e24;
    --sb-border: #23262f;
    --sb-text: #8e95a5;
    --sb-text-active: #ffffff;
    --sb-hover: #191c22;

    /* Canvas Principal Moderno (Contraste Limpio) */
    --canvas-bg: #f4f6fa;
    --card-bg: #ffffff;
    --card-border: #e6eaf0;
    --card-hover: #fafbfc;
    --card-dark: #121316;

    /* Textos Principales */
    --text-heading: #14171f;
    --text-body: #475062;
    --text-muted: #8a94a6;

    /* Acentos y Colores de Marca */
    --accent-volt: #d4f828;
    --accent-volt-dark: #b8de15;
    --accent-volt-subtle: #f5fdd4;
    --accent-dark-btn: #121316;
    --accent-dark-hover: #22252c;
    --accent-wa: #25d366;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    /* Bordes y Sombras */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 9999px;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 10px 30px -10px rgba(18, 22, 33, 0.07);
    --shadow-dropdown: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--canvas-bg);
    color: var(--text-body);
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   SIDEBAR MODERNO (Obsidian Dark)
   ========================================================================== */
.sidebar {
    width: 270px;
    background-color: var(--sb-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 100vh;
    border-right: 1px solid var(--sb-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #252830;
    border-radius: 4px;
}

.sidebar-header {
    padding: 26px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--accent-volt);
    color: #121316;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px rgba(212, 248, 40, 0.35);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.brand-tagline {
    font-size: 0.68rem;
    color: var(--sb-text);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Menú Sidebar */
.sidebar-nav {
    padding: 12px 16px;
    flex-grow: 1;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #555c6b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--sb-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 4px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    stroke-width: 2;
    transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-link:hover {
    background-color: var(--sb-hover);
    color: #ffffff;
}

.nav-link.active {
    background-color: var(--sb-card);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background-color: var(--accent-volt);
    border-radius: 4px;
}

.nav-link.active svg {
    stroke: var(--accent-volt);
}

/* Tarjeta Promocional en Sidebar */
.sidebar-promo-card {
    margin: 12px 16px;
    background: linear-gradient(145deg, #181b22, #111317);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(212, 248, 40, 0.15);
    color: var(--accent-volt);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.promo-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.promo-desc {
    color: var(--sb-text);
    font-size: 0.72rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.btn-promo {
    display: block;
    width: 100%;
    padding: 8px;
    background: #ffffff;
    color: #121316;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-promo:hover {
    background: var(--accent-volt);
}

/* Perfil de Usuario en Sidebar */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
}

.user-meta h5 {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
}

.user-meta p {
    color: var(--sb-text);
    font-size: 0.7rem;
    font-weight: 500;
}

/* ==========================================================================
   CANVAS PRINCIPAL Y BARRA SUPERIOR
   ========================================================================== */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-height: 100vh;
}

.top-navbar {
    height: 78px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    width: 320px;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 248, 40, 0.25);
}

.search-box svg {
    stroke: var(--text-muted);
    width: 17px;
    height: 17px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: var(--text-heading);
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ==========================================================================
   BOTONES MODERNOS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
}

.btn-primary {
    background-color: var(--accent-dark-btn);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-dark-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 19, 22, 0.2);
}

.btn-volt {
    background-color: var(--accent-volt);
    color: #121316;
}

.btn-volt:hover {
    background-color: var(--accent-volt-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 248, 40, 0.4);
}

.btn-secondary {
    background-color: #f1f4f9;
    color: var(--text-heading);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.78rem;
}

/* ==========================================================================
   CONTENEDOR Y TARJETAS
   ========================================================================== */
.container {
    padding: 32px 36px 60px;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

.grid-4,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 26px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 24px;
    margin-bottom: 26px;
}

/* Tarjetas de Métricas (Inspiradas en la foto) */
.metric-card {
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--card-border);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

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

/* Tarjeta Especial Oscura (Featured Card como en la foto) */
.metric-card.card-featured-dark {
    background: #121316;
    color: #ffffff;
    border-color: #1e2025;
}

.metric-card.card-featured-dark .metric-title {
    color: #8c93a3;
}

.metric-card.card-featured-dark .metric-value {
    color: #ffffff;
}

.metric-card.card-featured-dark .metric-trend {
    background: rgba(212, 248, 40, 0.15);
    color: var(--accent-volt);
}

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

.metric-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.metric-icon-circle.volt {
    background: var(--accent-volt);
    color: #121316;
}

.metric-icon-circle.yellow {
    background: #fef08a;
    color: #854d0e;
}

.metric-icon-circle.green {
    background: #dcfce7;
    color: #166534;
}

.metric-icon-circle.rose {
    background: #ffe4e6;
    color: #9f1239;
}

.metric-icon-circle.blue {
    background: #e0f2fe;
    color: #0369a1;
}

.metric-icon-circle.purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.trend-up {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}

.trend-neutral {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.metric-title,
.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: -0.01em;
}

.metric-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-top: 6px;
}

.metric-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Tarjeta General de Contenido */
.content-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   TABLAS SAAS MODERNAS
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.86rem;
}

.custom-table th {
    padding: 12px 18px;
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--card-border);
}

.custom-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #f1f4f8;
    color: var(--text-body);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background-color: #fbfcfe;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.badge-success { background-color: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.badge-warning { background-color: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
.badge-danger { background-color: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.badge-info { background-color: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.badge-purple { background-color: #f3e8ff; color: #581c87; border: 1px solid #d8b4fe; }
.badge-volt { background-color: #d4f828; color: #111317; border: 1px solid #b8de15; font-weight: 900; }

/* ==========================================================================
   FORMULARIOS MODERNOS
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    color: var(--text-heading);
    font-weight: 700;
}

.form-control {
    width: 100%;
    background-color: #f8fafc;
    border: 1.5px solid var(--card-border);
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-heading);
    font-family: var(--font-main);
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #94a3b8;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 248, 40, 0.3);
}

.pre-box {
    background: #111317;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.76rem;
    overflow-x: auto;
    border: 1px solid var(--sb-border);
    color: #67e8f9;
}

/* ==========================================================================
   SIMULADOR WHATSAPP MODERNO
   ========================================================================== */
.simulator-container {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    gap: 22px;
    height: calc(100vh - 140px);
}

.chat-panel {
    background: #efeae2;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}

.chat-header {
    background: #075e54;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wa {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #128c7e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
}

.chat-contact-info h4 {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 700;
}

.chat-contact-info p {
    font-size: 0.75rem;
    color: #a7f3d0;
    font-weight: 500;
}

.chat-messages {
    flex-grow: 1;
    padding: 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    position: relative;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bubble-client {
    align-self: flex-end;
    background-color: #d9fdd3;
    color: #111b21;
    border-bottom-right-radius: 2px;
}

.bubble-agent {
    align-self: flex-start;
    background-color: #ffffff;
    color: #111b21;
    border-bottom-left-radius: 2px;
}

.bubble-human {
    align-self: flex-start;
    background-color: #e0f2fe;
    border-left: 4px solid var(--accent-blue);
    color: #0369a1;
}

.message-meta {
    font-size: 0.68rem;
    color: rgba(0, 0, 0, 0.45);
    text-align: right;
    margin-top: 4px;
}

.tool-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3e8ff;
    color: #7e22ce;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 6px;
}

.chat-input-bar {
    background: #f0f2f5;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #d1d5db;
    outline: none;
    color: #111b21;
    padding: 12px 18px;
    border-radius: var(--radius-pill);
    font-family: var(--font-main);
    font-size: 0.88rem;
}

.chat-send-btn {
    background: #00a884;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 1.1rem;
    transition: transform 0.15s ease, background 0.15s ease;
}

.chat-send-btn:hover {
    background: #008f6f;
    transform: scale(1.06);
}

/* Paneles Laterales del Simulador */
.inspector-panel {
    background-color: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}

.inspector-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-heading);
}

.inspector-body {
    padding: 18px;
    overflow-y: auto;
    flex-grow: 1;
    font-size: 0.85rem;
}

/* Switch */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    margin-bottom: 18px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #121316;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Gráficos Visuales SVG en Dashboard */
.chart-container {
    padding: 10px 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 14px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.volt { background: var(--accent-volt); }
.legend-dot.gray { background: #cbd5e1; }

/* Modales y Animaciones */
.modal-backdrop {
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(4px);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   COMPONENTES ENTERPRISE SAAS (SETTINGS, PROMPT STUDIO, INPUTS)
   ========================================================================== */

/* Grupo de Input con Botón de Copiado */
.copy-input-group {
    display: flex;
    position: relative;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.copy-input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #f8fafc;
    color: var(--text-heading);
}

.copy-input-group .btn-copy {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: #f1f5f9;
    color: var(--text-heading);
    border: 1.5px solid var(--card-border);
    border-left: none;
    padding: 0 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-input-group .btn-copy:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

/* Selector Hero de Empresa Multi-Tenant */
.company-hero-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-subtle);
}

.company-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.company-avatar-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #111317, #1e2229);
    color: var(--accent-volt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.company-hero-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-hero-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Prompt Engineering Studio (Full-Width Pro Editor) */
.prompt-studio {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.prompt-studio-header {
    background: #161b22;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #21262d;
    flex-wrap: wrap;
    gap: 10px;
}

.prompt-studio-title {
    color: #e6edf3;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-studio-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.prompt-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.prompt-chip:hover {
    background: rgba(212, 248, 40, 0.15);
    color: var(--accent-volt);
    border-color: rgba(212, 248, 40, 0.35);
}

.prompt-studio-textarea {
    width: 100%;
    min-height: 240px;
    background: #0d1117;
    color: #f0f6fc;
    border: none;
    padding: 18px 20px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.86rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.prompt-studio-textarea:focus {
    box-shadow: inset 0 0 0 1px #388bfd;
}

.prompt-studio-footer {
    background: #161b22;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #21262d;
    font-size: 0.72rem;
    color: #7d8590;
    font-weight: 500;
}

/* Guía Paso a Paso Limpia */
.meta-guide-card {
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-top: 14px;
}

.guide-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-body);
    line-height: 1.45;
}

.guide-step-item:last-child {
    margin-bottom: 0;
}

.guide-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1e293b;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Barra de Acciones de Tarjeta */
.card-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--card-border);
}

/* ==========================================================================
   ESTILOS PREMIUM PARA LISTAS & CRM KANBAN (ESTILO LINEAR / SAAS)
   ========================================================================== */
.crm-lead-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crm-lead-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(18, 22, 33, 0.08);
    border-color: #cbd5e1;
}

.crm-lead-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.crm-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: var(--accent-volt);
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crm-lead-info {
    flex-grow: 1;
    min-width: 0;
}

.crm-lead-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-lead-phone {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.crm-lead-phone:hover {
    color: #0284c7;
}

.crm-score-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    line-height: 1.2;
}

.crm-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.crm-tag-pill {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.3;
}

.crm-ai-summary {
    background: #f8fafc;
    border-left: 3px solid #0284c7;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    color: #334155;
    line-height: 1.45;
}

.crm-lead-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.crm-stage-select-box {
    flex-grow: 1;
    min-width: 0;
}

.crm-mini-select {
    width: 100%;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-main);
    outline: none;
    transition: all 0.15s ease;
}

.crm-mini-select:focus {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.crm-actions-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.crm-btn-action {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 0.76rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.crm-btn-action:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.crm-btn-action.btn-delete:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}
