.ex-wrap {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 20px 24px;
}

.ex-header,
.ex-card-head,
.ex-list-toolbar,
.ex-editor-header,
.ex-editor-footer,
.ex-section-head,
.ex-inventory-heading,
.ex-inventory-method-head,
.ex-category-head,
.ex-recipe-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ex-header {
    margin-bottom: 16px;
}

.ex-title {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
    color: #111827;
}

.ex-actions,
.ex-row-actions,
.ex-check-row,
.ex-excel-actions,
.ex-delete-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ex-btn {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 9px 14px;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.ex-btn:hover:not(:disabled) {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.ex-btn:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.ex-btn-primary {
    background: #ef4444;
    box-shadow: 0 8px 20px rgba(239, 68, 68, .18);
}

.ex-btn-danger {
    background: #b91c1c;
}

.ex-btn-light {
    background: #fff;
    color: #111827;
    border-color: #d7e0eb;
}

.ex-btn-recipe {
    background: #7c3aed;
}

.ex-btn-edit {
    background: #0f172a;
}

.ex-btn-sm {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
}

.ex-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e3e9f1;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.ex-card-head {
    padding: 18px 20px;
    border-bottom: 1px solid #e8edf4;
}

.ex-card-title {
    font-size: 20px;
    font-weight: 900;
    color: #111827;
}

.ex-list-toolbar {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e8edf4;
}

.ex-search-field {
    width: min(500px, 100%);
    display: grid;
    gap: 6px;
}

.ex-search-field > span,
.ex-field > span,
.ex-field > label {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.ex-count {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
}

.ex-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.ex-table {
    width: 100%;
    min-width: 850px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.ex-table th,
.ex-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
}

.ex-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ex-table th:nth-child(1),
.ex-table td:nth-child(1) { width: 130px; }
.ex-table th:nth-child(2),
.ex-table td:nth-child(2) { width: auto; }
.ex-table th:nth-child(3),
.ex-table td:nth-child(3),
.ex-table th:nth-child(4),
.ex-table td:nth-child(4) { width: 135px; }
.ex-table th:nth-child(5),
.ex-table td:nth-child(5) { width: 330px; }

.ex-table tbody tr:hover td {
    background: #fbfdff;
}

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

.ex-id-cell {
    color: #334155;
    font-size: 13px;
}

.ex-name-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.ex-name-cell strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-status-off {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 10px;
    font-weight: 900;
}

.ex-row-actions {
    justify-content: center;
    flex-wrap: nowrap;
}

.ex-input,
.ex-select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d8e0ea;
    border-radius: 11px;
    padding: 9px 11px;
    background: #fff;
    color: #111827;
    font-weight: 700;
    outline: none;
}

.ex-input:focus,
.ex-select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.ex-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.ex-textarea {
    min-height: 86px;
    resize: vertical;
}

.ex-hidden {
    display: none !important;
}

.ex-hint {
    padding: 12px 20px;
    color: #64748b;
    font-size: 12px;
}

.ex-empty {
    padding: 36px 18px;
    color: #64748b;
    text-align: center;
    font-weight: 800;
}

.ex-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483647;
    max-width: min(520px, calc(100vw - 44px));
    padding: 13px 16px;
    border-radius: 13px;
    background: #111827;
    color: #fff;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
}

.ex-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.ex-toast.ok { background: #15803d; }
.ex-toast.bad { background: #b91c1c; }

.ex-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(3px);
}

.ex-modal.show {
    display: flex;
}

body.ex-modal-open {
    overflow: hidden !important;
}

.ex-editor-dialog {
    width: min(1180px, 96vw);
    max-height: 94vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #f8fafc;
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .34);
}

.ex-editor-header {
    padding: 19px 22px;
    background: #fff;
    border-bottom: 1px solid #e4eaf1;
}

.ex-editor-kicker {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ex-editor-header h2 {
    margin: 0;
    color: #111827;
    font-size: 25px;
    font-weight: 950;
}

.ex-editor-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

.ex-close-btn {
    flex: 0 0 auto;
    width: 43px;
    height: 43px;
    border: 0;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 25px;
    cursor: pointer;
}

.ex-editor-body {
    overflow-y: auto;
    padding: 18px;
    scrollbar-gutter: stable;
}

.ex-form-section {
    margin-bottom: 16px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
}

.ex-form-section:last-child {
    margin-bottom: 0;
}

.ex-section-head {
    margin-bottom: 16px;
}

.ex-section-head > div:first-child {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.ex-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-weight: 950;
}

.ex-section-head h3 {
    margin: 1px 0 3px;
    color: #0f172a;
    font-size: 17px;
    font-weight: 950;
}

.ex-section-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.ex-form-grid {
    display: grid;
    gap: 14px;
}

.ex-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ex-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ex-field {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.ex-field-wide {
    grid-column: 1 / -1;
}

.ex-field small {
    color: #64748b;
    font-size: 11px;
}

.ex-check-row {
    margin-top: 15px;
}

.ex-check-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 39px;
    padding: 8px 12px;
    border: 1px solid #dbe3ed;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.ex-check-pill input {
    width: 17px;
    height: 17px;
    accent-color: #ef4444;
}

.ex-label-with-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ex-info-dot,
.ex-inline-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border: 0;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 950;
    cursor: help;
}

.ex-info-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: 290px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity .16s ease, transform .16s ease;
}

