/* ==========================================================================
   Smart Forms — Universal Design System
   Version 1.0.0
   Consolidated from: product/create, product/edit, purchase/create,
   purchase/edit, quick_purchase/create, sell/create, sell/edit,
   product/partials/quick_add_product, quick_purchase/partials/quick_add_product_modal
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & VARIABLES
   -------------------------------------------------------------------------- */
:root {
    --sf-border:            #e2e8f0;
    --sf-border-hover:      #cbd5e1;
    --sf-bg-card:           #ffffff;
    --sf-bg-ctrl:           #f8fafc;
    --sf-text-heading:      #0f172a;
    --sf-text-primary:      #1e293b;
    --sf-text-label:        #334155;
    --sf-text-muted:        #64748b;
    --sf-text-placeholder:  #94a3b8;
    --sf-accent:            #0284c7;
    --sf-accent-hover:      #0369a1;
    --sf-focus-glow:        rgba(2, 132, 199, 0.15);
    --sf-radius-input:      10px;
    --sf-radius-card:       16px;
    --sf-radius-badge:      12px;
    --sf-height-input:      42px;
    --sf-height-table-ctrl: 36px;
}

/* --------------------------------------------------------------------------
   2. PAGE HEADER BANNER
   -------------------------------------------------------------------------- */
.smart-page-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.02), 0 1px 2px rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (min-width: 768px) {
    .smart-page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.smart-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.smart-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(2,132,199,.25);
    flex-shrink: 0;
}
.smart-header-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -.02em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}
.smart-header-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 3px 0 0 0;
}
.smart-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.smart-header-action,
.smart-header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all .2s ease;
    cursor: pointer;
}
.smart-header-action:hover,
.smart-header-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    text-decoration: none !important;
}

/* --------------------------------------------------------------------------
   3. MODERN CARD CONTAINERS
   -------------------------------------------------------------------------- */
.smart-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(0,0,0,.04), 0 2px 6px -1px rgba(0,0,0,.02);
    margin-bottom: 24px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    overflow: visible !important;
}
.smart-form-card:hover {
    box-shadow: 0 8px 25px -4px rgba(0,0,0,.06);
    border-color: #cbd5e1;
}
/* Stacking: prevents dropdowns/datepickers from going under subsequent cards */
.smart-section-card-1 { position: relative !important; z-index: 40 !important; }
.smart-section-card-2 { position: relative !important; z-index: 30 !important; }
.smart-section-card-3 { position: relative !important; z-index: 20 !important; }
.smart-section-card-4 { position: relative !important; z-index: 10 !important; }
.smart-form-card:focus-within { z-index: 50 !important; }

.smart-card-body {
    padding: 24px;
    overflow: visible !important;
}
@media (max-width: 768px) {
    .smart-card-body { padding: 16px; }
}

/* --------------------------------------------------------------------------
   4. CARD HEADERS, BADGES & GRADIENTS
   -------------------------------------------------------------------------- */
.smart-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.header-gradient-blue    { background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%); }
.header-gradient-emerald { background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%); }
.header-gradient-purple  { background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%); }
.header-gradient-sky     { background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%); }
.header-gradient-indigo  { background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%); }
.header-gradient-amber   { background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%); }
.header-gradient-rose    { background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%); }

.icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.icon-badge-blue    { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.icon-badge-emerald { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.icon-badge-purple  { background: #faf5ff; color: #7c3aed; border: 1px solid #ede9fe; }
.icon-badge-sky     { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.icon-badge-indigo  { background: #eef2ff; color: #4f46e5; border: 1px solid #e0e7ff; }
.icon-badge-amber   { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.icon-badge-rose    { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }

.smart-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.smart-card-subtitle {
    margin: 2px 0 0 0;
    font-size: 12.5px;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   5. CARD SUBDIVIDER
   -------------------------------------------------------------------------- */
.smart-card-subdivider {
    position: relative;
    text-align: left;
    margin: 24px 0 18px 0;
}
.smart-card-subdivider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
    z-index: 1;
}
.smart-card-subdivider > span {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding-right: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* --------------------------------------------------------------------------
   6. FORM CONTROLS — UNIVERSAL MODERNIZATION
   -------------------------------------------------------------------------- */
.smart-product-form .form-group label,
.smart-purchase-form label,
.smart-sale-form .form-group label,
.smart-quick-purchase-form .form-group label,
.smart-quick-product-modal .form-group label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 6px !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: .01em;
}

.smart-product-form .form-control,
.smart-purchase-form .form-control,
.smart-sale-form .form-control,
.smart-quick-purchase-form .form-control,
.smart-quick-product-modal .form-control {
    height: 42px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 8px 14px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.02) !important;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease !important;
}
.smart-product-form .form-control:focus,
.smart-purchase-form .form-control:focus,
.smart-sale-form .form-control:focus,
.smart-quick-purchase-form .form-control:focus,
.smart-quick-product-modal .form-control:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2,132,199,.15) !important;
    outline: none !important;
    background-color: #ffffff !important;
}
.smart-product-form .form-control::placeholder,
.smart-purchase-form .form-control::placeholder,
.smart-sale-form .form-control::placeholder,
.smart-quick-purchase-form .form-control::placeholder,
.smart-quick-product-modal .form-control::placeholder { color: #94a3b8 !important; }

.smart-product-form textarea.form-control,
.smart-purchase-form textarea.form-control,
.smart-sale-form textarea.form-control,
.smart-quick-purchase-form textarea.form-control,
.smart-quick-product-modal textarea.form-control {
    height: auto !important;
    min-height: 80px !important;
    border-radius: 10px !important;
    line-height: 1.5 !important;
}
.smart-product-form .form-group,
.smart-sale-form .form-group,
.smart-quick-purchase-form .form-group,
.smart-quick-product-modal .form-group { margin-bottom: 20px; }

.smart-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.smart-label-row label { margin-bottom: 0 !important; }

/* --------------------------------------------------------------------------
   7. SELECT2 MODERNIZATION
   -------------------------------------------------------------------------- */
.smart-product-form .select2-container--default .select2-selection--single,
.smart-purchase-form .select2-container--default .select2-selection--single,
.smart-sale-form .select2-container--default .select2-selection--single,
.smart-quick-purchase-form .select2-container--default .select2-selection--single,
.smart-quick-product-modal .select2-container--default .select2-selection--single {
    height: 42px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    background-color: #ffffff !important;
    padding: 6px 12px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.02) !important;
    transition: all .15s ease !important;
    display: flex !important;
    align-items: center !important;
}
.smart-product-form .select2-container--default.select2-container--focus .select2-selection--single,
.smart-product-form .select2-container--default.select2-container--open .select2-selection--single,
.smart-purchase-form .select2-container--default.select2-container--focus .select2-selection--single,
.smart-purchase-form .select2-container--default.select2-container--open .select2-selection--single,
.smart-sale-form .select2-container--default.select2-container--focus .select2-selection--single,
.smart-sale-form .select2-container--default.select2-container--open .select2-selection--single,
.smart-quick-purchase-form .select2-container--default.select2-container--focus .select2-selection--single,
.smart-quick-purchase-form .select2-container--default.select2-container--open .select2-selection--single,
.smart-quick-product-modal .select2-container--default.select2-container--focus .select2-selection--single,
.smart-quick-product-modal .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2,132,199,.15) !important;
}
.smart-product-form .select2-selection__rendered,
.smart-purchase-form .select2-selection__rendered,
.smart-sale-form .select2-selection__rendered,
.smart-quick-purchase-form .select2-selection__rendered,
.smart-quick-product-modal .select2-selection__rendered {
    color: #1e293b !important;
    font-size: 13.5px !important;
    line-height: 28px !important;
    padding-left: 0 !important;
}
.smart-product-form .select2-selection__placeholder,
.smart-purchase-form .select2-selection__placeholder,
.smart-sale-form .select2-selection__placeholder,
.smart-quick-purchase-form .select2-selection__placeholder,
.smart-quick-product-modal .select2-selection__placeholder { color: #94a3b8 !important; }

.smart-product-form .select2-selection__arrow,
.smart-purchase-form .select2-selection__arrow,
.smart-sale-form .select2-selection__arrow,
.smart-quick-purchase-form .select2-selection__arrow,
.smart-quick-product-modal .select2-selection__arrow {
    height: 40px !important;
    right: 10px !important;
    display: flex !important;
    align-items: center !important;
}
.smart-product-form .select2-container--default .select2-selection--multiple,
.smart-purchase-form .select2-container--default .select2-selection--multiple,
.smart-sale-form .select2-container--default .select2-selection--multiple,
.smart-quick-purchase-form .select2-container--default .select2-selection--multiple,
.smart-quick-product-modal .select2-container--default .select2-selection--multiple {
    min-height: 42px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 3px 8px !important;
    background-color: #ffffff !important;
}
.smart-product-form .select2-container--default .select2-selection--multiple .select2-selection__choice,
.smart-purchase-form .select2-container--default .select2-selection--multiple .select2-selection__choice,
.smart-sale-form .select2-container--default .select2-selection--multiple .select2-selection__choice,
.smart-quick-purchase-form .select2-container--default .select2-selection--multiple .select2-selection__choice,
.smart-quick-product-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
    border-radius: 6px !important;
    padding: 2px 8px !important;
    font-size: 13px !important;
    margin-top: 4px !important;
}

/* --------------------------------------------------------------------------
   8. UNIFIED PILL INPUT GROUPS
   -------------------------------------------------------------------------- */
.smart-product-form .input-group,
.smart-purchase-form .input-group,
.smart-sale-form .input-group,
.smart-quick-purchase-form .input-group,
.smart-quick-product-modal .input-group {
    display: flex !important;
    width: 100% !important;
    position: relative !important;
}
.smart-product-form .input-group .select2-container,
.smart-purchase-form .input-group .select2-container,
.smart-sale-form .input-group .select2-container,
.smart-quick-purchase-form .input-group .select2-container,
.smart-quick-product-modal .input-group .select2-container {
    flex: 1 1 auto !important;
    width: 1% !important;
}
.smart-product-form .input-group .select2-container .select2-selection,
.smart-purchase-form .input-group .select2-container .select2-selection,
.smart-sale-form .input-group .select2-container .select2-selection,
.smart-quick-purchase-form .input-group .select2-container .select2-selection,
.smart-quick-product-modal .input-group .select2-container .select2-selection {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}
.smart-product-form .input-group > .form-control:not(:last-child),
.smart-purchase-form .input-group > .form-control:not(:last-child),
.smart-sale-form .input-group > .form-control:first-child,
.smart-quick-purchase-form .input-group > .form-control:not(:last-child),
.smart-quick-product-modal .input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}
.smart-product-form .input-group-btn,
.smart-purchase-form .input-group-btn,
.smart-sale-form .input-group-btn,
.smart-quick-purchase-form .input-group-btn,
.smart-quick-product-modal .input-group-btn {
    width: auto !important;
    display: flex !important;
    align-items: stretch !important;
    white-space: nowrap !important;
    position: static !important;
    flex-shrink: 0 !important;
}
.smart-product-form .input-group-btn > button.btn,
.smart-purchase-form .input-group-btn > button.smart-addon-btn,
.smart-purchase-form .input-group-btn > button.btn,
.smart-sale-form .input-group-btn > button.smart-addon-btn,
.smart-sale-form .input-group-btn > button.btn,
.smart-quick-purchase-form .input-group-btn > button.smart-addon-btn,
.smart-quick-purchase-form .input-group-btn > button.btn,
.smart-quick-product-modal .input-group-btn > button.btn {
    height: 42px !important;
    border-radius: 0 10px 10px 0 !important;
    border: 1.5px solid #e2e8f0 !important;
    border-left: none !important;
    background: #f8fafc !important;
    padding: 0 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all .2s cubic-bezier(.4,0,.2,1) !important;
    color: #0284c7 !important;
    margin: 0 !important;
    box-shadow: none !important;
}
.smart-product-form .input-group-btn > button.btn:hover,
.smart-purchase-form .input-group-btn > button.smart-addon-btn:hover,
.smart-purchase-form .input-group-btn > button.btn:hover,
.smart-sale-form .input-group-btn > button.smart-addon-btn:hover,
.smart-sale-form .input-group-btn > button.btn:hover,
.smart-quick-purchase-form .input-group-btn > button.smart-addon-btn:hover,
.smart-quick-purchase-form .input-group-btn > button.btn:hover,
.smart-quick-product-modal .input-group-btn > button.btn:hover {
    background: #f0f9ff !important;
    color: #0369a1 !important;
    border-color: #e2e8f0 !important;
}
.smart-product-form .input-group-btn > button.btn i,
.smart-purchase-form .input-group-btn > button.btn i,
.smart-sale-form .input-group-btn > button.btn i,
.smart-quick-purchase-form .input-group-btn > button.btn i,
.smart-quick-product-modal .input-group-btn > button.btn i {
    font-size: 16px !important;
    transition: transform .2s ease !important;
}
.smart-product-form .input-group-btn > button.btn:hover i,
.smart-purchase-form .input-group-btn > button.btn:hover i,
.smart-sale-form .input-group-btn > button.btn:hover i,
.smart-quick-purchase-form .input-group-btn > button.btn:hover i,
.smart-quick-product-modal .input-group-btn > button.btn:hover i { transform: scale(1.18); }

