/* ============================================
   INTER FONT (self-hosted, no FOUC)
   ============================================ */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-500-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-600-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-700-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ============================================
   BOOTSTRAP UTILITIES (minimal replacement)
   ============================================ */

/* Flexbox */
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.flex-column { flex-direction: column !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* Sizing */
.h-100 { height: 100% !important; }
.w-100 { width: 100% !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }

/* Text */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.text-nowrap { white-space: nowrap !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-muted { color: #6b7280 !important; }
.text-secondary { color: #6b7280 !important; }
.text-primary { color: #688bbe !important; }
.text-success { color: #7ab892 !important; }
.text-danger { color: #c47a7a !important; }
.text-warning { color: #d4a84b !important; }
.text-info { color: #6a9ec2 !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

/* Position */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

/* Grid */
.row { display: flex; flex-wrap: wrap; margin-left: -0.5rem; margin-right: -0.5rem; }
.row > * { padding-left: 0.5rem; padding-right: 0.5rem; }
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-12 { flex: 0 0 auto; width: 100%; }
.col-md-6 { flex: 0 0 auto; width: 50%; }

/* ============================================
   BOOTSTRAP COMPONENTS (minimal)
   ============================================ */

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-lg { padding: 0.5rem 1rem; font-size: 1rem; }
.btn-primary { background-color: #688bbe; border-color: #688bbe; color: #fff; }
.btn-primary:hover { background-color: #5a7aa8; border-color: #5a7aa8; }
.btn-secondary { background-color: #6b7280; border-color: #6b7280; color: #fff; }
.btn-success { background-color: #7ab892; border-color: #7ab892; color: #fff; }
.btn-danger { background-color: #c47a7a; border-color: #c47a7a; color: #fff; }
.btn-warning { background-color: #d4a84b; border-color: #d4a84b; color: #fff; }
.btn-info { background-color: #6a9ec2; border-color: #6a9ec2; color: #fff; }
.btn-dark { background-color: #4b5563; border-color: #4b5563; color: #fff; }
.btn-link { background: none; border: none; color: #688bbe; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.btn-outline-primary { color: #688bbe; border-color: #688bbe; background: transparent; }
.btn-outline-primary:hover { background-color: #688bbe; color: #fff; }
.btn-outline-secondary { color: #6b7280; border-color: #c4cad3; background: transparent; }
.btn-outline-secondary:hover { background-color: #f5f6f8; }
.btn-outline-success { color: #7ab892; border-color: #7ab892; background: transparent; }
.btn-outline-success:hover { background-color: #7ab892; color: #fff; }
.btn-outline-danger { color: #c47a7a; border-color: #c47a7a; background: transparent; }
.btn-outline-danger:hover { background-color: #c47a7a; color: #fff; }
.btn-outline-warning { color: #d4a84b; border-color: #d4a84b; background: transparent; }
.btn-outline-warning:hover { background-color: #d4a84b; color: #fff; }
.btn-outline-info { color: #6a9ec2; border-color: #6a9ec2; background: transparent; }
.btn-outline-info:hover { background-color: #6a9ec2; color: #fff; }
.btn-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    width: 1.5rem;
    height: 1.5rem;
    position: relative;
}
.btn-close::before {
    content: '×';
    font-size: 1.5rem;
    line-height: 1;
}
.btn-close:hover { opacity: 1; }

/* Search path hint for deep items */
.search-path {
    color: var(--bs-gray-500);
    font-size: 0.75rem;
    font-style: italic;
}

/* Selection list (regions, etc.) */
.selection-list {
    border: 1px solid var(--bs-gray-300);
    border-radius: 6px;
    max-height: 160px;
    overflow-y: auto;
    background: #fff;
}

.selection-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--bs-gray-100);
    transition: background 0.1s ease;
}

.selection-item:last-child {
    border-bottom: none;
}

.selection-item:hover {
    background: var(--bs-gray-50);
}

.selection-item.selected {
    background: rgba(104, 139, 190, 0.1);
    color: var(--bs-primary);
    font-weight: 500;
}

.selection-item i {
    margin-right: 6px;
}

.selection-item small {
    font-weight: 400;
}

/* Client type selector */
.client-type-selector {
    display: flex;
    gap: 0;
    border: 1px solid var(--bs-gray-300);
    border-radius: 6px;
    overflow: hidden;
}

.client-type-option {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.client-type-option input {
    display: none;
}

.client-type-option span {
    display: block;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.8rem;
    background: #fff;
    border-right: 1px solid var(--bs-gray-300);
    transition: all 0.15s ease;
}

.client-type-option:last-child span {
    border-right: none;
}

.client-type-option input:checked + span {
    background: var(--bs-primary);
    color: #fff;
}

.client-type-option:hover span {
    background: var(--bs-gray-100);
}

.client-type-option input:checked + span:hover {
    background: var(--bs-primary);
}

.client-select-wrap {
    display: none;
    margin-top: 8px;
}

.client-select-wrap.active {
    display: block;
}

/* ============================================
   RULE MODAL - Unified Form Styles
   ============================================ */
#ruleModal .modal-dialog {
    max-width: 560px;
}

#ruleModal .modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#ruleModal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bs-gray-200);
    background: var(--bs-gray-50);
    border-radius: 10px 10px 0 0;
}

#ruleModal .modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
}

#ruleModal .modal-body {
    padding: 0;
}

#ruleModal .modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--bs-gray-200);
    background: var(--bs-gray-50);
    gap: 8px;
}

/* Accordion */
#ruleModal .accordion-item {
    border: none;
    border-bottom: 1px solid var(--bs-gray-200);
}

#ruleModal .accordion-item:last-child {
    border-bottom: none;
}

#ruleModal .accordion-button {
    padding: 14px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-strong);
    background: #fff;
}

#ruleModal .accordion-button:not(.collapsed) {
    background: var(--bs-gray-50);
    box-shadow: none;
}

#ruleModal .accordion-button::after {
    width: 14px;
    height: 14px;
    background-size: 14px;
}

#ruleModal .accordion-body {
    padding: 16px 20px;
    background: #fff;
}

#ruleModal .accordion-body .row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
}

#ruleModal .accordion-body .row > div {
    flex: 1;
    min-width: 0;
    padding: 0;
}

#ruleModal .accordion-body .row .form-control,
#ruleModal .accordion-body .row .form-select {
    width: 100%;
}

/* Form elements */
#ruleModal .form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

#ruleModal .form-control,
#ruleModal .form-select {
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--bs-gray-300);
    transition: border-color 0.15s, box-shadow 0.15s;
}

#ruleModal .form-control:focus,
#ruleModal .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(104, 139, 190, 0.15);
}

#ruleModal .form-control::placeholder {
    color: var(--bs-gray-400);
}

#ruleModal textarea.form-control {
    resize: none;
}

/* Selection lists (regions, clients, etc.) */
#ruleModal .selection-list {
    max-height: 140px;
}

/* Product tree */
#ruleModal .product-tree {
    max-height: 180px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 6px;
}

/* Buttons */
#ruleModal .btn {
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}

#ruleModal .btn-secondary {
    background: var(--bs-gray-200);
    border-color: var(--bs-gray-200);
    color: var(--text-strong);
}

#ruleModal .btn-secondary:hover {
    background: var(--bs-gray-300);
    border-color: var(--bs-gray-300);
}

/* File upload area */
.file-upload-area {
    position: relative;
    border: 2px dashed var(--bs-gray-300);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: var(--bs-gray-50);
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bs-gray-100);
    border-radius: 4px;
    font-size: 0.8rem;
}

.file-item i {
    color: var(--bs-gray-500);
}

.file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    color: var(--bs-gray-500);
    font-size: 0.75rem;
}

