/* Global & Focus Styles */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.cursor-pointer {
    cursor: pointer;
}

.sku-link {
    transition: color 0.2s ease-in-out;
}

.sku-link:hover {
    text-decoration: underline !important;
    color: #084298 !important;
}

/* Safe Area Insets for iPhone 15 Pro Max Dynamic Island & Android Navigation Bars */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

.mobile-top-nav {
    padding-top: max(0.6rem, env(safe-area-inset-top)) !important;
    padding-left: max(0.75rem, env(safe-area-inset-left)) !important;
    padding-right: max(0.75rem, env(safe-area-inset-right)) !important;
}

.app-main-content {
    padding-bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1.5rem)) !important;
}

/* Mobile PWA, iOS Touch Targets & Table Responsive Card Overrides */
@media (max-width: 767.98px) {
    /* Prevent iOS Safari 16px auto-zoom on input focus */
    input, select, textarea, .form-control, .form-select {
        font-size: 16px !important;
    }
    
    /* Touch target sizing */
    .btn-mobile-touch {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .modal-dialog-responsive {
        max-width: 98vw !important;
        width: 98vw !important;
        margin: 0.5rem auto !important;
        max-height: 96vh !important;
    }

    .modal-body-responsive {
        padding: 0.65rem !important;
    }

    .toast-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.5rem !important;
    }
}

@media (min-width: 768px) {
    .modal-dialog-responsive {
        max-width: 96vw !important;
        width: 96vw !important;
        margin: 1rem auto !important;
        max-height: 94vh !important;
    }
}

/* Prevent iOS Safari from forcing auto-zoom on input focus */
@media screen and (max-width: 767.98px) {
    input, select, textarea, .form-control, .form-select {
        font-size: 16px !important;
    }
}

/* Touch Friendly Targets (min 44px height on mobile) */
@media screen and (max-width: 767.98px) {
    .btn {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-pills .nav-link {
        min-height: 44px;
    }

    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}
.nav-link.active{
    color:white!important;
}
/* Table Responsiveness: Smooth Horizontal Scroll on Mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Sticky Columns ONLY on Desktop/Tablet (>= 768px). 
   On mobile phones (390px - 430px), sticky columns covering 410px would lock the entire screen! */
@media (min-width: 768px) {
    .sticky-sku {
        position: sticky;
        left: 0;
        background-color: white !important;
        z-index: 1;
        min-width: 160px;
        max-width: 160px;
    }

    .sticky-title {
        position: sticky;
        left: 160px;
        background-color: white !important;
        z-index: 1;
        min-width: 250px;
        max-width: 250px;
        border-right: 2px solid #e9ecef;
    }

    thead .sticky-sku, thead .sticky-title {
        background-color: #f8f9fa !important;
        z-index: 2;
    }
}

/* On mobile phones, render SKU and title as clean non-blocking columns with minimum widths */
@media (max-width: 767.98px) {
    .sticky-sku {
        min-width: 130px;
        background-color: inherit;
    }

    .sticky-title {
        min-width: 180px;
        max-width: 240px;
        background-color: inherit;
    }
}

/* Mobile Sidebar (Slide-in Drawer) */
@media (max-width: 991.98px) {
    .blazor-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: min(300px, 85vw);
        height: 100vh;
        z-index: 1055;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding-top: max(1rem, env(safe-area-inset-top)) !important;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom)) !important;
    }

    .blazor-sidebar.show {
        left: 0;
    }
}

/* Desktop Sidebar (Sticky on the Left) */
@media (min-width: 992px) {
    .blazor-sidebar {
        position: sticky;
        top: 0;
        width: 280px;
        height: 100vh;
        overflow-y: auto;
    }
}

/* ==========================================================================
   Global App Header & Sticky Action Bars (Desktop & Mobile)
   ========================================================================== */
.app-global-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #dee2e6 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
}

/* Page Action & Search Bar: Sticks right under Global Header on Desktop (56px) or Mobile Top Nav (54px) */
.page-search-bar-sticky {
    position: sticky !important;
    top: 56px !important;
    z-index: 1020 !important;
    background-color: #f8f9fa !important;
    padding: 0.65rem 0.5rem !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

@media (max-width: 991.98px) {
    .page-search-bar-sticky {
        top: 54px !important;
        padding: 0.5rem 0.25rem !important;
    }
}

/* ==========================================================================
   Mobile Pills Fix (Touch Scrollable & Wrapped Rounded Pills)
   ========================================================================== */
.mobile-pills-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 2px 6px 2px;
    gap: 8px;
    align-items: center;
}

