.fi-sidebar {
    border-right: 1px solid rgb(231 229 228);
    background: rgb(255 253 250);
}

.dark .fi-sidebar {
    border-right-color: rgb(68 64 60);
    background: rgb(28 25 23);
}

.fi-sidebar-header {
    min-height: 4.5rem;
    border-bottom: 1px solid rgb(231 229 228);
}

.dark .fi-sidebar-header {
    border-bottom-color: rgb(68 64 60);
}

html {
    scrollbar-color: rgb(168 162 158 / 0.4) transparent;
    scrollbar-width: thin;
}

html::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgb(168 162 158 / 0.4);
    background-clip: content-box;
}

html::-webkit-scrollbar-thumb:hover {
    background: rgb(217 119 6 / 0.7);
    background-clip: content-box;
}

html.dark {
    scrollbar-color: rgb(168 162 158 / 0.45) transparent;
}

html.dark::-webkit-scrollbar-thumb {
    background: rgb(168 162 158 / 0.45);
    background-clip: content-box;
}

.fi-sidebar-nav {
    padding: 1rem 0.75rem;
    /* Keep the scrollbar invisible until interaction without changing the
       navigation width when it appears. */
    direction: rtl;
    scrollbar-color: transparent transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.fi-sidebar-nav:hover,
.fi-sidebar-nav:focus-within {
    scrollbar-color: rgb(168 162 158 / 0.4) transparent;
}

.fi-sidebar-nav > * {
    direction: ltr;
}

.fi-sidebar-nav::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

/* Chromium's standard scrollbar properties override its pseudo-elements.
   Use one styling mechanism per engine, with a fixed gutter in every state. */
@supports selector(::-webkit-scrollbar) {
    .fi-sidebar-nav,
    .fi-sidebar-nav:hover,
    .fi-sidebar-nav:focus-within {
        scrollbar-width: auto;
        scrollbar-color: auto;
    }

    .fi-sidebar-nav::-webkit-scrollbar,
    .fi-sidebar-nav::-webkit-scrollbar-track,
    .fi-sidebar-nav::-webkit-scrollbar-track-piece,
    .fi-sidebar-nav::-webkit-scrollbar-corner {
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .fi-sidebar-nav::-webkit-scrollbar-button {
        display: none;
        width: 0;
        height: 0;
    }
}

.fi-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.fi-sidebar-nav::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    background-clip: content-box;
}

.fi-sidebar-nav:hover::-webkit-scrollbar-thumb,
.fi-sidebar-nav:focus-within::-webkit-scrollbar-thumb {
    background: rgb(168 162 158 / 0.4);
    background-clip: content-box;
}

.fi-sidebar-nav:hover::-webkit-scrollbar-thumb:hover,
.fi-sidebar-nav:focus-within::-webkit-scrollbar-thumb:hover {
    background: rgb(217 119 6 / 0.7);
    background-clip: content-box;
}

.fi-sidebar-group {
    margin-bottom: 0;
}

.fi-sidebar-group-btn {
    padding: 0.5rem 0.625rem;
}

.fi-sidebar-group-label {
    color: rgb(120 113 108);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fi-sidebar-group-btn::before {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: '';
}

.fi-sidebar-group[data-group-label='Operación'] > .fi-sidebar-group-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d97706' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 21 3 16.5m0 0L7.5 12M3 16.5h18m-4.5-13.5L21 7.5m0 0L16.5 12M21 7.5H3'/%3E%3C/svg%3E");
}

.fi-sidebar-group[data-group-label='Catálogo'] > .fi-sidebar-group-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d97706' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 6.75A2.25 2.25 0 0 1 5.25 4.5h4.5L12 6.75h6.75A2.25 2.25 0 0 1 21 9v8.25a2.25 2.25 0 0 1-2.25 2.25h-13.5A2.25 2.25 0 0 1 3 17.25V6.75Z'/%3E%3C/svg%3E");
}

