/* Frontend CSS - Inventario Integral v2 */
/* ========================================
   Aplicación de Inventario 100% Independiente
   Oculta completamente WordPress
   Mantiene diseño profesional azul
   ======================================== */

/* ========== OCULTAR TODO DE WORDPRESS ========== */
/* Headers y navegación */
.wp-block-navigation,
.wp-block-navigation__container,
nav.wp-block-navigation,
header.wp-block-template-part,
.site-header,
header nav,
.wp-block-navigation-link,
.wp-block-post-title,
.entry-title,
.site-title,
.site-description,
.wp-block-header,
header,
nav {
    display: none !important;
    visibility: hidden !important;
}

/* Footer de WordPress */
footer,
.site-footer,
.wp-block-template-part footer,
.wp-footer {
    display: none !important;
    visibility: hidden !important;
}

/* Admin bar */
#wpadminbar {
    display: none !important;
    visibility: hidden !important;
}

/* Comentarios */
.comments-area,
.wp-block-comments,
.comment-form {
    display: none !important;
    visibility: hidden !important;
}

/* Widgets */
.sidebar,
.widget-area,
aside.sidebar,
.wp-sidebar {
    display: none !important;
    visibility: hidden !important;
}

/* Breadcrumbs */
.breadcrumb,
.wp-block-breadcrumbs {
    display: none !important;
    visibility: hidden !important;
}

/* Post navigation */
.post-navigation,
.wp-block-post-navigation {
    display: none !important;
    visibility: hidden !important;
}

/* ========== RESETEO GLOBAL ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
    overflow-x: hidden !important;
}

body {
    height: 100vh;
    width: 100vw;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background: #f5f7fa !important;
    line-height: 1.6;
}

/* Forzar que el contenido ocupe toda la pantalla */
.entry-content,
.wp-site-blocks,
main,
article,
.wp-block-group,
.wp-block-post-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ========== ESTRUCTURA PRINCIPAL ========== */

/* Wrapper principal del inventario */
.inventario-frontend-wrapper {
    display: flex !important;
    min-height: 100vh !important;
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f7fa !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    z-index: 9999;
}

/* Barra lateral - Sidebar */
.inventario-sidebar {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    background: linear-gradient(180deg, #023e8a 0%, #03045e 100%) !important;
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
    z-index: 10000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.sidebar-logo svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.sidebar-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: white;
}

.sidebar-nav {
    flex: 1 !important;
    padding: 20px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 0;
}

.nav-item {
    display: flex !important;
    align-items: center !important;
    font-size: 12.5px !important;
    gap: 12px !important;
    padding: 12px 20px !important;
    color: rgba(255,255,255,0.7) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer;
    background: none !important;
    border: none;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05) !important;
    color: white !important;
    border-left-color: #00a8e8 !important;
}

.nav-item.active {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    border-left-color: #00a8e8 !important;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    color: white;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 12px;
    opacity: 0.7;
    color: white;
}

.btn-logout {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Contenido principal */
.inventario-main-content {
    margin-left: 180px !important;
    flex: 1 !important;
    padding: 20px !important;
    width: calc(100vw - 180px) !important;
    height: 100vh;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #f5f7fa !important;
    z-index: 100;
    position: relative;
}

/* ========== HEADER DE PÁGINA ========== */

.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 5px;
}

.page-header p {
    color: #6c757d;
    font-size: 14px;
}

/* ========== BARRA DE FILTROS ========== */

.filters-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #023e8a;
    box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.1);
}

.search-input::placeholder {
    color: #aaa;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #023e8a;
    box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.1);
}

.btn-primary {
    background: #023e8a;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    align-self: flex-end;
}

.btn-primary:hover {
    background: #03045e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(2, 62, 138, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #2d6a4f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #1b4332;
}

.btn-danger {
    background: #c0392b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #922b21;
}

/* ========== TABLA DE INVENTARIO ========== */

.inventory-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    border-top: 1px solid #e0e0e0;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
}

