/* ============================================================
   Arch 2.0 — Component Styles
   ============================================================ */

/* --- Page Header -------------------------------------------- */
.page-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-xl);
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: var(--space-1);
}

.page-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
}

/* --- Card --------------------------------------------------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--card-shadow);
}

.card-header {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--fs-md);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
}

/* --- KPI Cards ---------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.kpi-label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-2xl);
    color: var(--text-primary);
    line-height: 1.1;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-md);
    background: var(--brand-subtle);
    color: var(--brand);
    margin-bottom: var(--space-1);
}

/* --- Table -------------------------------------------------- */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

/* --- Table Responsive (horizontal scroll for mobile) ---------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scroll indicator: inset shadow on right edge when content overflows */
.table-responsive.has-scroll {
    box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.08);
}

/* --- Scrollable table section (sticky header + overflow) ------ */
.mv-table-scroll {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.mv-table-scroll table {
    margin: 0;
}
.mv-table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-surface-alt);
    box-shadow: 0 1px 0 var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table thead {
    background: var(--bg-surface-alt);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

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

.table tbody tr:hover {
    background: var(--bg-surface-hover);
}

.table td.text-muted {
    color: var(--text-tertiary);
}

/* Subtotal row for summary tables (e.g. Resumen Volumenes en detail) */
.table tr.total-row td {
    font-weight: 700;
    border-top: 1px solid var(--text-primary);
    background: var(--brand-subtle);
}
.table tr.spacer td {
    border: none;
    padding: var(--space-2);
}

.table .actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* --- Badge -------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: var(--fs-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    line-height: 1.5;
    white-space: nowrap;
}

.badge-brand {
    background: var(--brand-subtle);
    color: var(--brand);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-secondary {
    background: var(--bg-surface-alt);
    color: var(--text-tertiary);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* --- Status Dot --------------------------------------------- */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-active::before {
    background: var(--success);
}

.status-inactive::before {
    background: var(--text-tertiary);
}

/* --- Buttons ------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration) var(--ease),
                color var(--duration) var(--ease),
                border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
    white-space: nowrap;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--brand-strong);
    color: var(--brand-text);
    border-color: var(--brand-strong);
}

.btn-primary:hover {
    background: var(--brand-strong-hover);
    border-color: var(--brand-strong-hover);
    color: var(--brand-text);
}

.btn-primary:active {
    background: var(--brand-strong-active);
    border-color: var(--brand-strong-active);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-danger {
    background: var(--danger);
    color: var(--brand-text);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-text);
    border-color: var(--danger-text);
}

.btn-success {
    background: var(--success);
    color: var(--brand-text);
    border-color: var(--success);
}

.btn-success:hover:not([disabled]) {
    filter: brightness(1.08);
    color: var(--brand-text);
}

.btn-info {
    background: var(--info);
    color: var(--brand-text);
    border-color: var(--info);
}

.btn-info:hover:not([disabled]) {
    filter: brightness(1.08);
    color: var(--brand-text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
}

/* --- Forms -------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    line-height: 1.5;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-subtle);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:read-only {
    background: var(--bg-surface-alt);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 12px;
    padding-right: var(--space-8);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: var(--space-2);
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
    cursor: pointer;
    flex-shrink: 0;
}

.form-hint {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* --- Action Bar --------------------------------------------- */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.action-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* --- Toasts (feedback flash -> toast overlay) --------------------- */
.toast-stack {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: min(360px, calc(100vw - var(--space-8)));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm);
    cursor: pointer;
}
.toast .bi { flex-shrink: 0; }
.toast--success { border-left: 3px solid var(--success); }
.toast--success .bi { color: var(--success); }
.toast--danger { border-left: 3px solid var(--danger); }
.toast--danger .bi { color: var(--danger); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--warning .bi { color: var(--warning); }
.toast--info { border-left: 3px solid var(--info); }
.toast--info .bi { color: var(--info); }

/* --- Tinte funcional de iconos (un color solido por icono) --- */
.icon-brand { color: var(--brand); }
.icon-success { color: var(--success); }
.icon-warning { color: var(--warning); }
.icon-danger { color: var(--danger); }
.icon-info { color: var(--info); }
.icon-muted { color: var(--text-tertiary); }

/* --- Empty State -------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-3);
    display: block;
}

.empty-state p {
    font-size: var(--fs-sm);
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Toggle Switch ------------------------------------------ */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: var(--radius-full);
    transition: background var(--duration) var(--ease);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    transition: transform var(--duration) var(--ease);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background: var(--brand);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* --- Utility Classes ---------------------------------------- */
.text-brand { color: var(--brand); }
.text-muted { color: var(--text-tertiary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

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

.w-full { width: 100%; }
.hidden { display: none; }

/* --- Responsive form row ------------------------------------ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: var(--space-4);
}

/* --- Search input (max-width that adapts to mobile) --------- */
.search-input {
    max-width: 280px;
}

/* === Modal === */
/* Used by configuraciones list pages (proveedores, camaras, defectos,
   validadores). Alpine.js drives showModal/x-show; CSS handles
   layout, backdrop and styling. */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
}
.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    width: 100%; max-width: 480px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-5);
}
.modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    color: var(--text-primary);
}
.modal-content.modal-lg { max-width: 680px; }

/* Sectioned modal: content sin padding; header/body/footer con padding y
   separadores propios. Sólo lo activan los modales con .modal--sectioned. */
.modal--sectioned.modal-content { padding: 0; }
.modal--sectioned .modal-header {
    margin-bottom: 0;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.modal--sectioned .modal-body { padding: var(--space-4); }
.modal--sectioned .modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    border-top: 1px solid var(--border);
}
.btn-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-tertiary); font-size: var(--fs-md);
    padding: var(--space-1);
}
.btn-close:hover { color: var(--text-primary); }

