/* =========================
   OVERLAY
   ========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    display: none;
}

/* =========================
   MODAL CENTRAL
   ========================= */

.modal-central {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 860px;
    max-width: 95vw;
    max-height: 85vh;
    background: rgba(5, 14, 24, 0.97);
    border: 1px solid rgba(54, 181, 229, 0.4);
    border-radius: 20px;
    box-shadow:
        0 0 40px rgba(54, 181, 229, 0.2),
        0 0 120px rgba(54, 181, 229, 0.08);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-central.hidden {
    display: none;
}

.modal-central.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* =========================
   MODAL HEADER
   ========================= */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(54, 181, 229, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #36B5E5;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.modal-icon {
    width: 28px;
    height: 28px;
    filter: invert(1) sepia(1) saturate(3) hue-rotate(175deg);
}

.modal-close {
    background: transparent;
    border: 1px solid rgba(54, 181, 229, 0.3);
    color: #36B5E5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(54, 181, 229, 0.15);
    border-color: #36B5E5;
}

/* =========================
   TABS
   ========================= */

.modal-tabs {
    display: flex;
    gap: 4px;
    padding: 14px 28px 0;
    border-bottom: 1px solid rgba(54, 181, 229, 0.12);
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.45);
    padding: 8px 18px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 0.5px;
    margin-bottom: -1px;
}

.tab-btn:hover { color: rgba(54, 181, 229, 0.8); }
.tab-btn.active {
    color: #36B5E5;
    border-bottom-color: #36B5E5;
}

/* =========================
   MODAL BODY
   ========================= */

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(54, 181, 229, 0.3);
    border-radius: 10px;
}

.tab-panel { display: none; }
.tab-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   STATS GRID
   ========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(54, 181, 229, 0.06);
    border: 1px solid rgba(54, 181, 229, 0.18);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
}

.stat-card.verde {
    border-color: rgba(0, 220, 130, 0.3);
    background: rgba(0, 220, 130, 0.06);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #36B5E5;
}

.stat-card.verde .stat-value {
    color: #00dc82;
    font-size: 16px;
}

/* =========================
   CHART PLACEHOLDER
   ========================= */

.chart-placeholder {
    height: 200px;
    border: 1px dashed rgba(54, 181, 229, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* =========================
   DATA GRID
   ========================= */

.data-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(54, 181, 229, 0.1);
    border-radius: 10px;
    transition: 0.2s;
}

.data-row:hover {
    background: rgba(54, 181, 229, 0.06);
    border-color: rgba(54, 181, 229, 0.25);
}

/* =========================
   EMPTY STATE
   ========================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.3);
    gap: 8px;
}

.empty-state p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state span { font-size: 13px; }

/* =========================
   UPLOAD ZONE
   ========================= */

.upload-zone {
    border: 2px dashed rgba(54, 181, 229, 0.3);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: 0.3s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: rgba(54, 181, 229, 0.6);
    background: rgba(54, 181, 229, 0.04);
}

.upload-icon { font-size: 48px; margin-bottom: 8px; }
.upload-zone p { font-size: 16px; color: rgba(255, 255, 255, 0.7); }
.upload-zone span { font-size: 12px; color: rgba(255, 255, 255, 0.35); }

/* =========================
   ALYA PANEL
   ========================= */

.alya-panel { display: flex; flex-direction: column; gap: 14px; }

.alya-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    line-height: 1.6;
}

.alya-select,
.alya-input,
.alya-input-line {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(54, 181, 229, 0.25);
    color: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.alya-input { resize: vertical; }
.alya-input-line { width: 100%; }

.alya-select:focus,
.alya-input:focus,
.alya-input-line:focus {
    border-color: #36B5E5;
    box-shadow: 0 0 12px rgba(54, 181, 229, 0.2);
}

.alya-resultado {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(54, 181, 229, 0.12);
    border-radius: 10px;
    padding: 16px;
    min-height: 100px;
    font-size: 14px;
    line-height: 1.7;
    color: #d8ecff;
}

.muted {
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

/* =========================
   DATA TABLE
   ========================= */

.data-table-wrap { overflow-x: auto; }

/* =========================
   DOCUMENTOS — ESTILOS
   ========================= */

.doc-seccion {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(54, 181, 229, 0.1);
}

.doc-seccion:last-of-type { border-bottom: none; }

.doc-seccion-titulo {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #36B5E5;
    margin-bottom: 10px;
}

.doc-niveles { display: flex; flex-direction: column; gap: 10px; }

.doc-nivel {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 14px;
    background: rgba(54, 181, 229, 0.05);
    border: 1px solid rgba(54, 181, 229, 0.12);
    border-radius: 10px;
}

.doc-nivel-icon { font-size: 1.2rem; margin-top: 2px; }

.doc-nivel strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 4px;
}

.doc-nivel p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

.doc-enlaces { display: flex; flex-direction: column; gap: 8px; }

.doc-enlace {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(54, 181, 229, 0.12);
    border-radius: 10px;
    text-decoration: none;
    color: #ddd;
    transition: border-color 0.2s, background 0.2s;
}

.doc-enlace:hover {
    border-color: rgba(54, 181, 229, 0.35);
    background: rgba(54, 181, 229, 0.06);
}

.doc-enlace-icon { font-size: 1.2rem; width: 26px; text-align: center; }

.doc-enlace div { flex: 1; }

.doc-enlace strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
}

.doc-enlace span {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
}

.doc-enlace-arrow {
    color: #36B5E5;
    font-size: 1.1rem;
}

/* =========================
   INFORME DE SEGUIMIENTO
   ========================= */

.informe-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.informe-titulo-lista {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 10px;
}

.informe-fila {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.88rem;
}

.informe-pos {
    color: rgba(255,255,255,0.3);
    width: 22px;
    text-align: center;
    font-size: 0.8rem;
}

.informe-dominio { flex: 1; color: #ddd; }

.informe-total {
    color: #36B5E5;
    font-size: 0.8rem;
    white-space: nowrap;
}

.informe-actualizado {
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.2);
    margin-top: 18px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {
    .modal-central {
        width: 95vw;
        max-height: 90vh;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .informe-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .modal-tabs { overflow-x: auto; padding-bottom: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .modal-header { padding: 16px 18px; }
}