/* ============================================================
   style.css — Sistema visual de ROKI CRM
   Tipografías: Poppins (títulos) + Inter (texto)
   ============================================================ */

:root {
    /* Colores de marca */
    --naranja:        #FB6E4C;   /* principal: botones, activo, acentos */
    --naranja-hover:  #E85A39;
    --naranja-suave:  #FFEFEA;   /* fondos de íconos/acentos */
    --aqua:           #5CC7D1;   /* acentos secundarios */
    --aqua-logo:      #84D7DF;
    --aqua-suave:     #E9F8FA;

    /* Apoyo */
    --verde:          #1FA971;
    --rojo:           #E5484D;
    --morado:         #8B6FE0;

    /* Neutros */
    --texto:          #1F2A37;
    --texto-2:        #6B7280;
    --borde:          #E8EAED;
    --fondo:          #FFFFFF;
    --blanco:         #FFFFFF;

    /* Forma */
    --radio:          12px;
    --radio-sm:       9px;
    --sombra:         0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: var(--texto);
    background: var(--fondo);
    -webkit-font-smoothing: antialiased;
    zoom: 0.8;   /* Reduce el tamaño general para que se vea más fino */
}

h1, h2, h3, h4 {
    font-family: "Poppins", "Segoe UI", Arial, sans-serif;
    margin: 0;
    color: var(--texto);
}

a { color: inherit; }

/* ---------- Logo ROKI (wordmark en CSS) ---------- */
.logo-roki {
    position: relative;
    display: inline-block;
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--aqua-logo);
    line-height: 1;
}
.logo-roki .barra {
    position: absolute;
    top: -5px;
    right: -2px;
    width: 16px;
    height: 5px;
    border-radius: 2px;
    background: var(--naranja);
}

/* Logo como imagen (archivo PNG oficial) — ancho fijo, alto automático = mantiene proporción */
.logo-img { display: block; width: 112px; height: auto; }
.sidebar .logo-img { margin: 6px 8px 24px; }
.caja-login .logo-img { margin: 0 auto 20px; width: 150px; }

/* ============================================================
   LAYOUT GENERAL (menú lateral + barra superior)
   ============================================================ */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 224px;
    flex-shrink: 0;
    background: var(--blanco);
    border-right: 1px solid var(--borde);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
}

.sidebar .logo-roki { margin: 4px 8px 22px; }

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radio-sm);
    color: var(--texto-2);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--naranja-suave); color: var(--texto); }

.nav-item.activo {
    background: var(--naranja-suave);
    color: var(--naranja);
    font-weight: 600;
}

.nav-item.deshabilitado {
    color: #B6BCC4;
    cursor: default;
}
.nav-item.deshabilitado .tag-pronto {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 600;
    background: #F0F1F3;
    color: #9AA1AA;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: .3px;
}

.sidebar-ayuda {
    margin-top: auto;
    background: var(--naranja-suave);
    border-radius: var(--radio);
    padding: 14px;
    font-size: 12px;
    color: var(--texto-2);
}
.sidebar-ayuda strong { color: var(--naranja); display: block; margin-bottom: 4px; }

/* ---------- Zona principal ---------- */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--blanco);
    border-bottom: 1px solid var(--borde);
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 70;   /* el header siempre por encima de drawers/overlays */
}
.topbar-titulo { font-size: 19px; font-weight: 600; }
.topbar-derecha {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}
.usuario-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    color: var(--texto);
    padding: 3px 5px 3px 3px;
    border-radius: 999px;
    transition: background .15s;
}
.usuario-chip:hover { background: var(--naranja-suave); }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--aqua);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    font-family: "Poppins", sans-serif;
    overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Selector de idioma (Español / English) — texto limpio, sin recuadro */
.lang-sel { border: none; background: transparent; padding: 4px 2px; font-size: 13.5px; font-weight: 500;
    color: var(--texto); font-family: inherit; cursor: pointer; }
.lang-sel:hover { color: var(--naranja); }
.lang-sel:focus { outline: none; }

/* Campo de correo con dominio fijo (crear usuario) */
.email-dominio { display: flex; align-items: center; gap: 7px; }
.email-dominio input { flex: 1; min-width: 0; }
.email-dominio span { color: var(--texto-2); font-weight: 600; }
.email-dominio select { width: auto; flex-shrink: 0; }

/* ===== Página de perfil ===== */
.perfil-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 880px; align-items: start; }
.perfil-foto-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.perfil-foto { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: var(--naranja-suave); color: var(--naranja); display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 30px; }
.perfil-foto img { width: 100%; height: 100%; object-fit: cover; }
.perfil-dato { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--borde); }
.perfil-dato:last-child { border-bottom: 0; }
.perfil-dato .help-text { font-size: 13px; }
@media (max-width: 760px) { .perfil-grid { grid-template-columns: 1fr; } }

