/* ============================================================
   TRYCONTROLLER — estilos.css
   Tema oscuro neón · Mobile-first · Sin duplicados
   ============================================================ */

/* ── 1. VARIABLES ─────────────────────────────────────────── */
:root {
    --neon:           #39FF14;
    --neon-dim:       rgba(57, 255, 20, 0.25);
    --neon-glow-sm:   0 0 8px rgba(57, 255, 20, 0.35);
    --neon-glow-md:   0 0 14px rgba(57, 255, 20, 0.5);

    --accent:         #e74c3c;
    --accent-dim:     rgba(231, 76, 60, 0.25);
    --warning:        #f39c12;

    --bg:             #121212;
    --surface:        #1a1a1a;
    --surface-2:      #222222;
    --border:         #2e2e2e;
    --hover:          #252525;

    --text:           #e0e0e0;
    --text-muted:     #888888;

    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      50px;

    --footer-h:       48px;

    --font-body:      'Inter', sans-serif;
    --font-ui:        'Nunito', sans-serif;
}

/* ── 2. RESET / BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100%;
}

/* Sólo bloquea scroll en la pantalla principal (no en modales ni iframes) */
body.no-scroll {
    overflow: hidden;
    height: 100%;
}

/* Página principal con iframe */
body.layout-iframe {
    overflow: hidden;
    height: 100dvh;
}

/* ── 3. SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── 4. TIPOGRAFÍA / ENLACES ──────────────────────────────── */
a { color: var(--neon); text-decoration: none; transition: color .2s, text-shadow .2s; }
a:hover { color: #70ff52; text-shadow: var(--neon-glow-sm); }

/* ── 5. LAYOUT GENERAL ────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(var(--footer-h) + 16px);
}

/* ── 6. BARRA DE PROGRESO SUPERIOR ───────────────────────── */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--neon), var(--accent));
    z-index: 9999;
    transition: width .3s ease;
}

/* ── 7. NAVBAR ────────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, #131720, #0a0e14) !important;
    height: 60px;
    padding: 0 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text) !important;
}

#contador-enlaces {
    background: var(--neon);
    padding: 2px 10px;
    border-radius: var(--radius-lg);
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--neon-glow-sm);
    transition: box-shadow .2s;
}
#contador-enlaces:hover { box-shadow: var(--neon-glow-md); }
#contador-enlaces .numero { font-weight: 700; color: #000; font-size: 1rem; }

/* ── 8. FORMULARIO DE CONSULTA ────────────────────────────── */
#formulario-consulta {
    max-width: 480px;
    margin: 20px auto;
}

#formulario-consulta .input-group { position: relative; }

#formulario-consulta input[type="text"] {
    width: 100%;
    padding: 13px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    background: transparent;
    color: var(--text);
    text-align: center;
    transition: border-color .3s, box-shadow .3s;
}
#formulario-consulta input[type="text"]:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-dim);
    outline: none;
}

/* ── 9. ÁREA DE RESULTADOS ────────────────────────────────── */
#resultado {
    max-width: 1000px;
    margin: 8px auto;
    padding: 12px;
    border-radius: var(--radius-md);
    min-height: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all .3s;
}

#resultado p, #resultado div, #resultado h1, #resultado h2,
#resultado h3, #resultado h4, #resultado h5, #resultado h6,
#resultado span, #resultado strong, #resultado em, #resultado a {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
#resultado table { margin-left: auto; margin-right: auto; }

/* ── 10. COMPAÑÍA / CLIPBOARD ─────────────────────────────── */
#compania, #nombreCompania {
    padding: 10px 16px;
    background: #1e3b1e;
    border-left: 4px solid var(--neon);
    margin: 8px 0;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: background .25s;
}
#compania:hover, #nombreCompania:hover { background: #284b28; }
#compania::after, #nombreCompania::after {
    content: "Copiado al portapapeles";
    display: none;
    font-size: .8rem;
    color: var(--neon);
    margin-left: 10px;
}
#compania.copiado::after, #nombreCompania.copiado::after {
    display: inline;
    animation: fadeIn 1s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── 11. TABLAS ───────────────────────────────────────────── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

