/* Servicio transfusional — Bento sobre el fondo del design system */
body.has-presentation-bar .card-content-area:has(.tx-container) {
    background: var(--bg-page, #F4F6F9);
}

.tx-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px 1.75rem 40px;
    box-sizing: border-box;
    background: var(--bg-page, #F4F6F9);
    min-height: 100%;
}

.tx-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.tx-header-text { min-width: 0; }

.tx-mode-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--border-radius-full);
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-xs);
    margin-bottom: 14px;
    transition: all var(--transition-fast);
}

.tx-back:hover {
    color: var(--primary);
    border-color: var(--primary-lighter);
}

/* Título: .banchy-page-header h1 en components.css (misma escala en todos los módulos) */

.tx-lead {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.tx-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tx-kpi,
.banchy-metric-card {
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.35rem 1.4rem 1.2rem;
    min-height: 118px;
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.12);
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tx-kpi:hover,
.banchy-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.05);
}

.tx-kpi span,
.banchy-metric-card span {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.tx-kpi strong,
.banchy-metric-card strong {
    display: block;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
    .tx-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .tx-header { flex-direction: column; }
    .tx-kpi-row { grid-template-columns: 1fr; }
}

.tx-tabs-wrap { margin-bottom: 20px; }

.tx-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    box-shadow: var(--shadow-xs);
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 16px;
}

.tx-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    padding: 10px 16px;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tx-tab:hover {
    color: var(--text-primary);
    background: var(--surface-50);
}

.tx-tab.active {
    color: var(--text-white);
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

.tx-panel {
    display: none;
    animation: txFadeUp 0.25s ease;
}

.tx-panel.active { display: block; }

@keyframes txFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tx-section {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 16px;
}

.tx-section-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 16px;
}

.tx-section-title--spaced { margin-top: 8px; }

.tx-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
}

@media (min-width: 1100px) {
    .tx-form-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .tx-form-grid { grid-template-columns: 1fr; }
}

.tx-field--full { grid-column: 1 / -1; }

.tx-field--span2 { grid-column: 1 / -1; }

/* Paciente: nombre amplio + HC; fila ABO/Rh/nacimiento/edad */
.tx-form-grid--patient {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.tx-form-grid--patient-meta {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
}

@media (max-width: 900px) {
    .tx-form-grid--patient { grid-template-columns: 1fr; }
    .tx-form-grid--patient-meta { grid-template-columns: repeat(2, 1fr); }
}

/* Solicitud: bloques con título */
.tx-request-form {
    margin-top: 8px;
}

.tx-request-form--nested {
    margin-top: 16px;
}

.tx-request-block {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.tx-request-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tx-request-block-title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.tx-form-grid--episode {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(10rem, 12rem);
    gap: 14px 16px;
}

@media (max-width: 768px) {
    .tx-form-grid--episode {
        grid-template-columns: 1fr;
    }
    .tx-form-grid--episode .tx-field--urgency {
        max-width: 16rem;
    }
}

.tx-component-units-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.75rem;
    gap: 16px;
    align-items: end;
}

@media (max-width: 480px) {
    .tx-component-units-row {
        grid-template-columns: 1fr 5.75rem;
    }
}

.tx-field--units input {
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding-left: 8px;
    padding-right: 8px;
}

.tx-field label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.tx-field input,
.tx-field select,
.tx-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-glass-dark);
}

.tx-field textarea { min-height: 72px; resize: vertical; }

.tx-age-value {
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--surface-glass-dark);
    display: flex;
    align-items: center;
}

.tx-lookup-banner {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    background: rgba(59, 130, 246, 0.08);
}

.tx-lookup-banner.tx-lookup-banner--new {
    background: rgba(34, 197, 94, 0.08);
}

.tx-advanced-block {
    margin-top: 16px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.tx-advanced-block summary {
    cursor: pointer;
    color: var(--text-primary);
}

.tx-sample-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    background: rgba(234, 179, 8, 0.12);
    color: var(--text-primary);
}

.tx-sample-hint[hidden] {
    display: none !important;
}

.tx-sample-active {
    margin: 0 0 14px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.tx-sample-active-id {
    color: var(--text-secondary);
    font-size: 12px;
}

.tx-sample-workflow--disabled {
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.tx-sample-workflow--disabled .tx-sample-hint-inner {
    pointer-events: auto;
}

.tx-field--actions label {
    visibility: hidden;
}

.tx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.tx-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 24px 0;
}

.tx-table-wrap { overflow-x: auto; margin-top: 12px; }

.tx-table,
.banchy-clean-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-base);
}

.tx-table th,
.tx-table td,
.banchy-clean-table th,
.banchy-clean-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.tx-table th,
.banchy-clean-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.tx-table tbody tr:hover,
.banchy-clean-table tbody tr:hover {
    background: #f8fafc;
}

.tx-table--selectable tbody tr[data-request-id] {
    cursor: pointer;
}

.tx-table--selectable tbody tr[data-request-id]:hover {
    background: var(--surface-50);
}