.contenido { padding: 26px 28px; max-width: 1180px; }
.subtitulo { color: var(--texto-2); margin: 4px 0 0; font-size: 13.5px; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radio-sm);
    padding: 9px 16px;
    font-family: "Inter", sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-naranja { background: var(--naranja); color: #fff; }
.btn-naranja:hover { background: var(--naranja-hover); }

.btn-aqua { background: var(--aqua); color: #fff; }
.btn-aqua:hover { filter: brightness(0.95); }

.btn-secundario {
    background: var(--blanco);
    border-color: var(--borde);
    color: var(--texto);
}
.btn-secundario:hover { background: #F3F5F7; }

/* ============================================================
   TARJETAS
   ============================================================ */
.card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 18px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 22px 0;
}

/* Tarjeta de estadística (número grande + ícono) */
.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-icono {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icono svg { width: 22px; height: 22px; }
.icono-naranja { background: var(--naranja-suave); color: var(--naranja); }
.icono-aqua    { background: var(--aqua-suave);   color: var(--aqua); }
.stat-numero {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 25px;
    line-height: 1.1;
}
.stat-label { color: var(--texto-2); font-size: 12.5px; margin-top: 2px; }

.nota {
    background: var(--blanco);
    border: 1px dashed #D7DBE0;
    border-radius: var(--radio);
    padding: 15px 18px;
    color: var(--texto-2);
    font-size: 13.5px;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.campo { display: flex; flex-direction: column; margin-bottom: 14px; }
.campo label {
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--texto);
}
.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo input[type="tel"],
.campo input[type="date"],
.campo input[type="time"],
.campo input[type="number"],
.campo select,
.campo textarea {
    border: 1px solid var(--borde);
    border-radius: var(--radio-sm);
    padding: 10px 12px;
    font-family: "Inter", sans-serif;
    font-size: 13.5px;
    color: var(--texto);
    background: var(--blanco);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
/* Igualar el texto interno de fecha/hora a la fuente del formulario */
.campo input[type="date"]::-webkit-datetime-edit,
.campo input[type="time"]::-webkit-datetime-edit { color: var(--texto); font-family: "Inter", sans-serif; }
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: var(--aqua);
    box-shadow: 0 0 0 3px var(--aqua-suave);   /* acento secundario aqua */
}

/* ---------- Toggle (interruptor sí/no) ---------- */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.toggle .pista {
    width: 40px; height: 22px;
    background: #D5D9DE;
    border-radius: 999px;
    position: relative;
    transition: background .15s;
    flex-shrink: 0;
}
.toggle .pista::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle input:checked + .pista { background: var(--naranja); }
.toggle input:checked + .pista::after { transform: translateX(18px); }
.toggle .texto { font-size: 13.5px; font-weight: 500; }

/* ---------- Opción tipo radio (botón-tarjeta, para 3 o menos) ---------- */
.opciones { display: flex; gap: 10px; flex-wrap: wrap; }
.opcion-card {
    flex: 1;
    min-width: 130px;
    border: 1.5px solid var(--borde);
    border-radius: var(--radio-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.opcion-card input { display: none; }
.opcion-card .op-titulo { font-weight: 600; font-size: 13.5px; }
.opcion-card .op-desc { font-size: 12px; color: var(--texto-2); margin-top: 2px; }
.opcion-card:has(input:checked) {
    border-color: var(--naranja);
    background: var(--naranja-suave);
}

/* ============================================================
   BADGES (estados)
   ============================================================ */
.badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}
.badge-aqua    { background: var(--aqua-suave);   color: #2a9aa4; }
.badge-verde   { background: #E6F6EF; color: var(--verde); }
.badge-gris    { background: #F0F1F3; color: var(--texto-2); }
.badge-amarillo{ background: #FEF3DA; color: #B5781A; }
.badge-rojo    { background: #FDECEC; color: #C0362C; }

/* ============================================================
   LISTADOS EN CARDS
   ============================================================ */
.cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}
.item-card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 16px;
    box-shadow: var(--sombra);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.item-card:hover { border-color: var(--naranja); box-shadow: 0 5px 16px rgba(16,24,40,.09); }
.item-card:active { transform: translateY(1px); }
.item-card-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px; margin-bottom: 10px;
}
.item-card-title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.item-card-sub { font-size: 12px; color: var(--texto-2); margin-top: 2px; }
.item-card-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--texto-2); padding: 3px 0; }
.item-card-row strong { color: var(--texto); font-weight: 600; text-align: right; }
.item-card-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.item-avatar {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: var(--naranja-suave); color: var(--naranja);
    display: flex; align-items: center; justify-content: center;
    font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15px;
}

/* ============================================================
   DRAWER (panel lateral derecho)
   ============================================================ */
.drawer-overlay {
    position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: rgba(16,24,40,.45);
    z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.abierto { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; top: 60px; bottom: 0; right: 0; width: min(430px, 94vw);
    background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.15);
    transform: translateX(100%); transition: transform .25s;
    z-index: 61; display: flex; flex-direction: column;
}
.drawer.abierto { transform: translateX(0); }
.drawer-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--borde);
}
.drawer-head h3 { font-size: 17px; font-weight: 600; }
.drawer-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--borde); display: flex; gap: 10px; justify-content: flex-end; }
.drawer-seccion { margin-bottom: 18px; }
.drawer-seccion h4 {
    font-family: "Poppins", sans-serif; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px; color: var(--texto-2); margin-bottom: 8px;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    background: var(--aqua-suave); color: #2a9aa4;
    font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px;
}
.chip.core { background: var(--naranja-suave); color: var(--naranja); }

/* Panel lateral más ancho (para pestañas) */
.drawer.drawer-lg { width: min(540px, 96vw); }
.drawer-body .tabnav { position: sticky; top: 0; background: #fff; z-index: 2; }

/* Cabecera del panel */
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.panel-logo {
    width: 54px; height: 54px; border-radius: 13px; flex-shrink: 0; object-fit: cover;
    background: var(--naranja-suave); color: var(--naranja);
    display: flex; align-items: center; justify-content: center;
    font-family: "Poppins", sans-serif; font-weight: 700; font-size: 22px; border: 1px solid var(--borde);
}

/* Links de protocolo: tel / mailto / whatsapp */
.proto-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.proto {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px;
    border: 1px solid var(--borde); border-radius: 9px; font-size: 12.5px;
    text-decoration: none; color: var(--texto); background: #fff; font-weight: 500;
    transition: border-color .15s, background .15s;
}
.proto:hover { border-color: var(--naranja); background: #FFFBFA; }
.proto svg { width: 15px; height: 15px; }
.proto.tel svg { color: var(--aqua); }
.proto.mail svg { color: var(--naranja); }
.proto.wa { color: #128C4B; } .proto.wa svg { color: #25D366; }

/* Tarjeta de contacto (pestaña Contactos del panel) */
.contacto-card { display: flex; gap: 16px; align-items: flex-start;
    border: 1px solid var(--borde); border-radius: 14px; padding: 18px; margin-bottom: 12px; background: #fff; }
.contacto-avatar { flex-shrink: 0; width: 60px; height: 60px; border-radius: 50%;
    background: var(--naranja-suave); color: var(--naranja); display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .5px; }
.contacto-body { flex: 1; min-width: 0; }
.contacto-nombre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.contacto-nombre strong { font-family: 'Poppins', sans-serif; font-size: 17px; color: var(--texto); }

/* Empresa elegida (paso 1 del wizard de oportunidad) */
.empresa-elegida { display: flex; align-items: center; gap: 14px; margin-top: 8px;
    border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px; }

/* Modal rápido (agregar nota/pendiente) */
.modal-box.modal-sm { height: auto; max-height: 86vh; width: min(460px, 92vw); }
.modal-box.modal-sm .modal-body { padding: 18px 20px; overflow: auto; }

/* Ficha de detalle (título + valor) */
.detalle { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.d-item { padding: 9px 0; border-bottom: 1px solid #F1F2F4; }
.d-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--texto-2); font-weight: 600; }
.d-val { font-size: 13.5px; font-weight: 600; margin-top: 2px; color: var(--texto); }
.d-item.col-2 { grid-column: 1 / -1; }
@media (max-width: 520px) { .detalle { grid-template-columns: 1fr; } }

/* Filas de redes/perfil con ícono oficial */
.red-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid #F1F2F4; }
.red-ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.red-ico svg { width: 17px; height: 17px; }
.red-info { flex: 1; min-width: 0; }
.red-info .red-lbl { font-size: 11px; color: var(--texto-2); }
.red-info a { font-size: 13px; font-weight: 600; color: var(--naranja); text-decoration: none; word-break: break-all; }
.red-info .vacio-txt { font-size: 12.5px; color: #B6BCC4; }

/* Línea de tiempo */
.timeline { position: relative; padding-left: 24px; margin-top: 4px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 6px; width: 2px; background: var(--borde); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--naranja); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--borde); }
.tl-item.verde::before { background: var(--verde); }
.tl-item.aqua::before { background: var(--aqua); }
.tl-title { font-weight: 600; font-size: 13.5px; }
.tl-date { font-size: 11.5px; color: var(--texto-2); margin-top: 2px; }

/* Logo chico en cards (la imagen llena el avatar; el avatar sigue siendo chico) */
.item-avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.item-avatar.con-logo { width: 46px; height: 46px; padding: 3px; background: #fff; border: 1px solid var(--borde); overflow: hidden; }
.dz-preview { max-width: 90px; max-height: 60px; border-radius: 8px; border: 1px solid var(--borde); margin-top: 8px; display: block; }

/* Vista previa de PDF (antes de guardar y guardado) */
.pdf-card { cursor: pointer; max-width: 360px; border-radius: 10px; }
.pdf-preview { width: 100%; height: 170px; border: 1px solid var(--borde); border-radius: 10px; pointer-events: none; background: #fff; }
.pdf-card:hover .pdf-preview { border-color: var(--naranja); }
.pdf-card-lbl { display: block; font-size: 12.5px; color: var(--naranja); font-weight: 600; margin-top: 6px; }

/* Combobox con buscador (custom) */
.combo { position: relative; }
.combo-list {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px;
    background: #fff; border: 1px solid var(--borde); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,24,40,.12); max-height: 240px; overflow: auto;
}
.combo-opt { padding: 9px 12px; font-size: 13.5px; cursor: pointer; }
.combo-opt:hover { background: var(--naranja-suave); }
.combo-opt.oculto { display: none; }

/* Ícono de módulo (catálogo modulos.icono) */
.mod-ico { display: inline-flex; vertical-align: middle; margin-right: 2px; }
.mod-ico svg { width: 15px; height: 15px; color: var(--texto-2); }
.chip .mod-ico svg { width: 13px; height: 13px; }
.chip .mod-ico { margin-right: 4px; }

/* Pestaña Datos: tarjetas con ícono */
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.det-card { display: flex; align-items: center; gap: 12px; background: #fff;
    border: 1px solid var(--borde); border-radius: 12px; padding: 13px 15px; }
.det-card-ico { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
    background: var(--naranja-suave); display: flex; align-items: center; justify-content: center; }
.det-card-ico svg { width: 20px; height: 20px; color: var(--naranja); }
.det-card-tx { min-width: 0; }
.det-card-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .5px;
    text-transform: uppercase; color: var(--texto-2); }
.det-card-val { font-size: 15px; font-weight: 600; color: var(--texto);
    font-family: 'Poppins', sans-serif; margin-top: 2px; word-break: break-word; }
@media (max-width: 560px) { .det-grid { grid-template-columns: 1fr; } }

/* Selector visual de íconos (mantenimiento de módulos) */
.ico-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 8px; margin-top: 6px; }
.ico-pick label { display: flex; align-items: center; justify-content: center; height: 46px;
    border: 1.5px solid var(--borde); border-radius: 10px; cursor: pointer; color: var(--texto-2); }
.ico-pick label:hover { border-color: var(--naranja); }
.ico-pick input { position: absolute; opacity: 0; }
.ico-pick input:checked + label { border-color: var(--naranja); background: var(--naranja-suave); color: var(--naranja); }
.ico-pick svg { width: 20px; height: 20px; }

/* Tabla de mantenimiento (módulos) */
.tabla-mant { width: 100%; border-collapse: collapse; }
.tabla-mant th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    color: var(--texto-2); padding: 8px 10px; border-bottom: 1px solid var(--borde); }
.tabla-mant td { padding: 10px; border-bottom: 1px solid var(--borde); font-size: 13.5px; vertical-align: middle; }
.tabla-mant .mant-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--naranja-suave);
    display: inline-flex; align-items: center; justify-content: center; }
.tabla-mant .mant-ico svg { width: 18px; height: 18px; color: var(--naranja); }

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */
.pagina-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #FFFFFF;
}
.caja-login {
    background: var(--blanco);
    border: 1px solid var(--borde);
    padding: 34px 32px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.10);
    width: 340px;
    display: flex;
    flex-direction: column;
}
.caja-login .logo-roki { margin: 0 auto 18px; font-size: 32px; }
.caja-login h1 { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.caja-login .subtitulo { text-align: center; margin-bottom: 20px; }
.caja-login .btn-naranja { margin-top: 8px; padding: 11px; }

.login-divisor { display: flex; align-items: center; color: var(--texto-2); font-size: 12px; margin: 16px 0; }
.login-divisor::before, .login-divisor::after { content: ""; flex: 1; height: 1px; background: var(--borde); }
.login-divisor span { padding: 0 12px; }
.btn-ms {
    background: #fff; border: 1px solid var(--borde); color: var(--texto);
    width: 100%; padding: 11px; gap: 10px; font-weight: 600;
}
.btn-ms:hover { background: #F7F8FA; }

.mensaje-error {
    background: #FDECEC;
    color: #B42318;
    padding: 10px 12px;
    border-radius: var(--radio-sm);
    font-size: 12.5px;
    margin-bottom: 14px;
}

.mensaje-ok {
    background: #E6F6EF;
    color: #136f49;
    padding: 10px 12px;
    border-radius: var(--radio-sm);
    font-size: 12.5px;
    margin-bottom: 14px;
}

/* ============================================================
   ENCABEZADO DE PÁGINA (título + botón de acción)
   ============================================================ */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.page-head h2 { font-size: 19px; font-weight: 600; }
.page-head .subtitulo { margin-top: 2px; }

/* ============================================================
   TABLAS
   ============================================================ */
.tabla-wrap {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow: hidden;
}
table.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.tabla th {
    text-align: left;
    font-weight: 600;
    color: var(--texto-2);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 12px 16px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--borde);
}
table.tabla td {
    padding: 12px 16px;
    border-bottom: 1px solid #F1F2F4;
}
table.tabla tr:last-child td { border-bottom: none; }
table.tabla tr:hover td { background: var(--aqua-suave); }
.tabla .acciones { display: flex; gap: 8px; }

.vacio {
    text-align: center;
    color: var(--texto-2);
    padding: 40px 20px;
    font-size: 13.5px;
}

/* ============================================================
   FORMULARIOS LARGOS
   ============================================================ */
.form-card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 22px 24px;
    max-width: 760px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}