table {
    width: 100%;
    max-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px auto;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

table th {
    color: var(--neon);
    padding: 14px 16px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: .9rem;
    border-bottom: 2px solid var(--neon);
}

table td {
    padding: 13px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: .95rem;
}

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

table td a {
    color: #fff !important;
    font-weight: 700;
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-lg);
    transition: transform .2s, text-shadow .2s;
}
table td a:hover {
    color: #f0f0f0 !important;
    text-shadow: 0 0 8px rgba(255,255,255,.5);
    transform: scale(1.05);
}

/* Ajuste column 2 padding — sólo en pantallas anchas */
@media (min-width: 769px) {
    table td:nth-child(2) { padding-left: 74px; }
    table th:nth-child(2) { padding-left: 78px; }
}

/* ── 12. KAM ──────────────────────────────────────────────── */
.kam {
    display: block;
    margin-top: 4px;
    font-size: .82rem;
    color: var(--neon);
}
.sin-kam {
    display: block;
    color: var(--warning);
    font-size: .82rem;
    margin-top: 4px;
    cursor: pointer;
    position: relative;
    transition: all .3s;
}
.sin-kam.mostrar-vane::after {
    content: "¿Lo archivó Vane?";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: .78rem;
    animation: aparecer 2s ease forwards;
    white-space: nowrap;
}
@keyframes aparecer {
    0%   { opacity: 0; top: -20px; }
    10%  { opacity: 1; top: -30px; }
    90%  { opacity: 1; top: -30px; }
    100% { opacity: 0; top: -20px; }
}

/* ── 13. BOTONES ──────────────────────────────────────────── */
.btn { border-radius: var(--radius-lg); font-weight: 500; transition: all .2s; }

.btn-primary {
    background: var(--neon);
    border-color: var(--neon);
    color: #000;
    box-shadow: var(--neon-glow-sm);
}
.btn-primary:hover, .btn-primary:focus {
    background: #32e312;
    border-color: #32e312;
    box-shadow: var(--neon-glow-md);
    transform: translateY(-2px);
}

.btn-danger { background: var(--accent); border-color: var(--accent); }
.btn-danger:hover, .btn-danger:focus {
    background: #c0392b;
    border-color: #c0392b;
    box-shadow: 0 4px 10px rgba(231,76,60,.35);
}

.btn-sm { padding: .2rem .5rem; font-size: .75rem; }

.btn-implementacion {
    color: #fff !important;
    display: inline-block;
    padding: 5px 14px;
    background: transparent;
    font-weight: 700;
    transition: all .3s;
}

/* ── 14. TARJETAS DE ENLACES ──────────────────────────────── */
.enlace-card {
    height: 100%;
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
    background: transparent;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.enlace-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(57,255,20,.2);
    background: var(--hover);
}
.card-body { padding: .7rem; }
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
    margin-bottom: .2rem;
}
.titulo-container { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.fecha-container  { display: flex; align-items: center; justify-content: space-between; }

/* ── 15. BADGES ───────────────────────────────────────────── */
.badge { padding: 4px 9px; font-weight: 500; font-size: .72rem; letter-spacing: .4px; }
.bg-secondary { background: #34495e !important; }
.text-muted { font-size: .7rem; color: var(--text-muted) !important; }

/* ── 16. ALERTAS FLOTANTES ────────────────────────────────── */
#floating-alerts-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    width: min(340px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.floating-alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    animation: slideAlert .3s ease-out, fadeOutAlert 3s ease-in-out forwards;
}

@keyframes slideAlert {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOutAlert {
    0%,80% { opacity: 1; }
    100%   { opacity: 0; }
}

.alert-success { background: #163219; color: #a2f0bc; border-left: 4px solid var(--neon); }
.alert-danger  { background: #4d2126; color: #f5b7bd; border-left: 4px solid var(--accent); }
.alert-info    { background: #1e3b1e; color: #a9f0bc; border-left: 4px solid var(--neon); }

/* ── 17. MODALES ──────────────────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.modal-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
}
.modal-footer {
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    padding: 14px 20px;
}
.modal-title { font-family: var(--font-ui); font-weight: 600; color: var(--text); }

/* ── 18. FORMULARIOS ──────────────────────────────────────── */
.form-control {
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    transition: border-color .3s, box-shadow .3s;
}
.form-control:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-dim);
    background: var(--bg);
    color: var(--text);
}
.form-label { font-weight: 500; color: var(--text); margin-bottom: 6px; }

/* ── 19. DROPDOWN ─────────────────────────────────────────── */
.dropdown-menu { font-size: .85rem; background: var(--surface); border-color: var(--border); }
.dropdown-item { color: var(--text) !important; }
.dropdown-item i { color: var(--neon) !important; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--hover); }

/* ── 20. RESULTADOS CON COLUMNAS CUSTOM ─────────────────────*/
.resultado-tabla { width: 100%; margin: 16px auto; color: var(--text); }
.tabla-header { display: flex; justify-content: space-between; padding: 10px 0; }
.columna-header {
    text-align: center; font-weight: 700; color: var(--neon);
    text-transform: uppercase; font-size: .9rem; letter-spacing: 1px;
}
.columna-25 { flex: 0 0 25%; }
.columna-50 { flex: 0 0 50%; }
.separador {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), transparent);
    margin-bottom: 10px;
}
.tabla-fila { display: flex; justify-content: space-between; padding: 13px 0; }
.columna-dato { text-align: center; padding: 4px; font-size: .95rem; }
.kam-nombre { display: block; margin-top: 4px; font-size: .82rem; color: var(--neon); }

