/**
 * admin-dashboard.css
 * Estilos exclusivos del Dashboard de SecureDocs
 */

.gestdoc-admin-wrapper .gestdoc-btn {
    transition: background 0.3s ease;
}

.gestdoc-admin-wrapper .gestdoc-btn:hover {
    background: #135e96 !important;
}

/* ============================================= */
/* TARJETAS DE ESTADÍSTICAS                      */
/* ============================================= */

.gestdoc-admin-wrapper .gestdoc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.gestdoc-admin-wrapper .gestdoc-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 10px solid #c3c4c7;
    border-radius: 10px;
    padding: 16px 18px;
    box-sizing: border-box;
}

.gestdoc-admin-wrapper .gestdoc-stat-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.gestdoc-admin-wrapper .gestdoc-stat-text {
    margin-top: 10px;
}

.gestdoc-admin-wrapper .gestdoc-stat-num {
    font-size: 26px;
    font-weight: 600;
    color: #1d2327;
}

.gestdoc-admin-wrapper .gestdoc-stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.gestdoc-admin-wrapper .gestdoc-stat-bar {
    height: 4px;
    background: #f0f0f1;
    border-radius: 2px;
    overflow: hidden;
}

.gestdoc-admin-wrapper .gestdoc-stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.gestdoc-admin-wrapper .gestdoc-stat-blue   { border-left-color: #2271b1; }
.gestdoc-admin-wrapper .gestdoc-stat-blue   .gestdoc-stat-icon { color: #2271b1; }
.gestdoc-admin-wrapper .gestdoc-stat-green  { border-left-color: #3b6d11; }
.gestdoc-admin-wrapper .gestdoc-stat-green  .gestdoc-stat-icon { color: #3b6d11; }
.gestdoc-admin-wrapper .gestdoc-stat-amber  { border-left-color: #b7791f; }
.gestdoc-admin-wrapper .gestdoc-stat-amber  .gestdoc-stat-icon { color: #b7791f; }
.gestdoc-admin-wrapper .gestdoc-stat-pink   { border-left-color: #a53860; }
.gestdoc-admin-wrapper .gestdoc-stat-pink   .gestdoc-stat-icon { color: #a53860; }
.gestdoc-admin-wrapper .gestdoc-stat-purple { border-left-color: #534ab7; }
.gestdoc-admin-wrapper .gestdoc-stat-purple .gestdoc-stat-icon { color: #534ab7; }

/* ============================================= */
/* SECURITY LOG BOX                              */
/* ============================================= */

.gestdoc-admin-wrapper .gestdoc-security-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}

.gestdoc-admin-wrapper .gestdoc-security-header {
    width: 100%;
    margin-bottom: 20px;
}

.gestdoc-admin-wrapper .gestdoc-security-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.gestdoc-admin-wrapper .gestdoc-security-text {
    min-width: 0;
    flex: 1;
}

.gestdoc-admin-wrapper .gestdoc-security-text h4 {
    margin: 0 0 8px 0;
}

.gestdoc-admin-wrapper .gestdoc-security-text p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    max-width: 900px;
}

.gestdoc-admin-wrapper .gestdoc-security-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 0;
    min-width: 220px;
}

.gestdoc-admin-wrapper .gestdoc-security-total {
    background: #f3f4f6;
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.gestdoc-admin-wrapper .gestdoc-btn-clear-logs {
    background: transparent;
    color: #555;
    border: 1px solid #e0e0e0;
    height: 34px;
    padding: 0 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.gestdoc-admin-wrapper .gestdoc-btn-clear-logs:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.gestdoc-admin-wrapper .gestdoc-security-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 10px;
}

.gestdoc-admin-wrapper .gestdoc-security-table {
    width: 100%;
    border-collapse: collapse;
}

.gestdoc-admin-wrapper .gestdoc-security-table thead th {
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 20;
}

.gestdoc-security-table th,
.gestdoc-admin-wrapper .gestdoc-security-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 13px;
}

/* Anchos de columnas */
.gestdoc-security-table th:nth-child(1),
.gestdoc-security-table td:nth-child(1) { width: 140px; }

.gestdoc-security-table th:nth-child(2),
.gestdoc-security-table td:nth-child(2) { width: 200px; }

.gestdoc-security-table th:nth-child(3),
.gestdoc-security-table td:nth-child(3) { width: 180px; }

.gestdoc-security-table th:nth-child(4),
.gestdoc-security-table td:nth-child(4) { width: auto; }

/* ============================================= */
/* BADGES                                        */
/* ============================================= */

.gestdoc-admin-wrapper .gestdoc-badge-danger {
    background: #fee2e2;
    color: #991b1b;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.gestdoc-admin-wrapper .gestdoc-badge-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.gestdoc-admin-wrapper .gestdoc-badge-info {
    background: #d1e7dd;
    color: #0f5132;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.gestdoc-admin-wrapper .gestdoc-security-empty {
    background: #ecfdf5;
    color: #065f46;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

/* ============================================= */
/* CLEANUP BOX                                   */
/* ============================================= */

.gestdoc-admin-wrapper .gestdoc-cleanup-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}

.gestdoc-admin-wrapper .gestdoc-cleanup-text h4 {
    margin: 0 0 8px 0;
}

.gestdoc-admin-wrapper .gestdoc-cleanup-text p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

.gestdoc-cleanup-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.gestdoc-cleanup-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.gestdoc-cleanup-scroll::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
.gestdoc-cleanup-scroll::-webkit-scrollbar-thumb:hover { background: #555; }

.gestdoc-admin-wrapper .gestdoc-cleanup-btn {
    transition: background 0.2s;
}

.gestdoc-admin-wrapper .gestdoc-cleanup-btn:hover {
    background: #b91c1c !important;
}

/* ============================================= */
/* RESPONSIVE                                    */
/* ============================================= */

@media (max-width: 900px) {
    .gestdoc-admin-wrapper .gestdoc-security-top {
        flex-direction: column;
        align-items: stretch;
    }
.gestdoc-admin-wrapper .gestdoc-security-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .gestdoc-cleanup-table th,
.gestdoc-admin-wrapper .gestdoc-cleanup-table td {
        font-size: 12px;
        padding: 8px;
    }

    /* Tarjetas de estadísticas (documentos, clientes, descargas...) en móvil:
       rejilla de 2 columnas y cada tarjeta en horizontal (icono a la
       izquierda, número+etiqueta a la derecha) en vez de apiladas a toda
       pantalla — así las 5 caben en una sola pantalla vertical. */
    .gestdoc-admin-wrapper .gestdoc-dashboard .gestdoc-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .gestdoc-admin-wrapper .gestdoc-dashboard .gestdoc-stat-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    .gestdoc-admin-wrapper .gestdoc-dashboard .gestdoc-stat-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .gestdoc-admin-wrapper .gestdoc-dashboard .gestdoc-stat-text {
        margin-top: 0;
        min-width: 0;
    }

    .gestdoc-admin-wrapper .gestdoc-dashboard .gestdoc-stat-num {
        font-size: 18px;
    }

    .gestdoc-admin-wrapper .gestdoc-dashboard .gestdoc-stat-label {
        font-size: 11px;
        margin-top: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   MANTENIMIENTO A DOS COLUMNAS
   Las dos cajas de limpieza son tareas hermanas;
   apiladas ocupaban una pantalla entera.
============================================ */

.gestdoc-admin-wrapper .gestdoc-cleanup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch; /* las dos cajas igualan altura con la más alta */
    margin-top: 30px;
}

.gestdoc-admin-wrapper .gestdoc-cleanup-grid > .gestdoc-cleanup-box {
    min-width: 0;
    /* La igualación de altura no depende solo de align-items: con height 100%
       la caja llena la fila aunque algún estilo del tema pise la alineación. */
    height: 100%;
    box-sizing: border-box;
    /* .gestdoc-cleanup-box ya trae margin-top: 30px; dentro de la rejilla el
       espaciado lo pone el propio contenedor, así que aquí sobra. */
    margin-top: 0;
}

@media (max-width: 1000px) {
    .gestdoc-admin-wrapper .gestdoc-cleanup-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   GUÍA DE PESTAÑAS
============================================ */

.gestdoc-admin-wrapper .gestdoc-guia-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.gestdoc-admin-wrapper .gestdoc-guia-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gestdoc-admin-wrapper .gestdoc-guia-item:hover {
    border-color: #c5d9ec;
    box-shadow: 0 1px 4px rgba(34, 113, 177, 0.12);
}

.gestdoc-admin-wrapper .gestdoc-guia-icono {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1.3;
}

.gestdoc-admin-wrapper .gestdoc-guia-item strong {
    display: block;
    margin-bottom: 3px;
    color: #2271b1;
    font-size: 14px;
}

.gestdoc-admin-wrapper .gestdoc-guia-item span {
    color: #50575e;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .gestdoc-admin-wrapper .gestdoc-guia-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .gestdoc-admin-wrapper .gestdoc-guia-grid {
        grid-template-columns: 1fr;
    }
}