.inventory-table th {
    background: #023e8a;
    color: white;
    padding: 12px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.inventory-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.inventory-table tbody tr {
    transition: background-color 0.2s;
}

.inventory-table tbody tr:hover {
    background: #f9fafb;
}

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

/* ========== BADGES Y ESTADOS ========== */

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-disponible,
.status-DISPONIBLE {
    background: #d4edda;
    color: #155724;
}

.status-reservado,
.status-RESERVADO {
    background: #fff3cd;
    color: #856404;
}

.status-agotado,
.status-AGOTADO {
    background: #f8d7da;
    color: #721c24;
}

.status-en_transito,
.status-EN_TRANSITO {
    background: #cce5ff;
    color: #004085;
}

.status-bloqueado,
.status-BLOQUEADO {
    background: #e2e3e5;
    color: #383d41;
}

.status-parcia,
.status-PARCIA {
    background: #fff3cd;
    color: #856404;
}

.status-dispo,
.status-DISPO {
    background: #d4edda;
    color: #155724;
}

/* ========== FEEDBACK ========== */

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #023e8a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
}

.warning {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #ffeeba;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
    .inventario-sidebar {
        width: 160px;
    }

    .inventario-main-content {
        margin-left: 160px;
        width: calc(100vw - 160px);
        padding: 15px;
    }

    .filters-bar {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .inventario-sidebar {
        width: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .inventario-sidebar.open {
        width: 180px;
        transform: translateX(0);
    }

    .inventario-main-content {
        margin-left: 0;
        width: 100vw;
        padding: 15px;
    }

    .filters-bar {
        grid-template-columns: 1fr;
    }

    .inventory-table {
        font-size: 12px;
    }

    .inventory-table th,
    .inventory-table td {
        padding: 8px 6px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .btn-primary {
        width: 100%;
        align-self: stretch;
    }
}

/* ========== SCROLLBAR PERSONALIZADO ========== */

.inventario-main-content::-webkit-scrollbar {
    width: 8px;
}

.inventario-main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.inventario-main-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.inventario-main-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== UTILIDADES ========== */

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted {
    color: #6c757d;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* ========== ANIMACIONES ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inventory-table-container {
    animation: fadeIn 0.3s ease-out;
}

.modal {
    animation: fadeIn 0.3s ease-out;
}

/* ========== TABS DE SECCIÓN, estilo carpeta (Recibos, Usuarios, Análisis, etc.) ========== */

.recibos-tabs {
    display: flex;
    border-bottom: 3px solid #023e8a;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 2px;
}

.recibo-tab {
    padding: 10px 18px;
    background: #e8edf4;
    border: 1px solid #d0d6e0;
    border-bottom: none;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    transition: all 0.15s;
}

.recibo-tab:hover { background: #d6dde8; }
.recibo-tab.active { background: #023e8a; color: #fff; border-color: #023e8a; }

.tab-count {
    display: inline-block;
    background: rgba(0,0,0,0.12);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}

.recibo-tab.active .tab-count { background: rgba(255,255,255,0.25); }

.recibo-panel {
    background: transparent;
    padding-top: 20px;
}

/* ========== FORMULARIOS DE SECCIÓN ========== */

.recibo-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 24px;
    max-width: 900px;
}

.recibo-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.recibo-form .form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.recibo-form .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.recibo-form .form-group input[type="text"],
.recibo-form .form-group input[type="email"],
.recibo-form .form-group input[type="password"],
.recibo-form .form-group input[type="date"],
.recibo-form .form-group input[type="time"],
.recibo-form .form-group input[type="number"],
.recibo-form .form-group input[type="file"],
.recibo-form .form-group select,
.recibo-form .form-group textarea {
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
}

.recibo-form .form-group input:focus,
.recibo-form .form-group select:focus,
.recibo-form .form-group textarea:focus {
    outline: none;
    border-color: #023e8a;
    box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.1);
}

.recibo-form .field-hint { font-size: 12px; color: #666; margin: 4px 0 0; }

.recibo-form .form-actions { display: flex; gap: 10px; margin-top: 20px; }

@media (max-width: 768px) {
    .recibo-form .form-grid { grid-template-columns: 1fr; }
}