/* ── 21. LOGIN FLOTANTE ───────────────────────────────────── */
body.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px calc(var(--footer-h) + 24px);
    overflow: auto;
}

.login-floating {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo libre — sin recorte */
.login-logo {
    margin-bottom: 24px;
    text-align: center;
}
.login-logo img {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 14px rgba(57,255,20,.35));
}

/* Separador neón */
.login-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon) 50%, transparent);
    margin-bottom: 28px;
}

/* Formulario */
.login-form {
    width: 100%;
}
.login-form .form-control {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.login-form .form-control:focus {
    background: var(--surface);
    border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-dim);
    color: var(--text);
}
.login-form .form-control::placeholder { color: var(--text-muted); }

/* Botón mostrar/ocultar contraseña */
.login-form .btn-outline-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: color .2s;
}
.login-form .btn-outline-secondary:hover { color: var(--neon); background: var(--hover); }

/* Input pegado al botón del ojo */
.login-form .input-group .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Botón submit */
.login-form .btn-primary {
    padding: 13px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
}

/* Alerta de error */
.login-form .alert-danger {
    background: #4d2126;
    color: #f5b7bd;
    border: none;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: .9rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-animation { animation: fadeInUp .5s ease-out forwards; }

/* ── 22. DASHBOARD LAYOUT ─────────────────────────────────── */

/* Body del dashboard: ocupa toda la pantalla, sin scroll */
body.dashboard-layout {
    overflow: hidden;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ZONA SUPERIOR: search + resultado */
.dashboard-top {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 16px 0;
    gap: 8px;
    z-index: 2;
}

/* Search bar */
.dash-search-wrap {
    width: 100%;
    max-width: 480px;
}

#formulario-consulta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.dash-search-input {
    width: 100%;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 22px;
    font-size: 1rem;
    color: var(--text);
    text-align: center;
    outline: none;
    font-family: var(--font-body);
    transition: border-color .25s, box-shadow .25s;
}
.dash-search-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-dim);
}
.dash-search-input::placeholder { color: #3a3a3a; }

/* Línea separadora neón bajo el input */
.dash-search-divider {
    width: 100%;
    max-width: 480px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--neon) 50%, transparent);
    opacity: .3;
}

/* Área de resultado */
#resultado {
    width: 100%;
    max-width: 960px;
    padding: 4px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* IFRAME embebido */
.dash-iframe-wrap {
    flex: 1;
    margin: 8px 14px calc(var(--footer-h) + 10px);
    border-radius: var(--radius-md);
    border: 1.5px solid #1e1e1e;
    overflow: hidden;
    position: relative;
    min-height: 0;
}
.dash-iframe-wrap iframe {
    width: 105.3%;
    height: 105.3%;
    border: none;
    display: block;
    transform: scale(0.95);
    transform-origin: top left;
}

/* Esquinas decorativas del iframe */
.dash-iframe-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--neon);
    border-style: solid;
    opacity: .35;
    z-index: 2;
    pointer-events: none;
}
.dash-iframe-corner.tl { top: 7px;  left: 7px;  border-width: 1.5px 0 0 1.5px; }
.dash-iframe-corner.tr { top: 7px;  right: 7px; border-width: 1.5px 1.5px 0 0; }
.dash-iframe-corner.bl { bottom: 7px; left: 7px;  border-width: 0 0 1.5px 1.5px; }
.dash-iframe-corner.br { bottom: 7px; right: 7px; border-width: 0 1.5px 1.5px 0; }