.fi-sidebar-group[data-group-label='Administración'] > .fi-sidebar-group-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d97706' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath stroke-linecap='round' d='M12 3v2m0 14v2M3 12h2m14 0h2M5.64 5.64l1.42 1.42m9.88 9.88 1.42 1.42m0-12.16-1.42 1.42m-9.88 9.88-1.42 1.42'/%3E%3C/svg%3E");
}

.fi-sidebar-group[data-group-label='Filament Shield'] > .fi-sidebar-group-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d97706' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 3 4.5 6v5.25c0 4.58 3.15 8.85 7.5 9.75 4.35-.9 7.5-5.17 7.5-9.75V6L12 3Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m9.5 12 1.6 1.6 3.4-3.4'/%3E%3C/svg%3E");
}

.dark .fi-sidebar-group-label {
    color: rgb(168 162 158);
}

.fi-sidebar-group-items {
    margin-inline-start: 0.75rem;
    padding-inline-start: 0.75rem;
    border-left: 2px solid rgb(217 119 6 / 0.82) !important;
    border-inline-start: 2px solid rgb(217 119 6 / 0.82) !important;
    border-inline-start-color: rgb(217 119 6 / 0.82) !important;
}

.dark .fi-sidebar-group-items {
    border-left-color: rgb(245 158 11 / 0.9) !important;
    border-inline-start-color: rgb(245 158 11 / 0.9) !important;
}