.ex-info-dot:hover .ex-info-tooltip,
.ex-info-dot:focus .ex-info-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.ex-rule-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid #fde68a;
    border-radius: 11px;
    background: #fffbeb;
    color: #78350f;
    font-size: 12px;
}

.ex-category-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: #f8fafc;
}

.ex-category-head {
    margin-bottom: 10px;
}

.ex-category-head > div {
    display: grid;
    gap: 2px;
}

.ex-category-head strong {
    color: #0f172a;
    font-size: 13px;
}

.ex-category-head small {
    color: #64748b;
    font-size: 11px;
}

.ex-category-count {
    padding: 5px 9px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
}

.ex-category-list {
    max-height: 225px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-right: 3px;
}

.ex-category-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    border: 1px solid #dce4ee;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}

.ex-category-option.is-selected {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.ex-category-option input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: #7c3aed;
}

.ex-category-option span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.ex-category-option strong {
    color: #334155;
    font-size: 11px;
}

.ex-category-option small {
    overflow: hidden;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-category-empty {
    grid-column: 1 / -1;
    padding: 18px;
    color: #64748b;
    text-align: center;
    font-size: 12px;
}

.ex-inventory-section {
    border-color: #d8e3f0;
}

.ex-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    color: #0f172a;
    font-size: 12px;
}

.ex-switch-label input {
    position: absolute;
    opacity: 0;
}

.ex-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .2s ease;
}

.ex-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .22);
    transition: transform .2s ease;
}

.ex-switch-label input:checked + .ex-switch {
    background: #16a34a;
}

.ex-switch-label input:checked + .ex-switch::after {
    transform: translateX(20px);
}

.ex-inventory-settings {
    margin: 0;
    padding: 15px;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: #f8fafc;
    transition: opacity .2s ease, filter .2s ease;
}

.ex-inventory-settings.is-disabled {
    opacity: .55;
    filter: grayscale(.15);
}

.ex-inventory-settings:disabled {
    cursor: not-allowed;
}

.ex-inventory-method-head {
    align-items: flex-start;
    margin-bottom: 13px;
}

.ex-inventory-method-head > div {
    display: grid;
    gap: 3px;
}

.ex-inventory-method-head label {
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
}

.ex-inventory-method-head small {
    color: #64748b;
    font-size: 11px;
}

.ex-inventory-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ex-inventory-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid #d9e2ed;
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
}

.ex-inventory-option:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .08);
}

.ex-inventory-option input {
    margin-top: 3px;
    accent-color: #4f46e5;
}

.ex-inventory-option > span:nth-child(2) {
    display: grid;
    gap: 4px;
}

.ex-inventory-option strong {
    color: #0f172a;
    font-size: 13px;
}

.ex-inventory-option small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.ex-inventory-panel {
    margin-top: 13px;
    padding: 14px;
    border: 1px solid #dce5ef;
    border-radius: 13px;
    background: #fff;
}

.ex-inventory-panel[hidden] {
    display: none !important;
}

.ex-inventory-panel > .ex-field + .ex-form-grid,
.ex-inventory-panel > .ex-form-grid + .ex-field,
.ex-inventory-panel > .ex-form-grid + .ex-form-grid {
    margin-top: 13px;
}

.ex-reference-card {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid #d8e2ed;
    border-radius: 12px;
    background: #f8fafc;
}

