/**
 * Sistema Administrativo Express (XSA)
 * Estilos Unificados para Informes y Reportes
 * Archivo: reports.css (lowercase, english, no separators)
 */

/* Contenedor Principal del Informe */
.report-container {
    padding: 0.5rem 0.5rem;
    max-width: 100%;
    margin: 0 auto;
    font-family: inherit;
    color: var(--text-primary, #0f172a);
}

/* Encabezado Superior y Breadcrumbs */
.report-header {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.report-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.report-breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.report-breadcrumb .crumb-active {
    color: var(--primary, #2563eb);
    font-weight: 600;
}

.report-title-block h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary, #475569);
}

/* Barra de Herramientas de Exportación */
.report-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.report-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

/* Barra de Filtros Dinámica */
.report-filter-bar {
    background: var(--bg-surface-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.report-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.02em;
}

.report-filter-group input[type="date"],
.report-filter-group select,
.report-filter-group input[type="text"] {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    height: 34px;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-primary, #0f172a);
    outline: none;
    transition: border-color 0.15s;
}

.report-filter-group input[type="date"]:focus,
.report-filter-group select:focus,
.report-filter-group input[type="text"]:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Accesos Rápidos de Fechas */
.report-quick-periods {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.btn-quick-period {
    background: #ffffff;
    border: 1px solid var(--border, #cbd5e1);
    color: var(--text-secondary, #475569);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-quick-period:hover {
    background: var(--bg-surface-secondary, #f1f5f9);
    color: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
}

.btn-quick-period.active {
    background: var(--primary, #2563eb);
    color: #ffffff;
    border-color: var(--primary, #2563eb);
}

/* Selector de Moneda de Visualización (Bs / USD) */
.currency-toggle-group {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 6px;
    overflow: hidden;
    height: 34px;
}

.btn-currency-toggle {
    border: none;
    background: transparent;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-currency-toggle.active {
    background: var(--primary, #2563eb);
    color: #ffffff;
}

/* KPI Summary Cards */
.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.report-kpi-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.report-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary, #2563eb);
    flex-shrink: 0;
}

.report-kpi-card.kpi-success .report-kpi-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.report-kpi-card.kpi-warning .report-kpi-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.report-kpi-card.kpi-danger .report-kpi-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.report-kpi-card.kpi-purple .report-kpi-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.report-kpi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.report-kpi-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-kpi-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    font-variant-numeric: tabular-nums;
}

/* Tarjeta y Tabla de Datos */
.report-table-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.report-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.report-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.45rem;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
}

.report-table tbody td {
    padding: 0.45rem 0.45rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.report-table tbody tr:hover td {
    background: #f8fafc;
}

/* Columnas Numéricas y de Fecha */
.col-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    white-space: nowrap;
}

.col-center {
    text-align: center !important;
}

/* Enlaces Interactivos y Drill-Down */
.drilldown-link {
    color: var(--primary, #2563eb);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    transition: background 0.12s ease, color 0.12s ease;
}

.drilldown-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    text-decoration: underline;
}

.doc-badge-link {
    font-family: monospace;
    font-weight: 700;
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-block;
}

.doc-badge-link:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Filas de Subtotal y Total General */
.table-group-header td {
    background: #e2e8f0 !important;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
}

.table-subtotal-row td {
    background: #f8fafc !important;
    font-weight: 700;
    color: #1e293b;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
}

.table-grandtotal-row td {
    background: #0f172a !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.88rem;
    border-top: 2px solid #0f172a;
    border-bottom: 2px solid #0f172a;
}

.table-grandtotal-row td .drilldown-link {
    color: #93c5fd;
}

/* Badges de Estatus */
.status-badge {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    border-radius: 9999px;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge.completed,
.status-badge.paid,
.status-badge.available {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.pending,
.status-badge.partial {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* Banner de actualización de plan (Starter / Emprendedor) */
.plan-restriction-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.plan-restriction-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-restriction-content p {
    font-size: 0.88rem;
    color: #1e40af;
    margin: 0;
    line-height: 1.4;
}

/* Modal Drill-Down de Auditoría de Documentos */
.doc-audit-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.doc-audit-modal-backdrop.active {
    display: flex;
}

.doc-audit-modal {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.doc-audit-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-audit-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-audit-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-audit-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.doc-audit-meta-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}

.doc-audit-meta-card h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.doc-audit-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Estilos de Impresión Oficial y PDF */
@media print {
    @page {
        size: landscape;
        margin: 0.5cm;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 8.5pt !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Asegurar visibilidad total de los contenedores de reportes */
    .app-layout,
    .main-content,
    #app-content,
    #sales-reports-root,
    #sales-reports-root *,
    #ar-reports-root,
    #ar-reports-root *,
    #purchases-reports-root,
    #purchases-reports-root *,
    #cxp-reports-root,
    #cxp-reports-root * {
        visibility: visible !important;
    }

    /* Eliminar layout de pantalla (flex/100vh) y mantener flujo normal para paginación */
    .app-layout {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .main-content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }

    #sales-reports-root,
    #ar-reports-root,
    #purchases-reports-root,
    #cxp-reports-root {
        display: block !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .app-header,
    .app-header *,
    .sidebar,
    .sidebar *,
    .btn-toggle-sidebar,
    .report-actions,
    .report-actions *,
    .report-filter-bar,
    .report-filter-bar *,
    .plan-restriction-banner,
    .plan-restriction-banner *,
    .btn,
    .doc-audit-modal-backdrop,
    #toast-container {
        display: none !important;
        visibility: hidden !important;
    }

    .report-header {
        border: none !important;
        padding: 0 0 0.5rem 0 !important;
        box-shadow: none !important;
        margin-bottom: 0.75rem !important;
    }

    .report-title-block h2 {
        font-size: 1.15rem !important;
        color: #000000 !important;
    }

    .report-subtitle {
        color: #334155 !important;
        font-size: 0.8rem !important;
    }

    .report-kpis {
        gap: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .report-kpi-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        padding: 0.4rem 0.6rem !important;
    }

    .report-kpi-value {
        font-size: 0.95rem !important;
    }

    .report-table-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .report-table-wrapper {
        overflow: visible !important;
    }

    .report-table {
        font-size: 8pt !important;
    }

    .report-table th,
    .report-table td {
        padding: 3pt 5pt !important;
        border-color: #cbd5e1 !important;
        color: #000000 !important;
    }

    .report-table thead th {
        background: #f1f5f9 !important;
    }

    .table-grandtotal-row td {
        background: #e2e8f0 !important;
        color: #000000 !important;
        font-weight: 800 !important;
    }

    .doc-badge-link {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        color: #000000 !important;
    }

    .drilldown-link {
        color: #000000 !important;
        text-decoration: none !important;
    }

    @page {
        size: landscape;
        margin: 1cm;
    }
}

/* Buscador Inteligente en Barra de Filtros de Reportes */
.report-filter-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.report-filter-search-box input[type="text"] {
    width: 100%;
    padding-right: 2.35rem !important;
}

.report-filter-search-box .btn-clear-filter {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    display: none;
    padding: 0;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
    pointer-events: auto !important;
}

.report-filter-search-box .btn-clear-filter:hover {
    color: #ef4444;
    background: #fee2e2;
    border-color: #fca5a5;
}

.report-filter-search-box .btn-clear-filter svg,
.report-filter-search-box .btn-clear-filter i {
    pointer-events: none !important;
    width: 14px !important;
    height: 14px !important;
}

.report-filter-group .autocomplete-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 320px;
    max-width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.22), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
    z-index: 2600 !important;
    display: none;
}

.report-filter-group .autocomplete-results.active {
    display: block;
}

.report-filter-group .autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    transition: background 0.15s ease;
}

.report-filter-group .autocomplete-item:last-child {
    border-bottom: none;
}

.report-filter-group .autocomplete-item:hover {
    background-color: #f8fafc;
    color: var(--primary, #2563eb);
}

.report-filter-group .autocomplete-item.item-all {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}
.report-filter-group .autocomplete-item.item-all:hover {
    background: #f1f5f9;
}

/* =============================================================================
   OPTIMIZACIONES ESPECÍFICAS PARA INFORMES DE INVENTARIOS (#inventory-reports-root)
   Garantiza visualización perfecta en resoluciones de portátiles (1366x768, etc.)
   ============================================================================= */

#inventory-reports-root .report-kpis {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
}

@media (max-width: 1100px) {
    #inventory-reports-root .report-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 580px) {
    #inventory-reports-root .report-kpis {
        grid-template-columns: 1fr !important;
    }
}

/* Estilo unificado de tarjetas KPI para inventarios (Nunca flex horizontal) */
#inventory-reports-root .ir-kpi-card,
#inventory-reports-root .kpi-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 0.75rem 0.95rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 0.25rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    border-left: 4px solid var(--kpi-accent, #2563eb) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

#inventory-reports-root .ir-kpi-card:hover,
#inventory-reports-root .kpi-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-1px) !important;
}

#inventory-reports-root .ir-kpi-header,
#inventory-reports-root .kpi-card .kpi-label {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.45rem !important;
    margin-bottom: 0.2rem !important;
    min-width: 0 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#inventory-reports-root .ir-kpi-header i,
#inventory-reports-root .ir-kpi-header svg,
#inventory-reports-root .kpi-card .kpi-label i,
#inventory-reports-root .kpi-card .kpi-label svg {
    width: 15px !important;
    height: 15px !important;
    color: var(--kpi-accent, #2563eb) !important;
    flex-shrink: 0 !important;
}

#inventory-reports-root .ir-kpi-body,
#inventory-reports-root .kpi-card .kpi-value {
    margin: 0.15rem 0 0.35rem 0 !important;
    min-width: 0 !important;
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    color: var(--kpi-val-color, #0f172a) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
    font-variant-numeric: tabular-nums !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#inventory-reports-root .ir-kpi-footer,
#inventory-reports-root .kpi-card .kpi-subtitle {
    font-size: 0.71rem !important;
    color: #64748b !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    border-top: 1px dashed #f1f5f9 !important;
    padding-top: 0.35rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
}

/* Optimización de tabla para visualización nítida y compacta */
#inventory-reports-root .report-table-card {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
}

#inventory-reports-root .report-table-wrapper {
    overflow-x: auto !important;
    scrollbar-width: thin !important;
    width: 100% !important;
}

#inventory-reports-root .report-filter-bar {
    gap: 0.5rem !important;
    padding: 0.65rem 0.85rem !important;
}

#inventory-reports-root .report-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.78rem !important;
}

#inventory-reports-root .report-table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    padding: 0.5rem 0.35rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

#inventory-reports-root .report-table tbody td {
    padding: 0.42rem 0.35rem !important;
    font-size: 0.76rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

#inventory-reports-root .report-table .text-right,
#inventory-reports-root .report-table td.text-right,
#inventory-reports-root .report-table th.text-right,
#inventory-reports-root .report-table tfoot td.text-right {
    white-space: nowrap !important;
}

#inventory-reports-root .report-table tbody tr:hover td {
    background-color: #f8fafc !important;
}

#inventory-reports-root .report-table tfoot td {
    background: #f8fafc !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    padding: 0.5rem 0.35rem !important;
    border-top: 2px solid #cbd5e1 !important;
}

/* Enlaces drilldown y detalles */
#inventory-reports-root .drilldown-link {
    color: var(--primary, #2563eb) !important;
    cursor: pointer !important;
    transition: color 0.15s ease !important;
    display: inline-block !important;
}

#inventory-reports-root .drilldown-link:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

/* Botones de acción compactos */
#inventory-reports-root .btn-action-kardex {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

#inventory-reports-root .btn-action-kardex:hover {
    background: #eff6ff !important;
    color: #2563eb !important;
    border-color: #93c5fd !important;
}

#inventory-reports-root .btn-action-kardex svg,
#inventory-reports-root .btn-action-kardex i {
    width: 14px !important;
    height: 14px !important;
}

#inventory-reports-root .badge-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

#inventory-reports-root .badge {
    border-radius: 4px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}


