﻿.monitor-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}


/* =========================
   PANEL DE UNIDADES
========================= */

.units-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 320px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(12px);
}


/* =========================
   HEADER
========================= */

.units-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

    .units-panel__header h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: #111827;
    }

    .units-panel__header span {
        display: block;
        margin-top: 4px;
        font-size: 12px;
        color: #6b7280;
    }

.units-panel__toggle {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .units-panel__toggle:hover {
        background: #f3f4f6;
    }


/* =========================
   ESTADO DE CONEXIÓN
========================= */

.connection-status {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease, color 0.2s ease;
}

    .connection-status.online {
        background: #ecfdf5;
        color: #166534;
    }

    .connection-status.offline {
        background: #fef2f2;
        color: #991b1b;
    }


/* =========================
   ACCIONES
========================= */

.units-panel__actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

    .units-panel__actions button {
        flex: 1;
        padding: 8px 10px;
        border: none;
        border-radius: 8px;
        background: #f3f4f6;
        color: #374151;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.1s ease;
    }

        .units-panel__actions button:hover {
            background: #e5e7eb;
        }

        .units-panel__actions button:active {
            transform: scale(0.98);
        }


/* =========================
   LISTA DE UNIDADES
========================= */

.units-panel__list {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.unit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .unit-item:hover {
        background: #f3f4f6;
    }

.unit-checkbox {
    display: none;
}

.unit-item__indicator {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid #9ca3af;
    border-radius: 5px;
    background: white;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.unit-checkbox:checked + .unit-item__indicator {
    background: #111827;
    border-color: #111827;
}

    .unit-checkbox:checked + .unit-item__indicator::after {
        content: "✓";
        position: absolute;
        top: -2px;
        left: 3px;
        color: white;
        font-size: 12px;
        font-weight: 700;
    }

.unit-item__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .unit-item__info strong {
        font-size: 14px;
        font-weight: 600;
        color: #111827;
    }

    .unit-item__info span {
        margin-top: 2px;
        font-size: 12px;
        color: #6b7280;
    }


/* =========================
   FOOTER
========================= */

.units-panel__footer {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
}

.btn-apply {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #111827;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

    .btn-apply:hover {
        opacity: 0.9;
    }

    .btn-apply:active {
        transform: scale(0.98);
    }


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .units-panel {
        top: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-height: 45vh;
    }
}