.ex-reference-card span,
.ex-reference-card small {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.ex-reference-card strong {
    color: #111827;
    font-size: 18px;
}

.ex-recipe-empty {
    padding: 18px;
    border: 1px dashed #f59e0b;
    border-radius: 12px;
    background: #fffbeb;
    text-align: center;
}

.ex-recipe-empty h4 {
    margin: 9px 0 5px;
    color: #78350f;
    font-size: 16px;
}

.ex-recipe-empty p {
    margin: 0;
    color: #92400e;
    font-size: 12px;
}

.ex-recipe-state {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
}

.ex-recipe-state.is-missing {
    background: #fef3c7;
    color: #92400e;
}

.ex-recipe-state.is-ready {
    background: #dcfce7;
    color: #166534;
}

.ex-recipe-summary {
    display: grid;
    gap: 12px;
}

.ex-recipe-summary[hidden] {
    display: none !important;
}

.ex-recipe-summary-head h4 {
    margin: 6px 0 0;
    color: #0f172a;
    font-size: 17px;
}

.ex-recipe-version {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 10px;
    font-weight: 900;
}

.ex-recipe-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.ex-recipe-metrics > div {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
}

.ex-recipe-metrics span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.ex-recipe-metrics strong {
    overflow: hidden;
    color: #111827;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-recipe-ingredients {
    max-height: 210px;
    overflow-y: auto;
    display: grid;
    gap: 7px;
}

.ex-recipe-ingredient-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.ex-recipe-ingredient-row > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.ex-recipe-ingredient-row strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-recipe-ingredient-row small {
    color: #64748b;
    font-size: 10px;
}

.ex-recipe-ingredient-row > span {
    flex: 0 0 auto;
    max-width: 180px;
    overflow: hidden;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-recipe-no-ingredients {
    padding: 13px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    text-align: center;
    font-size: 11px;
}

#exRecipeActionButton {
    margin-top: 12px;
}

.ex-recipe-help {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 10px;
}

.ex-editor-footer {
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #e3e9f1;
}

.ex-footer-spacer {
    flex: 1 1 auto;
}

.ex-modal-hidden {
    display: none !important;
}

.ex-modal-show {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .62);
}

