.fi-resource-manufacturing-work-orders .fi-header-actions-ctn {
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.fi-resource-manufacturing-work-orders .fi-header-actions-ctn > .fi-ac {
    max-width: 100%;
}

.fi-header-actions-ctn:has(.erp-product-header-action) {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fi-header-actions-ctn:has(.erp-product-header-action) > .fi-ac {
    min-width: 0;
    width: 100%;
}

.fi-btn.erp-product-header-action {
    width: 100%;
    min-height: 2.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    white-space: nowrap;
}

/*
 * Manufacturing Work Orders repeatable table — mobile-first.
 * Mobile: let table shrink to viewport so users see content without forced
 * horizontal scrolling. Wider breakpoints reintroduce a min-width so columns
 * stay readable on tablet/desktop.
 */
.fi-resource-manufacturing-work-orders .fi-in-table-repeatable {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.fi-resource-manufacturing-work-orders .fi-in-table-repeatable > table {
    width: 100%;
    min-width: 0;
}

@media (min-width: 40rem) {
    .fi-header-actions-ctn:has(.erp-product-header-action) {
        width: auto;
    }

    .fi-header-actions-ctn:has(.erp-product-header-action) > .fi-ac {
        width: auto;
    }

    .fi-btn.erp-product-header-action {
        width: auto;
        min-width: 9rem;
    }

    .fi-resource-manufacturing-work-orders .fi-in-table-repeatable > table {
        min-width: 36rem;
        width: max-content;
    }
}

@media (min-width: 64rem) {
    .fi-resource-manufacturing-work-orders .fi-in-table-repeatable > table {
        min-width: 64rem;
    }
}

/* Runtime utility compatibility for schema-rendered Filament pages. */
.grid { display: grid; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

.w-full { width: 100%; }
.w-7 { width: 1.75rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-32 { width: 8rem; }
.w-72 { width: 18rem; }
.h-2 { height: 0.5rem; }
.h-7 { height: 1.75rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.max-w-full { max-width: 100%; }
.max-w-lg { max-width: 32rem; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.break-words { overflow-wrap: break-word; word-break: break-word; }

.p-1 { padding: 0.25rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; border-style: solid; }
.border-dashed { border-style: dashed; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-primary-200 { border-color: #bfdbfe; }
.border-warning-300 { border-color: #fcd34d; }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-primary-50 { background-color: #eff6ff; }
.bg-warning-50\/70 { background-color: rgba(255, 251, 235, 0.7); }
.bg-warning-500 { background-color: #f59e0b; }
.bg-success-100 { background-color: #dcfce7; }
.bg-warning-100 { background-color: #fef3c7; }

.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }

.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-primary-600 { color: #2563eb; }
.text-primary-700 { color: #1d4ed8; }
.text-success-700 { color: #15803d; }
.text-success-800 { color: #166534; }
.text-warning-600 { color: #d97706; }
.text-warning-700 { color: #b45309; }
.text-warning-800 { color: #92400e; }
.text-warning-900\/90 { color: rgba(120, 53, 15, 0.9); }
.text-danger-600 { color: #dc2626; }
.text-info-700 { color: #0369a1; }

.overflow-hidden { overflow: hidden; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); }
.transition { transition: all 150ms ease-in-out; }

.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:shadow:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.hover\:-translate-y-0\.5:hover { transform: translateY(-0.125rem); }

.dark .dark\:bg-gray-800 { background-color: #1f2937; }
.dark .dark\:bg-gray-900 { background-color: #111827; }
.dark .dark\:bg-gray-900\/40 { background-color: rgba(17, 24, 39, 0.4); }
.dark .dark\:bg-gray-900\/60 { background-color: rgba(17, 24, 39, 0.6); }
.dark .dark\:bg-primary-500\/10 { background-color: rgba(59, 130, 246, 0.1); }
.dark .dark\:bg-success-500\/20 { background-color: rgba(34, 197, 94, 0.2); }
.dark .dark\:bg-warning-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.dark .dark\:bg-warning-500\/20 { background-color: rgba(245, 158, 11, 0.2); }
.dark .dark\:border-gray-600 { border-color: #4b5563; }
.dark .dark\:border-gray-700 { border-color: #374151; }
.dark .dark\:border-primary-500\/30 { border-color: rgba(59, 130, 246, 0.3); }
.dark .dark\:border-warning-500\/40 { border-color: rgba(245, 158, 11, 0.4); }
.dark .dark\:text-gray-100 { color: #f3f4f6; }
.dark .dark\:text-gray-200 { color: #e5e7eb; }
.dark .dark\:text-gray-300 { color: #d1d5db; }
.dark .dark\:text-gray-400 { color: #9ca3af; }
.dark .dark\:text-primary-300 { color: #93c5fd; }
.dark .dark\:text-primary-400 { color: #60a5fa; }
.dark .dark\:text-success-300 { color: #86efac; }
.dark .dark\:text-success-400 { color: #4ade80; }
.dark .dark\:text-warning-200 { color: #fde68a; }
.dark .dark\:text-warning-300 { color: #fcd34d; }
.dark .dark\:text-warning-400 { color: #fbbf24; }
.dark .dark\:text-danger-400 { color: #f87171; }
.dark .dark\:text-info-400 { color: #38bdf8; }
.dark .dark\:hover\:bg-gray-800:hover { background-color: #1f2937; }
.dark .dark\:hover\:text-gray-100:hover { color: #f3f4f6; }

/*
 * General Tailwind utility compatibility.
 * Further utilities referenced by interactive admin Blade pages (inventory
 * overview, cash hub, field collections, bank reconciliation, product tiles,
 * etc.) that the panel does not compile. Standard Tailwind values; defined
 * here so existing markup renders as intended. Kept ahead of the responsive
 * `@media` blocks below so `sm:`/`md:`/`lg:`/`xl:` variants win the cascade.
 */

/* Backgrounds */
.bg-gray-400 { background-color: #9ca3af; }
.bg-success-50 { background-color: #f0fdf4; }
.bg-danger-50 { background-color: #fef2f2; }

/* Borders & dividers */
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-gray-100 { border-color: #f3f4f6; }
.rounded { border-radius: 0.25rem; }
.ring-1 { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.divide-y > :not([hidden]) ~ :not([hidden]) {
    border-top-width: 1px;
    border-bottom-width: 0;
    border-style: solid;
}
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #f3f4f6; }
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #e5e7eb; }

/* Typography */
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-gray-400 { color: #9ca3af; }
.text-gray-950 { color: #030712; }
.text-danger-700 { color: #b91c1c; }
.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}
.tabular-nums { font-variant-numeric: tabular-nums; }
.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.underline { text-decoration-line: underline; }
.list-disc { list-style-type: disc; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Layout */
.hidden { display: none; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Sizing */
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-9 { height: 2.25rem; }
.h-11 { height: 2.75rem; }
.h-14 { height: 3.5rem; }
.h-24 { height: 6rem; }
.w-2 { width: 0.5rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-9 { width: 2.25rem; }
.max-w-sm { max-width: 24rem; }
.max-w-\[120px\] { max-width: 120px; }
.max-w-\[140px\] { max-width: 140px; }
.min-w-full { min-width: 100%; }
.min-w-\[12rem\] { min-width: 12rem; }
.min-w-\[32rem\] { min-width: 32rem; }
.min-w-\[36rem\] { min-width: 36rem; }
.object-cover { object-fit: cover; }

/* Spacing */
.p-2 { padding: 0.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pl-5 { padding-left: 1.25rem; }
.pr-4 { padding-right: 1rem; }
.gap-1\.5 { gap: 0.375rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mb-4 { margin-bottom: 1rem; }
.ms-5 { margin-inline-start: 1.25rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Dark mode */
.dark .dark\:bg-gray-100 { background-color: #f3f4f6; }
.dark .dark\:text-white { color: #ffffff; }
.dark .dark\:divide-gray-700 > :not([hidden]) ~ :not([hidden]) { border-color: #374151; }
.dark .dark\:divide-gray-800 > :not([hidden]) ~ :not([hidden]) { border-color: #1f2937; }

@media (min-width: 40rem) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
    .sm\:w-72 { width: 18rem; }
    .sm\:h-16 { height: 4rem; }
    .sm\:w-16 { width: 4rem; }
}

@media (min-width: 48rem) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 80rem) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/*
 * Mobile escape hatch for Filament's sticky form footer actions.
 * Sticky footer is helpful on desktop (the submit button stays in view as
 * users scroll a long form), but on phones the fixed bar overlays mid-form
 * fields while the user is filling them. Pages that opt in to
 * `extraAttributes(['class' => 'erp-mobile-static-actions'])` on the
 * Schemas\Components\Actions footer get the sticky behaviour disabled
 * below the `sm` breakpoint while keeping it on tablet/desktop.
 */
@media (max-width: 39.99rem) {
    .erp-mobile-static-actions.fi-sticky .fi-ac,
    .erp-mobile-static-actions .fi-ac.fi-sticky {
        position: static;
        bottom: auto;
        margin-left: 0;
        margin-right: 0;
        padding: 0.75rem 0;
        width: 100%;
        background: transparent;
        box-shadow: none;
    }
}

.mfg-guide-runbook {
    max-width: 100%;
    line-height: 1.6;
}

.mfg-guide-page {
    display: grid;
    gap: 1rem;
}

.mfg-guide-hero {
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 1rem;
    background: linear-gradient(130deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 233, 0.03));
}

.mfg-guide-eyebrow {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1d4ed8;
}

.mfg-guide-title {
    margin: 0.35rem 0 0;
    font-size: 1.45rem;
    line-height: 1.2;
    color: #111827;
}

.mfg-guide-subtitle {
    margin: 0.5rem 0 0;
    color: #374151;
    font-size: 0.95rem;
}

.mfg-guide-workflows {
    display: grid;
    gap: 0.75rem;
}

.mfg-guide-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: #ffffff;
    padding: 0.9rem;
}

.mfg-guide-card h3 {
    margin: 0;
    font-size: 1rem;
    color: #111827;
}

.mfg-guide-card ol {
    margin: 0.65rem 0 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.35rem;
    color: #374151;
}

.mfg-guide-runbook h1,
.mfg-guide-runbook h2,
.mfg-guide-runbook h3,
.mfg-guide-runbook h4 {
    color: #111827;
    line-height: 1.25;
}

.mfg-guide-runbook h1 { font-size: 1.35rem; margin: 1.25rem 0 0.5rem; }
.mfg-guide-runbook h2 { font-size: 1.2rem; margin: 1.1rem 0 0.45rem; }
.mfg-guide-runbook h3 { font-size: 1.05rem; margin: 0.9rem 0 0.4rem; }
.mfg-guide-runbook h4 { font-size: 0.95rem; margin: 0.75rem 0 0.35rem; }

.mfg-guide-runbook p,
.mfg-guide-runbook li {
    color: #374151;
}

.mfg-guide-runbook code {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.85em;
}

.mfg-guide-runbook pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
}

.mfg-guide-runbook pre,
.mfg-guide-runbook table,
.mfg-guide-runbook .overflow-x-auto {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.mfg-guide-runbook table {
    border-collapse: collapse;
}

.mfg-guide-runbook table th,
.mfg-guide-runbook table td {
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.45rem 0.6rem;
    white-space: nowrap;
}

.mfg-guide-runbook table th {
    background: rgba(241, 245, 249, 0.8);
    color: #111827;
}

.dark .mfg-guide-hero {
    border-color: rgba(96, 165, 250, 0.35);
    background: linear-gradient(130deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.25));
}

.dark .mfg-guide-eyebrow { color: #93c5fd; }
.dark .mfg-guide-title { color: #f8fafc; }
.dark .mfg-guide-subtitle { color: #cbd5e1; }

.dark .mfg-guide-card {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(100, 116, 139, 0.45);
}

.dark .mfg-guide-card h3,
.dark .mfg-guide-runbook h1,
.dark .mfg-guide-runbook h2,
.dark .mfg-guide-runbook h3,
.dark .mfg-guide-runbook h4 {
    color: #f8fafc;
}

.dark .mfg-guide-card ol,
.dark .mfg-guide-runbook p,
.dark .mfg-guide-runbook li {
    color: #cbd5e1;
}

.dark .mfg-guide-runbook code {
    background: rgba(51, 65, 85, 0.75);
    color: #e2e8f0;
}

.dark .mfg-guide-runbook table th {
    background: rgba(51, 65, 85, 0.65);
    color: #f1f5f9;
}

.dark .mfg-guide-runbook table th,
.dark .mfg-guide-runbook table td {
    border-color: rgba(100, 116, 139, 0.45);
}

@media (min-width: 48rem) {
    .mfg-guide-workflows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/*
 * Scoped input padding for custom Blade operator pages.
 * Tailwind padding utilities (`px-*`) sometimes do not survive onto custom
 * Blade surfaces (per AGENTS.md §"Critical input padding"), leaving the
 * placeholder/text flush against the left border. Apply `.erp-operator-input`
 * on the offending <input> to lock in an explicit horizontal inset.
 *
 * Use `.erp-search-input` for icon-leading search inputs that need extra
 * left padding to clear a leading magnifier glyph; otherwise the normal
 * operator-input padding is fine.
 */
.erp-operator-input {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.erp-search-input {
    padding-left: 2.5rem;
    padding-right: 0.75rem;
}

/*
 * Scanner onboarding banner.
 * Rendered by a Filament widget, so it cannot rely on Tailwind utilities
 * being compiled (the panel ships component CSS only — see "Runtime utility
 * compatibility" above). Layout, colour, dark mode and responsive behaviour
 * are therefore defined explicitly. Mobile-first: the icon/copy block and the
 * action button stack under 40rem, then sit inline on a row above it.
 */
.erp-scanner-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #fcd34d;
    border-radius: 0.75rem;
    background-color: #fffbeb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.erp-scanner-banner__body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.erp-scanner-banner__copy {
    min-width: 0;
}

.erp-scanner-banner .erp-scanner-banner__icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.125rem;
    color: #d97706;
}

.erp-scanner-banner__title {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    color: #78350f;
}

.erp-scanner-banner__text {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #92400e;
}

.erp-scanner-banner__action {
    width: 100%;
}

.erp-scanner-banner__action .fi-btn {
    width: 100%;
    justify-content: center;
}

@media (min-width: 40rem) {
    .erp-scanner-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
        padding: 1.25rem 1.5rem;
    }

    .erp-scanner-banner__action {
        width: auto;
        flex-shrink: 0;
    }

    .erp-scanner-banner__action .fi-btn {
        width: auto;
    }
}

.dark .erp-scanner-banner {
    border-color: rgba(180, 83, 9, 0.6);
    background-color: rgba(69, 26, 3, 0.4);
}

.dark .erp-scanner-banner .erp-scanner-banner__icon { color: #fbbf24; }
.dark .erp-scanner-banner__title { color: #fef3c7; }
.dark .erp-scanner-banner__text { color: #fde68a; }

/*
 * Responsive + flex utility compatibility.
 * Custom Blade surfaces use these Tailwind utilities for mobile-first
 * layouts, but the panel does not compile them. Without these definitions
 * `flex-col` is a no-op (so surfaces meant to stack on mobile render as a
 * row) and `sm:*`/`md:*`/`lg:*`/`xl:*` variants never apply. Defined here so
 * existing markup behaves as written.
 */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-none { flex: none; }
.flex-1 { flex: 1 1 0%; }
.w-auto { width: auto; }
.items-stretch { align-items: stretch; }

@media (min-width: 40rem) {
    .sm\:flex { display: flex; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:flex-col { flex-direction: column; }
    .sm\:flex-wrap { flex-wrap: wrap; }
    .sm\:flex-nowrap { flex-wrap: nowrap; }
    .sm\:flex-none { flex: none; }
    .sm\:items-center { align-items: center; }
    .sm\:items-start { align-items: flex-start; }
    .sm\:items-end { align-items: flex-end; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:justify-center { justify-content: center; }
    .sm\:w-auto { width: auto; }
    .sm\:shrink-0 { flex-shrink: 0; }
    .sm\:mx-0 { margin-left: 0; margin-right: 0; }
    .sm\:p-5 { padding: 1.25rem; }
    .sm\:gap-6 { gap: 1.5rem; }
    .sm\:hidden { display: none; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:min-w-40 { min-width: 10rem; }
    .sm\:min-w-48 { min-width: 12rem; }
    .sm\:max-w-\[160px\] { max-width: 160px; }
    .sm\:max-w-\[180px\] { max-width: 180px; }
}

@media (min-width: 48rem) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 80rem) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Compact navigation filter for dense admin sidebars. */
.erp-sidebar-filter {
    position: sticky;
    top: 0;
    z-index: 2;
    flex: none;
    margin: -1rem -0.25rem -0.75rem;
    padding: 1rem 0.25rem 0.75rem;
    background: linear-gradient(to bottom, #fff 0%, #fff 78%, rgba(255, 255, 255, 0));
}

.erp-sidebar-filter__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.erp-sidebar-filter__field {
    position: relative;
    display: flex;
    align-items: center;
}

.erp-sidebar-filter__input {
    box-sizing: border-box;
    appearance: none;
    width: 100%;
    height: 2.25rem;
    padding: 0.375rem 2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    background: #fff;
    color: #111827;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.erp-sidebar-filter__input::placeholder {
    color: #6b7280;
}

.erp-sidebar-filter__input::-webkit-search-cancel-button {
    appearance: none;
}

.erp-sidebar-filter__input:focus {
    border-color: rgb(var(--primary-600));
    box-shadow: 0 0 0 1px rgb(var(--primary-600)), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.erp-sidebar-filter__icon,
.erp-sidebar-filter__clear {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.erp-sidebar-filter__icon {
    left: 0.6875rem;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

.erp-sidebar-filter__clear {
    right: 0.375rem;
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    cursor: pointer;
}

.erp-sidebar-filter__clear:hover,
.erp-sidebar-filter__clear:focus-visible {
    background: #f3f4f6;
    color: #111827;
}

.erp-sidebar-filter__clear-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.erp-sidebar-filter__empty {
    margin: 0.5rem 0.25rem 0;
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1rem;
}

.erp-sidebar-filter [hidden],
.fi-sidebar-nav .fi-sidebar-group[hidden],
.fi-sidebar-nav .fi-sidebar-item[hidden] {
    display: none !important;
}

.fi-sidebar-nav.erp-sidebar-filter-active {
    gap-y: 1rem;
}

.fi-sidebar-nav.erp-sidebar-filter-active .fi-sidebar-nav-groups {
    gap-y: 0.75rem;
}

.fi-sidebar-nav.erp-sidebar-filter-active .fi-sidebar-group-items {
    display: flex !important;
    height: auto !important;
    overflow: visible !important;
}

.fi-sidebar-nav.erp-sidebar-filter-active .fi-sidebar-group-collapse-btn {
    display: none;
}

.dark .erp-sidebar-filter__input {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f9fafb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.dark .erp-sidebar-filter {
    background: linear-gradient(to bottom, #09090b 0%, #09090b 78%, rgba(9, 9, 11, 0));
}

.dark .erp-sidebar-filter__input::placeholder,
.dark .erp-sidebar-filter__icon,
.dark .erp-sidebar-filter__clear,
.dark .erp-sidebar-filter__empty {
    color: #9ca3af;
}

.dark .erp-sidebar-filter__clear:hover,
.dark .erp-sidebar-filter__clear:focus-visible {
    background: #374151;
    color: #f9fafb;
}

/* POS cart line: readable line math plus a direct, touch-safe quantity stepper. */
.erp-pos-cart-line {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.erp-pos-cart-line__main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

/* Product thumbnail: a small, fixed, white-backed box so any colour photo
   stays legible in both light and dark panel themes. Rendered only when the
   product actually has an image (no fake placeholder). */
.erp-pos-cart-line__thumb {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.erp-pos-cart-line__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dark .erp-pos-cart-line__thumb {
    border-color: #374151;
}

.erp-pos-cart-line__summary {
    min-width: 0;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.25rem;
    overflow-wrap: anywhere;
}

.erp-pos-cart-quantity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
}

.erp-pos-cart-quantity__label {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
}

.erp-pos-cart-quantity__stepper {
    display: inline-grid;
    grid-template-columns: 2.25rem minmax(4.5rem, 5.5rem) 2.25rem;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.erp-pos-cart-quantity__button,
.erp-pos-cart-quantity__input {
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: #111827;
    font: inherit;
}

.erp-pos-cart-quantity__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #4b5563;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.erp-pos-cart-quantity__button:hover,
.erp-pos-cart-quantity__button:focus-visible {
    background: #f3f4f6;
    color: #111827;
    outline: none;
}

.erp-pos-cart-quantity__input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 0.375rem 0.25rem;
    border-right: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-radius: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    outline: none;
    appearance: textfield;
}

.erp-pos-cart-quantity__input::-webkit-inner-spin-button,
.erp-pos-cart-quantity__input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.erp-pos-cart-quantity__input:focus {
    background: #fffbeb;
    box-shadow: inset 0 0 0 1px rgb(var(--primary-600));
}

.dark .erp-pos-cart-line__summary {
    color: #d1d5db;
}

.dark .erp-pos-cart-quantity__label {
    color: #9ca3af;
}

.dark .erp-pos-cart-quantity__stepper {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.dark .erp-pos-cart-quantity__button,
.dark .erp-pos-cart-quantity__input {
    color: #f3f4f6;
}

.dark .erp-pos-cart-quantity__button:hover,
.dark .erp-pos-cart-quantity__button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.dark .erp-pos-cart-quantity__input {
    border-color: rgba(255, 255, 255, 0.12);
}

.dark .erp-pos-cart-quantity__input:focus {
    background: rgba(245, 158, 11, 0.1);
}

@media (min-width: 40rem) {
    .erp-pos-cart-line {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 1rem;
    }

    .erp-pos-cart-line__summary {
        padding-bottom: 0.5rem;
    }

    .erp-pos-cart-quantity {
        flex-shrink: 0;
    }
}

/* UI-4 — the topbar bell was a thin outline icon at text-gray-500, low
   contrast against both the light and dark topbar. Scoped class (not a bare
   utility class) so the resting colour + dark-mode state don't depend on
   which Tailwind utilities happen to be present in the compiled CSS; the
   hover-to-primary behaviour stays a `hover:text-primary-600` utility on the
   anchor itself (unchanged) since Filament's primary colour is theme-
   configurable, not a fixed hex this stylesheet should hardcode. */
.erp-notification-bell {
    color: #4b5563;
}

.dark .erp-notification-bell {
    color: #e5e7eb;
}

.erp-notification-badge {
    box-shadow: 0 0 0 2px #fff;
}

.dark .erp-notification-badge {
    box-shadow: 0 0 0 2px #1f2937;
}