.mobile-pills-bar::-webkit-scrollbar {
    display: none;
}

.mobile-pills-bar .btn,
.mobile-pills-bar .badge {
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 50rem !important;
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem !important;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .mobile-pills-bar {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 2px;
    }
}

@media (max-width: 767.98px) {
    .mobile-pills-center-wrap {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .mobile-pills-center-wrap .btn {
        border-radius: 50rem !important;
        font-size: 0.82rem;
        padding: 0.35rem 0.85rem !important;
        min-height: 38px;
    }
}

/* ==========================================================================
   Mobile 3-Column Layout Centering (iPhone & Android)
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Center columns, text, inputs, and labels when 3 columns are shown on mobile */
    .row > .col-4,
    .row-cols-3 > div,
    .row-cols-3 > .col {
        text-align: center;
    }

    .row > .col-4 label,
    .row > .col-4 .form-label,
    .row-cols-3 label {
        display: block;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .row > .col-4 input,
    .row > .col-4 select,
    .row-cols-3 input {
        text-align: center !important;
    }

    .row-cols-3 {
        justify-content: center;
    }
}

body {
    overflow-x: clip;
}

/* ==========================================================================
   COMPUTER FORGE - DARK THEME OVERRIDES (Bootstrap 5.3 & WebApp ERP)
   ========================================================================== */
[data-bs-theme="dark"] {
    --bs-body-bg: #0b0f19;
    --bs-body-color: #f1f5f9;
    --bs-border-color: #273043;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] body {
    background-color: #0b0f19 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #131b2e !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #0e1422 !important;
}

/* High Contrast Utility Text Colors in Dark Theme */
[data-bs-theme="dark"] .text-dark:not(.btn-warning):not(.btn-info):not(.badge-warning):not(.bg-warning):not(.bg-info):not(.bg-warning-subtle):not(.bg-info-subtle):not(.bg-secondary-subtle):not(.bg-dark-subtle):not(.btn-outline-warning):not(.btn-outline-info):not(.alert-warning):not(.alert-info) {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .text-success {
    color: #4ade80 !important;
}

[data-bs-theme="dark"] .text-primary {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .text-danger {
    color: #f87171 !important;
}

[data-bs-theme="dark"] .text-warning {
    color: #facc15 !important;
}

[data-bs-theme="dark"] .text-info {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .sku-link {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .sku-link:hover {
    color: #93c5fd !important;
}

/* Card & Container Surfaces */
[data-bs-theme="dark"] .card {
    background-color: #131b2e !important;
    border-color: #273043 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #182239 !important;
    border-color: #273043 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #182239 !important;
    border-color: #273043 !important;
}

/* Borders */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: #273043 !important;
}

/* Header & Sidebar */
[data-bs-theme="dark"] .app-global-header,
[data-bs-theme="dark"] .mobile-top-nav,
[data-bs-theme="dark"] .mobile-search-row {
    background-color: #131b2e !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] .blazor-sidebar {
    background-color: #0e1422 !important;
    border-right: 1px solid #273043 !important;
}

[data-bs-theme="dark"] .blazor-sidebar .nav-link.text-dark {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .blazor-sidebar .nav-link:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .blazor-sidebar .nav-link.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Tables & Table Headers (Eliminates White / Light Blue Table Headers in Dark Theme) */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #f1f5f9;
    --bs-table-border-color: #273043;
    --bs-table-striped-color: #f1f5f9;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-active-color: #ffffff;
    --bs-table-active-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: #ffffff;
    --bs-table-hover-bg: #1a253d;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] .table > thead,
[data-bs-theme="dark"] .table > thead > tr,
[data-bs-theme="dark"] .table > thead > tr > th,
[data-bs-theme="dark"] .table thead,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table thead tr,
[data-bs-theme="dark"] thead.table-light,
[data-bs-theme="dark"] thead.table-primary,
[data-bs-theme="dark"] thead.table-secondary,
[data-bs-theme="dark"] thead.table-light > tr > th,
[data-bs-theme="dark"] thead.table-primary > tr > th,
[data-bs-theme="dark"] thead.table-secondary > tr > th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-primary,
[data-bs-theme="dark"] .table-secondary,
[data-bs-theme="dark"] .table-light > th,
[data-bs-theme="dark"] .table-light > td,
[data-bs-theme="dark"] .table-primary > th,
[data-bs-theme="dark"] .table-primary > td {
    --bs-table-bg: #182239 !important;
    --bs-table-color: #f1f5f9 !important;
    --bs-table-border-color: #273043 !important;
    background-color: #182239 !important;
    color: #f1f5f9 !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] thead th {
    font-weight: 700 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] thead .text-secondary,
[data-bs-theme="dark"] thead th.text-secondary,
[data-bs-theme="dark"] thead .text-muted,
[data-bs-theme="dark"] thead th.text-muted {
    color: #cbd5e1 !important;
}

/* Sticky columns in table headers & data rows */
[data-bs-theme="dark"] thead .sticky-sku,
[data-bs-theme="dark"] thead .sticky-title,
[data-bs-theme="dark"] thead th.sticky-sku,
[data-bs-theme="dark"] thead th.sticky-title {
    --bs-table-bg: #182239 !important;
    background-color: #182239 !important;
    color: #f8fafc !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] tbody .sticky-sku,
[data-bs-theme="dark"] tbody .sticky-title,
[data-bs-theme="dark"] tbody td.sticky-sku,
[data-bs-theme="dark"] tbody td.sticky-title,
[data-bs-theme="dark"] .sticky-sku,
[data-bs-theme="dark"] .sticky-title {
    --bs-table-bg: #0b0f19 !important;
    background-color: #0b0f19 !important;
    color: #f1f5f9 !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #1a253d !important;
    background-color: #1a253d !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > .sticky-sku,
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > .sticky-title {
    background-color: #1a253d !important;
}

/* List Groups */
[data-bs-theme="dark"] .list-group-item {
    background-color: #131b2e !important;
    border-color: #273043 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .hover-item:hover,
[data-bs-theme="dark"] .hover-card:hover {
    background-color: #1a253d !important;
}

/* Form Controls & Inputs */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0b0f19 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f172a !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
    background-color: #131b2e !important;
    border-color: #273043 !important;
    color: #f1f5f9 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: #273043 !important;
}

/* Badges & Pills */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-white {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-secondary-subtle {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .badge.bg-primary-subtle {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .badge.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

[data-bs-theme="dark"] .badge.bg-warning-subtle {
    background-color: rgba(234, 179, 8, 0.2) !important;
    color: #facc15 !important;
}

[data-bs-theme="dark"] .badge.bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.2) !important;
    color: #38bdf8 !important;
}

/* ==========================================================================
   Buttons & Tabs in Dark Theme (High Contrast, Deep Corporate Blue & Slate)
   ========================================================================== */
.btn-primary,
[data-bs-theme="dark"] .btn-primary {
    background-color: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    --bs-btn-bg: #2563eb !important;
    --bs-btn-border-color: #1d4ed8 !important;
    --bs-btn-color: #ffffff !important;
    --bs-btn-hover-bg: #1d4ed8 !important;
    --bs-btn-hover-border-color: #1e40af !important;
    --bs-btn-hover-color: #ffffff !important;
    --bs-btn-active-bg: #1e40af !important;
    --bs-btn-active-border-color: #172554 !important;
    --bs-btn-active-color: #ffffff !important;
}

.btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #1d4ed8 !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
}

.btn-outline-danger,
[data-bs-theme="dark"] .btn-outline-danger {
    background-color: transparent !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
    --bs-btn-color: #f87171 !important;
    --bs-btn-border-color: #ef4444 !important;
    --bs-btn-hover-bg: #dc2626 !important;
    --bs-btn-hover-border-color: #dc2626 !important;
    --bs-btn-hover-color: #ffffff !important;
}

.btn-outline-danger:hover,
[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-dark {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    --bs-btn-bg: #1e293b !important;
    --bs-btn-border-color: #334155 !important;
    --bs-btn-color: #f8fafc !important;
    --bs-btn-hover-bg: #334155 !important;
    --bs-btn-hover-border-color: #475569 !important;
    --bs-btn-hover-color: #ffffff !important;
    --bs-btn-active-bg: #0f172a !important;
    --bs-btn-active-border-color: #334155 !important;
    --bs-btn-active-color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-dark:hover,
[data-bs-theme="dark"] .btn-dark:focus,
[data-bs-theme="dark"] .btn-dark:active,
[data-bs-theme="dark"] .btn-dark.active {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-dark {
    background-color: transparent !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
    --bs-btn-color: #cbd5e1 !important;
    --bs-btn-border-color: #475569 !important;
    --bs-btn-hover-bg: #334155 !important;
    --bs-btn-hover-border-color: #64748b !important;
    --bs-btn-hover-color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover,
[data-bs-theme="dark"] .btn-outline-dark:focus,
[data-bs-theme="dark"] .btn-outline-dark:active,
[data-bs-theme="dark"] .btn-outline-dark.active {
    background-color: #334155 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    background-color: #182239 !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
    --bs-btn-color: #cbd5e1 !important;
    --bs-btn-border-color: #334155 !important;
    --bs-btn-bg: #182239 !important;
    --bs-btn-hover-bg: #273043 !important;
    --bs-btn-hover-border-color: #475569 !important;
    --bs-btn-hover-color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus,
[data-bs-theme="dark"] .btn-outline-secondary:active,
[data-bs-theme="dark"] .btn-outline-secondary.active {
    background-color: #273043 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

/* Theme Toggle Button Styling */
[data-bs-theme="dark"] .theme-toggle-btn {
    background-color: #182239 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
    background-color: #273043 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

/* ERP Tab Navigation Buttons (Prevents muddy yellow buttons on /newsletter and ERP hubs) */
.erp-tab-btn {
    background-color: #182239 !important;
    border: 1px solid #334155 !important;
    color: #94a3b8 !important;
    font-weight: 600 !important;
    min-height: 42px !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out !important;
}

.erp-tab-btn:hover {
    background-color: #273043 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

.erp-tab-btn.active {
    background-color: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
}

[data-bs-theme="light"] .erp-tab-btn {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

[data-bs-theme="light"] .erp-tab-btn:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-bs-theme="light"] .erp-tab-btn.active {
    background-color: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
}

[data-bs-theme="dark"] .btn-light {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
    --bs-btn-bg: #1e293b !important;
    --bs-btn-border-color: #334155 !important;
    --bs-btn-color: #f1f5f9 !important;
    --bs-btn-hover-bg: #334155 !important;
    --bs-btn-hover-border-color: #475569 !important;
    --bs-btn-hover-color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-light:focus,
[data-bs-theme="dark"] .btn-light:active,
[data-bs-theme="dark"] .btn-light.active {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-light {
    background-color: transparent !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
    --bs-btn-color: #e2e8f0 !important;
    --bs-btn-border-color: #475569 !important;
}

[data-bs-theme="dark"] .btn-outline-light:hover,
[data-bs-theme="dark"] .btn-outline-light:focus,
[data-bs-theme="dark"] .btn-outline-light:active,
[data-bs-theme="dark"] .btn-outline-light.active {
    background-color: #334155 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-white,
[data-bs-theme="dark"] .btn.bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .btn-white:hover,
[data-bs-theme="dark"] .btn.bg-white:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* Yellow / Cyan Action & Channel Buttons */
[data-bs-theme="dark"] .btn-warning {
    background-color: #eab308 !important;
    border-color: #ca8a04 !important;
    color: #0f172a !important;
    --bs-btn-color: #0f172a !important;
}

[data-bs-theme="dark"] .btn-warning:hover {
    background-color: #facc15 !important;
    border-color: #eab308 !important;
    color: #000000 !important;
}

[data-bs-theme="dark"] .btn-info {
    background-color: #0ea5e9 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    --bs-btn-color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-info:hover {
    background-color: #38bdf8 !important;
    border-color: #0ea5e9 !important;
    color: #000000 !important;
}

[data-bs-theme="dark"] .btn-outline-warning {
    color: #facc15 !important;
    border-color: #eab308 !important;
}

[data-bs-theme="dark"] .btn-outline-warning:hover,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-warning {
    background-color: #eab308 !important;
    border-color: #ca8a04 !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .btn-outline-info {
    color: #38bdf8 !important;
    border-color: #0284c7 !important;
}

[data-bs-theme="dark"] .btn-outline-info:hover,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-info {
    background-color: #0ea5e9 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Page Search Bar & Sticky Table Columns in Dark Theme */
[data-bs-theme="dark"] .page-search-bar-sticky {
    background-color: #0e1422 !important;
    border-color: #273043 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .sticky-sku,
[data-bs-theme="dark"] .sticky-title {
    background-color: #131b2e !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] thead .sticky-sku,
[data-bs-theme="dark"] thead .sticky-title {
    background-color: #182239 !important;
}

/* ==========================================================================
   Dark Theme Table & Header High Contrast System (No White Table Headers)
   ========================================================================== */
[data-bs-theme="dark"] .table {
    --bs-table-bg: #111726 !important;
    --bs-table-color: #f1f5f9 !important;
    --bs-table-striped-bg: #141d30 !important;
    --bs-table-striped-color: #f1f5f9 !important;
    --bs-table-hover-bg: #1c2842 !important;
    --bs-table-hover-color: #ffffff !important;
    --bs-table-border-color: #273043 !important;
    color: #f1f5f9 !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] .table thead,
[data-bs-theme="dark"] .table thead tr,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] thead.table-light,
[data-bs-theme="dark"] thead.table-light th,
[data-bs-theme="dark"] thead.table-primary,
[data-bs-theme="dark"] thead.table-primary th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-primary,
[data-bs-theme="dark"] .erp-table-head,
[data-bs-theme="dark"] .erp-table-head th {
    background-color: #182239 !important;
    color: #f1f5f9 !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] .table tbody,
[data-bs-theme="dark"] .table tbody tr,
[data-bs-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .table tbody th {
    background-color: #111726 !important;
    color: #cbd5e1 !important;
    border-color: #273043 !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #141d30 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: #1c2842 !important;
    color: #ffffff !important;
}

/* Alerts */
[data-bs-theme="dark"] .alert-light {
    background-color: #131b2e !important;
    border-color: #273043 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .alert-secondary {
    background-color: #182239 !important;
    border-color: #273043 !important;
    color: #cbd5e1 !important;
}

/* Dropdown Menus */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #131b2e !important;
    border-color: #273043 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Universal Connected Input-Group System (Seamless Rounded Inputs & Connected Buttons)
   ========================================================================== */
.input-group {
    border-radius: 8px;
}

/* Leftmost element: Rounded left corners, completely flat right */
.input-group > :first-child:not(:last-child),
.input-group > .form-control:first-child:not(:last-child),
.input-group > .form-select:first-child:not(:last-child),
.input-group > .input-group-text:first-child:not(:last-child),
.input-group > .btn:first-child:not(:last-child),
.input-group > button:first-child:not(:last-child) {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Middle elements: Completely flat on all sides */
.input-group > :not(:first-child):not(:last-child),
.input-group > .form-control:not(:first-child):not(:last-child),
.input-group > .form-select:not(:first-child):not(:last-child),
.input-group > .input-group-text:not(:first-child):not(:last-child),
.input-group > .btn:not(:first-child):not(:last-child),
.input-group > button:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Rightmost element (button / addon / text): Flat left, rounded right */
.input-group > :last-child:not(:first-child),
.input-group > .form-control:last-child:not(:first-child),
.input-group > .form-select:last-child:not(:first-child),
.input-group > .input-group-text:last-child:not(:first-child),
.input-group > .btn:last-child:not(:first-child),
.input-group > button:last-child:not(:first-child) {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Hover & focus states must preserve the exact outer radii and inner flush seams */
.input-group > :first-child:not(:last-child):hover,
.input-group > :first-child:not(:last-child):focus,
.input-group > .btn:first-child:not(:last-child):hover,
.input-group > .btn:first-child:not(:last-child):focus {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :last-child:not(:first-child):hover,
.input-group > :last-child:not(:first-child):focus,
.input-group > .btn:last-child:not(:first-child):hover,
.input-group > .btn:last-child:not(:first-child):focus {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Ensure buttons connected inside input groups match height, vertical alignment and font size cleanly */
.input-group > .btn,
.input-group > button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
}


/* ==========================================================================
   FORGE ERP - TABLE STATE RESET, EDIT-ROW HIGHLIGHT & COHESIVE FLUENT COLORS
   Fixes Bootstrap 5.3 --bs-table-bg-state box-shadow wash (yellow hover bug)
   and unifies Primary (Sapphire), Secondary (Steel Slate), Tertiary (Mica),
   Info (Arctic Teal), Success (Emerald), Warning (Light Amber) & Danger (Ruby).
   ========================================================================== */

/* 1. Clear Bootstrap 5.3 inset 9999px box-shadow state overlay in Dark Mode */
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    box-shadow: none !important;
    --bs-table-bg-state: transparent !important;
    --bs-table-bg-type: transparent !important;
    --bs-table-accent-bg: transparent !important;
}

/* Dark Mode Contextual Row Variants (No glaring pale cream / white text bugs) */
[data-bs-theme="dark"] .table tbody tr.table-warning > *,
[data-bs-theme="dark"] .table-warning > td,
[data-bs-theme="dark"] .table-warning > th {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #f8fafc !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    --bs-table-bg: rgba(245, 158, 11, 0.12) !important;
    --bs-table-hover-bg: rgba(245, 158, 11, 0.19) !important;
    --bs-table-color: #f8fafc !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr.table-warning:hover > * {
    background-color: rgba(245, 158, 11, 0.19) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table tbody tr.table-danger > *,
[data-bs-theme="dark"] .table-danger > td,
[data-bs-theme="dark"] .table-danger > th {
    background-color: rgba(244, 63, 94, 0.14) !important;
    color: #fecdd3 !important;
    border-color: rgba(244, 63, 94, 0.26) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr.table-danger:hover > * {
    background-color: rgba(244, 63, 94, 0.22) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table tbody tr.table-info > *,
[data-bs-theme="dark"] .table-info > td,
[data-bs-theme="dark"] .table-info > th {
    background-color: rgba(14, 165, 233, 0.13) !important;
    color: #e0f2fe !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr.table-info:hover > * {
    background-color: rgba(14, 165, 233, 0.20) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table tbody tr.table-success > *,
[data-bs-theme="dark"] .table-success > td,
[data-bs-theme="dark"] .table-success > th {
    background-color: rgba(16, 185, 129, 0.13) !important;
    color: #d1fae5 !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr.table-success:hover > * {
    background-color: rgba(16, 185, 129, 0.20) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table tbody tr.table-primary > *,
[data-bs-theme="dark"] .table tbody tr.table-active > * {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #dbeafe !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr.table-primary:hover > *,
[data-bs-theme="dark"] .table-hover > tbody > tr.table-active:hover > * {
    background-color: rgba(59, 130, 246, 0.23) !important;
    color: #ffffff !important;
}

/* 2. Dedicated Inline Edit Row Styling (Category Management & ERP Inline Editors) */
.table > tbody > tr.erp-edit-row > td,
.table > tbody > tr.erp-edit-row > th,
.table > tbody > tr.erp-edit-row-sub > td,
.table > tbody > tr.erp-edit-row-sub > th {
    background-color: #f0f7ff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease;
}

.table > tbody > tr.erp-edit-row > td:first-child,
.table > tbody > tr.erp-edit-row-sub > td:first-child {
    border-left: 3px solid #2563eb !important;
}

.table-hover > tbody > tr.erp-edit-row:hover > td,
.table-hover > tbody > tr.erp-edit-row:hover > th,
.table-hover > tbody > tr.erp-edit-row-sub:hover > td,
.table-hover > tbody > tr.erp-edit-row-sub:hover > th {
    background-color: #e6f0fe !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

.erp-edit-label {
    color: #334155 !important;
}

.erp-edit-card {
    background-color: #f0f7ff !important;
    border-left: 3px solid #2563eb !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .table > tbody > tr.erp-edit-row > td,
[data-bs-theme="dark"] .table > tbody > tr.erp-edit-row > th,
[data-bs-theme="dark"] .table > tbody > tr.erp-edit-row-sub > td,
[data-bs-theme="dark"] .table > tbody > tr.erp-edit-row-sub > th {
    background-color: #17233b !important;
    color: #f1f5f9 !important;
    border-color: rgba(59, 130, 246, 0.28) !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .table > tbody > tr.erp-edit-row > td:first-child,
[data-bs-theme="dark"] .table > tbody > tr.erp-edit-row-sub > td:first-child {
    border-left: 3px solid #3b82f6 !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr.erp-edit-row:hover > td,
[data-bs-theme="dark"] .table-hover > tbody > tr.erp-edit-row:hover > th,
[data-bs-theme="dark"] .table-hover > tbody > tr.erp-edit-row-sub:hover > td,
[data-bs-theme="dark"] .table-hover > tbody > tr.erp-edit-row-sub:hover > th {
    background-color: #1d2c4a !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .erp-edit-label {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .erp-edit-card {
    background-color: #17233b !important;
    border-left: 3px solid #3b82f6 !important;
    color: #f1f5f9 !important;
}

/* 3. Subtle Badges & Containers in Dark Mode */
[data-bs-theme="dark"] .badge.bg-warning-subtle {
    background-color: rgba(250, 204, 21, 0.18) !important;
    color: #fef08a !important;
    border-color: rgba(250, 204, 21, 0.36) !important;
}

[data-bs-theme="dark"] .badge.bg-danger-subtle {
    background-color: rgba(244, 63, 94, 0.20) !important;
    color: #fda4af !important;
    border-color: rgba(244, 63, 94, 0.36) !important;
}

[data-bs-theme="dark"] .badge.bg-info-subtle {
    background-color: rgba(34, 211, 238, 0.18) !important;
    color: #67e8f9 !important;
    border-color: rgba(34, 211, 238, 0.36) !important;
}

[data-bs-theme="dark"] .badge.bg-secondary-subtle {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-dark-subtle {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .bg-warning-subtle:not(.badge) {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #fef3c7 !important;
}

[data-bs-theme="dark"] .bg-info-subtle:not(.badge) {
    background-color: rgba(14, 165, 233, 0.12) !important;
    color: #e0f2fe !important;
}

[data-bs-theme="dark"] .bg-danger-subtle:not(.badge) {
    background-color: rgba(244, 63, 94, 0.14) !important;
    color: #fecdd3 !important;
}

[data-bs-theme="dark"] .bg-success-subtle:not(.badge) {
    background-color: rgba(16, 185, 129, 0.13) !important;
    color: #d1fae5 !important;
}

[data-bs-theme="dark"] .bg-primary-subtle:not(.badge) {
    background-color: rgba(59, 130, 246, 0.14) !important;
    color: #dbeafe !important;
}

[data-bs-theme="dark"] .bg-secondary-subtle:not(.badge) {
    background-color: #182239 !important;
    color: #cbd5e1 !important;
}

/* 4. Cohesive Fluent Button Palette (Primary / Secondary / Tertiary / Semantic) */
.btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
}

.btn-group > .btn:hover,
.input-group > .btn:hover {
    transform: none !important;
}

/* Primary: Electric Sapphire Gradient */
.btn-primary,
[data-bs-theme="dark"] .btn-primary,
.fluent-erp-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 65%, #1d4ed8 100%) !important;
    border-color: rgba(37, 99, 235, 0.75) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
}

.btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:hover,
.fluent-erp-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 55%, #2563eb 100%) !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.32) !important;
    transform: translateY(-1px);
}

/* Outline Primary: Sapphire Frosted Acrylic */
.btn-outline-primary {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-color: rgba(37, 99, 235, 0.36) !important;
    color: #1d4ed8 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28) !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.19) 0%, rgba(37, 99, 235, 0.11) 100%) !important;
    border-color: rgba(96, 165, 250, 0.42) !important;
    color: #93c5fd !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.36) !important;
}

/* Secondary: Cool Pearl-Slate (Light) / Graphite-Steel Acrylic (Dark) */
.btn-secondary,
.btn-outline-secondary,
.fluent-erp-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    border: 1px solid rgba(15, 23, 42, 0.15) !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.fluent-erp-secondary:hover {
    background: linear-gradient(180deg, #eff6ff 0%, #e0ecff 100%) !important;
    border-color: rgba(59, 130, 246, 0.48) !important;
    color: #1d4ed8 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .fluent-erp-secondary {
    background: linear-gradient(180deg, #243044 0%, #182235 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}

[data-bs-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark"] .btn-secondary:focus,
[data-bs-theme="dark"] .btn-secondary:active,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus,
[data-bs-theme="dark"] .btn-outline-secondary:active,
[data-bs-theme="dark"] .btn-outline-secondary.active,
[data-bs-theme="dark"] .fluent-erp-secondary:hover {
    background: linear-gradient(180deg, #2e3e59 0%, #212e45 100%) !important;
    border-color: rgba(96, 165, 250, 0.54) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

/* Tertiary / Low-Emphasis Ghost Slate: .btn-tertiary, .fluent-erp-tertiary, .btn-outline-dark, .erp-tab-btn */
.btn-tertiary,
.fluent-erp-tertiary {
    background: rgba(15, 23, 42, 0.04) !important;
    border: 1px solid rgba(15, 23, 42, 0.10) !important;
    color: #475569 !important;
    box-shadow: none !important;
}

.btn-tertiary:hover,
.fluent-erp-tertiary:hover {
    background: rgba(37, 99, 235, 0.09) !important;
    border-color: rgba(37, 99, 235, 0.28) !important;
    color: #1d4ed8 !important;
}

[data-bs-theme="dark"] .btn-tertiary,
[data-bs-theme="dark"] .fluent-erp-tertiary,
[data-bs-theme="dark"] .btn-outline-dark {
    background: rgba(30, 41, 59, 0.56) !important;
    border: 1px solid rgba(148, 163, 184, 0.20) !important;
    color: #cbd5e1 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .btn-tertiary:hover,
[data-bs-theme="dark"] .fluent-erp-tertiary:hover,
[data-bs-theme="dark"] .btn-outline-dark:hover,
[data-bs-theme="dark"] .btn-outline-dark:focus,
[data-bs-theme="dark"] .btn-outline-dark:active,
[data-bs-theme="dark"] .btn-outline-dark.active {
    background: rgba(59, 130, 246, 0.16) !important;
    border-color: rgba(96, 165, 250, 0.42) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .btn-dark {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
    color: #f8fafc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .btn-dark:hover,
[data-bs-theme="dark"] .btn-dark:focus,
[data-bs-theme="dark"] .btn-dark:active,
[data-bs-theme="dark"] .btn-dark.active {
    background: linear-gradient(180deg, #28354b 0%, #172033 100%) !important;
    border-color: rgba(96, 165, 250, 0.48) !important;
    color: #ffffff !important;
}

.erp-tab-btn {
    background: rgba(15, 23, 42, 0.04) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #475569 !important;
}

.erp-tab-btn:hover {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.30) !important;
    color: #1d4ed8 !important;
}

[data-bs-theme="dark"] .erp-tab-btn {
    background: rgba(30, 41, 59, 0.56) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .erp-tab-btn:hover {
    background: rgba(59, 130, 246, 0.16) !important;
    border-color: rgba(96, 165, 250, 0.42) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .erp-tab-btn.active,
[data-bs-theme="light"] .erp-tab-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.34) !important;
}

/* Info: Arctic Teal-Cyan Acrylic (Distinct from Cobalt Primary) */
.btn-info,
[data-bs-theme="dark"] .btn-info {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%) !important;
    border-color: rgba(6, 182, 212, 0.65) !important;
    color: #082f49 !important;
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.btn-info:hover,
[data-bs-theme="dark"] .btn-info:hover {
    background: linear-gradient(135deg, #67e8f9 0%, #22d3ee 100%) !important;
    border-color: #67e8f9 !important;
    color: #082f49 !important;
}

.btn-outline-info {
    background: linear-gradient(180deg, #ecfeff 0%, #cffafe 100%) !important;
    border-color: rgba(6, 182, 212, 0.42) !important;
    color: #0e7490 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

.btn-outline-info:hover,
.btn-check:checked + .btn-outline-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    border-color: #0891b2 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-info {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.16) 0%, rgba(6, 182, 212, 0.09) 100%) !important;
    border-color: rgba(34, 211, 238, 0.42) !important;
    color: #67e8f9 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .btn-outline-info:hover,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    border-color: #22d3ee !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.30) !important;
}

/* Success: Satin Emerald & Jade Acrylic */
.btn-success,
[data-bs-theme="dark"] .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: rgba(5, 150, 105, 0.72) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.btn-success:hover,
[data-bs-theme="dark"] .btn-success:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
    border-color: #34d399 !important;
    color: #052e16 !important;
}

.btn-outline-success {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: rgba(16, 185, 129, 0.42) !important;
    color: #065f46 !important;
}

.btn-outline-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-success {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.10) 100%) !important;
    border-color: rgba(52, 211, 153, 0.42) !important;
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .btn-outline-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
}

/* Warning: Luminous Light Amber Acrylic */
.btn-warning,
[data-bs-theme="dark"] .btn-warning {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%) !important;
    border-color: rgba(234, 179, 8, 0.72) !important;
    color: #0f172a !important;
    box-shadow: 0 3px 10px rgba(234, 179, 8, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
}

.btn-warning:hover,
[data-bs-theme="dark"] .btn-warning:hover {
    background: linear-gradient(180deg, #fef9c3 0%, #fde047 100%) !important;
    border-color: #eab308 !important;
    color: #0f172a !important;
}

.btn-outline-warning {
    background: linear-gradient(180deg, #fefce8 0%, #fef08a 100%) !important;
    border-color: rgba(234, 179, 8, 0.52) !important;
    color: #854d0e !important;
}

.btn-outline-warning:hover,
.btn-check:checked + .btn-outline-warning {
    background: linear-gradient(180deg, #fde047 0%, #eab308 100%) !important;
    border-color: #ca8a04 !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .btn-outline-warning {
    background: linear-gradient(180deg, rgba(254, 240, 138, 0.19) 0%, rgba(250, 204, 21, 0.11) 100%) !important;
    border-color: rgba(253, 224, 71, 0.45) !important;
    color: #fef08a !important;
}

[data-bs-theme="dark"] .btn-outline-warning:hover,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-warning {
    background: linear-gradient(180deg, #fde047 0%, #eab308 100%) !important;
    border-color: #facc15 !important;
    color: #0f172a !important;
}

/* Danger: Satin Coral-Ruby & Frosted Crimson Acrylic */
.btn-danger,
[data-bs-theme="dark"] .btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    border-color: rgba(225, 29, 72, 0.72) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(225, 29, 72, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

.btn-danger:hover,
[data-bs-theme="dark"] .btn-danger:hover {
    background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%) !important;
    border-color: #fb7185 !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%) !important;
    border-color: rgba(225, 29, 72, 0.35) !important;
    color: #be123c !important;
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    border-color: #e11d48 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.17) 0%, rgba(225, 29, 72, 0.10) 100%) !important;
    border-color: rgba(251, 113, 133, 0.40) !important;
    color: #fda4af !important;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    border-color: #fb7185 !important;
    color: #ffffff !important;
}
