/* ══════════════════════════════════════════════════
   Riegos - Diseño ERP Funcional
   ══════════════════════════════════════════════════ */

/* Página */
.erp-page { background: #f4f6f9; min-height: calc(100vh - 100px); padding: 32px 24px; }
.erp-page__container { max-width: 1200px; margin: 0 auto; }

/* Header página */
.erp-page-header { text-align: center; margin-bottom: 32px; }
.erp-page-header__title {
    font-size: 1.75rem; font-weight: 700; color: #1B365D;
    margin: 0 0 8px; display: flex; align-items: center;
    justify-content: center; gap: 12px;
}
.erp-page-header__title i { font-size: 1.5rem; color: #3273dc; }
.erp-page-header__subtitle {
    font-size: 0.9375rem; color: #6c757d; margin: 0;
}

/* Sección */
.erp-section {
    background: #fff; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden; margin-bottom: 24px;
}
.erp-section__header {
    background: #34495e; color: #fff;
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.erp-section__title {
    font-size: 0.85rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.erp-section__body { padding: 0; }
.erp-section__body--padded { padding: 20px; }

/* Tabla */
.table-wrapper { overflow-x: auto; }
.table-erp { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Header de tabla más elegante */
.table-erp thead th {
    background: linear-gradient(180deg, #1B365D 0%, #152a4a 100%);
    color: #ffffff;
    font-size: 0.75rem; 
    font-weight: 600;
    text-transform: uppercase; 
    letter-spacing: 1.2px;
    padding: 16px 18px;
    text-align: center; 
    white-space: nowrap;
    border: none;
    position: relative;
    box-shadow: 0 2px 4px rgba(27, 54, 93, 0.15);
}

/* Separadores entre columnas del header */
.table-erp thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

/* Filas del body con zebra striping elegante */
.table-erp tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

.table-erp tbody tr:nth-child(even) { 
    background: #f8fafb; 
}

.table-erp tbody tr:hover { 
    background: #eef5ff;
    box-shadow: 0 2px 8px rgba(27, 54, 93, 0.08);
    transform: translateY(-1px);
}

/* Celdas del body más espaciadas y elegantes */
.table-erp tbody td {
    padding: 14px 18px;
    text-align: center;
    border-bottom: 1px solid #e5e9ef;
    border-top: none; 
    border-left: none; 
    border-right: none;
    vertical-align: middle;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.2px;
}

/* Primera columna con énfasis */
.table-erp tbody td:first-child {
    font-weight: 600;
    color: #1B365D;
}

/* Última fila sin borde inferior */
.table-erp tbody tr:last-child td { 
    border-bottom: none; 
}

/* Panel estado */
.erp-status-panel {
    border-left: 4px solid; border-radius: 0 6px 6px 0;
    padding: 16px 20px; margin-bottom: 24px;
    display: flex; align-items: flex-start; gap: 12px;
}
.erp-status-panel--info { background: #eff6ff; border-color: #3273dc; }
.erp-status-panel--warning { background: #fff8e1; border-color: #f59e0b; }
.erp-status-panel__icon { font-size: 1.2rem; margin-top: 1px; flex-shrink: 0; }
.erp-status-panel--info .erp-status-panel__icon { color: #3273dc; }
.erp-status-panel--warning .erp-status-panel__icon { color: #f59e0b; }
.erp-status-panel__title {
    font-size: 0.95rem; font-weight: 700; color: #2c3e50; margin: 0 0 4px;
}
.erp-status-panel__text {
    font-size: 0.875rem; color: #6c757d; margin: 0; line-height: 1.5;
}

/* Badges */
.erp-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 4px;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.erp-badge--gray { background: #f1f5f9; color: #475569; }

/* Responsive - Diseño Móvil Profesional */
@media (max-width: 768px) {
    .erp-page { padding: 20px 16px; }
    .erp-page-header__title { font-size: 1.4rem; }
    .erp-section__header { 
        flex-direction: column; 
        align-items: flex-start;
    }
    
    /* Tabla responsive: cards verticales elegantes */
    .table-wrapper { overflow-x: visible; }
    
    .table-erp thead {
        display: none;
    }
    
    .table-erp,
    .table-erp tbody,
    .table-erp tbody tr,
    .table-erp tbody td {
        display: block;
    }
    
    /* Card móvil con estructura elegante */
    .table-erp tbody tr {
        background: #ffffff;
        margin-bottom: 20px;
        padding: 0;
        border: 1px solid #d6dce5;
        border-radius: 10px;
        box-shadow: 
            0 3px 10px rgba(27, 54, 93, 0.06),
            0 1px 4px rgba(0, 0, 0, 0.03);
        overflow: hidden;
    }
    
    .table-erp tbody tr:nth-child(even) {
        background: #ffffff;
    }
    
    .table-erp tbody tr:last-child {
        margin-bottom: 0;
    }
    
    /* Primera celda: Encabezado destacado del card */
    .table-erp tbody td:first-child {
        background: #f8fafb;
        border-bottom: 2px solid #e0e5ec;
        padding: 14px 16px !important;
        margin: 0 !important;
        text-align: center !important;
        font-size: 0.9375rem;
        font-weight: 600;
        color: #1B365D;
        letter-spacing: 0.3px;
    }
    
    .table-erp tbody td:first-child::before {
        display: none;
    }
    
    /* Resto de celdas: Estructura de filas con labels */
    .table-erp tbody td {
        padding: 14px 16px;
        border: none !important;
        position: relative;
        min-height: auto;
        font-size: 0.9375rem;
        color: #1e293b;
        font-weight: 600;
        line-height: 1.6;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right !important;
    }
    
    /* Fondo alternado para mejor lectura */
    .table-erp tbody td:nth-child(even):not(:first-child) {
        background: #f8fafb;
    }
    
    .table-erp tbody td:last-child {
        padding-bottom: 14px;
    }
    
    /* Labels como elementos estructurales */
    .table-erp tbody td::before {
        content: attr(data-label);
        position: static;
        font-weight: 600;
        font-size: 0.75rem;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        flex-shrink: 0;
        width: auto;
    }
    
    /* Líneas divisorias sutiles entre filas */
    .table-erp tbody td:not(:first-child):not(:last-child) {
        border-bottom: 1px solid #e8ecf0 !important;
    }
    
    /* Status panel móvil */
    .erp-status-panel {
        margin: 16px 0;
        border-radius: 12px;
        border-left-width: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
}
