/* --- LAYOUT GENERAL --- */
.dt-dashboard-wrapper {
    display: flex; gap: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    align-items: flex-start; margin: 20px 0;
}
.d-spin { animation: spin 1s infinite linear; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- SIDEBAR --- */
.dt-sidebar {
    width: 260px; flex-shrink: 0; background: #fff;
    border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden;
}
.dt-sidebar-title {
    padding: 15px 20px; background: #002753; color: #fff;
    font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.dt-tabs-list { display: flex; flex-direction: column; }
.dt-tab-item {
    background: #fff; border: none; border-bottom: 1px solid #eee;
    text-align: left; padding: 15px 20px; cursor: pointer;
    font-size: 15px; color: #444; transition: all 0.2s;
    display: flex; align-items: center; gap: 10px;
}
.dt-tab-item:hover { background-color: #f5f9ff; color: #002753; padding-left: 25px; }
.dt-tab-item.active {
    background-color: #eef6ff; color: #002753; font-weight: 700; border-left: 4px solid #002753;
}
.dt-tab-item .dashicons { font-size: 16px; color: #aaa; }
.dt-tab-item.active .dashicons { color: #002753; }

/* --- CONTENIDO PRINCIPAL --- */
.dt-main-content-wrapper { flex-grow: 1; width: 100%; min-width: 0; }

/* --- FILTROS --- */
.dt-filters-bar {
    display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; align-items: center;
    background: #f8f9fa; padding: 15px; border-radius: 8px;
}
.dt-search-group { position: relative; flex-grow: 2; min-width: 200px; }
.dt-search-group .dashicons { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #999; }
.dt-search-group input {
    width: 100%; padding: 10px 10px 10px 35px; border: 1px solid #ddd; border-radius: 4px; outline: none;
}
.dt-date-group, .dt-filter-group { display: flex; gap: 10px; align-items: center; }
.dt-date-input { display: flex; flex-direction: column; font-size: 12px; color: #666; }
.dt-date-input input { padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
/* Estilo Select Año */
#dt-year-select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; min-width: 120px; }

/* --- GRILLAS DINÁMICAS (CONFIGURACIÓN DE TABLAS) --- */
.dt-table-header {
    background-color: #002753; color: white; padding: 12px 20px;
    font-weight: 600; font-size: 14px; border-radius: 8px 8px 0 0;
}
.dt-row {
    padding: 15px 20px; border-bottom: 1px solid #eee; align-items: center;
    font-size: 14px; background: #fff; transition: background 0.2s;
}
.dt-row:hover { background-color: #fbfbfb; }

/* --- CONFIGURACIONES DE COLUMNAS --- */
/* 1. Resoluciones (4 columnas: Fecha | Tipo | Desc | Doc) */
.dt-grid-4-cols {
    display: grid; grid-template-columns: 100px 140px 1fr 140px; gap: 15px;
}
/* 2. Memorias (3 columnas: Fecha | Nombre | Doc) */
.dt-grid-3-cols {
    display: grid; grid-template-columns: 110px 1fr 140px; gap: 15px;
}
/* 3. Doc Oficiales (2 columnas anchas: Nombre | Doc) */
.dt-grid-2-cols-wide {
    display: grid; grid-template-columns: 1fr 140px; gap: 15px;
}

.dt-col-titulo { font-weight: 500; color: #333; line-height: 1.4; }
.dt-col-fecha, .dt-col-sesion { color: #666; font-size: 13px; }

/* --- ARCHIVOS (DISEÑO ICONO GRANDE + TEXTO ABAJO) --- */
.dt-col-archivo { height: auto !important; overflow: visible !important; }
.dt-files-grid {
    display: flex; gap: 15px; justify-content: flex-start; flex-wrap: wrap;
}
.dt-btn-download {
    display: inline-flex; flex-direction: column; align-items: center; text-align: center;
    width: auto; height: auto; background: transparent; color: #002753;
    text-decoration: none; padding: 4px; border-radius: 4px; transition: all 0.2s;
}
.dt-btn-download:hover { background-color: #f0f0f0; transform: translateY(-2px); color: #d32f2f; }
.dt-btn-download .dashicons { font-size: 26px; width: 26px; height: 26px; line-height: 26px; margin-bottom: 4px; }
.dt-mobile-file-name {
    display: block; font-size: 10px; color: #555; line-height: 1.2;
    max-width: 65px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dt-mobile-label { display: none; } 

/* --- PAGINACIÓN --- */
.dt-pagination { margin-top: 20px; display: flex; justify-content: flex-end; gap: 5px; }
.dt-page-btn {
    width: 34px; height: 34px; border: 1px solid #ddd; background: #fff;
    cursor: pointer; border-radius: 4px; color: #002753; display: flex; align-items: center; justify-content: center;
}
.dt-page-btn.active { background-color: #002753; color: #fff; border-color: #002753; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 850px) {
    .dt-dashboard-wrapper { flex-direction: column; gap: 0; }
    .dt-sidebar { width: 100%; margin-bottom: 20px; }
    .dt-tabs-list { flex-direction: row; overflow-x: auto; }
    .dt-tab-item { white-space: nowrap; border-bottom: none; border-right: 1px solid #eee; }
    .dt-tab-item.active { border-left: none; border-bottom: 3px solid #002753; }
    
    .dt-filters-bar { padding: 10px; flex-direction: column; align-items: stretch; }
    .dt-search-group, .dt-filter-group, #dt-year-select { width: 100%; }
    .dt-date-input { width: 50%; }

    /* Forzar tabla a tarjetas en Móvil */
    .dt-table-header { display: none !important; } 
    .dt-grid-4-cols, .dt-grid-3-cols, .dt-grid-2-cols-wide {
        display: flex; flex-direction: column; gap: 5px;
        padding: 20px; margin-bottom: 15px; border: 1px solid #e0e0e0;
        border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    }
    
    .dt-col-titulo { order: 1; font-size: 1.1em; font-weight: 700; color: #002753; margin-bottom: 5px; }
    .dt-col-fecha { order: 2; background: #f4f4f4; padding: 4px 10px; border-radius: 4px; display: inline-block; align-self: flex-start; }
    .dt-col-sesion { order: 3; }
    
    .dt-col-archivo {
        order: 4; width: 100%; margin-top: 10px; border-top: 1px dashed #eee; padding-top: 10px;
    }
    .dt-files-grid { flex-direction: column; gap: 8px; }
    .dt-btn-download {
        width: 100%; flex-direction: row; justify-content: flex-start;
        padding: 8px 12px; background: #f8f9fa; border: 1px solid #eee; border-radius: 6px;
    }
    .dt-btn-download .dashicons { font-size: 18px; width: 18px; margin-bottom: 0; margin-right: 8px; color: #d32f2f; }
    .dt-mobile-file-name { font-size: 13px; max-width: none; color: #333; }
    .dt-mobile-label { display: inline-block; font-weight: bold; margin-right: 5px; color: #333; }
}