.form-grid .col-2 { grid-column: 1 / -1; }

/* Sección que se muestra/oculta según la selección */
.seccion {
    border-top: 1px solid var(--borde);
    margin-top: 8px;
    padding-top: 16px;
}
.seccion-titulo {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 12px;
}
.oculto { display: none !important; }

.help-text { font-size: 11.5px; color: var(--texto-2); margin-top: 4px; }

/* Teléfono con prefijo +504 */
.tel-wrap { display: flex; }
.tel-prefijo {
    display: flex; align-items: center;
    padding: 0 11px;
    background: var(--aqua-suave);
    border: 1px solid var(--borde);
    border-right: none;
    border-radius: var(--radio-sm) 0 0 var(--radio-sm);
    font-size: 13.5px;
    color: #2a9aa4;
    font-weight: 600;
}
.tel-wrap input {
    border-radius: 0 var(--radio-sm) var(--radio-sm) 0 !important;
    flex: 1;
}

/* Lista de toggles (módulos, alianzas) */
.toggle-list { display: flex; flex-direction: column; gap: 10px; }
.toggle-list .toggle { justify-content: flex-start; }

.acciones-form {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--borde);
}

/* Resumen lateral (oportunidades / planes) */
.resumen {
    background: #FFFFFF;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 16px;
    font-size: 13px;
}
.resumen .fila { display: flex; justify-content: space-between; padding: 6px 0; color: var(--texto-2); }
.resumen .fila strong { color: var(--texto); }