/* Modal contraseña — botón ojo consistente con login */
#cambiarContrasenaModal .btn-outline-secondary {
    background: var(--surface);
    border-color: var(--border);
    border-left: none;
    color: var(--text-muted);
    transition: color .2s;
}
#cambiarContrasenaModal .btn-outline-secondary:hover {
    color: var(--neon);
    background: var(--hover);
}
#cambiarContrasenaModal .input-group .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
#cambiarContrasenaModal .progress {
    background: var(--border);
    border-radius: 2px;
}

/* Responsive dashboard */
@media (max-width: 768px) {
    .dashboard-top { padding: 12px 12px 0; gap: 6px; }
    .dash-search-input { padding: 10px 18px; font-size: .93rem; }
    .dash-iframe-wrap { margin: 6px 8px calc(var(--footer-h) + 8px); }
}

@media (max-width: 576px) {
    .dashboard-top { padding: 10px 8px 0; }
    .dash-search-input { padding: 9px 14px; font-size: .88rem; }
    .dash-iframe-wrap {
        margin: 5px 6px calc(var(--footer-h) + 6px);
        border-radius: var(--radius-sm);
    }
    .dash-iframe-corner { width: 8px; height: 8px; }
}

/* ── 23. FOOTER ───────────────────────────────────────────── */
.site-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--footer-h);
    background: #0e1219;
    border-top: 1.5px solid var(--neon);
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 14px;
    font-family: var(--font-body);
}

/* Izquierda */
.sf-left {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.sf-autor {
    font-size: .68rem;
    font-weight: 600;
    color: var(--neon);
    letter-spacing: .04em;
}
.sf-version {
    font-size: .6rem;
    color: var(--text-muted);
    letter-spacing: .03em;
}

/* Centro: logo */
.sf-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.sf-center img {
    height: 22px;
    width: auto;
    opacity: .88;
    filter: drop-shadow(0 0 6px rgba(57,255,20,.3));
}

/* Derecha: botones */
.sf-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.sf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #666;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    transition: color .2s, background .2s;
}
.sf-btn i { font-size: 14px; }
.sf-btn:hover {
    color: var(--neon) !important;
    background: rgba(57,255,20,.08);
    text-shadow: none !important;
}

.sf-sep {
    width: 1px;
    height: 14px;
    background: #222;
    margin: 0 2px;
    flex-shrink: 0;
}

/* ── 24. PANEL CARTERAS ───────────────────────────────────── */
#carteras-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 998;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .3s;
}
#carteras-overlay.show { display: flex; align-items: center; justify-content: center; opacity: 1; }

#carteras-panel {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.93);
    width: min(90vw, 860px);
    height: min(80vh, 640px);
    background: #0e1219;
    border: 2px solid var(--neon);
    box-shadow: 0 0 50px rgba(57,255,20,.2);
    border-radius: var(--radius-md);
    z-index: 999;
    display: flex; flex-direction: column;
    overflow: hidden;
    opacity: 0; pointer-events: none;
    transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1);
}
#carteras-panel.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }

#carteras-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--neon-dim);
    flex-shrink: 0;
    background: rgba(57,255,20,.04);
}
#carteras-panel-header span {
    color: var(--neon); font-weight: 600; font-size: .9rem;
    letter-spacing: .08em; text-transform: uppercase;
}
#carteras-panel-close {
    background: none;
    border: 1px solid rgba(57,255,20,.3);
    color: #999; font-size: .95rem; cursor: pointer;
    padding: 4px 8px; border-radius: var(--radius-sm); line-height: 1;
    transition: all .2s;
}
#carteras-panel-close:hover { color: var(--neon); border-color: var(--neon); background: rgba(57,255,20,.08); }
#carteras-panel-body { flex: 1; overflow-y: auto; }
#carteras-panel-body iframe { width: 100%; height: 100%; border: none; }

