/*
 * admin-layout.css
 * Refinamientos visuales solo para las páginas de panel de admin y usuario.
 * Se aplica sobre style.css — no modifica las páginas públicas.
 *
 * Objetivos:
 *   - Romper el patrón de "tarjetas apiladas idénticas"
 *   - Jerarquía de contenido y espaciado natural
 *   - Agrupación de paneles adaptada al sidebar
 *   - Bordes de panel más ligeros, profundidad/peso variado entre secciones
 */

/* ── Contenedor de la app para páginas internas ──────────────────────────────────────── */
.internal-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 64px;
}
body.has-top-back .internal-shell {
    padding-top: 88px;
}

/* ── Diseño de página: sidebar + contenido principal ──────────────────────────── */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto;
    gap: 0 24px;
    align-items: start;
}

/* El sidebar se mantiene fijo al hacer scroll */
.dashboard-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Barra de encabezado del admin ─────────────────────────────────────────────────── */
.admin-header {
    padding: 0 0 20px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.admin-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 4px 0 0;
    color: var(--text);
}

/* ── Barra de estadísticas — en línea, no tarjetas en cuadrícula ──────────────────────────── */
.stat-strip {
    display: flex;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 28px;
}

.stat-strip .stat-item {
    flex: 1;
    padding: 16px 20px;
    border-right: 1px solid var(--line);
    min-width: 0;
}
.stat-strip .stat-item:last-child {
    border-right: none;
}

.stat-strip .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    display: block;
}

.stat-strip .stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    display: block;
}

/* ── Secciones: eliminar tarjeta de panel pesada, usar divisores ───────────── */
.content-section {
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}

.content-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.section-header .eyebrow {
    color: var(--primary);
    margin-bottom: 2px;
}

.section-header .result-note {
    margin: 0;
    font-size: 0.82rem;
}

/* ── Área de carga: más ligera, aspecto en línea ──────────────────────────────────── */
.upload-zone {
    background: #f8fafc;
    border: 1.5px dashed rgba(13,105,158,0.3);
    border-radius: 10px;
    padding: 20px 24px;
}

.upload-zone .file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ── Campos de formulario en secciones: más compactos, menos relleno ─────────────────── */
.content-section .field input,
.content-section .field select,
.content-section .field textarea {
    padding: 10px 13px;
    border-radius: 8px;
    border: 1px solid rgba(13,105,158,0.22);
    background: #fff;
}

.content-section .field input:focus,
.content-section .field select:focus,
.content-section .field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,105,158,0.1);
}

/* ── Filtros: fila compacta en línea ────────────────────────────────────────── */
.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 16px;
}

.filter-row .field {
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}

.filter-row .field span {
    font-size: 0.75rem;
}

/* ── Tablas: sin bordes, limpias ──────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
    background: none;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--line);
    transition: background 0.12s;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(13,105,158,0.04);
}

.data-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

/* ── Botones de acción: más pequeños, en línea ────────────────────────────────────── */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--primary);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.action-btn:hover {
    background: rgba(13,105,158,0.07);
    border-color: var(--primary);
}

.action-btn.danger {
    color: var(--danger);
}

.action-btn.danger:hover {
    background: rgba(198,63,63,0.06);
    border-color: var(--danger);
}

/* ── Tarjetas de registro / solicitud: estilo lista en vez de cuadrícula ─────────── */
.request-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.request-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.request-item:last-child {
    border-bottom: none;
}

.request-item .request-name {
    font-weight: 600;
    font-size: 0.92rem;
    min-width: 0;
    flex: 1;
}

.request-item .request-meta {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.request-item .request-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Elementos de navegación del sidebar ───────────────────────────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(13,105,158,0.1);
    color: var(--primary);
}

.nav-item .nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 14px 14px 6px;
}

/* ── Sobreescritura del panel: reducir peso visual en paneles internos ───────────────── */
.admin-view .panel,
.user-view .panel {
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(18,39,34,0.07);
    border: 1px solid rgba(13,105,158,0.12);
    backdrop-filter: none;
    background: #fff;
}

.admin-view .hero-card,
.user-view .hero-card {
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(18,39,34,0.07);
    border: 1px solid rgba(13,105,158,0.12);
    backdrop-filter: none;
    background: linear-gradient(135deg, #f0f6fb 0%, #e8f3f9 100%);
    padding: 20px 24px;
}

/* stat-box de hero-card en contexto admin/usuario */
.admin-view .stats-grid,
.user-view .stats-grid {
    gap: 10px;
}

.admin-view .stat-box,
.user-view .stat-box {
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(13,105,158,0.1);
    background: rgba(255,255,255,0.9);
    backdrop-filter: none;
}

/* Reducir ligeramente el padding del panel */
.admin-view .panel,
.user-view .panel {
    padding: 20px 22px;
}

/* panel-head: línea divisora simple en vez de un bloque de encabezado completo */
.admin-view .panel-head,
.user-view .panel-head {
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.admin-view .panel-head h3,
.user-view .panel-head h3 {
    font-size: 1rem;
    font-weight: 700;
}

/* Sección de carga dentro del panel: más ligera */
.admin-view .upload-section {
    background: #f8fafc;
    border: 1.5px dashed rgba(13,105,158,0.25);
    border-radius: 8px;
    margin-top: 0;
    padding: 20px;
}

/* Sub-etiquetas de sección */
.admin-view .panel > p[style*="eyebrow"],
.section-sublabel {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin: 16px 0 10px;
}

/* ── Espaciado más compacto entre secciones de admin-view ────────────────────────── */
.admin-view,
.user-view {
    gap: 16px;
}

/* ── Etiqueta de sección de cuadrícula de formulario en línea ─────────────────────────────────────── */
.form-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    padding: 14px 0 8px;
    border-top: 1px solid var(--line);
    margin-top: 6px;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        border-bottom: 1px solid var(--line);
        padding-bottom: 12px;
        margin-bottom: 8px;
    }
    .nav-section-label { display: none; }
    .stat-strip {
        flex-wrap: wrap;
    }
    .stat-strip .stat-item {
        flex: 1 1 45%;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .stat-strip .stat-item:last-child {
        border-bottom: none;
    }
    .filter-row .field {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .stat-strip .stat-item {
        flex: 1 1 100%;
    }
    .request-item {
        flex-wrap: wrap;
    }
    .admin-view .panel,
    .user-view .panel {
        padding: 16px;
    }
}