/* ============================================================
   CONTACTOS (filas repetibles)
   ============================================================ */
.contacto-row {
    border: 1px solid var(--borde);
    border-radius: var(--radio-sm);
    padding: 14px 14px 6px;
    margin-bottom: 12px;
    background: #FFFFFF;
    position: relative;
}
.contacto-head {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--texto-2);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 10px;
}
.contacto-row .quitar-contacto {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 9px;
    font-size: 12px;
}
.btn-agregar {
    border: 1px dashed var(--naranja);
    color: var(--naranja);
    background: var(--naranja-suave);
    width: 100%;
    padding: 10px;
}
.btn-agregar:hover { background: #FFE5DD; }

.badge-naranja { background: var(--naranja-suave); color: var(--naranja); }

/* Filas de tramos de la escalera de tasas */
.tramo-row { display: flex; gap: 8px; margin-bottom: 8px; max-width: 560px; align-items: center; }
.tramo-row input {
    flex: 1; min-width: 0;
    border: 1px solid var(--borde);
    border-radius: var(--radio-sm);
    padding: 8px 10px;
    font-family: "Inter", sans-serif;
    font-size: 13px;
}
.tramo-row button { flex: 0 0 auto; padding: 7px 11px; }

/* Zona de arrastre de archivos (drag & drop) */
.dropzone {
    border: 2px dashed var(--borde);
    border-radius: var(--radio);
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    color: var(--texto-2);
    max-width: 420px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--naranja); background: var(--naranja-suave); }
.dropzone svg { width: 28px; height: 28px; color: var(--naranja); margin-bottom: 4px; }
.dropzone p { margin: 2px 0; font-size: 13px; }
.dropzone .dz-link { color: var(--naranja); font-weight: 600; }
.dropzone .dz-nombre { font-weight: 600; color: var(--texto); font-size: 13px; margin-top: 6px; }

/* ============================================================
   PESTAÑAS (sub-navegación)
   ============================================================ */
.subtabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--borde);
    margin-bottom: 22px;
}
.subtab {
    padding: 9px 15px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--texto-2);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.subtab:hover { color: var(--texto); }
.subtab.activo { color: var(--naranja); border-bottom-color: var(--naranja); }

/* Pestañas internas (ver/editar) controladas por JS */
.tabnav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--borde); margin-bottom: 20px; }
.tabbtn {
    padding: 9px 15px; font-size: 13.5px; font-weight: 600;
    color: var(--texto-2); background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
    font-family: "Inter", sans-serif;
}
.tabbtn:hover { color: var(--texto); }
.tabbtn.activo { color: var(--naranja); border-bottom-color: var(--naranja); }

/* ============================================================
   INPUTS MÁS MODERNOS
   ============================================================ */