/* ── 25. FILTROS ──────────────────────────────────────────── */
.filtros-container {
    background: var(--surface);
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.filtro-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filtro-label { font-weight: 600; color: var(--neon); text-transform: uppercase; letter-spacing: .5px; font-size: .85rem; }

.btn-filtro {
    padding: 5px 12px; font-size: .85rem; border-radius: var(--radius-lg);
    background: transparent; border: 2px solid var(--border);
    color: var(--text); transition: all .25s; cursor: pointer;
}
.btn-filtro:hover { background: var(--hover); border-color: var(--neon); transform: translateY(-1px); }
.filtro-activo {
    background: var(--neon) !important; color: #000 !important;
    border-color: var(--neon) !important; box-shadow: var(--neon-glow-sm);
    font-weight: 600;
}

/* ── 26. ELIMINAR MES ─────────────────────────────────────── */
#btn-eliminar-mes {
    background: var(--accent); border-color: var(--accent);
    color: #fff; padding: 5px 16px; font-size: .85rem;
    border-radius: var(--radius-lg); font-weight: 600;
    box-shadow: 0 4px 10px var(--accent-dim);
    transition: all .3s;
}
#btn-eliminar-mes:hover {
    background: #c0392b; border-color: #c0392b;
    box-shadow: 0 6px 16px rgba(231,76,60,.5); transform: translateY(-2px);
}
@keyframes pulseRed {
    0%,100% { box-shadow: 0 4px 10px var(--accent-dim); }
    50%      { box-shadow: 0 4px 16px rgba(231,76,60,.55); }
}
#btn-eliminar-mes.pulse { animation: pulseRed 2s infinite; }

#eliminarMesModal .modal-header.bg-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c) !important;
    border-bottom: 2px solid #922b21;
}
#eliminarMesModal .modal-title { color: #fff; }
#eliminarMesModal .alert-danger { border-radius: var(--radius-sm); }
#eliminarMesModal .modal-body p { font-size: 1rem; line-height: 1.6; }
#eliminarMesModal #cantidad-enlaces-mes { color: var(--accent); font-size: 1.1rem; font-weight: 700; }
#eliminarMesModal #nombre-mes-eliminar { color: var(--neon); text-transform: capitalize; }
#eliminarMesModal .btn-secondary { background: #34495e; border-color: #34495e; border-radius: var(--radius-lg); }
#eliminarMesModal #confirmar-eliminar-mes {
    background: var(--accent); border-color: var(--accent);
    border-radius: var(--radius-lg); font-weight: 600;
    box-shadow: 0 4px 10px var(--accent-dim);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-40px); }
    to   { opacity: 1; transform: translateY(0); }
}
#eliminarMesModal.show .modal-dialog { animation: modalSlideIn .3s ease-out; }

/* ── 27. LOADING ──────────────────────────────────────────── */
.loading { position: relative; }
.loading::after {
    content: "";
    position: absolute; inset: 0;
    background: rgba(10,14,20,.7);
    z-index: 10;
}
.loading::before {
    content: "";
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px;
    border: 3px solid #2c3e50;
    border-top-color: var(--neon);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}
@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── 28. CONTENEDOR ENLACES ───────────────────────────────── */
#contenedor-enlaces {
    max-width: 1600px;
    margin: 24px auto;
    padding: 0 12px;
    width: 100%;
}

/* ── 29. RESPONSIVE — MOBILE FIRST ───────────────────────── */

/* Tablets (≥768px) */
@media (min-width: 768px) {
    .container { padding: 20px; padding-bottom: calc(var(--footer-h) + 20px); }
    #formulario-consulta { margin: 24px auto; }
    .filtro-label { font-size: .9rem; }
    .btn-filtro { font-size: .9rem; padding: 6px 14px; }
    footer.footer-neon { font-size: .78rem; }
}

/* Desktop (≥1024px) */
@media (min-width: 1024px) {
    .navbar { height: 70px; }
    table th { font-size: 1rem; padding: 15px 20px; }
    table td { font-size: 1rem; padding: 14px 20px; }
}

/* ── Breakpoints hacia abajo (max-width) ── */