.ex-delete-box {
    width: min(520px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 22px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
    text-align: center;
}

.ex-delete-box h3 {
    margin: 0 0 8px;
    color: #b91c1c;
    font-size: 21px;
}

.ex-delete-box p {
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.ex-delete-actions,
.ex-excel-actions {
    justify-content: center;
}

.ex-excel-box {
    width: min(620px, 94vw);
}

#exExcelFileName {
    margin-top: 11px;
    text-align: center;
}

@media (max-width: 900px) {
    .ex-wrap {
        padding: 13px 10px;
    }

    .ex-header,
    .ex-card-head,
    .ex-list-toolbar,
    .ex-inventory-heading,
    .ex-inventory-method-head {
        align-items: stretch;
        flex-direction: column;
    }

    .ex-actions,
    .ex-actions .ex-btn,
    .ex-card-head > .ex-btn,
    .ex-search-field {
        width: 100%;
    }

    .ex-grid-2,
    .ex-grid-3,
    .ex-inventory-options,
    .ex-category-list,
    .ex-recipe-metrics {
        grid-template-columns: 1fr;
    }

    .ex-editor-dialog {
        width: 100%;
        max-height: 96vh;
    }

    .ex-editor-header,
    .ex-editor-footer {
        padding: 14px;
    }

    .ex-editor-body {
        padding: 12px;
    }

    .ex-form-section {
        padding: 14px;
    }

    .ex-editor-footer {
        flex-wrap: wrap;
    }

    .ex-footer-spacer {
        display: none;
    }

    .ex-editor-footer .ex-btn {
        flex: 1 1 145px;
    }
}

/* Paginación de categorías dentro del editor de extras */
.ex-category-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.ex-category-pagination[hidden] {
    display: none !important;
}

.ex-category-pagination strong {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.ex-category-pagination button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 620px) {
    .ex-category-pagination {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }
}

/* El detalle de inventario solo se despliega al activar el control. */
.ex-inventory-settings[hidden] {
    display: none !important;
}

/* Receta producida: el extra consume stock elaborado */
.ex-produced-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.ex-produced-head h4 { margin: 7px 0 4px; }
.ex-produced-head p { margin: 0; color: var(--ex-muted, #718096); }
#exInvProducedUnit[readonly], #exInvUnit[readonly] {
    background: #f4f7fa;
    cursor: not-allowed;
    font-weight: 800;
}

/* =========================================================
   2026-08-06 · Extras: tabla limpia + navegación de enlaces
   ========================================================= */
.ex-wrap .ex-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(25, 39, 54, .06);
}

.ex-list-toolbar {
    margin: 0;
    padding: 14px 18px;
    border-top: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    background: #f9fbfd;
}

.ex-search-field { max-width: 430px; }
.ex-count {
    padding: 7px 11px;
    border: 1px solid #dce4ec;
    border-radius: 999px;
    background: #fff;
    color: #637285;
    font-size: 12px;
    font-weight: 800;
}

.ex-table-wrap {
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
}
.ex-table { min-width: 1040px; }
.ex-table thead th {
    padding: 13px 15px;
    border-bottom: 1px solid #e3e9ef;
    background: #f5f8fb;
    color: #677588;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.ex-table tbody td {
    padding: 14px 15px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}
.ex-table tbody tr { transition: background .15s ease; }
.ex-table tbody tr:hover { background: #f9fbfe; }
.ex-table tbody tr:last-child td { border-bottom: 0; }

.ex-id-cell {
    display: inline-flex;
    min-width: 62px;
    justify-content: center;
    padding: 6px 9px;
    border-radius: 9px;
    background: #eef3f8;
    color: #405065;
    font-size: 12px;
}
.ex-name-cell { display: grid; gap: 3px; }
.ex-name-cell > strong { color: #172233; font-size: 14px; }
.ex-name-cell > small {
    display: block;
    max-width: 280px;
    overflow: hidden;
    color: #7a8796;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-money-cell { color: #1e2c3a; white-space: nowrap; }
.ex-cost-cell { color: #687587; font-weight: 750; white-space: nowrap; }

.ex-inventory-cell { display: grid; gap: 4px; }
.ex-inventory-cell small {
    display: block;
    max-width: 250px;
    overflow: hidden;
    color: #7b8794;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-link-badge,
.ex-status-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}
.ex-link-badge.is-item { background: #e9f8ef; color: #26754d; }
.ex-link-badge.is-recipe { background: #edf3ff; color: #3e65a3; }
.ex-link-badge.is-produced { background: #f2edff; color: #6949a3; }
.ex-link-badge.is-free { background: #f1f3f5; color: #6d7782; }
.ex-link-badge.is-warning { background: #fff0df; color: #9d5e17; }
.ex-status-pill.is-active { background: #e9f8ef; color: #23744b; }
.ex-status-pill.is-inactive { background: #f0f2f4; color: #69727d; }

.ex-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: nowrap;
}
.ex-row-actions .ex-btn {
    min-height: 34px;
    border-radius: 9px;
    white-space: nowrap;
}
.ex-btn-link-target {
    border: 1px solid #d7e1eb;
    background: #fff;
    color: #40536a;
}
.ex-btn-link-target.is-recipe { border-color: #d6e3fa; background: #f0f5ff; color: #35619d; }
.ex-btn-link-target.is-item { border-color: #d8eadf; background: #eff9f3; color: #2d7550; }
.ex-btn-link-target.is-product { border-color: #e2dcf3; background: #f5f1ff; color: #684da0; }
.ex-btn-edit { background: #25394f; border-color: #25394f; color: #fff; }
.ex-btn-edit:hover { background: #1d3044; color: #fff; }

.ex-hint {
    margin: 0;
    padding: 12px 18px 14px;
    border-top: 1px solid #edf1f5;
    background: #fbfcfd;
    color: #7a8795;
}

.ex-editor-dialog {
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(7, 20, 35, .3);
}
.ex-editor-header {
    border-bottom: 1px solid #e8edf2;
    background: rgba(255, 255, 255, .98);
}
.ex-form-section {
    border: 1px solid #e6ebf0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(27, 43, 59, .035);
}
.ex-section-number {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.ex-inventory-options {
    gap: 10px;
}
.ex-inventory-option {
    border-radius: 14px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ex-inventory-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 48, 67, .06);
}

@media (max-width: 760px) {
    .ex-row-actions { flex-wrap: wrap; }
    .ex-row-actions .ex-btn { flex: 1 1 auto; }
}

/* Carga masiva editable + paginación (2026-08-09) */
.ex-bulk-preview {
    width: min(1480px, 97vw);
    max-height: 94vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .38);
}
.ex-bulk-preview-head,
.ex-bulk-preview-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e8edf3;
}
.ex-bulk-preview-head h3 { margin: 0; color: #0f172a; font-size: 22px; font-weight: 950; }
.ex-bulk-preview-head p { margin: 5px 0 0; color: #64748b; font-size: 13px; }
.ex-bulk-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e8edf3;
    color: #475569;
}
.ex-bulk-preview-toolbar > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ex-bulk-validation { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eaf8ef; color: #24724a; font-size: 11px; font-weight: 900; }
.ex-bulk-validation.is-invalid { background: #fff0f0; color: #b42318; }
.ex-bulk-table-wrap { overflow: auto; background: #fff; }
.ex-bulk-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; }
.ex-bulk-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    background: #f5f7fb;
    border-bottom: 1px solid #dfe6ee;
    color: #536178;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .035em;
    white-space: nowrap;
}
.ex-bulk-table td { padding: 8px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
.ex-bulk-table tr.is-invalid td { background: #fff8f8; }
.ex-bulk-row-number { width: 80px; color: #334155; }
.ex-bulk-row-number strong { display: block; }
.ex-bulk-row-number small { display: block; margin-top: 4px; color: #c2413b; font-size: 10px; line-height: 1.25; }
.ex-bulk-input {
    width: 100%;
    min-width: 150px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #d8e1eb;
    border-radius: 9px;
    background: #fff;
    color: #182235;
    outline: none;
}
.ex-bulk-input:focus { border-color: #5f8df7; box-shadow: 0 0 0 3px rgba(95, 141, 247, .12); }
.ex-bulk-textarea { min-width: 230px; resize: vertical; }
.ex-bulk-number { min-width: 110px; width: 120px; text-align: right; }
.ex-bulk-small { min-width: 74px; width: 78px; text-align: center; }
.ex-bulk-categories { min-width: 180px; }
.ex-bulk-remove {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}
.ex-bulk-empty { padding: 30px !important; text-align: center; color: #64748b; }
.ex-bulk-preview-foot { border-top: 1px solid #e8edf3; border-bottom: 0; background: #fff; }
.ex-bulk-pagination,
.ex-bulk-preview-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ex-bulk-pagination strong { min-width: 110px; text-align: center; color: #475569; }
.ex-bulk-preview button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 820px) {
    .ex-bulk-preview { width: 99vw; max-height: 97vh; border-radius: 14px; }
    .ex-bulk-preview-head,
    .ex-bulk-preview-foot,
    .ex-bulk-preview-toolbar { align-items: stretch; flex-direction: column; }
    .ex-bulk-pagination,
    .ex-bulk-preview-actions { justify-content: space-between; }
}

/* 2026-08-22 · Extras responsive: mantener la tabla completa antes de recurrir al scroll */
.ex-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b8c3d1 #eef2f6;
}
.ex-table-wrap::-webkit-scrollbar { height: 8px; }
.ex-table-wrap::-webkit-scrollbar-track { background: #eef2f6; border-radius: 999px; }
.ex-table-wrap::-webkit-scrollbar-thumb { background: #b8c3d1; border-radius: 999px; }
.ex-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.ex-table {
    width: 100% !important;
    min-width: 0;
    table-layout: fixed !important;
}
.ex-table th:nth-child(1), .ex-table td:nth-child(1) { width: 88px; }
.ex-table th:nth-child(2), .ex-table td:nth-child(2) { width: auto; }
.ex-table th:nth-child(3), .ex-table td:nth-child(3) { width: 90px; }
.ex-table th:nth-child(4), .ex-table td:nth-child(4) { width: 90px; }
.ex-table th:nth-child(5), .ex-table td:nth-child(5) { width: 250px; }
.ex-table th:nth-child(6), .ex-table td:nth-child(6) { width: 82px; }
.ex-table th:nth-child(7), .ex-table td:nth-child(7) { width: 190px; }
.ex-table th,
.ex-table td { min-width: 0 !important; }
.ex-table thead th,
.ex-table thead th .vase-sort-btn,
.ex-table thead th .vase-sort-btn > span:first-child {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}
.ex-table .vase-sort-btn { min-width: 0; }
.ex-table .vase-sort-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.ex-name-cell > strong {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.3;
}
.ex-row-actions { min-width: 0; }
.ex-row-actions .ex-btn { max-width: 100%; }

@media (max-width: 1320px) {
    .ex-table th:nth-child(5), .ex-table td:nth-child(5) { width: 220px; }
    .ex-table th:nth-child(7), .ex-table td:nth-child(7) { width: 165px; }
    .ex-row-actions { gap: 4px; }
    .ex-row-actions .ex-btn { padding-left: 7px; padding-right: 7px; font-size: 11px; }
}

@media (max-width: 1120px) {
    .ex-table { min-width: 880px !important; }
    .ex-table th:nth-child(5), .ex-table td:nth-child(5) { width: 210px; }
    .ex-table th:nth-child(7), .ex-table td:nth-child(7) { width: 125px; }
    .ex-row-actions { flex-direction: column; align-items: stretch; }
    .ex-row-actions .ex-btn { width: 100%; }
}

/* 2026-08-22 · Extras v10: todas las columnas visibles y proporcionales */
.ex-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
}
.ex-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}
.ex-table col.ex-col-id { width: 7%; }
.ex-table col.ex-col-name { width: 31%; }
.ex-table col.ex-col-price { width: 8%; }
.ex-table col.ex-col-cost { width: 8%; }
.ex-table col.ex-col-inventory { width: 23%; }
.ex-table col.ex-col-status { width: 8%; }
.ex-table col.ex-col-actions { width: 15%; }
.ex-table thead th,
.ex-table thead th .vase-sort-btn,
.ex-table thead th .vase-sort-btn > span:first-child {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-wrap: nowrap !important;
}
.ex-table .vase-sort-btn {
    min-width: 0 !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
    gap: 4px !important;
}
.ex-table .vase-sort-btn > span:first-child {
    overflow: visible !important;
    text-overflow: clip !important;
}
.ex-table th,
.ex-table td {
    min-width: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}
.ex-table .ex-name-cell > strong,
.ex-table .ex-name-cell > small,
.ex-table .ex-inventory-cell small {
    max-width: 100%;
}
.ex-table .ex-name-cell > small,
.ex-table .ex-inventory-cell small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-row-actions {
    width: min(128px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
}
.ex-row-actions .ex-btn {
    width: 100%;
    min-width: 0 !important;
    min-height: 30px !important;
    padding: 5px 6px !important;
    font-size: 10.5px !important;
    line-height: 1.15;
    white-space: nowrap !important;
}
@media (max-width: 1080px) {
    .ex-table {
        min-width: 0 !important;
    }
    .ex-table col.ex-col-id { width: 8%; }
    .ex-table col.ex-col-name { width: 29%; }
    .ex-table col.ex-col-price { width: 9%; }
    .ex-table col.ex-col-cost { width: 9%; }
    .ex-table col.ex-col-inventory { width: 22%; }
    .ex-table col.ex-col-status { width: 9%; }
    .ex-table col.ex-col-actions { width: 14%; }
}
@media (max-width: 767.98px) {
    .ex-table {
        display: table !important;
        width: 820px !important;
        min-width: 820px !important;
        max-width: none !important;
    }
    .ex-table thead { display: table-header-group !important; }
    .ex-table tbody { display: table-row-group !important; }
    .ex-table tr { display: table-row !important; }
    .ex-table th,
    .ex-table td { display: table-cell !important; }
}

/* 2026-08-27 · Encabezado fijo completamente opaco */
.ex-table-wrap.vase-ux-sticky-shell {
    position: relative;
    overflow: auto !important;
    isolation: isolate;
    background: #fff;
}
.ex-table-wrap.vase-ux-sticky-shell .ex-table {
    position: relative;
    z-index: 1;
}
.ex-table-wrap.vase-ux-sticky-shell .ex-table thead {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: #f8fafc !important;
    box-shadow:
        0 -34px 0 34px #f8fafc,
        inset 0 -1px 0 #dfe7f1,
        0 6px 14px rgba(15, 23, 42, .08) !important;
    transform: translateZ(0);
}
.ex-table-wrap.vase-ux-sticky-shell .ex-table thead tr {
    position: relative;
    z-index: 2;
    background: #f8fafc !important;
}
.ex-table-wrap.vase-ux-sticky-shell .ex-table thead th {
    position: relative !important;
    top: auto !important;
    z-index: 3 !important;
    background: #f8fafc !important;
    background-clip: border-box !important;
    box-shadow: none !important;
}
.ex-table-wrap.vase-ux-sticky-shell .ex-table tbody {
    position: relative;
    z-index: 0;
}
.ex-table-wrap.vase-ux-sticky-shell .ex-table tbody td {
    position: relative;
    z-index: 0;
}