.campo input, .campo select, .campo textarea, .input-group input, .tramo-row input {
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
/* Sin flechitas feas en los number */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Campo con símbolo integrado ($, %): se ve como UN solo input limpio */
.input-group {
    display: flex; align-items: center; max-width: 340px;
    border: 1px solid var(--borde); border-radius: 10px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.input-group:focus-within { border-color: var(--aqua); box-shadow: 0 0 0 3px var(--aqua-suave); }
.input-group input {
    flex: 1; min-width: 0; border: none !important; box-shadow: none !important;
    background: transparent; border-radius: 10px;
}
.ig-affix {
    display: flex; align-items: center; color: var(--texto-2);
    font-weight: 600; font-size: 14px; background: transparent; border: none;
    padding: 0 2px 0 13px;
}
.ig-affix.right { padding: 0 13px 0 2px; }

.tramo-row input { border: 1px solid var(--borde); }

/* ============================================================
   WIZARD (pasos)
   ============================================================ */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 24px; }
.wstep {
    flex: 1; text-align: center; font-size: 12px; color: var(--texto-2);
    padding-bottom: 9px; border-bottom: 2px solid var(--borde); display: flex;
    align-items: center; justify-content: center; gap: 7px;
}
.wstep.activo { color: var(--naranja); border-bottom-color: var(--naranja); font-weight: 600; }
.wstep.hecho { color: var(--verde); border-bottom-color: var(--verde); }
.wstep .wnum {
    display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
    background: #F0F1F3; color: var(--texto-2); align-items: center; justify-content: center;
    font-weight: 700; font-size: 11.5px;
}
.wstep.activo .wnum { background: var(--naranja); color: #fff; }
.wstep.hecho .wnum  { background: var(--verde); color: #fff; }
.wizard-pane.oculto { display: none; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--borde); }

/* ============================================================
   CABECERA DE COMERCIO (vista Ver)
   ============================================================ */
.perfil-head {
    display: flex; align-items: center; gap: 18px;
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    box-shadow: var(--sombra); padding: 20px 22px; margin-bottom: 16px;
}
.perfil-logo {
    width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0; object-fit: cover;
    background: var(--naranja-suave); color: var(--naranja);
    display: flex; align-items: center; justify-content: center;
    font-family: "Poppins", sans-serif; font-weight: 700; font-size: 26px;
    border: 1px solid var(--borde);
}
.perfil-head h2 { font-size: 21px; }
.perfil-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Logo dropzone preview */
.logo-preview { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--borde); }

/* ============================================================
   PENDIENTES
   ============================================================ */
.pendiente {
    display: flex; align-items: flex-start; gap: 12px;
    border: 1px solid var(--borde); border-radius: var(--radio-sm);
    padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.pendiente.listo { opacity: .6; }
.pendiente.listo .pend-texto { text-decoration: line-through; }
.pend-texto { font-size: 13.5px; }
.pend-meta { font-size: 11.5px; color: var(--texto-2); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   MODAL (ver PDF / detalles)
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal-overlay.oculto { display: none; }
.modal-box {
    background: #fff;
    border-radius: 14px;
    width: min(900px, 92vw);
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--borde);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-cerrar {
    cursor: pointer; background: none; border: none;
    font-size: 24px; color: var(--texto-2); line-height: 1;
}
.modal-body { flex: 1; min-height: 0; }
.modal-body iframe { width: 100%; height: 100%; border: none; }

/* ============================================================
   DASHBOARD (Resumen General)
   ============================================================ */
.dash-intro { color: var(--texto-2); font-size: 13.5px; margin: -4px 0 18px; }

/* Tarjetas de KPI */
.dash-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-card { padding: 16px 18px; }
.kpi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi-lbl { font-size: 13px; color: var(--texto-2); font-weight: 500; }
.kpi-num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 27px; color: var(--texto); line-height: 1.1; }
.kpi-trend { font-size: 12px; font-weight: 600; margin-top: 8px; }
.kpi-trend span { color: var(--texto-2); font-weight: 400; }
.trend-up { color: #1FA971; } .trend-down { color: #E5484D; }

/* Variantes de color de íconos */
.kpi-aqua    { background: #E3F5F7; color: #34AEBC; }
.kpi-naranja { background: var(--naranja-suave); color: var(--naranja); }
.kpi-azul    { background: #E8EEFC; color: #5B82E0; }
.kpi-verde   { background: #E2F3EA; color: #1FA971; }
.kpi-amarillo{ background: #FBF896; background: #FBF0DC; color: #D69A2E; }

/* Filas de tarjetas */
.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.dash-h { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.dash-h-row { display: flex; align-items: center; justify-content: space-between; }
.dash-vertodas { font-size: 12.5px; color: var(--texto-2); text-decoration: none; border: 1px solid var(--borde); padding: 4px 10px; border-radius: 8px; }
.dash-vertodas:hover { border-color: var(--naranja); color: var(--naranja); }
.dash-notas { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--texto-2); line-height: 2; }

/* Acciones rápidas */
.acc-rapidas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.acc-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    border: 1px solid var(--borde); border-radius: 12px; padding: 18px 10px; text-decoration: none;
    color: var(--texto); font-size: 13px; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.acc-btn:hover { border-color: var(--naranja); box-shadow: 0 4px 14px rgba(251,110,76,.12); }
.acc-ico { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.acc-ico svg { width: 19px; height: 19px; }

/* Pipeline */
.pipeline { display: flex; flex-direction: column; gap: 14px; }
.pl-row { display: flex; align-items: center; gap: 12px; }
.pl-label { width: 92px; font-size: 13px; color: var(--texto); flex-shrink: 0; }
.pl-track { flex: 1; height: 12px; background: #F2F4F6; border-radius: 6px; overflow: hidden; }
.pl-bar { height: 100%; border-radius: 6px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.pl-val { width: 120px; flex-shrink: 0; text-align: right; }
.pl-val strong { display: block; font-size: 14px; color: var(--texto); }
.pl-val span { font-size: 11.5px; color: var(--texto-2); }
.pl-total { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--borde); }
.pl-total-num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 22px; color: var(--texto); }

/* Oportunidades recientes */
.rec-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--borde); text-decoration: none; }
.rec-item:last-child { border-bottom: 0; }
.rec-item:hover { background: #FCFCFD; }
.rec-logo { width: 42px; height: 42px; border-radius: 10px; background: var(--naranja-suave); color: var(--naranja);
    display: flex; align-items: center; justify-content: center; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.rec-logo img { width: 100%; height: 100%; object-fit: contain; }
.rec-info { flex: 1; min-width: 0; }
.rec-info strong { display: block; font-size: 14px; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-info span { font-size: 12px; color: var(--texto-2); }
.rec-saas { text-align: right; flex-shrink: 0; }
.rec-saas strong { display: block; font-size: 13.5px; color: var(--texto); }
.rec-saas span { font-size: 11px; color: var(--texto-2); }
.rec-time { font-size: 11.5px; color: var(--texto-2); flex-shrink: 0; white-space: nowrap; }

/* Mis tareas */
.tarea-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--borde); }
.tarea-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--naranja); margin-top: 4px; flex-shrink: 0; }
.tarea-tx { flex: 1; min-width: 0; font-size: 13px; }
.tarea-fecha { font-size: 11.5px; color: var(--texto-2); flex-shrink: 0; white-space: nowrap; }
.tarea-foot { margin-top: 10px; font-size: 12.5px; color: var(--aqua); font-weight: 600; }

/* Propuestas por estado */
.estado-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.estado-ico { flex-shrink: 0; display: inline-flex; }
.estado-ico svg { width: 20px; height: 20px; }
.estado-lbl { width: 88px; font-size: 13px; flex-shrink: 0; }
.estado-track { flex: 1; height: 8px; background: #F2F4F6; border-radius: 5px; overflow: hidden; }
.estado-bar { height: 100%; border-radius: 5px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.estado-num { width: 56px; text-align: right; flex-shrink: 0; }
.estado-num strong { font-size: 14px; } .estado-num span { font-size: 11.5px; color: var(--texto-2); margin-left: 4px; }

/* Oportunidades por categoría */
.cat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat-lbl { width: 130px; font-size: 12.5px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-track { flex: 1; height: 8px; background: #F2F4F6; border-radius: 5px; overflow: hidden; }
.cat-bar { height: 100%; border-radius: 5px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.cat-num { width: 26px; text-align: right; font-size: 13px; font-weight: 600; flex-shrink: 0; }

@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr !important; }
    .acc-rapidas { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   NOTIFICACIONES (campanita + panel)
   ============================================================ */
.notif-wrap { position: relative; }
.notif-btn { position: relative; background: none; border: none; cursor: pointer; padding: 7px;
    border-radius: 10px; color: var(--texto-2); display: inline-flex; }
.notif-btn:hover { background: var(--naranja-suave); color: var(--naranja); }
.notif-btn svg { width: 21px; height: 21px; }
.notif-badge { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--naranja); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px;
    border-radius: 9px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }

.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 360px; z-index: 200;
    background: #fff; border: 1px solid var(--borde); border-radius: 14px;
    box-shadow: 0 12px 34px rgba(16,24,40,.16); overflow: hidden; display: none; }
.notif-panel.abierto { display: block; animation: notifIn .14s ease-out; }
@keyframes notifIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notif-head { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px;
    padding: 13px 16px; border-bottom: 1px solid var(--borde); }
.notif-list { max-height: 360px; overflow: auto; }
.notif-vacio { padding: 22px 16px; text-align: center; color: var(--texto-2); font-size: 13px; }

.notif-item { display: flex; align-items: center; gap: 11px; padding: 11px 14px;
    text-decoration: none; border-bottom: 1px solid var(--borde); }
.notif-item:hover { background: #FCFCFD; }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; }
.notif-ico svg { width: 18px; height: 18px; }
.notif-tx { flex: 1; min-width: 0; font-size: 13px; color: var(--texto); line-height: 1.35; }
.notif-tx strong { font-weight: 600; }
.notif-time { display: block; font-size: 11.5px; color: var(--texto-2); margin-top: 2px; }
.notif-vertodas { display: block; text-align: center; padding: 12px; font-size: 13px; font-weight: 600;
    color: var(--naranja); text-decoration: none; border-top: 1px solid var(--borde); }
.notif-vertodas:hover { background: var(--naranja-suave); }

/* Lista completa (página notificaciones.php) */
.notif-list-full .notif-item { border-radius: 10px; border-bottom: 1px solid var(--borde); }
.notif-list-full .notif-item:last-child { border-bottom: 0; }

/* ============================================================
   DASHBOARD KAM
   ============================================================ */
.kpi-sub { font-size: 12px; color: var(--texto-2); margin-top: 3px; }
.kpi-link { display: inline-block; margin-top: 9px; font-size: 12.5px; font-weight: 600; color: var(--aqua); text-decoration: none; }
.kpi-link:hover { color: var(--naranja); }

/* Donut de cartera (conic-gradient, sin librerías) */
.kam-cartera { display: flex; align-items: center; gap: 26px; }
.kam-donut { position: relative; width: 152px; height: 152px; border-radius: 50%; flex-shrink: 0; }
.kam-donut::before { content: ''; position: absolute; inset: 22px; background: #fff; border-radius: 50%; }
.kam-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.kam-donut-c strong { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 30px; color: var(--texto); }
.kam-donut-c span { font-size: 12px; color: var(--texto-2); }
.kam-leg { flex: 1; display: flex; flex-direction: column; gap: 13px; }
.kam-leg-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.kam-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.kam-leg-lbl { flex: 1; color: var(--texto); }
.kam-leg-row strong { font-size: 15px; }
.kam-leg-pc { width: 40px; text-align: right; color: var(--texto-2); font-size: 12.5px; }

/* Rendimiento (4 celdas con barra de progreso) */
.rend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rend-cell { border: 1px solid var(--borde); border-radius: 12px; padding: 13px 14px; }
.rend-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rend-ico { display: inline-flex; } .rend-ico svg { width: 18px; height: 18px; }
.rend-lbl { font-size: 12.5px; color: var(--texto-2); }
.rend-val { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 21px; color: var(--texto); }
.rend-meta { font-size: 11.5px; color: var(--texto-2); margin: 2px 0 8px; }
.rend-track { height: 7px; background: #F2F4F6; border-radius: 4px; overflow: hidden; }
.rend-bar { height: 100%; border-radius: 4px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.rend-pc { text-align: right; font-size: 11.5px; color: var(--texto-2); margin-top: 4px; }

.tarea-grupo { font-size: 12px; font-weight: 600; color: var(--texto-2); margin: 12px 0 2px; }

/* Cartera por plan (barra apilada) */
.plan-stack { display: flex; height: 30px; border-radius: 8px; overflow: hidden; margin-bottom: 14px; background: #F2F4F6; }
.plan-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; min-width: 0; }
.plan-leg { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.plan-leg-item { display: flex; align-items: center; gap: 8px; }
.plan-leg-item .help-text { display: block; }

.mrr-total-num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 30px; color: var(--texto); }
.mrr-total-num span { font-size: 14px; color: var(--texto-2); font-weight: 500; }

@media (max-width: 1100px) {
    .kam-cartera { flex-direction: column; align-items: flex-start; }
    .rend-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PANEL DE CLIENTE (cliente_panel.php)
   ============================================================ */
.cli-body { background: #fff; }
.cli-wrap { max-width: 1280px; margin: 0 auto; padding: 26px 28px 40px; }
/* Cuando se muestra dentro de la app (con menú y header) */
.cli-in-app { max-width: none; margin: 0; padding: 0; }

/* Generar propuesta (dos columnas: info + vista previa) */
.gp-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.gp-info { padding: 18px; }
.gp-h { font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--texto-2); margin-bottom: 14px; }
.gp-sub { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--texto-2); margin: 16px 0 8px; }
.gp-cond { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.gp-cell span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--texto-2); }
.gp-cell strong { font-size: 14px; color: var(--texto); }
.gp-prop { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 10px; margin-bottom: 8px; text-decoration: none; }
.gp-prop:hover { border-color: var(--naranja); }
.gp-prop > div { flex: 1; min-width: 0; }
.gp-prop strong { display: block; font-size: 13.5px; color: var(--texto); }
.gp-prop-arrow { color: var(--texto-2); font-size: 18px; }
.gp-acciones { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.btn-azul { background: #3B82F6; border: 1px solid #3B82F6; color: #fff; }
.btn-azul:hover { background: #2f6fd6; }
.btn-verde { background: #1FA971; border: 1px solid #1FA971; color: #fff; }
.btn-verde:hover { background: #178a5c; }
.gp-prev { padding: 0; overflow: hidden; }
.gp-prev-head { padding: 16px 18px 0; }
.gp-prev-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--borde); }
.gp-zoom, .gp-pages { display: flex; align-items: center; gap: 8px; }
.gp-prev-bar button { border: 1px solid var(--borde); background: #fff; border-radius: 8px; padding: 5px 11px; cursor: pointer; font-size: 13px; color: var(--texto); font-family: inherit; }
.gp-prev-bar button:hover { border-color: var(--naranja); color: var(--naranja); }
.gp-zoom span { min-width: 44px; text-align: center; font-size: 13px; color: var(--texto-2); }
.gp-pages span { min-width: 96px; text-align: center; font-size: 13px; color: var(--texto-2); }
.gp-full { margin-left: auto; }
.gp-prev-wrap { background: #e7ebef; padding: 14px; overflow: auto; max-height: 80vh; }
.gp-frame { width: 8.5in; max-width: 100%; border: 0; display: block; margin: 0 auto; background: transparent; }
@media (max-width: 1000px) { .gp-layout { grid-template-columns: 1fr; } }

/* ============================================================
   CALENDARIO DE CITAS
   ============================================================ */
.cal-card { padding: 18px; }
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-head h3 { font-family: 'Poppins', sans-serif; font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--texto-2); padding-bottom: 4px; }
.cal-day { min-height: 92px; border: 1px solid var(--borde); border-radius: 10px; padding: 6px; background: #fff; }
.cal-day.otro { background: #fafbfc; border-style: dashed; }
.cal-day.hoy { border-color: var(--naranja); box-shadow: inset 0 0 0 1px var(--naranja); }
.cal-day-num { font-size: 12px; font-weight: 600; color: var(--texto-2); margin-bottom: 4px; }
.cal-day.hoy .cal-day-num { color: var(--naranja); }
.cal-cita { font-size: 11px; padding: 3px 6px; border-radius: 6px; margin-bottom: 3px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.cal-cita-h { font-weight: 700; }
.cal-cita.cita-pend { background: #FBF0DC; border-color: #E8A53A; color: #8a5d12; }
.cal-cita.cita-conf { background: #E2F3EA; border-color: #1FA971; color: #136b46; }
.cal-cita.cita-rech { background: #FDECEC; border-color: #E5484D; color: #a3262b; }
.cal-leyenda { display: flex; gap: 18px; margin-top: 14px; font-size: 12.5px; color: var(--texto-2); }
.cal-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cal-leyenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-leyenda i.cita-pend { background: #E8A53A; } .cal-leyenda i.cita-conf { background: #1FA971; } .cal-leyenda i.cita-rech { background: #E5484D; }
@media (max-width: 700px) { .cal-day { min-height: 64px; } .cal-cita { font-size: 9.5px; } }

/* Preview de carga masiva de leads */
.csv-resumen { margin: 16px 0 8px; font-size: 14px; }
.csv-prev-wrap { border: 1px solid var(--borde); border-radius: 10px; overflow: auto; max-height: 340px; }
.csv-prev { width: 100%; border-collapse: collapse; font-size: 13px; }
.csv-prev th { position: sticky; top: 0; background: #F7F8FA; text-align: left; font-size: 11px;
    text-transform: uppercase; letter-spacing: .3px; color: var(--texto-2); padding: 8px 10px; border-bottom: 1px solid var(--borde); }
.csv-prev td { padding: 8px 10px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.csv-prev tr:last-child td { border-bottom: 0; }
.csv-prev .fila-err { background: #FEF2F2; }
.csv-prev .fila-err strong { color: var(--texto-2); }

.cli-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.cli-head-left { display: flex; gap: 18px; align-items: center; }
.cli-logo { width: 72px; height: 72px; border: 1px solid var(--borde); border-radius: 14px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: #fff;
    font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 24px; color: var(--naranja); flex-shrink: 0; }
.cli-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cli-nombre { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 27px; color: var(--texto); }
.cli-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.cli-head-right { display: flex; align-items: flex-start; gap: 6px; }
.cli-kam-lbl { font-size: 12px; color: var(--texto-2); text-align: right; margin-bottom: 7px; }
.cli-kam-row { display: flex; align-items: center; gap: 10px; }
.cli-kam-foto { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: var(--aqua); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.cli-kam-foto img { width: 100%; height: 100%; object-fit: cover; }
.cli-kam-row strong { font-size: 15px; }
.cli-kam-mail { width: 36px; height: 36px; border: 1px solid var(--borde); border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; color: var(--texto-2); }
.cli-kam-mail svg { width: 18px; height: 18px; } .cli-kam-mail:hover { border-color: var(--naranja); color: var(--naranja); }
.cli-close { font-size: 28px; color: var(--texto-2); text-decoration: none; line-height: 1; padding: 4px 8px; }
.cli-close:hover { color: var(--texto); }

/* KPIs */
.cli-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.cli-kpi { padding: 16px 18px; }
.cli-kpi-ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.cli-kpi-ico svg { width: 20px; height: 20px; }
.cli-kpi-lbl { font-size: 13px; color: var(--texto-2); }
.cli-kpi-num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 23px; color: var(--texto); margin-top: 2px; line-height: 1.15; }
.cli-kpi-sub { font-size: 12px; color: var(--texto-2); margin-top: 4px; }
.cli-kpi-link { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--naranja); text-decoration: none; }

/* Grids */
.cli-grid3 { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.cli-grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }

/* Resumen comercial */
.cli-res { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.cli-res:last-child { border-bottom: 0; }
.cli-res-ico { width: 34px; height: 34px; border-radius: 9px; background: #F2F6F7; color: var(--aqua);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cli-res-ico svg { width: 17px; height: 17px; }
.cli-res-lbl { font-size: 12px; color: var(--texto-2); }
.cli-res-val { font-size: 14.5px; font-weight: 600; color: var(--texto); }

/* Timeline actividad */
.cli-timeline { margin-bottom: 4px; }
.cli-tl { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.cli-tl:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--borde); }
.cli-tl-ico { width: 35px; height: 35px; border-radius: 50%; background: #F2F6F7; color: var(--aqua);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.cli-tl-ico svg { width: 17px; height: 17px; }
.cli-tl-body { flex: 1; min-width: 0; }
.cli-tl-top { display: flex; justify-content: space-between; }
.cli-tl-dia { font-size: 12px; font-weight: 600; color: var(--texto-2); }
.cli-tl-hora { font-size: 12px; color: var(--texto-2); }
.cli-tl-tit { font-size: 14px; font-weight: 600; color: var(--texto); margin-top: 2px; }
.cli-tl-sub { font-size: 12.5px; color: var(--texto-2); }
.cli-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--aqua); text-decoration: none; }
.cli-link:hover { color: var(--naranja); }

/* Próximas acciones */
.cli-accion { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--borde); margin: 0; }
.cli-check { width: 20px; height: 20px; border: 2px solid var(--borde); border-radius: 6px; background: #fff;
    cursor: pointer; flex-shrink: 0; color: #fff; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.cli-check.on { background: #1FA971; border-color: #1FA971; }
.cli-accion-tx { flex: 1; font-size: 13.5px; }
.cli-accion-tx.hecho { text-decoration: line-through; color: var(--texto-2); }
.cli-accion-fch { font-size: 11.5px; color: var(--texto-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cli-accion-fch svg { width: 13px; height: 13px; }

/* Stepper de etapa */
.cli-stepper { display: flex; padding-top: 8px; }
.cli-step { flex: 1; text-align: center; position: relative; }
.cli-step-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #CBD2D9; background: #fff;
    color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
    position: relative; z-index: 2; font-weight: 700; font-size: 15px; }
.cli-step:not(:first-child)::before { content: ''; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: #E1E5EA; z-index: 1; }
.cli-step.done .cli-step-dot { background: #1FA971; border-color: #1FA971; }
.cli-step.actual .cli-step-dot { border-color: #8B7FE8; color: #8B7FE8; }
.cli-step.done:not(:first-child)::before, .cli-step.actual:not(:first-child)::before { background: #1FA971; }
.cli-step-lbl { font-weight: 600; font-size: 13.5px; color: var(--texto); }
.cli-step-est { font-size: 12px; color: var(--texto-2); margin-top: 2px; }
.cli-step.actual .cli-step-est { color: #8B7FE8; font-weight: 600; }
.cli-step-fch { font-size: 11.5px; color: var(--texto-2); margin-top: 2px; }

/* Última interacción */
.cli-ult { display: flex; flex-direction: column; gap: 6px; }
.cli-ult-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.cli-ult-ico { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cli-ult-ico svg { width: 19px; height: 19px; }
.cli-ult-item strong { font-size: 14.5px; display: block; }
.cli-ult-h { font-size: 12px; color: var(--texto-2); }

@media (max-width: 1100px) {
    .cli-kpis { grid-template-columns: repeat(3, 1fr); }
    .cli-grid3, .cli-grid2 { grid-template-columns: 1fr; }
}

/* ============================================================
   DASHBOARD (fintech)
   ============================================================ */
.hero {
    background: linear-gradient(120deg, #11304B 0%, #1C5A66 55%, #2C8A86 100%);
    border-radius: 16px;
    padding: 22px 26px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.hero h2 { color: #fff; font-size: 22px; }
.hero .hero-sub { color: rgba(255,255,255,.8); font-size: 13.5px; margin-top: 4px; }
.hero .hero-dato { text-align: right; }
.hero .hero-dato .num { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 26px; }
.hero .hero-dato .lbl { font-size: 12px; color: rgba(255,255,255,.8); }

.stat-trend { font-size: 11.5px; font-weight: 600; margin-top: 3px; }
.trend-up { color: var(--verde); }
.trend-down { color: var(--rojo); }

.charts-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    margin-top: 18px;
}
.chart-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.chart-card .chart-sub { font-size: 12px; color: var(--texto-2); margin-bottom: 14px; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* Movimiento e interactividad */
.stat-card, .chart-card { transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover, .chart-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16,24,40,.10); }
.stat-icono { transition: transform .18s ease; }
.stat-card:hover .stat-icono { transform: scale(1.08) rotate(-3deg); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s ease both; }

.hero { position: relative; overflow: hidden; }
.hero::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}

/* Acciones rápidas */
.quick-actions {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; margin-bottom: 22px;
}
.qa {
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    padding: 16px; text-decoration: none; color: inherit;
    display: flex; flex-direction: column; gap: 12px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.qa:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16,24,40,.10); border-color: var(--naranja); }
.qa-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.qa-icon svg { width: 22px; height: 22px; }
.qa-label { font-weight: 600; font-size: 13.5px; }
.qa-sub { font-size: 11.5px; color: var(--texto-2); margin-top: -6px; }

/* ============================================================
   BARRA DE BÚSQUEDA / FILTROS / PAGINACIÓN
   ============================================================ */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search-box input {
    width: 100%; padding: 10px 12px 10px 38px;
    border: 1px solid var(--borde); border-radius: 10px; font-size: 13.5px;
    font-family: "Inter", sans-serif; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px var(--aqua-suave); outline: none; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--texto-2); }
.toolbar select {
    border: 1px solid var(--borde); border-radius: 10px; padding: 9px 12px;
    font-size: 13.5px; font-family: "Inter", sans-serif; background: #fff;
}
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 20px; font-size: 13px; color: var(--texto-2); }
.pager .btn { padding: 7px 12px; }
.btn-eliminar { color: var(--rojo); }
.btn-eliminar:hover { background: #FDECEC; border-color: #F3C0BC; }