/* Tablets pequeñas / landscape móvil */
@media (max-width: 768px) {
    :root { --footer-h: 44px; }

    .container { padding: 12px; padding-bottom: calc(var(--footer-h) + 12px); }

    #formulario-consulta { max-width: 100%; margin: 14px auto; }
    #formulario-consulta input[type="text"] { padding: 11px 16px; font-size: .97rem; }

    table th, table td { padding: 10px 12px; font-size: .85rem; }

    .filtros-container { padding: 10px; }
    .filtro-group { gap: 6px; }
    .btn-filtro { padding: 4px 10px; font-size: .8rem; }

    #btn-eliminar-mes { width: 100%; margin-top: 8px; }

    .card-title { font-size: .95rem; }

    #carteras-panel { width: 95vw; height: 85vh; }
}

/* Móviles (≤ 576px) */
@media (max-width: 576px) {
    :root { --footer-h: 42px; }

    .container { padding: 8px; padding-bottom: calc(var(--footer-h) + 8px); }

    .navbar { height: 52px; padding: 0 10px; }
    .navbar-brand { font-size: .92rem; }
    #contador-enlaces { padding: 2px 8px; }
    #contador-enlaces .numero { font-size: .9rem; }

    #formulario-consulta input[type="text"] { padding: 10px 14px; font-size: .92rem; border-radius: 30px; }

    table { border-radius: var(--radius-sm); }
    table th { padding: 9px 8px; font-size: .78rem; letter-spacing: .5px; }
    table td { padding: 9px 8px; font-size: .82rem; }
    table td a { padding: 3px 10px; }

    .tabla-header, .tabla-fila { font-size: .82rem; }
    .columna-dato { font-size: .82rem; padding: 2px; }
    .kam, .kam-nombre, .sin-kam { font-size: .74rem; }

    .filtros-container { padding: 8px 10px; border-radius: var(--radius-sm); }
    .btn-filtro { font-size: .75rem; padding: 4px 9px; }
    .filtro-label { font-size: .78rem; }

    .badge { padding: 3px 7px; font-size: .65rem; }
    .text-muted { font-size: .65rem; }

    .card-title { font-size: .9rem; }
    .card-body { padding: .55rem; }

    footer.site-footer { padding: 0 8px; }
    .sf-btn { width: 30px; height: 30px; }
    .sf-btn i { font-size: 13px; }
    .sf-center img { height: 18px; }
    .sf-autor { font-size: .62rem; }
    .sf-version { font-size: .56rem; }

    .floating-alert { font-size: .85rem; }

    .modal-dialog { margin: 10px; }
    .modal-content { border-radius: var(--radius-sm); }
    .login-card .card-body { padding: 20px; }

    #carteras-panel { width: 98vw; height: 88vh; border-radius: var(--radius-sm); }

    /* Columnas custom: apiladas en móvil */
    .tabla-header, .tabla-fila { flex-direction: column; }
    .columna-25, .columna-50 { flex: 0 0 100%; margin-bottom: 6px; }
}

/* Móviles muy pequeños (≤ 380px) */
@media (max-width: 380px) {
    .navbar-brand { font-size: .82rem; }
    table th { font-size: .72rem; padding: 7px 5px; }
    table td { font-size: .76rem; padding: 7px 5px; }
    #formulario-consulta input[type="text"] { font-size: .87rem; padding: 9px 12px; }
    .btn-filtro { font-size: .7rem; padding: 3px 7px; }
    .sf-btn { width: 28px; height: 28px; }
    .sf-btn i { font-size: 12px; }
}

/* ── PANEL TIENDAS — mismo patrón exacto que #carteras ──
   Pegar en estilos.css justo después del bloque "24. PANEL CARTERAS"
────────────────────────────────────────────────────────── */

#tiendas-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 998;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .3s;
}
#tiendas-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

#tiendas-panel {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.93);
    width: min(90vw, 860px);
    height: min(80vh, 640px);
    background: #0e1219;
    border: 2px solid var(--neon);
    box-shadow: 0 0 50px rgba(57,255,20,.2);
    border-radius: var(--radius-md);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1);
}
#tiendas-panel.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

#tiendas-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--neon-dim);
    flex-shrink: 0;
    background: rgba(57,255,20,.04);
}
#tiendas-panel-header span {
    color: var(--neon);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
#tiendas-panel-close {
    background: none;
    border: 1px solid rgba(57,255,20,.3);
    color: #999;
    font-size: .95rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: all .2s;
}
#tiendas-panel-close:hover {
    color: var(--neon);
    border-color: var(--neon);
    background: rgba(57,255,20,.08);
}