.fi-sidebar-item-btn {
    min-height: 2.75rem;
    border-radius: 0.5rem;
    color: rgb(68 64 60);
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.dark .fi-sidebar-item-btn {
    color: rgb(231 229 228);
}

.fi-sidebar-item-btn:hover {
    background: rgb(245 245 244);
    color: rgb(28 25 23);
}

.dark .fi-sidebar-item-btn:hover {
    background: rgb(68 64 60);
    color: rgb(255 251 235);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: rgb(245 158 11);
    color: rgb(28 25 23);
    box-shadow: 0 4px 12px rgb(245 158 11 / 0.2);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
    color: inherit;
}

.fi-sidebar-item-icon {
    color: rgb(168 162 158);
}

.fi-sidebar-item-btn:hover .fi-sidebar-item-icon {
    color: rgb(217 119 6);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: rgb(28 25 23);
}

/* Shared presentation for Filament's login, MFA and password recovery pages. */
.fi-simple-layout {
    background:
        radial-gradient(ellipse at 15% 10%, rgb(251 191 36 / 0.14), transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgb(214 211 209 / 0.28), transparent 50%),
        rgb(250 249 246);
}

.dark .fi-simple-layout {
    background:
        radial-gradient(ellipse at 15% 10%, rgb(217 119 6 / 0.10), transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgb(120 113 108 / 0.10), transparent 50%),
        rgb(18 18 20);
}

.fi-simple-layout .fi-simple-main-ctn {
    padding: 1.25rem;
}

.fi-simple-layout .fi-simple-main {
    max-width: 30rem;
    margin-block: 4rem;
    padding: clamp(1.5rem, 5vw, 2.75rem);
    border: 1px solid rgb(231 229 228);
    border-radius: 1.5rem;
    background: rgb(255 255 255 / 0.97);
    box-shadow: 0 20px 60px -24px rgb(68 64 60 / 0.23), 0 2px 8px rgb(68 64 60 / 0.03);
}

.dark .fi-simple-layout .fi-simple-main {
    border-color: rgb(255 255 255 / 0.10);
    background: rgb(28 28 31 / 0.97);
    box-shadow: 0 24px 64px -24px rgb(0 0 0 / 0.55);
}

.fi-simple-layout .fi-simple-header .fi-logo {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.fi-simple-layout .fi-simple-header-heading {
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.fi-simple-layout .fi-simple-header-subheading {
    margin-top: 0.875rem;
    line-height: 1.65;
    text-wrap: pretty;
}

.fi-simple-layout .fi-input-wrp {
    border-radius: 0.875rem;
    background: rgb(250 250 249);
}

.dark .fi-simple-layout .fi-input-wrp {
    background: rgb(255 255 255 / 0.04);
}

.fi-simple-layout .fi-input-wrp:not(.fi-invalid):focus-within {
    outline: 3px solid rgb(245 158 11 / 0.14);
    outline-offset: 2px;
}

.fi-simple-layout .fi-input {
    min-height: 3rem;
    font-size: 1rem;
}

.fi-simple-layout .fi-btn {
    min-height: 3rem;
    border-radius: 0.875rem;
    font-weight: 650;
}

.fi-simple-layout .fi-one-time-code-input-ctn {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(0.375rem, 1.5vw, 0.625rem);
    width: 100%;
    max-width: 21rem;
    margin-inline: auto;
}

.fi-simple-layout .fi-one-time-code-input-ctn > .fi-one-time-code-input-digit {
    width: 100%;
    min-width: 0;
    height: 3.25rem;
    padding: 0;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .fi-simple-layout .fi-simple-main-ctn {
        padding-inline: 1rem;
    }

    .fi-simple-layout .fi-simple-main {
        padding: 1.5rem 1.25rem;
        border-radius: 1.25rem;
    }
}

@media (forced-colors: active) {
    .fi-sidebar-nav,
    .fi-sidebar-nav:hover,
    .fi-sidebar-nav:focus-within {
        scrollbar-color: auto;
        scrollbar-width: auto;
    }
}

/* Product editing shares the fixed action bar used by POS sales. */
.product-wizard-edit {
    margin-bottom: 5rem;
}

.product-wizard-edit > .fi-sc-wizard-footer {
    display: none;
}

.product-edit-actions.fi-sticky .fi-ac {
    z-index: 20;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

@media (max-width: 767px) {
    .product-wizard > .fi-sc-wizard-header {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-wizard > .fi-sc-wizard-header > .fi-sc-wizard-header-step {
        display: flex;
        min-width: 0;
    }

    .product-wizard .fi-sc-wizard-header-step-btn {
        width: 100%;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .product-wizard .fi-sc-wizard-header-step-icon-ctn {
        width: 1.75rem;
        height: 1.75rem;
    }

    .product-wizard .fi-sc-wizard-header-step-text {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .product-edit-actions.fi-sticky .fi-ac {
        display: grid;
        grid-template-columns: 0.85fr 1fr 1.1fr 1fr;
        gap: 0.375rem;
        padding: 0.75rem 0.5rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    .product-edit-actions .fi-btn {
        min-height: 2.75rem;
        min-width: 0;
        width: 100%;
        padding-inline: 0.25rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .product-wizard .fi-sc-wizard-header-step-btn {
        gap: 0.25rem;
        padding: 0.75rem 0.5rem;
        min-height: 2.75rem;
    }

    .product-wizard .fi-sc-wizard-header-step-icon-ctn {
        width: 1.25rem;
        height: 1.25rem;
    }

    .product-wizard .fi-sc-wizard-header-step-icon-ctn .fi-icon {
        width: 1rem;
        height: 1rem;
    }

    .product-wizard .fi-sc-wizard-header-step-label {
        font-size: 0.75rem;
    }
}

/* Keep long variation names readable beside their item actions. */
.product-variations .fi-fo-repeater-item-header-label {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.product-variations .fi-fo-repeater-item-header-end-actions {
    flex-shrink: 0;
}

.product-variation-name { display: block; }
.product-variation-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.product-variation-tags:empty { display: none; }
.product-variation-tag { display: inline-block; padding: 2px 7px; border-radius: 6px; background: rgba(99, 102, 241, .12); font-size: 11px; line-height: 1.5; font-weight: 500; }

/* Wrap at word boundaries on narrow cards, never split the three-letter currency. */
.product-inventory-variations tbody > tr > td:nth-last-child(2) .fi-in-text-item {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Keep the currency suffix with its amount in the desktop inventory table. */
@media (min-width: 640px) {
    .product-inventory-variations tbody > tr > td:nth-last-child(2) .fi-in-text-item {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }
}

@media (max-width: 639px) {
    .product-inventory-summary > .fi-section {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        outline: none;
        --tw-ring-shadow: 0 0 #0000;
    }
    .product-inventory-summary .fi-section-header { padding: 0 0 12px; }
    .product-inventory-summary .fi-section-header-description,
    .product-inventory-summary .fi-section-header > .fi-icon { display: none; }
    .product-inventory-summary .fi-section-content-ctn { border: 0; }
    .product-inventory-summary .fi-section-content { padding: 0; }
    .product-inventory-variations tbody > tr {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px !important;
        padding: 12px !important;
    }
    .product-inventory-variations tbody > tr > td { min-width: 0; padding: 0 !important; }
    .product-inventory-variations tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .product-inventory-variations tbody > tr > td:nth-child(2) { grid-column: 2 / span 3; grid-row: 1; }
    .product-inventory-variations tbody > tr > td:nth-child(3) { grid-column: 1 / span 2; grid-row: 3; }
    .product-inventory-variations tbody > tr > td:nth-child(5) { grid-column: 3 / span 2; grid-row: 2; }
    .product-inventory-variations tbody > tr > td:nth-child(4) { grid-column: 1 / span 2; grid-row: 2; }
    .product-inventory-variations tbody > tr > td:nth-child(6) { grid-column: 3 / span 2; grid-row: 3; align-self: end; }
    .product-inventory-without-costs tbody > tr > td:nth-child(5) { grid-column: 3 / span 2; grid-row: 3; align-self: end; }
    .product-inventory-variations td:nth-child(2) .fi-in-entry-label-col,
    .product-inventory-variations td:last-child .fi-in-entry-label-col { display: none; }
    .product-inventory-variations .fi-in-entry { gap: 2px; }
    .product-inventory-variations .fi-in-entry-label { font-size: 11px; }
    .product-inventory-variations .fi-in-image img { width: 52px !important; max-width: 100%; height: auto !important; aspect-ratio: 1; object-fit: cover; }
    .product-inventory-variations td:last-child a { display: flex; min-height: 44px; align-items: center; }
}

@media (max-width: 639px) {
    .product-variations-section,
    .product-variations-section > .fi-section {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0;
        box-shadow: none;
        outline: none;
        --tw-ring-shadow: 0 0 #0000;
    }
    .product-variations-section .fi-section-header { padding: 0 0 12px; }
    .product-variations-section .fi-section-header-description,
    .product-variations-section .fi-section-header > .fi-icon { display: none; }
    .product-variations-section .fi-section-content-ctn { border: 0; }
    .product-variations-section .fi-section-content { padding: 0; }
}

.product-attribute-group + .product-attribute-group { margin-top: 12px; }

.stock-variation-identity { display: flex; align-items: center; gap: 12px; }
.stock-variation-identity .product-variation-tags { min-width: 0; margin-top: 0; }
.stock-variation-image { width: 96px; height: 96px; flex-shrink: 0; object-fit: cover; border-radius: 8px; }
.stock-page-form { padding-bottom: 90px; }
.stock-page-actions { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--gray-50, #fafafa); padding: 10px 16px; border-top: 1px solid rgba(148,163,184,.25); }
.dark .stock-page-actions { background: #18181b; }
.stock-page-actions .fi-ac { justify-content: center; flex-wrap: nowrap; }
@media (min-width: 1024px) { .stock-page-actions { left: var(--sidebar-width, 20rem); } }
@media (max-width: 639px) { .stock-page-actions .fi-btn { flex: 1; min-height: 44px; } }

@media (max-width: 639px) { .stock-variation-filter { position: static !important; } }

@media (max-width: 639px) { .stock-page-actions .fi-btn { font-size: 12px; padding-inline: 10px; } .stock-page-actions .fi-btn-label { white-space: nowrap; } }

.product-description-preview { max-height: 192px; overflow: hidden; overflow-wrap: anywhere; }
.product-description-preview.is-expanded { max-height: none; }
.product-description-toggle { min-height: 44px; font-weight: 600; color: var(--primary-500, #f97316); }
.fi-fo-rich-editor .tiptap p.is-editor-empty:first-child::before { max-width: 100%; white-space: normal; overflow-wrap: anywhere; float: none; height: auto; display: block; }
.fi-fo-rich-editor .tiptap { min-width: 0; overflow-wrap: anywhere; }

.product-long-description-editor .tiptap { min-height: 144px; }

/* iPhone Safari zooms small fields on focus; keep product text at least 16px on phones. */
@media (max-width: 767px) {
    .product-form-wizard .fi-input,
    .product-form-wizard .tiptap {
        font-size: 16px;
    }
}

/* Product image capture controls stay compact on phones. */
.product-image-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin-bottom:.5rem; max-width:20rem; }
.product-image-tool { border:1px solid #94a3b84d; border-radius:.5rem; padding:.5rem .375rem; min-height:44px; font-size:.8125rem; font-weight:500; }
.product-image-tool:hover { background:#94a3b81a; }
.product-image-tool:focus-visible { outline:2px solid var(--primary-500); outline-offset:2px; }
.product-image-tool:disabled { opacity:.5; }
.product-image-message { font-size:.875rem; margin-bottom:.5rem; overflow-wrap:anywhere; }

/* Narrow gallery tiles overlap FilePond's edit and cancel controls on phones. */
@media (max-width: 639px) {
    :is(.product-form-wizard, .quick-product-images) .fi-fo-file-upload .filepond--root[data-style-panel-layout='grid'] .filepond--item {
        width: calc(100% - 0.5rem);
    }

    :is(.product-form-wizard, .quick-product-images) .fi-fo-file-upload .filepond--file {
        flex-direction: column;
        gap: 0.25rem;
    }

    :is(.product-form-wizard, .quick-product-images) .fi-fo-file-upload .filepond--file-info,
    :is(.product-form-wizard, .quick-product-images) .fi-fo-file-upload .filepond--file .filepond--file-status {
        flex: none;
        width: calc(100% - 2.25em);
        min-width: 0;
        margin: 0;
        align-items: flex-start;
        text-align: left;
    }

    :is(.product-form-wizard, .quick-product-images) .fi-fo-file-upload .filepond--file-status > * {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
@media (max-width: 639px) {
    .fi-ta-filters-modal > .fi-modal-window-ctn {
        display: flex;
        align-items: stretch;
        padding: 0;
    }

    .fi-ta-filters-modal > .fi-modal-window-ctn > .fi-modal-window {
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}

/* Product identity and per-variation navigation. */
.product-heading-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-heading-image, .product-heading-placeholder { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; object-fit: contain; background: rgba(148, 163, 184, .12); }
.product-heading-placeholder { display: flex; align-items: center; justify-content: center; }
.product-heading-placeholder svg { width: 28px; height: 28px; }
.product-heading-name { min-width: 0; overflow-wrap: anywhere; }
.product-inventory-variations td:last-child .fi-sc-actions { flex-wrap: wrap; gap: 8px; }
/* Tall touch targets must center the label with its icon, not pin it to a baseline. */
.product-inventory-variations .fi-link > .fi-link-label { align-self: center; }
.product-inventory-variations .fi-link > svg { flex-shrink: 0; }
@media (max-width: 640px) {
    .product-heading-image, .product-heading-placeholder { width: 64px; height: 64px; flex-basis: 64px; }
    .product-inventory-variations tbody > tr > td:last-child { grid-column: 1 / -1; grid-row: 4; }
    .product-inventory-variations td:last-child a { min-height: 44px; }
}

/* Read-only inventory navigation must not sit behind the fixed editing footer.
   Keep the existing fixed bar on editable wizard steps and standalone stock. */
.fi-page:has(#product-inventory.fi-active) .product-edit-actions.fi-sticky .fi-ac {
    position: static;
    width: 100% !important;
    margin: 0;
    transform: none;
}
.stock-page-actions-with-variations {
    position: static;
    margin-top: 1rem;
    border-radius: 0.75rem;
}
.fi-page:has(.stock-page-actions-with-variations) .stock-page-form { padding-bottom: 0; }
