/* ========================= */
/* ?? BASE */
/* ========================= */

body {
    background: 
        linear-gradient(rgba(11,18,32,0.55), rgba(11,18,32,0.65))
        url('/dashboard/assets/bg.jpg');

    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    color: #e5e7eb;
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
}

/* ========================= */
/* ?? CARDS */
/* ========================= */

.card {
    background: #111827;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    border: 1px solid #1f2937;
    width: 100%;
    box-sizing: border-box;
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 10px;
    color: #e2e8f0;
}

/* ========================= */
/* ?? GRID (EQUILIBRADO) */
/* ========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 4.5fr 2.5fr;
    gap: 12px;
    padding: 10px;
}

.users-card { grid-column: 1; }
.heard-card { grid-column: 2; }
.peers-card { grid-column: 3; }
.map-card   { grid-column: 1 / 4; }

/* ========================= */
/* ?? TABLAS */
/* ========================= */

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th {
    background: #1f2937;
    padding: 8px;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
}

td {
    padding: 8px;
    border-bottom: 1px solid #1f2937;
    font-size: 12px;
}

tr:hover {
    background: #1e3a8a;
}

/* ========================= */
/* ? LAST HEARD */
/* ========================= */

.new-heard {
    animation: pulse 1.2s ease-out;
}

@keyframes pulse {
    0% {
        background: rgba(0,255,120,0.5);
        transform: scale(1.01);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

.live {
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 8px #00ff88;
}

/* columnas last heard */
.heard-card td:nth-child(1) { width: 25%; font-weight: bold; }
.heard-card td:nth-child(2) { width: 20%; }
.heard-card td:nth-child(3) { width: 30%; }
.heard-card td:nth-child(4) { width: 25%; }

/* ========================= */
/* ?? USERS + PEERS FIX */
/* ========================= */

.users-card table,
.peers-card table {
    table-layout: fixed;
    width: 100%;
}

/* columnas USERS */
.users-card td:nth-child(1) { width: 40%; }
.users-card td:nth-child(2) { width: 25%; }
.users-card td:nth-child(3) { width: 20%; }
.users-card td:nth-child(4) { width: 15%; }

/* columnas PEERS */
.peers-card td:nth-child(1) { width: 45%; }
.peers-card td:nth-child(2) { width: 25%; }
.peers-card td:nth-child(3) { width: 30%; }

/* texto limpio */
.users-card td,
.peers-card td,
.users-card th,
.peers-card th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* centrado */
.users-card td:nth-child(3),
.users-card td:nth-child(4),
.peers-card td:nth-child(2),
.peers-card td:nth-child(3) {
    text-align: center;
}

/* ========================= */
/* ?? SCROLL USUARIOS */
/* ========================= */

.users-container {
    max-height: 600px;
    overflow-y: auto;
}

.users-container::-webkit-scrollbar {
    width: 8px;
}

.users-container::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 10px;
}

.users-container::-webkit-scrollbar-track {
    background: #020617;
}

/* ========================= */
/* ?? TYPES */
/* ========================= */

.type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.type svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.type.handheld { color: #22c55e; }
.type.base     { color: #e5e7eb; }
.type.mobile   { color: #38bdf8; }
.type.hotspot  { color: #f59e0b; }
.type.data     { color: #eab308; }
.type.app      { color: #a855f7; }

.type.handheld svg {
    filter: drop-shadow(0 0 5px #22c55e);
}

/* ========================= */
/* ?? PROTOCOL */
/* ========================= */

.protocol {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.protocol svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
}

.protocol-DExtra { color: #38bdf8; }
.protocol-DCS    { color: #22c55e; }
.protocol-XLX    { color: #f59e0b; }
.protocol-REF    { color: #a855f7; }

/* ========================= */
/* ??? MAP */
/* ========================= */

#map {
    border-radius: 10px;
}

/* ========================= */
/* ?? FOOTER */
/* ========================= */

.footer {
    background: #020617;
    color: #94a3b8;
    padding: 15px;
    border-top: 1px solid #1f2937;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 13px;
}

.footer strong {
    color: #e2e8f0;
}

/* ========================= */
/* ??? FULL WIDTH LAYOUT */
/* ========================= */

body {
    margin: 0;
    padding: 0;
}

/* contenedor principal (MUY IMPORTANTE) */
.dashboard-grid {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 20px; /* ajusta si quieres más margen */
    box-sizing: border-box;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 20px;
}

/* ========================= */
/* ?? RESPONSIVE MOBILE */
/* ========================= */

@media (max-width: 900px) {

    .dashboard-grid {
        grid-template-columns: 1fr; /* todo en columna */
        grid-template-rows: auto;
    }

    .users-card,
    .heard-card,
    .peers-card,
    .map-card {
        grid-column: 1; /* todos ocupan ancho completo */
    }

    /* orden lógico en móvil */
    .map-card   { order: 1; }
    .heard-card { order: 2; }
    .users-card { order: 3; }
    .peers-card { order: 4; }

    /* tablas más compactas */
    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px;
    }

    /* usuarios scroll más alto en móvil */
    .users-container {
        max-height: 250px;
    }

    /* títulos más pequeños */
    .card h2 {
        font-size: 14px;
    }
}





/* ========================= */
/* ?? FORCE FULL WIDTH */
/* ========================= */

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* rompe cualquier limitación del layout padre */
body > * {
    max-width: 100% !important;
    width: 100% !important;
}

/* si existe wrapper típico */
.container,
.wrapper,
.content,
main {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 20px !important;
}

/* asegura grid full */
.dashboard-grid {
    width: 100%;
    max-width: 100%;
}



.card {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(6px);
}



.logo-top-right {
    position: fixed !important;
    top: 12px !important;
    right: 20px !important;

    height: 55px !important;
    width: auto !important;

    z-index: 99999 !important;

    pointer-events: auto;

    /* CLAVE */
    transform: none !important;
}


/* ========================= */
/* ?? PROTOCOL COLORS */
/* ========================= */

.protocol-DPLUS {
    color: #a855f7; /* violeta */
}

.protocol-DPLUS svg {
    filter: drop-shadow(0 0 6px #a855f7);
}

.protocol-XLX {
    color: #f59e0b;
}

.protocol-DCS {
    color: #22c55e;
}

/* ========================= */
/* ?? SCROLL TODAS LAS TABLAS */
/* ========================= */

.table-container {
    max-height: 600px;
    overflow-y: auto;
}

/* scrollbar bonito */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #020617;
}


.type.hotspot.live {
    color: #ff3b3b;
    font-size: 16px;
    text-shadow: 0 0 8px #ff3b3b;
}



.live svg {
    animation: firePulse 0.8s infinite alternate;
}

@keyframes firePulse {
    from { transform: scale(0.9); opacity: 0.7; }
    to { transform: scale(1.2); opacity: 1; }
}