/* ============================================================
   Recepcion / wizard shared styles
   Plan 2c additions: tab wizard, back-link, filters bar,
   data list, checkbox grid, card-body wrapper, page header.
   These are used by the Recepcion module but are intentionally
   generic so other modules can reuse them.
   ============================================================ */

/* --- Page header (title + actions row) ---------------------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}
.page-header .page-title,
.page-header .page-subtitle {
    margin-bottom: 0;
}

/* --- Card body (semantic wrapper inside .card) -------------- */
/* .card already provides padding; card-body is a pass-through
   that resets margins so the header divider flows naturally. */
.card-body {
    margin: 0;
}

/* --- Back link ---------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--fs-sm);
    color: var(--text-tertiary);
    text-decoration: none;
    margin-bottom: var(--space-4);
    transition: color var(--duration) var(--ease);
}
.back-link:hover {
    color: var(--brand);
}

/* --- Filters bar -------------------------------------------- */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.filters-bar .form-input,
.filters-bar .form-select {
    max-width: 220px;
}

/* --- Checkbox grid + item ----------------------------------- */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
    cursor: pointer;
}

/* --- Tab nav (shared with mantenimiento tabs) --------------- */
.tab-nav {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.tab-btn {
    padding: var(--space-2) var(--space-4);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.tab-btn.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.tab-btn:hover {
    color: var(--text-primary);
}

/* --- Data list (dt/dd key-value pairs) ---------------------- */
.data-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
}
.data-list dt {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.data-list dd {
    font-size: var(--fs-sm);
    color: var(--text-primary);
    margin: 0;
}

/* ============================================================
   Recepcion form wizard v2 (Spec B1)
   ============================================================ */

/* --- Sticky header bar (brand green) ------------------------ */
.form-header-bar {
    background: var(--brand);
    color: var(--brand-text);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}
.form-header-bar .title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-md);
    margin: 0;
}
.form-header-bar .subtitle {
    font-size: var(--fs-xs);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}
.form-header-bar .close-btn {
    color: var(--brand-text);
    background: none;
    border: none;
    font-size: var(--fs-lg);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    opacity: 0.9;
}
.form-header-bar .close-btn:hover { opacity: 1; }