.tx-table--selectable tbody tr.tx-row-selected {
    background: color-mix(in srgb, var(--primary-500, #2563eb) 12%, transparent);
    box-shadow: inset 3px 0 0 var(--primary, #2563eb);
}

.tx-msg { padding: 12px 14px; border-radius: var(--border-radius-md); margin-bottom: 14px; font-size: var(--font-size-sm); }
.tx-msg.ok { background: var(--success-light, #ecfdf5); color: var(--success-dark, #065f46); border: 1px solid rgba(129, 178, 154, 0.4); }
.tx-msg.err { background: var(--error-light, #fef2f2); color: var(--error-dark, #991b1b); border: 1px solid rgba(224, 122, 95, 0.35); }

.tx-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    background: var(--surface-100);
    color: var(--text-secondary);
}

.tx-badge.urgent { background: #fff3e0; color: #e65100; }
.tx-badge.emergency { background: #ffebee; color: #b71c1c; }

.tx-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 12px;
}

.tx-check-row input { width: auto; margin: 0; }

.tx-sample-row { cursor: pointer; }
.tx-sample-row:hover { background: var(--surface-hover, #f5f7fa); }
.tx-checklist { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; }
.tx-checklist li { padding: 6px 0; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.tx-checklist li.ok { color: var(--success, #15803d); }
.tx-checklist li.fail { color: var(--danger, #b91c1c); }

.tx-subsection-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 8px;
}

.tx-form-grid--sihevi-period {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-width: 320px;
    margin-bottom: 12px;
}

.tx-sihevi-summary {
    margin-top: 16px;
}

.tx-sihevi-summary .tx-kpi-row {
    margin-bottom: 0;
}

.tx-sihevi-disclaimer {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.45;
}

body.tx-drawer-open { overflow: hidden; }

.tx-bandeja-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tx-bandeja-head .tx-section-title { margin: 0; }

.tx-jump-id {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.tx-jump-id .tx-input-group { width: 140px; }
.tx-jump-id .tx-input-group input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.15rem;
}

.tx-requests-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    width: 100%;
}

/* Solo partir la bandeja cuando el panel de detalle está visible (evita mitad vacía) */
.tx-requests-layout.is-open:has(.tx-request-detail.is-open),
.tx-requests-layout:has(.tx-request-detail.is-open) {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
}

.tx-requests-layout.is-open:has(.tx-request-detail.is-open) .tx-requests-list,
.tx-requests-layout:has(.tx-request-detail.is-open) .tx-requests-list {
    margin-bottom: 0;
    max-height: calc(100vh - 160px);
    overflow: auto;
}

.tx-requests-layout.is-open:has(.tx-request-detail.is-open) .tx-table th,
.tx-requests-layout:has(.tx-request-detail.is-open) .tx-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.tx-request-detail {
    display: none;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    min-height: 280px;
    max-height: calc(100vh - 160px);
    overflow: hidden;
    animation: txFadeUp 0.22s ease;
}

.tx-request-detail.is-open { display: flex; }

.tx-request-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tx-drawer-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.tx-drawer-subtitle {
    margin: 4px 0 0;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

.tx-drawer-close {
    border: none;
    background: var(--surface-100);
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.tx-drawer-close:hover {
    background: var(--surface-200);
    color: var(--text-primary);
}

.tx-request-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

.tx-request-detail-footer {
    flex-shrink: 0;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

.tx-request-detail .tx-form-grid,
.tx-request-detail .tx-form-grid--episode {
    grid-template-columns: 1fr;
}

.tx-request-detail .tx-component-units-row {
    grid-template-columns: minmax(0, 1fr) 5.75rem;
}

.tx-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(29, 53, 87, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9000;
}

.tx-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1100px) {
    .tx-requests-layout.is-open {
        grid-template-columns: minmax(0, 1fr);
    }

    .tx-request-detail {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(480px, 100vw);
        max-height: none;
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: var(--shadow-2xl, 0 25px 50px rgba(0, 0, 0, 0.25));
        z-index: 9001;
        display: flex;
        transform: translateX(105%);
        animation: none;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }

    .tx-request-detail.is-open {
        transform: translateX(0);
        pointer-events: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tx-request-detail,
    .tx-drawer-backdrop,
    .tx-request-detail.is-open {
        transition: none;
        animation: none;
    }
}

/* Bandeja: lectura clínica más clara */
.tx-kpi--pending { border-top: 3px solid #f59e0b; }
.tx-kpi--reserve { border-top: 3px solid #3b82f6; }
.tx-kpi--issued { border-top: 3px solid #10b981; }
.tx-kpi--bed { border-top: 3px solid #8b5cf6; }
.tx-kpi--pending .tx-kpi-label { color: #d97706; }
.tx-kpi--reserve .tx-kpi-label { color: #1e3a8a; }
.tx-kpi--issued .tx-kpi-label { color: #047857; }
.tx-kpi--bed .tx-kpi-label { color: #6d28d9; }
.tx-kpi-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}
.tx-kpi-label i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #f1f5f9;
    color: inherit;
}
.tx-kpi--pending .tx-kpi-label i { background: #fff7ed; }
.tx-kpi--reserve .tx-kpi-label i { background: #eff6ff; }
.tx-kpi--issued .tx-kpi-label i { background: #ecfdf5; }
.tx-kpi--bed .tx-kpi-label i { background: #f5f3ff; }

.tx-bandeja-head .tx-jump-id select {
    min-width: 180px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 13px;
    color: var(--text-primary);
    background: #fff;
}
.tx-table-wrap {
    border: 1px solid #e8eef3;
    border-radius: 12px;
    overflow: auto;
    max-height: min(52vh, 560px);
    margin-bottom: 0;
}

.tx-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #e8eef3;
    border-radius: 12px;
    background: #f8fafc;
    position: relative;
    z-index: 2;
    clear: both;
}

.tx-pager-info {
    margin: 0;
    flex: 1 1 12rem;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #64748b;
}

.tx-pager-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

.tx-pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.tx-pager-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.tx-pager-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tx-pager-page {
    min-width: 4.25rem;
    padding: 0 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    white-space: nowrap;
}

.tx-col-hint {
    margin: 8px 2px 0;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

@media (max-width: 720px) {
    .tx-pager {
        flex-direction: column;
        align-items: stretch;
    }

    .tx-pager-nav {
        margin-left: 0;
        justify-content: space-between;
    }
}
.tx-table thead th,
.banchy-clean-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
}

.tx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.tx-filter-select {
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 0.5rem;
    background: var(--surface);
    font: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.tx-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tx-search-bar .tx-input-group {
    flex: 1 1 220px;
    min-width: 0;
}

.tx-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.tx-input-group > i {
    position: absolute;
    left: 0.85rem;
    color: var(--text-tertiary, #64748b);
    pointer-events: none;
    font-size: 0.85rem;
}

.tx-input-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface);
}

.tx-input-group input:focus {
    outline: none;
    border-color: var(--primary-light, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.tx-table tbody tr[data-request-id] td { vertical-align: middle; }
.tx-table tbody tr[data-request-id]:nth-child(even) { background: #fcfdfe; }
.tx-row-emergency { box-shadow: inset 3px 0 0 #dc2626; }
.tx-date {
    font-variant-numeric: tabular-nums;
    color: #475569;
    white-space: nowrap;
}
.tx-code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    font-weight: 650;
    color: #1d3557;
}
.tx-patient-cell { min-width: 220px; }
.tx-patient-name {
    display: block;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}
.tx-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    font-size: 11px;
    color: #64748b;
}
.tx-abo {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 650;
    font-size: 10px;
}
.tx-comp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 550;
}
.tx-comp-qty {
    color: #64748b;
    font-weight: 500;
    font-size: 11px;
}
.tx-muted { color: #94a3b8; font-style: italic; font-weight: 400; }
.tx-badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
}
.tx-badge.routine { background: #f1f5f9; color: #475569; }
.tx-badge.pending { background: #fff7ed; color: #c2410c; }
.tx-badge.done { background: #ecfdf5; color: #047857; }
.tx-badge.active { background: #eff6ff; color: #1d4ed8; }
.tx-badge.ready { background: #f5f3ff; color: #6d28d9; }
.tx-badge.cancelled { background: #f1f5f9; color: #64748b; text-decoration: line-through; }

/* Dark / contraste: superficies del módulo ST */
html[data-banchy-theme='dark'] .tx-container,
html[data-banchy-theme='dark'] body.has-presentation-bar .card-content-area:has(.tx-container) {
    background: var(--bg-page);
}
html[data-banchy-theme='dark'] .tx-kpi,
html[data-banchy-theme='dark'] .banchy-metric-card,
html[data-banchy-theme='dark'] .tx-section,
html[data-banchy-theme='dark'] .tx-mode-chip,
html[data-banchy-theme='dark'] .tx-tabs {
    background: var(--surface);
    border-color: var(--border-color);
    box-shadow: none;
}
html[data-banchy-theme='dark'] .tx-table th,
html[data-banchy-theme='dark'] .banchy-clean-table th {
    background: var(--surface-50);
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}
html[data-banchy-theme='dark'] .tx-table td,
html[data-banchy-theme='dark'] .banchy-clean-table td {
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}
html[data-banchy-theme='dark'] .tx-input-group input,
html[data-banchy-theme='dark'] .tx-filter-select,
html[data-banchy-theme='dark'] .tx-field input,
html[data-banchy-theme='dark'] .tx-field select,
html[data-banchy-theme='dark'] .tx-field textarea {
    background: var(--surface-50);
    border-color: var(--border-color);
    color: var(--text-primary);
}
html[data-banchy-theme='dark'] .tx-pager {
    background: var(--surface-50);
    border-color: var(--border-color);
}
html[data-banchy-theme='dark'] .tx-pager-btn {
    background: var(--surface);
    border-color: var(--border-color);
    color: var(--text-primary);
}
html[data-banchy-theme='dark'] .tx-pager-info,
html[data-banchy-theme='dark'] .tx-col-hint {
    color: var(--text-secondary);
}
html[data-banchy-theme='dark'] .tx-pager-page {
    color: var(--text-primary);
}
html[data-banchy-theme='dark'] .tx-kpi-label i {
    background: var(--surface-100);
}