/* Input-group-addon for sale form */
.smart-sale-form .input-group-addon {
    height: 42px !important;
    min-width: 42px;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
}
.smart-sale-form .input-group-addon:first-child {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    border-right: none !important;
}
.smart-sale-form .input-group-addon:last-child {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
    border-left: none !important;
}

/* Suppress legacy square addon in payment rows */
.smart-purchase-form .payment_row .input-group-addon,
.smart-quick-purchase-form .payment_row .input-group-addon { display: none !important; }
.smart-purchase-form .payment_row .input-group,
.smart-quick-purchase-form .payment_row .input-group { display: block !important; width: 100% !important; }
.smart-purchase-form .payment_row .input-group > .form-control,
.smart-quick-purchase-form .payment_row .input-group > .form-control {
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    height: 42px !important;
    width: 100% !important;
}
.smart-purchase-form .payment_row .select2-container,
.smart-quick-purchase-form .payment_row .select2-container { width: 100% !important; }
.smart-purchase-form .payment_row .select2-selection,
.smart-quick-purchase-form .payment_row .select2-selection {
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    height: 42px !important;
}

/* --------------------------------------------------------------------------
   9. DUAL MULTI-INPUT (Pay Term / Expiry)
   -------------------------------------------------------------------------- */
.smart-dual-input { display: flex !important; width: 100% !important; }
.smart-dual-input .smart-dual-left {
    flex: 0 0 45% !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}