/* --- Summary row below header (readonly ticket snapshot) --- */
.form-summary-row {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    border-top: 0;
    padding: var(--space-4) var(--space-5);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.form-summary-row .cell .label {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: var(--space-1);
}
.form-summary-row .cell .value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--fs-base);
}
.form-summary-row .cell.bft .value {
    color: var(--brand);
}

/* --- Section divider (colored subheader with icon) --------- */
.section-divider {
    color: var(--brand);
    font-weight: 600;
    font-size: var(--fs-sm);
    margin: var(--space-5) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* --- Medidas del camion grid ------------------------------- */
.medidas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1.2fr;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}
/* Variante con 4 columnas (sin Factor) — se aplica cuando el toggle
   `mostrar_volumen_camion` esta apagado. Mantiene el ancho de BFT Est.
   proporcional para que el grid quede balanceado. */
.medidas-grid-sin-factor {
    grid-template-columns: 1fr 1fr 1fr 1.2fr;
}
.medidas-grid .field-label {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: var(--space-1);
}
.medidas-grid .bft-est {
    background: var(--brand-subtle);
    color: var(--brand);
    font-weight: 700;
    text-align: right;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--brand-muted);
    border-radius: var(--radius-sm);
}

/* --- Resumen cards (Tab 4) --------------------------------- */
.resumen-cards {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-4);
}
.resumen-cards .card { margin: 0; }
.resumen-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--fs-sm);
}
.resumen-row:last-child { border-bottom: 0; }
.resumen-row .label { color: var(--text-tertiary); }
.resumen-row .value { font-weight: 600; color: var(--text-primary); }
.resumen-row.aceptada .value { color: var(--success); }
.resumen-row.reb-largo .value,
.resumen-row.reb-espesor .value { color: var(--warning); }
.resumen-row.rechazo .value { color: var(--danger); }
.resumen-row.rendimiento {
    background: var(--bg-surface-alt);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    margin-top: var(--space-2);
    border-bottom: 0;
}
.resumen-row.rendimiento .value { color: var(--brand); }
.resumen-row.valor-total {
    background: var(--brand-subtle);
    border: 1px solid var(--brand);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-top: var(--space-3);
    border-bottom: 0;
}
.resumen-row.valor-total .label {
    font-weight: 700;
    color: var(--brand);
    font-size: var(--fs-sm);
}
.resumen-row.valor-total .value {
    font-size: var(--fs-xl);
    color: var(--brand);
}

/* --- Estado badges ----------------------------------------- */
.estado-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: capitalize;
}
.estado-badge.aceptada { background: var(--success-bg); color: var(--success-text); }
.estado-badge.rebaja_largo,
.estado-badge.rebaja_espesor { background: var(--warning-bg); color: var(--warning-text); }
.estado-badge.rechazo { background: var(--danger-bg); color: var(--danger-text); }

