/* Solo panel principal: color de marca en sidebar y topbar (no afecta login) */
.fi-sidebar .fi-sidebar-header {
    background-color: #1998d5 !important;
}

/* Topbar azul (Filament v4: el nav tiene la clase fi-topbar) */
.fi-topbar {
    background-color: #1998d5 !important;
}
.fi-topbar,
.fi-topbar a,
.fi-topbar button,
.fi-topbar [class*="fi-topbar-item"],
.fi-topbar .fi-topbar-item-label {
    color: #fff !important;
}
.fi-topbar svg {
    color: #fff !important;
    fill: currentColor;
}
.fi-topbar .fi-icon-btn {
    color: #fff !important;
}
.fi-topbar .fi-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

/* Totales y comisiones: encabezados con altura uniforme */
.sale-totales-comisiones .fi-in-entry-wrp .grid > div:first-child {
    min-height: 2.75rem;
    align-items: center;
}

/* Widget resumen por aliado (vista corte): tabla y contenedor a ancho completo */
.settlement-summary-widget-section {
    width: 100%;
}
.settlement-summary-widget-section .overflow-x-auto {
    width: 100%;
}
.settlement-summary-table {
    width: 100% !important;
}
/* Alineación por columna: títulos y datos deben coincidir (col 1 y 5 izquierda, col 2-4 derecha) */
.settlement-summary-table th:nth-child(1),
.settlement-summary-table td:nth-child(1),
.settlement-summary-table th:nth-child(5),
.settlement-summary-table td:nth-child(5) {
    text-align: left !important;
}
.settlement-summary-table th:nth-child(2),
.settlement-summary-table td:nth-child(2),
.settlement-summary-table th:nth-child(3),
.settlement-summary-table td:nth-child(3),
.settlement-summary-table th:nth-child(4),
.settlement-summary-table td:nth-child(4) {
    text-align: right !important;
}
/* Separación de la columna "Ver detalle" respecto a Neto */
.settlement-summary-table th:nth-child(5),
.settlement-summary-table td:nth-child(5) {
    padding-left: 2rem !important;
}

/* ========== Vista detalle por aliado (Ver detalle): tablas Ventas y Deducciones ========== */
.settlement-detail-table-wrap {
    width: 100%;
}
.settlement-detail-table {
    width: 100% !important;
    font-size: 0.875rem;
    border-collapse: collapse;
}
.settlement-detail-table-head {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    background-color: #f3f4f6;
}
.dark .settlement-detail-table-head {
    color: #d1d5db;
    background-color: #374151;
}
.settlement-detail-th {
    padding: 0.75rem 1rem;
    font-weight: 600;
}
.settlement-detail-th-left {
    text-align: left !important;
}
.settlement-detail-th-right {
    text-align: right !important;
}
.settlement-detail-table-body {
    border-bottom: 1px solid #e5e7eb;
}
.dark .settlement-detail-table-body {
    border-color: #374151;
}
.settlement-detail-tr {
    border-bottom: 1px solid #e5e7eb;
}
.dark .settlement-detail-tr {
    border-color: #374151;
}
.settlement-detail-td {
    padding: 0.75rem 1rem;
    color: #111827;
}
.dark .settlement-detail-td {
    color: #f9fafb;
}
.settlement-detail-td-left {
    text-align: left !important;
}
.settlement-detail-td-right {
    text-align: right !important;
}
.settlement-detail-subtext {
    font-size: 0.75rem;
    color: #6b7280;
}
.dark .settlement-detail-subtext {
    color: #9ca3af;
}

/* ========== Vista detalle por aliado: bloque Resumen ========== */
.settlement-detail-resumen {
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
}
.dark .settlement-detail-resumen {
    border-color: #374151;
}
.settlement-detail-resumen-ok {
    background-color: #f9fafb;
}
.dark .settlement-detail-resumen-ok {
    background-color: rgba(31, 41, 55, 0.5);
}
.settlement-detail-resumen-invalid {
    background-color: #fef2f2;
    border-color: #fecaca;
}
.dark .settlement-detail-resumen-invalid {
    background-color: rgba(127, 29, 29, 0.3);
    border-color: #991b1b;
}
.settlement-detail-resumen-dl {
    margin: 0;
    font-size: 0.875rem;
}
.settlement-detail-resumen-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.settlement-detail-resumen-row + .settlement-detail-resumen-row {
    margin-top: 0.5rem;
}
.settlement-detail-resumen-dt {
    margin: 0;
    color: #6b7280;
}
.dark .settlement-detail-resumen-dt {
    color: #9ca3af;
}
.settlement-detail-resumen-dd {
    margin: 0;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.settlement-detail-resumen-row-total {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}
.dark .settlement-detail-resumen-row-total {
    border-color: #374151;
}
.settlement-detail-resumen-row-total .settlement-detail-resumen-dt {
    font-weight: 500;
    color: #111827;
}
.dark .settlement-detail-resumen-row-total .settlement-detail-resumen-dt {
    color: #f9fafb;
}
.settlement-detail-resumen-row-total .settlement-detail-resumen-dd {
    font-weight: 600;
}
.settlement-detail-resumen-net-invalid {
    color: #dc2626 !important;
}
.dark .settlement-detail-resumen-net-invalid {
    color: #f87171 !important;
}
.settlement-detail-resumen-alert {
    margin-top: 0.75rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #dc2626;
}
.dark .settlement-detail-resumen-alert {
    color: #f87171;
}

/* ========== Panel Aliado: tablas resumen de pago ========== */
.ally-settlement-summary-widget-section,
.ally-settlement-sales-section,
.ally-settlement-deductions-section {
    width: 100%;
    max-width: 100%;
}
.ally-settlement-summary-widget-section .overflow-x-auto,
.ally-settlement-sales-section .overflow-x-auto,
.ally-settlement-deductions-section .overflow-x-auto {
    width: 100%;
}
.ally-settlement-table {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}
.ally-settlement-table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-weight: 600;
}
.ally-settlement-table th:last-child,
.ally-settlement-table td:last-child {
    padding-right: 1.5rem;
}
.ally-settlement-table td {
    padding: 0.75rem 1.5rem;
}
.ally-settlement-table th:first-child,
.ally-settlement-table td:first-child {
    padding-left: 1.5rem;
}
/* Columnas numéricas alineadas a la derecha */
.ally-settlement-table th.text-right,
.ally-settlement-table td.text-right {
    text-align: right !important;
    min-width: 6rem;
}