.smart-dual-input .smart-dual-right {
    flex: 1 1 55% !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.smart-dual-input .smart-dual-left:focus,
.smart-dual-input .smart-dual-right:focus { z-index: 2 !important; position: relative !important; }

/* --------------------------------------------------------------------------
   10. DATEPICKER — FLOATING POPOVER (non-clipping fix, universal)
   -------------------------------------------------------------------------- */
.bootstrap-datetimepicker-widget {
    z-index: 99999 !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,.12), 0 8px 10px -6px rgba(0,0,0,.06) !important;
    background-color: #ffffff !important;
}
.bootstrap-datetimepicker-widget.dropdown-menu {
    border-radius: 12px !important;
    padding: 8px !important;
}

/* --------------------------------------------------------------------------
   11. DOCUMENT FILE UPLOAD
   -------------------------------------------------------------------------- */
.smart-purchase-form .file-input,
.smart-sale-form .file-input,
.smart-quick-purchase-form .file-input { width: 100% !important; }
.smart-purchase-form .file-input .file-caption-main,
.smart-sale-form .file-input .file-caption-main,
.smart-quick-purchase-form .file-input .file-caption-main {
    display: flex !important;
    width: 100% !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04) !important;
    overflow: hidden !important;
}
.smart-purchase-form .file-input .file-caption,
.smart-sale-form .file-input .file-caption,
.smart-quick-purchase-form .file-input .file-caption {
    height: 42px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-right: none !important;
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    background-color: #f8fafc !important;
    color: #334155 !important;
    display: flex !important;
    align-items: center !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
}
.smart-purchase-form .file-input .input-group-btn,
.smart-sale-form .file-input .input-group-btn,
.smart-quick-purchase-form .file-input .input-group-btn {
    display: flex !important;
    align-items: stretch !important;
    width: auto !important;
    position: static !important;
    white-space: nowrap !important;
}
.smart-purchase-form .file-input .input-group-btn > .btn,
.smart-sale-form .file-input .input-group-btn > .btn,
.smart-quick-purchase-form .file-input .input-group-btn > .btn {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 0 16px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transition: all .2s ease !important;
}
.smart-purchase-form .file-input .input-group-btn > .btn-file,
.smart-quick-purchase-form .file-input .input-group-btn > .btn-file {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    border: 1px solid #0284c7 !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}
.smart-purchase-form .file-input .input-group-btn > .btn-file:hover,
.smart-quick-purchase-form .file-input .input-group-btn > .btn-file:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}
.smart-sale-form .file-input .input-group-btn > .btn-file {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: 1.5px solid #2563eb !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}
.smart-sale-form .file-input .input-group-btn > .btn-file:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}
.smart-purchase-form .file-input .input-group-btn > .fileinput-remove,
.smart-sale-form .file-input .input-group-btn > .fileinput-remove,
.smart-quick-purchase-form .file-input .input-group-btn > .fileinput-remove {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1.5px solid #fecaca !important;
    border-right: none !important;
}
.smart-sale-form .file-input .input-group-btn > .fileinput-remove:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* --------------------------------------------------------------------------
   12. PRODUCT SEARCH BAR (Spotlight group)
   -------------------------------------------------------------------------- */