#tiendas-panel-body {
    flex: 1;
    overflow-y: auto;
}
#tiendas-panel-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive — igual que carteras */
@media (max-width: 768px) {
    #tiendas-panel { width: 95vw; height: 85vh; }
}
@media (max-width: 576px) {
    #tiendas-panel { width: 98vw; height: 88vh; border-radius: var(--radius-sm); }
}

/* ── 3 Columnas de iframes ── */
.dash-cols-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 16px 16px;
    flex: 1;
    min-height: 0;
}

.dash-col-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    background: transparent;  /* ← era: rgba(255,255,255,0.03) */
}

.dash-col-header {
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;  /* ← agregar esto */
    gap: 8px;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, var(--neon), #00cfff);
}

.dash-col-panel iframe {
    flex: 1;
    width: 100%;
    border: none;
    min-height: 0;
}

/* Responsive: en móvil apila las columnas */
@media (max-width: 768px) {
    .dash-cols-wrap {
        grid-template-columns: 1fr;
    }
}
/* ── MÓDULO CONSULTA v2 ───────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 40px;
    padding: 6px 8px 6px 16px;
    gap: 8px;
}
.search-bar:focus-within {
    border-color: rgba(57,255,20,0.5);
    box-shadow: 0 0 0 3px rgba(57,255,20,0.1);
}
.search-bar > i { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }

.dash-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}
.dash-search-input::placeholder { color: #2e2e2e; }

.search-btn {
    background: var(--neon);
    border: none;
    border-radius: var(--radius-lg);
    color: #000;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 7px 16px;
    cursor: pointer;
    transition: background .2s, transform .15s;
    letter-spacing: 0.04em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.search-btn:hover  { background: #52ff30; transform: scale(1.03); }
.search-btn:active { transform: scale(0.97); }

/* Tarjeta resultado */
.result-card {
    margin-top: 10px;
    background: transparent;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    animation: rcSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes rcSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.rc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: none;
    gap: 8px;
}

.rc-top .rc-chip {
    flex-shrink: 0;
}

.plat-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface-2);
    border: 1px solid rgba(57,255,20,0.25);
    border-radius: var(--radius-lg);
    padding: 4px 12px 4px 8px;
    font-size: 0.8rem;
    color: var(--neon);
    font-weight: 700;
    letter-spacing: 0.06em;
}
.plat-badge i { font-size: 14px; }

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

.rc-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    transition: color .2s, background .2s, border-color .2s;
    text-decoration: none;
}
.rc-icon-btn:hover {
    color: var(--neon);
    border-color: rgba(57,255,20,0.3);
    background: rgba(57,255,20,0.06);
}
.rc-icon-btn.rc-new {
    color: var(--neon);
    border-color: rgba(57,255,20,0.4);
}
.rc-icon-btn.rc-new:hover { background: rgba(57,255,20,0.12); }
.rc-icon-btn.rc-no-impl  { opacity: 0.25; cursor: default; pointer-events: none; }

.rc-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.rc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a2e1a, #1e3b1e);
    border: 1px solid rgba(57,255,20,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: var(--neon);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

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

.rc-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.rc-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.rc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.rc-chip i { font-size: 11px; }
.rc-chip-kam     { background: rgba(57,255,20,0.1);    color: var(--neon);    border: 1px solid rgba(57,255,20,0.25); }
.rc-chip-sinKam  { background: rgba(243,156,18,0.12);  color: var(--warning); border: 1px solid rgba(243,156,18,0.25); }
.rc-chip-sinNeg  { background: rgba(100,116,139,0.15); color: #94a3b8;        border: 1px solid rgba(100,116,139,0.2); }

/* Empty state */
.rc-empty {
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: rcSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}
.rc-empty-icon { font-size: 28px; color: var(--text-muted); }
.rc-empty-text  { font-size: 0.88rem; color: var(--text-muted); text-align: center; }
.rc-empty-plat  { color: var(--text); font-weight: 700; }

/* Ocultar barra tras consulta */
#searchWrap.search-hidden { display: none !important; }

@media (max-width: 576px) {
    .rc-name   { font-size: .95rem; }
    .rc-avatar { width: 38px; height: 38px; font-size: 13px; }
    .search-btn { padding: 6px 12px; font-size: .78rem; }
}