/* --- Totales sticky bar (Tab 2) ---------------------------- */
.totales-bar {
    background: var(--brand-subtle);
    border: 1px solid var(--brand-muted);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    font-size: var(--fs-sm);
}
.totales-bar .cell .label {
    color: var(--text-tertiary);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: var(--space-2);
}
.totales-bar .cell .value {
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Action buttons Tab 2 ---------------------------------- */
.btn-agregar-rechazo {
    background: none;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-right: var(--space-2);
}
.btn-agregar-rechazo:hover { background: var(--danger-bg); }

.btn-agregar-separador {
    background: none;
    color: var(--text-tertiary);
    border: 1px solid var(--border-strong);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}
.btn-agregar-separador:hover { background: var(--bg-surface-alt); }

/* --- Registro table lock icon column ----------------------- */
.registro-table .lock-col { width: 64px; text-align: center; color: var(--text-tertiary); white-space: nowrap; }
.registro-table .lock-col.editable { color: var(--danger); cursor: pointer; }
.registro-table .ver-coche-link { color: var(--brand); text-decoration: none; margin-right: 10px; }
.registro-table .ver-coche-link:hover { color: var(--brand-active); }

/* ============================================================
   Recepción Historial — Spec B2a
   ============================================================ */

/* Nav buttons in pendientes header */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}
.btn-warning {
    background: var(--warning);
    color: var(--brand-text);
    border: 1px solid var(--warning);
}
.btn-warning:hover:not([disabled]) {
    filter: brightness(1.08);
}
.btn-purple {
    background: var(--purple);
    color: var(--brand-text);
    border: 1px solid var(--purple);
}
.btn-purple[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* KPI cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.kpi-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    text-align: center;
}
.kpi-value {
    font-size: var(--fs-xl);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--brand);
}
.kpi-value.kpi-money { color: var(--success); }
.kpi-value.kpi-accent { color: var(--brand); }
.kpi-label {
    font-size: var(--fs-sm);
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Split master + drawer layout */
.historial-split {
    display: flex;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.historial-table-wrap {
    flex: 1;
    min-width: 0;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.historial-drawer {
    width: 420px;
    min-width: 420px;
    background: var(--bg-surface-alt);
    border-left: 2px solid var(--brand);
    box-shadow: inset 8px 0 8px -8px rgba(0, 0, 0, 0.08);
    padding: var(--space-4);
    overflow-y: auto;
    max-height: 80vh;
}

/* Compact master table */
.historial-table-compact {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}
.historial-table-compact thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
.historial-table-compact thead th {
    background: var(--brand);
    color: var(--brand-text);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
}
.historial-table-compact tbody tr {
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.historial-table-compact tbody tr:hover { background: var(--bg-surface-hover); }
.historial-table-compact tbody tr.selected-row {
    background: var(--brand-subtle);
    border-left: 3px solid var(--brand);
}
.historial-table-compact tbody td { padding: 8px 10px; }
.historial-table-compact .a-recibir {
    color: var(--brand);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Per-row action buttons (Excel + PDF export) */
.historial-table-compact td.acciones-cell {
    white-space: nowrap;
    padding: 6px 10px;
}
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    color: var(--brand-text);
    text-decoration: none;
    font-size: 0.85rem;
    margin-right: 3px;
    border: none;
    cursor: pointer;
    transition: filter 0.15s;
}
.btn-action:last-child { margin-right: 0; }
.btn-action:hover { filter: brightness(1.12); color: var(--brand-text); }
.btn-action.btn-edit { background: var(--text-secondary); }
.btn-action.btn-excel { background: var(--success); }
.btn-action.btn-pdf { background: var(--danger); }
.btn-action.btn-purple { background: var(--purple); }
.btn-action.btn-undo { background: var(--danger); }
.btn-action[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Centered modal overlay (used by recepcion borrar modal) */
.modal-overlay-borrar-centrado {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Drawer header */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand);
    margin-bottom: 14px;
}
.drawer-header-label {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.drawer-header-title {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-primary);
}
.drawer-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-tertiary);
    line-height: 1;
    padding: 0 4px;
}

/* Drawer context card (read-only fields) */
.drawer-context {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    font-size: var(--fs-xs);
}
.drawer-context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
}
.drawer-context-item .ctx-label {
    color: var(--text-tertiary);
}
.drawer-context-item .ctx-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Drawer sections (editable) */
.drawer-section { margin-bottom: 14px; }
.drawer-section-title {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}
.drawer-section-locked { opacity: 0.85; }
.drawer-section-locked input:not([type="text"]),
.drawer-section-locked select {
    background: var(--bg-surface-alt);
    cursor: not-allowed;
}

.drawer-field-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.drawer-field-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.drawer-field label {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    margin-bottom: 2px;
}
.drawer-field label .hint {
    color: var(--text-tertiary);
    font-size: 0.6rem;
    font-style: italic;
}
.drawer-field input,
.drawer-field select,
.drawer-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    background: var(--bg-input);
    font-family: var(--font-body);
}
.drawer-field input.numeric {
    text-align: right;
    font-family: var(--font-mono);
}
.btn-link-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}
.drawer-field-readonly {
    padding: 6px 8px;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--brand);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Valor a Recibir highlight card */