.file-item .file-remove {
    color: var(--bs-danger);
    cursor: pointer;
    padding: 2px;
}

.file-item .file-remove:hover {
    color: var(--bs-danger);
    opacity: 0.7;
}
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 0.375rem 0 0 0.375rem; }
.btn-group .btn:last-child { border-radius: 0 0.375rem 0.375rem 0; }
.btn-check { position: absolute; clip: rect(0,0,0,0); }
.btn-check:checked + .btn-outline-secondary { background-color: #688bbe; border-color: #688bbe; color: #fff; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle::after { display: inline-block; margin-left: 0.255em; content: ""; border-top: 0.3em solid; border-right: 0.3em solid transparent; border-left: 0.3em solid transparent; }
.dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    min-width: 160px;
    padding: 4px 0;
    margin: 0;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    list-style: none;
    font-size: 12px;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: block;
    padding: 6px 12px;
    white-space: nowrap;
    color: #3d4551;
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    font-size: 12px;
}
.dropdown-item:hover { background-color: #f5f6f8; }
.dropdown-item.active { background-color: #688bbe; color: #fff; }
.dropdown-divider { margin: 4px 0; border-top: 1px solid #e9ecef; }
.dropdown-item.disabled {
    color: var(--bs-gray-400);
    pointer-events: none;
    opacity: 0.65;
}
.dropdown-item .bulk-count {
    font-size: 0.75rem;
    color: var(--bs-gray-500);
}
.dropdown-item.disabled .bulk-count { display: none; }

/* Nav */
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; align-items: center; }
.nav-item { display: flex; align-items: center; }
.nav-link { display: flex; align-items: center; padding: 0.5rem 1rem; color: #3d4551; text-decoration: none; }
.nav-link:hover { color: #5a7aa8; }
.nav-pills .nav-link { border-radius: 0.375rem; }
.nav-justified .nav-item { flex-basis: 0; flex-grow: 1; text-align: center; }

/* Forms */
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #3d4551;
    background-color: #fff;
    border: 1px solid #dce0e5;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus, .form-select:focus {
    border-color: #688bbe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(104, 139, 190, 0.25);
}
.form-control::placeholder { color: #9aa3ae; }
.form-control-sm, .form-select-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.form-label { margin-bottom: 0.5rem; font-weight: 500; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1rem; height: 1rem; margin: 0; accent-color: #688bbe; }
.form-check-label { margin: 0; }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
}
.bg-primary { background-color: #688bbe !important; }
.bg-secondary { background-color: #9aa3ae !important; }
.bg-success { background-color: #7ab892 !important; }
.bg-danger { background-color: #c47a7a !important; }
.bg-warning { background-color: #d4a84b !important; }
.bg-info { background-color: #6a9ec2 !important; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; z-index: 1055; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; background-color: rgba(0,0,0,0.5); }
.modal.show { display: block; }
.modal-dialog { position: relative; width: auto; margin: 1.75rem auto; max-width: 500px; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; background-color: #fff; border-radius: 0.5rem; box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #dce0e5; }
.modal-title { margin: 0; font-size: 1.25rem; font-weight: 500; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; padding: 1rem; border-top: 1px solid #dce0e5; gap: 0.5rem; }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 1050; width: 100vw; height: 100vh; background-color: #000; opacity: 0.5; }

/* Accordion */
.accordion { }
.accordion-item { border: 1px solid #dce0e5; }
.accordion-item:not(:first-child) { border-top: 0; }
.accordion-button {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    color: #3d4551;
    text-align: left;
    background-color: #fff;
    border: 0;
    cursor: pointer;
}
.accordion-button:not(.collapsed) { background-color: #e8eef5; color: #688bbe; }
.accordion-button::after {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%233d4551'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1rem;
    transition: transform 0.2s ease-in-out;
}
.accordion-button:not(.collapsed)::after { transform: rotate(-180deg); }
.accordion-collapse { display: none; }
.accordion-collapse.show { display: block; }
.accordion-body { padding: 1rem; }

/* Table */
.table { width: 100%; margin-bottom: 1rem; vertical-align: top; border-color: #dce0e5; }
.table > :not(:first-child) { border-top: 2px solid currentcolor; }
.table > thead { vertical-align: bottom; }
.table > tbody { vertical-align: inherit; }
.table th, .table td { padding: 0.5rem; border-bottom: 1px solid #dce0e5; }
.table-hover > tbody > tr:hover { background-color: rgba(0,0,0,0.02); }

/* Pagination */
.pagination { display: flex; padding-left: 0; list-style: none; gap: 0.25rem; }
.page-item { }
.page-link { display: block; padding: 0.375rem 0.75rem; color: #688bbe; text-decoration: none; background-color: #fff; border: 1px solid #dce0e5; border-radius: 0.25rem; }
.page-link:hover { background-color: #e8eef5; }
.page-item.active .page-link { background-color: #688bbe; border-color: #688bbe; color: #fff; }
.page-item.disabled .page-link { color: #9aa3ae; pointer-events: none; }

/* ============================================
   GLOBAL VARIABLES & RESET
   ============================================ */
:root {
    /* Primary - muted blue */
    --bs-primary: #688bbe;
    --bs-primary-hover: #5a7aa8;
    --bs-primary-light: #e8eef5;

    /* Status colors - pastel/muted */
    --color-success: #7ab892;
    --color-warning: #d4a84b;
    --color-danger: #c47a7a;
    --color-info: #6a9ec2;

    /* Grays - softer tones */
    --bs-gray-50: #fafbfc;
    --bs-gray-100: #f5f6f8;
    --bs-gray-200: #ebedf0;
    --bs-gray-300: #dce0e5;
    --bs-gray-400: #c4cad3;
    --bs-gray-500: #9aa3ae;
    --bs-gray-600: #6b7280;
    --bs-gray-700: #4b5563;

    /* Layout */
    --sidebar-width: 276px;
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.75rem;
    --font-size-base: 0.875rem;
    --border-color: #dce0e5;
    --input-height: 30px;

    /* Backgrounds */
    --bg-subtle: #f8f9fb;
    --bg-muted: #f0f2f5;

    /* Text colors - soft */
    --text-primary: #3d4551;
    --text-strong: #2d3340;
    --text-muted: #6b7280;

    /* Override Bootstrap CSS variables */
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bs-body-font-size: 0.875rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.5;
    --bs-body-color: #3d4551;
    --bs-body-bg: #f5f6f8;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--bs-body-font-family);
    font-size: var(--bs-body-font-size);
    line-height: var(--bs-body-line-height);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HEADER
   ============================================ */
header {
    min-height: 56px !important;
    max-height: 56px !important;
    height: 56px !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid var(--bs-gray-200) !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.brown-text { color: #5c4033; }
.btn-icon { text-decoration: none; }

.nav-pills-xmdash {
    background-color: var(--bs-gray-400);
    padding: .25rem .5rem;
    border-radius: .5rem;
    gap: .25rem;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.nav-pills-xmdash .nav-link {
    padding: .25em .5em;
    color: var(--text-strong);
    border-radius: 0.375rem;
}

.nav-pills-xmdash .nav-link.active {
    background-color: #fff;
    color: var(--text-strong);
}

.inactive-block {
    opacity: 0.5;
    pointer-events: none;
    filter: blur(1px);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
.pricemanager-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.pricemanager-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.pricemanager-scrollbar::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 3px;
}
.pricemanager-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* ============================================
   MAIN LAYOUT - fits screen exactly
   ============================================ */
.main-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ============================================
   SIDEBAR FILTERS
   ============================================ */
.filters-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bs-gray-100);
    border-right: 1px solid var(--border-color);
    padding: 12px;
    overflow-y: auto;
    flex-shrink: 0;
}

.filters-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: var(--font-size-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.filters-header button {
    font-size: var(--font-size-xs);
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group > label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--bs-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

/* Unified input/select styling in sidebar */
.filter-group .form-select,
.filter-group .form-control {
    font-family: inherit;
    font-size: var(--font-size-sm);
    height: var(--input-height);
    padding: 4px 8px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
    background-color: #fff;
    color: var(--text-primary);
    line-height: 1.4;
}

.filter-group .form-select:focus,
.filter-group .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(35, 86, 215, 0.1);
    outline: none;
}

/* ============================================
   SELECT2 - SIDEBAR (Professional styling)
   ============================================ */
.filters-sidebar .select2-container {
    width: 100% !important;
}

.filters-sidebar .select2-container--default .select2-selection {
    font-family: inherit;
    font-size: var(--font-size-sm);
    min-height: var(--input-height);
    height: var(--input-height);
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
    background-color: #fff;
    padding: 0;
    display: flex;
    align-items: center;
}

.filters-sidebar .select2-container--default .select2-selection--single .select2-selection__rendered {
    font-family: inherit;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    padding: 0 28px 0 8px;
    line-height: var(--input-height);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filters-sidebar .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--bs-gray-500);
}

.filters-sidebar .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--input-height) - 2px);
    width: 24px;
    right: 2px;
}

.filters-sidebar .select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: 20px;
    font-size: 14px;
}

.filters-sidebar .select2-container--default.select2-container--focus .select2-selection,
.filters-sidebar .select2-container--default.select2-container--open .select2-selection {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(35, 86, 215, 0.1);
}

/* Select2 dropdown */
.select2-container--default .select2-dropdown {
    font-family: inherit;
    font-size: var(--font-size-sm);
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.select2-container--default .select2-results__option {
    padding: 6px 10px;
    font-size: var(--font-size-sm);
}

.select2-container--default .select2-results__option--highlighted {
    background-color: var(--bs-primary);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    font-family: inherit;
    font-size: var(--font-size-sm);
    padding: 6px 8px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
}

/* ============================================
   PRODUCT TREE
   ============================================ */
.product-tree {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
    padding: 6px;
    background: #fff;
    font-size: var(--font-size-sm);
}

.tree-item {
    padding: 4px 6px;
    margin: 1px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 3px;
    transition: background-color 0.1s;
    font-size: var(--font-size-sm);
    line-height: 1.3;
}

.tree-item:hover {
    background: var(--bs-gray-100);
}

.tree-item.selected {
    background: var(--bs-primary-light);
    color: var(--bs-primary);
    font-weight: 500;
}

.tree-item .tree-toggle {
    width: 14px;
    min-width: 14px;
    text-align: center;
    color: var(--bs-gray-500);
    font-size: 10px;
}

.tree-item i.fa-folder,
.tree-item i.fa-cube,
.tree-item i.fa-globe {
    font-size: 11px;
}

.tree-item i.fa-building,
.tree-item i.fa-layer-group,
.tree-item i.fa-folder-open,
.tree-item i.fa-tape,
.tree-item i.fa-grip-lines-vertical,
.tree-item i.fa-scroll {
    font-size: 11px;
}

/* Color swatches in tree */
.color-swatches {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Level 4 products (groups) */
.tree-item[data-level="4"] {
    font-size: 11px;
}

/* Level 5 price groups */
.tree-item[data-level="5"] {
    font-size: 12px;
    padding: 4px 6px;
}

.tree-item[data-level="5"] small {
    font-size: 10px;
}

/* Level 6 products (color variants) */
.tree-item[data-level="6"] {
    font-size: 11px;
    padding: 3px 6px;
    color: var(--bs-gray-600);
}

.tree-item[data-level="6"] .color-dot {
    width: 8px;
    height: 8px;
}

.tree-children {
    padding-left: 14px;
    display: none;
}

.tree-children.open {
    display: block;
}

/* ============================================
   TABLE CONTAINER - fit to screen
   ============================================ */
.table-container {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 12px 16px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.table-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    min-height: 40px;
}

.table-header > div {
    display: flex !important;
    align-items: center !important;
}

.table-header .quick-tabs {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

/* Custom search box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: var(--bs-gray-500);
    font-size: 12px;
    pointer-events: none;
}

.search-box input {
    padding: 0 32px 0 32px !important;
    width: 200px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    font-size: var(--font-size-sm) !important;
    border: 1px solid var(--bs-gray-300) !important;
    border-radius: 6px !important;
    background: #fff !important;
    line-height: 30px !important;
    box-sizing: border-box !important;
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bs-gray-400);
    font-size: 11px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.search-clear:hover {
    color: var(--bs-gray-600);
    background: var(--bs-gray-200);
}

.search-box input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(104, 139, 190, 0.15);
    outline: none;
}

.search-box input::placeholder {
    color: var(--bs-gray-400);
}

/* ============================================
   QUICK TABS
   ============================================ */
.quick-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.quick-tab {
    padding: 5px 10px;
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid var(--bs-gray-300);
    background: #fff;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quick-tab:hover {
    background: var(--bs-gray-100);
    border-color: var(--bs-gray-400);
}

.quick-tab.active {
    background: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

.quick-tab.active:hover {
    background: var(--bs-primary-hover);
    border-color: var(--bs-primary-hover);
}

.quick-tab .badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 2px;
}

.quick-tab.active .badge {
    background: rgba(255,255,255,0.25) !important;
    color: #fff !important;
}

/* Muted badge colors */
.quick-tab .badge.bg-success { background-color: var(--color-success) !important; }
.quick-tab .badge.bg-warning { background-color: var(--color-warning) !important; color: #fff !important; }
.quick-tab .badge.bg-primary { background-color: var(--bs-primary) !important; }
.quick-tab .badge.bg-danger { background-color: var(--color-danger) !important; }
.quick-tab .badge.bg-secondary { background-color: var(--bs-gray-500) !important; }

/* ============================================
   DATA TABLE WRAPPER - NO HORIZONTAL SCROLL
   ============================================ */
.table-responsive-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--bs-gray-200);
    border-radius: 6px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* ============================================
   DATATABLES STYLING - RESPONSIVE
   ============================================ */
.dataTables_wrapper {
    font-family: inherit;
    font-size: var(--font-size-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* Table scroll area */
.dataTables_wrapper .table-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden !important;
}

/* Footer - length, info, pagination */
.dataTables_wrapper .table-footer {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 16px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    background: var(--bs-gray-100) !important;
    border-top: 1px solid var(--bs-gray-200) !important;
    gap: 16px !important;
    box-sizing: border-box !important;
}

.dataTables_wrapper .dataTables_length {
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dataTables_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: var(--bs-gray-600);
}

.dataTables_wrapper .dataTables_length select {
    font-family: inherit;
    font-size: 13px;
    padding: 3px 8px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    height: auto;
    line-height: 1.3;
}

.dataTables_wrapper .dataTables_info {
    font-size: 13px !important;
    color: var(--bs-gray-600) !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dataTables_wrapper .dataTables_paginate {
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    gap: 3px;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link {
    padding: 3px 8px;
    font-size: 13px;
    line-height: 1.3;
    border: none;
    background: transparent;
    color: var(--bs-gray-600);
    min-width: auto;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link:hover {
    background: transparent;
    color: var(--bs-primary);
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: transparent;
    color: var(--bs-primary);
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    background: transparent;
    color: var(--bs-gray-400);
}

/* Table - ALWAYS fits container, no overflow */
table.dataTable {
    font-family: inherit;
    font-size: var(--font-size-sm);
    border-collapse: collapse;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    table-layout: auto;
}

table.dataTable thead th {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--bs-gray-600);
    background: var(--bs-gray-50);
    border-bottom: 1px solid var(--bs-gray-300);
    padding: 6px 4px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sort icons BEFORE header text - icon at 3px, text starts at 16px (5px gap) */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    padding-left: 16px !important;
}
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
    left: 3px !important;
    right: auto !important;
}


table.dataTable tbody td {
    padding: 6px 4px;
    vertical-align: middle;
    border-bottom: 1px solid var(--bs-gray-200);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}


/* Gap between columns */
table.dataTable td,
table.dataTable th {
    padding-right: 10px;
}

table.dataTable tbody tr:hover {
    background-color: #f8fafc !important;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

/* Empty table state */
table.dataTable tbody td.dataTables_empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--bs-gray-500);
    font-style: italic;
}

/* Checkbox column */
table.dataTable th.select-checkbox,
table.dataTable td.select-checkbox {
    width: 32px !important;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding: 6px 2px;
}

table.dataTable th.select-checkbox input,
table.dataTable td.select-checkbox input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--bs-primary);
}


/* Text truncation utility */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   DISCOUNT VALUES - muted
   ============================================ */
.discount-value {
    font-weight: 600;
    font-size: var(--font-size-sm);
    font-family: inherit;
}
.discount-value.percent { color: var(--color-success); }
.discount-value.fixed { color: var(--color-info); }

/* ============================================
   CONFLICT BADGE - muted
   ============================================ */
.conflict-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: help;
}
.conflict-badge.has-conflict {
    background: rgba(212, 168, 75, 0.15);
    color: #b8923f;
}
.conflict-badge.no-conflict {
    color: var(--bs-gray-400);
}

/* ============================================
   RULE NAME LINK - clickable for edit
   ============================================ */
.rule-name-link {
    color: inherit;
    text-decoration: none;
}

/* ============================================
   ROW STATES
   ============================================ */
tr.row-disabled td:not(:first-child):not(:last-child) { opacity: 0.5; }
tr.row-expired td:not(:first-child):not(:last-child) { opacity: 0.5; }
tr.row-deleted td:not(:first-child):not(:last-child) { opacity: 0.3; }

/* ============================================
   BULK ACTIONS BUTTON
   ============================================ */
#bulkActionsBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   BOOTSTRAP OVERRIDES - Muted colors
   ============================================ */
.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary-hover);
    --bs-btn-hover-border-color: var(--bs-primary-hover);
    --bs-btn-active-bg: var(--bs-primary-hover);
    --bs-btn-active-border-color: var(--bs-primary-hover);
    --bs-btn-disabled-bg: var(--bs-gray-400);
    --bs-btn-disabled-border-color: var(--bs-gray-400);
}

.btn-success {
    --bs-btn-bg: var(--color-success);
    --bs-btn-border-color: var(--color-success);
    --bs-btn-hover-bg: #6aa580;
    --bs-btn-hover-border-color: #6aa580;
}

.btn-warning {
    --bs-btn-bg: var(--color-warning);
    --bs-btn-border-color: var(--color-warning);
    --bs-btn-hover-bg: #c49a40;
    --bs-btn-hover-border-color: #c49a40;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}

.btn-danger {
    --bs-btn-bg: var(--color-danger);
    --bs-btn-border-color: var(--color-danger);
    --bs-btn-hover-bg: #b36b6b;
    --bs-btn-hover-border-color: #b36b6b;
}

.btn-info {
    --bs-btn-bg: var(--color-info);
    --bs-btn-border-color: var(--color-info);
    --bs-btn-hover-bg: #5a8db1;
    --bs-btn-hover-border-color: #5a8db1;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}

.btn-dark {
    --bs-btn-bg: var(--bs-gray-700);
    --bs-btn-border-color: var(--bs-gray-700);
    --bs-btn-hover-bg: var(--bs-gray-600);
    --bs-btn-hover-border-color: var(--bs-gray-600);
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
}

.btn-outline-success {
    --bs-btn-color: var(--color-success);
    --bs-btn-border-color: var(--color-success);
    --bs-btn-hover-bg: var(--color-success);
    --bs-btn-hover-border-color: var(--color-success);
}

.btn-outline-warning {
    --bs-btn-color: var(--color-warning);
    --bs-btn-border-color: var(--color-warning);
    --bs-btn-hover-bg: var(--color-warning);
    --bs-btn-hover-border-color: var(--color-warning);
}

.btn-outline-danger {
    --bs-btn-color: var(--color-danger);
    --bs-btn-border-color: var(--color-danger);
    --bs-btn-hover-bg: var(--color-danger);
    --bs-btn-hover-border-color: var(--color-danger);
}

.btn-outline-info {
    --bs-btn-color: var(--color-info);
    --bs-btn-border-color: var(--color-info);
    --bs-btn-hover-bg: var(--color-info);
    --bs-btn-hover-border-color: var(--color-info);
}

.btn-outline-secondary {
    --bs-btn-color: var(--bs-gray-600);
    --bs-btn-border-color: var(--bs-gray-400);
    --bs-btn-hover-bg: var(--bs-gray-100);
    --bs-btn-hover-border-color: var(--bs-gray-400);
    --bs-btn-hover-color: var(--bs-gray-700);
}

/* Pagination - muted */
.page-link {
    color: var(--bs-gray-600);
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.page-link:hover {
    color: var(--bs-primary);
    background-color: var(--bs-primary-light);
}

/* Badge overrides */
.badge.bg-primary { background-color: var(--bs-primary) !important; }
.badge.bg-success { background-color: var(--color-success) !important; }
.badge.bg-warning { background-color: var(--color-warning) !important; }
.badge.bg-danger { background-color: var(--color-danger) !important; }
.badge.bg-info { background-color: var(--color-info) !important; }
.badge.bg-secondary { background-color: var(--bs-gray-500) !important; }

/* Form focus states */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(104, 139, 190, 0.15);
}

/* Checkbox accent */
input[type="checkbox"] {
    accent-color: var(--bs-primary);
}

/* Select2 active states */
.select2-container--default .select2-results__option--highlighted {
    background-color: var(--bs-primary) !important;
}

.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 2px rgba(104, 139, 190, 0.15) !important;
}

/* Nav pills active */
.nav-pills .nav-link.active {
    background-color: #fff;
    color: var(--bs-gray-700);
}

/* Dropdown active */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--bs-primary);
}

/* ============================================
   MODAL STYLING
   ============================================ */
.modal-header {
    background: var(--bs-gray-100);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   ACCORDION FORM
   ============================================ */
.form-accordion .accordion-item {
    border: 1px solid var(--border-color);
    margin-bottom: -1px;
}

.form-accordion .accordion-button {
    padding: 10px 14px;
    font-size: var(--font-size-base);
    font-weight: 600;
    background: var(--bs-gray-100);
}

.form-accordion .accordion-button:not(.collapsed) {
    background-color: #e8f0fe;
    color: var(--bs-primary);
    box-shadow: none;
}

.form-accordion .accordion-body {
    padding: 14px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.form-control,
.form-select {
    font-family: inherit;
    font-size: var(--font-size-sm);
    padding: 6px 10px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(35, 86, 215, 0.1);
}

.form-check-label {
    font-size: var(--font-size-sm);
}

/* ============================================
   MODAL SELECT2
   ============================================ */
.modal .select2-container--default .select2-selection {
    font-family: inherit;
    font-size: var(--font-size-sm);
    min-height: 34px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 4px;
}

.modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: var(--font-size-sm);
    padding: 4px 10px;
    line-height: 1.5;
}

.modal .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 2px 6px;
}

.modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    margin: 2px;
}

/* ============================================
   BUTTONS (btn-group in modal)
   ============================================ */
.btn-group .btn-outline-secondary.btn-sm {
    font-size: var(--font-size-sm);
    padding: 5px 12px;
}

.btn-group .btn-check:checked + .btn-outline-secondary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

/* ============================================
   TABLE TEXT COLORS - soft dark gray
   ============================================ */
table.dataTable {
    color: var(--text-primary);
}

table.dataTable small {
    font-size: 10px;
    color: var(--bs-gray-600);
}

table.dataTable td strong {
    font-weight: 600;
    color: var(--text-strong);
}

/* Extend modal styling */
#extendModal .modal-content {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

#extendModal .modal-header {
    background: var(--bs-gray-100);
    border-radius: 8px 8px 0 0;
}

#extendModal .modal-body {
    padding: 20px;
}

#extendModal .form-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bs-gray-600);
}

#extendModal .form-control {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
}

/* ============================================
   PRICE COMPARISON CARDS
   ============================================ */
.price-card {
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.price-card-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--bs-gray-500);
    margin-bottom: 4px;
}

.price-card-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
}

/* Discount card colors */
#discountCard.discount .price-card-value {
    color: var(--color-success);
}

#discountCard.markup .price-card-value {
    color: var(--color-danger);
}

/* ============================================
   VIEW RULE MODAL
   ============================================ */
.manager-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #5a7fb5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.view-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.view-card-header {
    background: var(--bs-gray-100);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-strong);
    border-bottom: 1px solid var(--border-color);
}

.view-card-body {
    padding: 12px;
}

.view-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.view-field + .view-field {
    border-top: 1px dashed var(--bs-gray-200);
}

.view-label {
    font-size: 12px;
    color: var(--bs-gray-500);
}

.view-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-strong);
}

.view-products-value {
    font-size: 13px;
    color: var(--text-strong);
}

.view-products-value i {
    font-size: 12px;
}

/* File items */
.file-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bs-gray-100);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-strong);
}

.file-item i {
    color: var(--bs-gray-500);
}

.file-item .file-size {
    color: var(--bs-gray-400);
    font-size: 11px;
}

/* No files message */
.no-files-msg {
    font-size: 12px;
    color: var(--bs-gray-400);
    font-style: italic;
}

/* Approval section */
.view-card.border-warning {
    border-color: #e0c66a;
}

.file-upload-area-sm {
    padding: 12px;
}

.file-upload-area-sm .file-upload-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-area-sm .file-upload-content i {
    font-size: 16px;
}

/* Action buttons in view modal */
#viewModalFooter .btn {
    min-width: 100px;
}

#viewModalFooter .btn-success {
    background-color: var(--color-success);
    border-color: var(--color-success);
}

#viewModalFooter .btn-danger {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
}