.smart-search-group {
    display: flex !important;
    width: 100% !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px -2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.02) !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    transition: border-color .2s ease, box-shadow .2s ease !important;
    margin-bottom: 20px !important;
}
.smart-search-group:focus-within {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2,132,199,.15) !important;
}
.smart-search-group .input-group-btn {
    width: auto !important;
    display: flex !important;
    align-items: stretch !important;
    position: static !important;
    white-space: nowrap !important;
}
.smart-search-group .smart-search-btn-left,
.smart-search-group .smart-search-config-btn {
    height: 48px !important;
    border: none !important;
    border-right: 1.5px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #0284c7 !important;
    padding: 0 16px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
    box-shadow: none !important;
}
.smart-search-group .smart-search-btn-left:hover,
.smart-search-group .smart-search-config-btn:hover { background: #f0f9ff !important; color: #0369a1 !important; }
.smart-search-group .smart-search-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    color: #94a3b8 !important;
    font-size: 16px !important;
    background: #ffffff !important;
}
.smart-search-group input,
.smart-search-group .smart-search-input {
    flex: 1 1 auto !important;
    border: none !important;
    box-shadow: none !important;
    height: 48px !important;
    font-size: 14.5px !important;
    color: #0f172a !important;
    padding: 0 12px !important;
    outline: none !important;
    background: #ffffff !important;
    border-radius: 0 !important;
}
.smart-search-group input::placeholder,
.smart-search-group .smart-search-input::placeholder { color: #94a3b8 !important; }
.smart-search-group .smart-search-btn-right,
.smart-search-group .smart-addon-btn {
    height: 48px !important;
    border: none !important;
    border-left: 1.5px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #059669 !important;
    padding: 0 18px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
    text-decoration: none !important;
    box-shadow: none !important;
}
.smart-search-group .smart-search-btn-right:hover,
.smart-search-group .smart-addon-btn:hover { background: #ecfdf5 !important; color: #047857 !important; }
.smart-search-group .smart-addon-btn i,
.smart-search-group .smart-search-btn-right i,
.smart-search-group .smart-search-config-btn i { font-size: 16px !important; transition: transform .2s ease !important; }
.smart-search-group .smart-addon-btn:hover i,
.smart-search-group .smart-search-btn-right:hover i,
.smart-search-group .smart-search-config-btn:hover i { transform: scale(1.15); }

/* --------------------------------------------------------------------------
   13. TABLES (purchase, sale, product price)
   -------------------------------------------------------------------------- */
.smart-purchase-table,
.smart-pos-table,
.smart-product-form .add-product-price-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    margin-bottom: 0 !important;
}
.smart-purchase-table thead th,
.smart-pos-table th,
.smart-product-form .add-product-price-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    padding: 12px 10px !important;
    vertical-align: middle !important;
}
.smart-purchase-table tbody td,
.smart-pos-table td,
.smart-product-form .add-product-price-table td {
    padding: 10px !important;
    vertical-align: middle !important;
    background: #ffffff !important;
    border-color: #f1f5f9 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
.smart-purchase-table tbody tr:hover { background: #f8fafc !important; }
.smart-purchase-table .form-control,
.smart-pos-table .form-control,
.smart-product-form .table .form-control,
.smart-product-form .form-control.input-sm {
    height: 36px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 4px 8px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.02) !important;
}
.smart-purchase-table .form-control:focus,
.smart-pos-table .form-control:focus,
.smart-product-form .table .form-control:focus,
.smart-product-form .form-control.input-sm:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2,132,199,.15) !important;
}
.smart-table-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   14. ADDRESS PREVIEW CARD
   -------------------------------------------------------------------------- */