.valor-a-recibir-card {
    background: var(--brand-subtle);
    border-left: 4px solid var(--brand);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.valor-a-recibir-card .label {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}
.valor-a-recibir-card .formula {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}
.valor-a-recibir-card .value {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--brand);
    font-family: var(--font-mono);
}

/* Estado row + badges */
.drawer-estado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}
.drawer-estado .label {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}
.estado-badge-pendiente {
    background: var(--warning);
    color: var(--brand-text);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.estado-badge-completado {
    background: var(--success);
    color: var(--brand-text);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.estado-badge-rechazado {
    background: var(--text-tertiary);
    color: var(--brand-text);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* Search bar above the split */
.historial-search-bar {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-3);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}
.historial-search-bar input,
.historial-search-bar select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    background: var(--bg-input);
}
.historial-search-bar input[type="text"] { min-width: 150px; }

/* ============================================================
   Responsive — 768px (tablet / phone landscape)
   ============================================================ */
@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .action-bar-left,
    .action-bar-right {
        justify-content: center;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filters-bar .form-input,
    .filters-bar .form-select {
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-content {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }

    .card {
        padding: var(--space-4);
    }
    .card-header {
        margin-bottom: var(--space-3);
        padding-bottom: var(--space-2);
    }

    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
    }

    .btn {
        min-height: 44px;
        padding: var(--space-3) var(--space-4);
    }
    .btn-sm {
        min-height: 36px;
    }

    .search-input {
        max-width: 100%;
    }
}

/* ============================================================
   Responsive — 480px (small phone portrait)
   ============================================================ */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .kpi-value {
        font-size: var(--fs-xl);
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .table th,
    .table td {
        padding: var(--space-1) var(--space-2);
        font-size: var(--fs-xs);
    }
}

/* ============================================================
   Historial de Recepcion — Mobile components
   ============================================================ */

/* Hidden on desktop, shown on mobile via media query */
.historial-filter-toggle { display: none; }
.historial-cards-mobile { display: none; }
.historial-drawer-overlay { display: none; }
.sheet-handle-bar { display: none; }

/* --- Ticket card (used in mobile list) --- */
.ticket-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ticket-card:active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-muted);
}
.ticket-card--selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-muted);
    background: var(--brand-subtle);
}
.ticket-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.ticket-card-id {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-sm);
}
.ticket-card-id .viaje-num {
    color: var(--text-tertiary);
    font-weight: 400;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    margin-left: 6px;
}
.ticket-card-proveedor {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    font-weight: 500;
}
.ticket-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 8px;
}
.ticket-card-field .f-label {
    font-size: 0.58rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    display: block;
}
.ticket-card-field .f-value {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-primary);
}
.ticket-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}
.ticket-card-recibir {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
}
.ticket-card-recibir strong {
    color: var(--brand);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}
.ticket-card-actions {
    display: flex;
    gap: 6px;
}
.btn-action-mini {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--brand-text);
    font-size: 0.78rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-action-mini.btn-edit { background: var(--text-secondary); }
.btn-action-mini.btn-excel { background: var(--success); }
.btn-action-mini.btn-pdf { background: var(--danger); }
.btn-action-mini.btn-undo { background: var(--danger); }

/* --- Sheet handle bar (drawer top grip) --- */
.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: var(--radius-full);
}