.smart-address-preview-card {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.02);
}
@media (min-width: 992px) {
    .smart-address-preview-card { flex-direction: row; align-items: stretch; }
}
.smart-address-preview-card .smart-address-block { flex: 1 1 0; min-width: 0; }
.smart-address-preview-card .smart-address-divider { width: 1px; background-color: #e2e8f0; margin: 0 10px; }
@media (max-width: 991px) {
    .smart-address-preview-card .smart-address-divider { width: 100%; height: 1px; margin: 6px 0; }
}
.smart-address-preview-card .smart-address-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    margin-bottom: 4px;
}
.smart-address-preview-card .smart-address-content {
    font-size: 12px;
    line-height: 1.45;
    color: #334155;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   15. SUMMARY BOXES & PILLS
   -------------------------------------------------------------------------- */
.smart-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 14px;
}
.smart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}
.smart-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13.5px;
}
.smart-summary-label { font-weight: 600; color: #64748b; }
.smart-summary-val   { font-weight: 700; color: #0f172a; }
.smart-summary-highlight { background: #eff6ff; border-color: #bfdbfe; }
.smart-summary-highlight .smart-summary-label { color: #2563eb; }
.smart-summary-highlight .smart-summary-val   { color: #1d4ed8; font-size: 15px; }
.smart-table-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   16. TOOLTIP QUESTION MARK
   -------------------------------------------------------------------------- */
.hover-q {
    color: #0ea5e9 !important;
    font-size: 13px !important;
    margin-left: 4px;
    cursor: pointer;
    transition: all .15s ease;
}
.hover-q:hover { color: #0284c7 !important; transform: scale(1.15); }

/* --------------------------------------------------------------------------
   17. SMART ACTION BAR (INLINE FORM FOOTER CARD)
   -------------------------------------------------------------------------- */
.smart-action-bar {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin-top: 24px !important;
    margin-bottom: 35px !important;
    border-radius: 14px !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    padding: 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 1 !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}
.smart-action-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 16px;
}
.smart-summary-tag {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
}
.smart-summary-price {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.02em;
}
.smart-action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   18. SMART BUTTONS
   -------------------------------------------------------------------------- */
.smart-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none !important;
    cursor: pointer;
    transition: all .2s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.smart-btn:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.smart-btn:active { transform: translateY(0); }
.smart-btn-primary { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important; color: #ffffff !important; }
.smart-btn-primary:hover { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important; color: #ffffff !important; }
.smart-btn-secondary { background: #1e293b !important; color: #ffffff !important; }
.smart-btn-secondary:hover { background: #0f172a !important; color: #ffffff !important; }
.smart-btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; color: #ffffff !important; }
.smart-btn-success:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; color: #ffffff !important; }
.smart-btn-danger  { background: linear-gradient(135deg, #f43f5e 0%, #dc2626 100%) !important; color: #ffffff !important; }
.smart-btn-danger:hover  { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important; color: #ffffff !important; }
.smart-btn-purple  { background: #7c3aed !important; color: #ffffff !important; }
.smart-btn-purple:hover  { background: #6d28d9 !important; color: #ffffff !important; }
.smart-btn-warning { background: #f59e0b !important; color: #ffffff !important; }
.smart-btn-warning:hover { background: #d97706 !important; color: #ffffff !important; }

/* --------------------------------------------------------------------------
   19. FEATURE TOGGLE CARDS (Product forms)
   -------------------------------------------------------------------------- */
.smart-toggle-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    min-height: 84px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all .2s ease;
    cursor: pointer;
}
.smart-toggle-card:hover {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 4px 12px -2px rgba(0,0,0,.05);
    transform: translateY(-1px);
}
.smart-toggle-card .toggle-content { flex: 1; }
.smart-toggle-card .toggle-content label {
    margin: 0 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.smart-toggle-card .toggle-content .help-block {
    margin: 4px 0 0 0 !important;
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   20. MEDIA / FILE UPLOAD AREA (Product)
   -------------------------------------------------------------------------- */
.smart-upload-container {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    transition: all .2s ease;
}
.smart-upload-container:hover { border-color: #3b82f6; background: #f0f7ff; }
.smart-media-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 14px !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    transition: all .2s ease;
}
.smart-media-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(67,56,202,.25);
}

/* --------------------------------------------------------------------------
   21. SUBSCRIPTION / RECURRING CARD
   -------------------------------------------------------------------------- */
.smart-subscription-card {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   22. ICON FIX (fa-sliders alias)
   -------------------------------------------------------------------------- */
.smart-product-form .fa-sliders::before,
.smart-product-form .fa-sliders-h::before { content: "\f1de" !important; }