/* ============================================================
   Historial — Mobile media query (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    /* -- Filter toggle visible -- */
    .historial-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        background: var(--bg-surface);
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        margin-bottom: var(--space-3);
        cursor: pointer;
        font-size: var(--fs-xs);
        font-weight: 600;
        color: var(--text-secondary);
        width: 100%;
    }
    .historial-filter-toggle i.chevron {
        color: var(--text-tertiary);
        transition: transform 0.2s;
    }
    .historial-filter-toggle.open i.chevron {
        transform: rotate(180deg);
    }

    /* -- Search bar: hidden until toggled -- */
    .historial-search-bar {
        display: none;
    }
    .historial-search-bar.mobile-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: var(--space-3);
    }
    .historial-search-bar.mobile-open select[name="proveedor_id"] {
        grid-column: 1 / -1;
    }
    .historial-search-bar.mobile-open input[type="text"] {
        min-width: 0;
    }

    /* -- Split layout: stacked, no card chrome -- */
    .historial-split {
        display: block;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }

    /* -- Card list scroll on mobile -- */
    .historial-table-wrap {
        max-height: 65vh;
    }

    /* -- Table hidden, cards shown -- */
    .historial-table-compact {
        display: none;
    }
    .historial-cards-mobile {
        display: block;
    }

    /* -- Drawer → bottom sheet -- */
    .historial-drawer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        min-width: 100%;
        max-height: 88vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        border-left: none;
        border-top: 2px solid var(--brand);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
        z-index: 500;
        padding: 0 var(--space-4) var(--space-4);
        animation: sheetSlideUp 0.3s var(--ease);
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .historial-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 499;
    }

    .sheet-handle-bar {
        display: flex;
        justify-content: center;
        padding: 10px 0 6px;
        position: sticky;
        top: 0;
        background: var(--bg-surface-alt);
        z-index: 2;
        margin: 0 calc(var(--space-4) * -1);
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .drawer-close {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        background: var(--bg-surface-alt);
    }
}

/* ============================================================
   Filtro tipo Excel en encabezados de tabla Registro
   ============================================================ */
.registro-table th.th-filter {
    position: relative;
    white-space: nowrap;
}
.registro-table th.th-filter .th-content {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.th-filter-btn {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.1s;
}
.th-filter-btn:hover {
    background: var(--brand-subtle);
    color: var(--brand);
    border-color: var(--brand);
    transform: translateY(-1px);
}
.th-filter-btn.active {
    color: var(--text-inverse);
    background: var(--brand);
    border-color: var(--brand);
}
.th-filter-btn.active:hover {
    opacity: 0.92;
}
.th-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 100;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: var(--space-2);
    min-width: 220px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-weight: normal;
    text-transform: none;
    color: var(--text-primary);
    letter-spacing: normal;
}
.th-filter-dropdown .th-filter-search {
    font-size: var(--fs-sm);
    padding: 4px 8px;
    width: 100%;
}
.th-filter-actions {
    display: flex;
    gap: 6px;
}
.th-filter-actions button {
    background: none;
    border: 1px solid var(--border);
    color: var(--brand);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--fs-xs);
    font-weight: 600;
    flex: 1;
}
.th-filter-actions button:hover {
    background: var(--brand-subtle);
}
.th-filter-values {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 2px;
}
.th-filter-value {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: normal;
    text-transform: none;
    color: var(--text-primary);
    margin: 0;
}
.th-filter-value:hover {
    background: var(--bg-surface-alt);
}
.th-filter-value input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.th-filter-value span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.th-filter-empty {
    color: var(--text-tertiary);
    font-size: var(--fs-xs);
    text-align: center;
    padding: var(--space-3) var(--space-2);
    font-style: italic;
}

/* Banner cuando hay filtros activos */
.registro-filtros-activos {
    background: var(--brand-subtle);
    color: var(--brand);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    border: 1px solid var(--brand);
    border-left-width: 3px;
}
.registro-filtros-activos strong {
    font-weight: 700;
}
.registro-filtros-activos button {
    margin-left: auto;
    background: var(--brand);
    color: var(--text-inverse);
    border: 0;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--fs-xs);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.registro-filtros-activos button:hover {
    background: var(--brand-hover, var(--brand));
    opacity: 0.92;
}

/* La columna # del registro debe permanecer angosta cuando otras tienen filtro */
.registro-table th:first-child {
    white-space: nowrap;
}

/* Cuando hay un dropdown de filtro abierto, dejar que se vea fuera de la tabla */
.table-container.dropdown-open {
    overflow: visible;
}
.table-container.dropdown-open.table-responsive {
    overflow-x: visible;
    overflow-y: visible;
}
