/* Custom Styles for Freezone ERP */

/* Toast close button styling */
.toast-close-btn {
    width: 0.75em;
    height: 0.75em;
    padding: 0;
    opacity: 0.8;
}

.toast-close-btn:hover {
    opacity: 1;
}

/* Primary color customization */
:root {
    --bs-primary: #F59921;
}

.bg-gradient-primary {
    background-image: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
}

.btn-primary,
.btn-outline-primary,
.btn-primary:hover,
.btn-outline-primary:hover {
    /* background-color: #F59921 !important; */
    border-color: #F59921 !important;
}

.sidebar-color {
    background-color: #F59921 !important;
}

.text-primary {
    color: #F59921 !important;
}

.text-gradient.text-primary {
    background-image: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
}

/* Override sidebar active link icon background if it uses primary gradient */
.navbar-vertical .navbar-nav>.nav-item .nav-link.active .icon {
    background-image: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
}

/* ============================================
   CONSOLIDATED CSS - Extracted from Inline Styles
   ============================================ */

/* ============================================
   1. DATATABLES STYLING
   ============================================ */

/* Premium Search Bar Styling */
.dataTable-input {
    border-radius: 20px !important;
    padding: 8px 20px !important;
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s ease !important;
    font-size: 0.875rem !important;
    width: 250px !important;
}

.dataTable-input:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    outline: none !important;
    width: 300px !important;
}

.dataTable-top {
    padding: 1rem 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.dataTable-dropdown {
    display: flex !important;
    align-items: center !important;
    font-size: 0.875rem !important;
    color: #495057 !important;
}

.dataTable-selector {
    margin: 0 8px !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    border: 1px solid #d2d6da !important;
    outline: none !important;
}

.dataTable-search {
    margin-top: 0 !important;
}

.dataTable-bottom {
    display: flex !important;
    justify-content: flex-end !important;
    padding: 0.5rem 0 !important;
}

.dataTable-pagination {
    margin-bottom: 0 !important;
}

.dataTable-pagination ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

.dataTable-pagination li {
    display: inline-block !important;
    list-style: none !important;
}

.dataTable-pagination a {
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    color: #495057 !important;
    margin: 0 2px !important;
    background-color: #f8f9fa !important;
    border: none !important;
}

.dataTable-pagination .active a {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #fff !important;
}

/* ============================================
   2. SELECT2 PLUGIN STYLING
   ============================================ */

/* Main Selection Box */
.select2-container--default .select2-selection--single {
    height: 40px !important;
    border: 1px solid #d2d6da !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057 !important;
    font-size: 0.875rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}

/* Dropdown Menu */
.select2-dropdown {
    border: 1px solid #d2d6da !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 26px -4px rgba(20, 20, 20, 0.15) !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

/* Search Box inside Dropdown */
.select2-container--default .select2-search--dropdown {
    padding: 10px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    outline: none !important;
}

/* Results List */
.select2-container--default .select2-results__option {
    padding: 8px 12px !important;
    font-size: 0.875rem !important;
    color: #67748e !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Hover/Highlight */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #f8f9fa !important;
    color: #3b82f6 !important;
}

/* Checkmark Styling */
.select2-results__option.select2-results__option--selected::after {
    content: '✔';
    color: #3b82f6;
    font-weight: bold;
}

.select2-results__option--selected {
    background-color: #f8f9fa !important;
}

/* ============================================
   3. SWEETALERT2 MODAL STYLING
   ============================================ */

/* Global SweetAlert theme matching the provided design */
:root {
    /* Drive popup colors from the current theme (System Settings sets --bs-primary). */
    --confirm-base: var(--bs-primary, #4d8ac8);
    --confirm-gradient-start: var(--bs-primary-light, #51c0ff);
    --confirm-gradient-end: var(--bs-primary-dark, #0f5bbf);
    --confirm-cancel-start: #9aa1aa;
    --confirm-cancel-end: #6c737c;
}

.swal2-popup.confirm-modal {
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22) !important;
    width: 440px !important;
}

.confirm-header {
    background: linear-gradient(135deg, var(--confirm-gradient-start), var(--confirm-gradient-end));
    height: 118px;
    padding: 16px 18px;
    display: flex;
    justify-content: flex-end;
    position: relative;
    margin-bottom: 30px;
}

.confirm-header .custom-icon-wrapper {
    position: absolute;
    left: 50%;
    bottom: -38px;
    transform: translateX(-50%);
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.confirm-header .custom-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 32px;
    color: #fff;
    background: linear-gradient(135deg, var(--confirm-gradient-start), var(--confirm-gradient-end));
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.confirm-body {
    background: #fff;
    padding: 64px 38px 32px;
    text-align: center;
}

.swal2-title.confirm-title {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #3a3a3a !important;
    margin: 0 0 0.35rem 0 !important;
}

.swal2-html-container.confirm-text {
    color: #737b8b !important;
    font-size: 0.98rem !important;
    margin: 0 0 1.2rem 0 !important;
}

.swal2-actions.confirm-actions {
    gap: 0.75rem;
    padding-bottom: 12px;
}

.swal-btn-cancel,
.swal-btn-confirm {
    border: none !important;
    border-radius: 22px !important;
    padding: 0.65rem 1.45rem !important;
    min-width: 120px;
    font-weight: 700 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    outline: none !important;
    transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.swal-btn-cancel:focus,
.swal-btn-confirm:focus {
    outline: none !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.swal-btn-cancel:hover,
.swal-btn-confirm:hover {
    transform: translateY(-1px);
}

.swal-btn-cancel {
    background: linear-gradient(135deg, var(--confirm-cancel-start), var(--confirm-cancel-end)) !important;
}

.swal-btn-confirm {
    background: linear-gradient(135deg, var(--confirm-gradient-start), var(--confirm-gradient-end)) !important;
}

/* Hide default SweetAlert icon when we inject our own */
.confirm-modal .swal2-icon {
    display: none !important;
}

/* ============================================
   4. TOAST NOTIFICATIONS
   ============================================ */

.custom-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 300px;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* ============================================
   5. UTILITY CLASSES & COMMON STYLES
   ============================================ */

/* Minimum height utility */
.min-vh-50 {
    min-height: 50vh;
}

/* Preview Container for Image Uploads */
.preview-container {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px dashed #d2d6da;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-label {
    font-size: 10px;
    color: #adb5bd;
    text-align: center;
    position: absolute;
}

/* User Avatar Placeholder */
.user-placeholder {
    background: linear-gradient(135deg, #8da3c1, #5c6f8a) !important;
}

.user-placeholder.has-photo {
    background: transparent !important;
}

/* Multi Selection Box styled same as single selection box */
.select2-container--default .select2-selection--multiple {
    height: 40px !important;
    border: 1px solid #d2d6da !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 8px !important;
    padding-right: 30px !important;
    background-color: #ffffff !important;
    position: relative !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__custom-label {
    position: absolute;
    left: 12px;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #495057 !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    pointer-events: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-search--inline {
    display: none !important;
}

.select2-container--default .select2-selection--multiple::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 18px;
    border-color: #888 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    width: 0;
    pointer-events: none;
}

/* ============================================
   6. UNIVERSAL MULTI-PAGE PRINT STYLES FOR FINANCIAL MODULE
   ============================================ */
@media print {
    /* 1. Reset overflow, heights, and position rules on ALL wrappers to allow unlimited page height */
    html, body, main, .main-content, .container-fluid, .row, .col-12, .card, .card-body, .table-responsive, table {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        position: static !important;
        float: none !important;
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
    }

    /* 2. Disable PerfectScrollbar height & overflow restrictions */
    .ps, .ps--active-x, .ps--active-y, .ps__rail-x, .ps__rail-y {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    /* 3. Hide non-printable UI chrome */
    #sidenav-main,
    .navbar,
    .btn,
    .btn-group,
    .form-control,
    .form-select,
    .select2-container,
    .card-header .btn,
    .alert,
    .custom-toast,
    footer,
    .no-print,
    .card-body form,
    .fixed-plugin,
    .fixed-plugin-button,
    .fixed-plugin-card,
    #fixed-plugin,
    .modal,
    .modal-backdrop,
    .modal-dialog {
        display: none !important;
    }

    /* 4. Card container styling */
    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        margin-bottom: 15px !important;
    }

    .card-body {
        padding: 0 !important;
    }

    /* 5. Format Tables for Multi-Page PDF & Paper Printing */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 10px !important;
        font-size: 11px !important;
        page-break-after: auto !important;
    }

    th, td {
        border: 1px solid #333333 !important;
        padding: 6px 8px !important;
        color: #000000 !important;
    }

    th {
        background-color: #f1f3f5 !important;
        color: #000000 !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }

    thead {
        display: table-header-group !important; /* Repeats table headers at top of every printed page */
    }

    tfoot {
        display: table-footer-group !important; /* Keeps footer totals intact */
    }

    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    .badge {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        background: transparent !important;
        font-weight: bold !important;
    }
}

/* ==========================================================================
   Delete (trash) icon buttons — larger, red, and easier to click.
   Applies to every icon-only trash button/link across the ERP. Buttons that
   carry a text label ("Remove", "Delete", "Clear All") are left untouched.
   ========================================================================== */
:is(button, a):not(.btn-remove-sh) > i:is(.fa-trash, .fa-trash-alt):only-child:not(.me-1) {
    font-size: 1rem;          /* 16px, up from ~12px */
    line-height: 1;
    color: #dc3545 !important;   /* red so it reads as "delete" at a glance */
}

:is(button, a):not(.btn-remove-sh):has(> i:is(.fa-trash, .fa-trash-alt):only-child:not(.me-1)) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;             /* comfortable click / touch target */
    min-height: 32px;
    padding: 0.4rem !important;
    margin: 0 0.15rem !important;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

:is(button, a):not(.btn-remove-sh):has(> i:is(.fa-trash, .fa-trash-alt):only-child:not(.me-1)):hover,
:is(button, a):not(.btn-remove-sh):has(> i:is(.fa-trash, .fa-trash-alt):only-child:not(.me-1)):focus-visible {
    background-color: rgba(220, 53, 69, 0.12);
    transform: scale(1.08);
}

:is(button, a):not(.btn-remove-sh):has(> i:is(.fa-trash, .fa-trash-alt):only-child:not(.me-1)):focus-visible {
    outline: 2px solid rgba(220, 53, 69, 0.5);
    outline-offset: 1px;
}


/* ==========================================================================
   Larger action icons — view / edit / download / duplicate etc.
   Icon-only buttons and links inside table cells get the same bigger icon
   and click area as the delete button. Colours that already carry meaning
   (red, green, blue…) are kept; plain grey icons are darkened for contrast.
   ========================================================================== */
td :is(button, a):not(.dropdown-item, .badge, .btn-remove-sh) > i:only-child:not(.me-1, .me-2),
td :is(button, a):not(.dropdown-item, .badge, .btn-remove-sh) > svg:only-child {
    font-size: 1rem;
    line-height: 1;
}

td :is(button, a):not(.dropdown-item, .badge, .btn-remove-sh):has(> i:only-child:not(.me-1, .me-2)) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 0.4rem !important;
    margin: 0 0.1rem !important;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

td :is(button, a):not(.dropdown-item, .badge, .btn-remove-sh):has(> i:only-child:not(.me-1, .me-2)):hover {
    background-color: rgba(52, 71, 103, 0.1);
    transform: scale(1.08);
}

td :is(button, a) > i.text-secondary:only-child {
    color: #4a5a78 !important;
}


/* ==========================================================================
   Larger fonts — tables, forms, buttons, badges and sidebar.
   Soft UI ships very small text (0.65rem – 0.75rem). Bumped by ~2px.
   ========================================================================== */
.text-xxs { font-size: 0.7rem !important; }
.text-xs  { font-size: 0.8rem !important; }
.text-sm  { font-size: 0.92rem !important; }

.table th,
.table thead th {
    font-size: 0.72rem;
}

.table td {
    font-size: 0.88rem;
}

.badge,
.badge.badge-sm {
    font-size: 0.72rem;
}

.form-label,
label {
    font-size: 0.82rem;
}

.form-control,
.form-select {
    font-size: 0.88rem;
}

.btn {
    font-size: 0.8rem;
}

.btn-sm {
    font-size: 0.75rem;
}

.navbar-vertical .navbar-nav .nav-link {
    font-size: 0.92rem;
}

.navbar-vertical .navbar-nav .nav-sm .nav-link {
    font-size: 0.85rem;
}

.navbar-vertical .navbar-nav .nav-link > i {
    font-size: 1rem;
}

.dropdown-menu .dropdown-item {
    font-size: 0.88rem;
}

/* ============================================
   SIDEBAR: collapsible groups (accordion)
   ============================================ */
.sidenav-group-toggle .sidenav-chevron {
    font-size: 0.7rem;
    opacity: 0.55;
    transition: transform 0.2s ease;
}

.sidenav-group-toggle[aria-expanded="true"] .sidenav-chevron {
    transform: rotate(180deg);
}

/* The group badge is redundant once the group is open (items show their own) */
.sidenav-group-toggle[aria-expanded="true"] .sidenav-group-badge {
    display: none;
}

.sidenav-group-toggle[aria-expanded="true"] {
    font-weight: 600;
}

.sidenav-group-toggle[aria-expanded="true"] .icon {
    background-image: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
}

.sidenav-group-toggle[aria-expanded="true"] .icon i {
    color: #fff !important;
}

.navbar-vertical .navbar-nav .sidenav-sub {
    list-style: none;
    margin: 0 0 0.35rem 1.35rem;
    padding: 0 0 0 0.6rem;
    border-left: 2px solid rgba(0, 0, 0, 0.07);
    flex-direction: column;
    flex-wrap: nowrap;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    margin: 0.1rem 0;
    font-size: 0.86rem;
    border-radius: 0.5rem;
    color: #67748e;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link:hover {
    background: rgba(245, 153, 33, 0.08);
    color: #344767;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link.active {
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    color: #344767;
    font-weight: 600;
}

.sidenav-sub-icon {
    width: 1.5rem;
    display: inline-flex;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0.45rem;
    font-size: 0.8rem;
    color: #8392ab;
}

.sidenav-sub .nav-link.active .sidenav-sub-icon {
    color: #F59921;
}

/* Collapsed (icon-only) sidebar: show every item as an icon, no group headers */
body.sidebar-collapsed #sidenav-main .sidenav-group-toggle {
    display: none !important;
}

body.sidebar-collapsed #sidenav-main .sidenav-group-body {
    display: block !important;
    height: auto !important;
}

body.sidebar-collapsed #sidenav-main .sidenav-group {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    margin-top: 0.4rem;
    padding-top: 0.4rem;
}

body.sidebar-collapsed #sidenav-main .navbar-nav .sidenav-sub {
    margin: 0;
    padding: 0;
    border-left: 0;
}

body.sidebar-collapsed #sidenav-main .sidenav-sub .nav-link {
    justify-content: center;
    padding: 0.6rem 0;
}

body.sidebar-collapsed #sidenav-main .sidenav-sub-icon {
    margin-right: 0;
    font-size: 1rem;
}

body.sidebar-collapsed #sidenav-main .sidenav-sub .badge {
    display: none;
}

/* Soft UI draws its own arrow/bullet on collapse links; we use our own chevron */
.navbar-vertical .navbar-nav .sidenav-group-toggle[data-bs-toggle="collapse"]::after {
    display: none !important;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link::before {
    display: none !important;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link,
.navbar-vertical .navbar-nav .sidenav-sub .nav-link .nav-link-text {
    opacity: 1;
    color: #4a5a78;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link.active,
.navbar-vertical .navbar-nav .sidenav-sub .nav-link.active .nav-link-text {
    color: #F59921;
}

.navbar-vertical .navbar-nav .sidenav-sub .nav-link .nav-link-text {
    margin-left: 0 !important;
}

/* Group header: label flexes/truncates, count is a compact pill, chevron never gets pushed out */
.sidenav-group-toggle .nav-link-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidenav-group-toggle .sidenav-chevron {
    flex: 0 0 auto;
    margin-left: 0.4rem;
}

.sidenav-group-badge,
.sidenav-count {
    flex: 0 0 auto;
    min-width: 1.35rem;
    padding: 0.28em 0.5em;
    margin-left: 0.4rem;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    border-radius: 999px;
    text-align: center;
}

.navbar-vertical .navbar-nav .sidenav-sub .sidenav-count {
    margin-left: auto;
}

.navbar-vertical .navbar-nav .sidenav-sub .sidenav-count + .sidenav-count {
    margin-left: 0.3rem;
}

/* ============================================
   SIDEBAR: clean white look (flat rows, orange active pill)
   Visual only — markup, links and behaviour are unchanged.
   ============================================ */
#sidenav-main.sidenav {
    background: #fff !important;
    margin: 0 !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border-right: 1px solid #eceef1 !important;
    box-shadow: none !important;
}

#sidenav-main .sidenav-header {
    padding: 0.85rem 1.25rem 0.5rem !important;
}

#sidenav-main .sidenav-header .navbar-brand {
    padding: 0;
}

#sidenav-main #sidenav-collapse-main {
    padding: 0 0.75rem;
}

#sidenav-main .navbar-nav > .nav-item {
    margin: 0.1rem 0;
}

/* Top-level rows (Dashboard + group headers) */
#sidenav-main .navbar-nav > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    margin: 0;
    border-radius: 0.6rem;
    background: transparent;
    box-shadow: none;
    color: #1f2530;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#sidenav-main .navbar-nav > .nav-item > .nav-link:focus,
#sidenav-main .navbar-nav > .nav-item > .nav-link:active {
    outline: none;
    box-shadow: none;
}

#sidenav-main .navbar-nav > .nav-item > .nav-link:focus-visible {
    outline: 2px solid rgba(245, 153, 33, 0.45);
    outline-offset: -2px;
}

#sidenav-main .navbar-nav > .nav-item > .nav-link:hover {
    background: #f4f5f7;
    color: #1f2530;
}

/* Icons: plain glyphs instead of white shadowed tiles */
#sidenav-main .navbar-nav > .nav-item > .nav-link .icon,
#sidenav-main .navbar-nav > .nav-item > .nav-link.active .icon,
#sidenav-main .sidenav-group-toggle[aria-expanded="true"] .icon {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    margin-right: 0.45rem !important;
}

#sidenav-main .navbar-nav > .nav-item > .nav-link .icon i,
#sidenav-main .sidenav-group-toggle[aria-expanded="true"] .icon i {
    font-size: 1.05rem !important;
    color: #1f2530 !important;
}

#sidenav-main .navbar-nav > .nav-item > .nav-link .nav-link-text {
    margin-left: 0 !important;
}

/* Open group header: soft grey tab so it reads as the parent of the list below */
#sidenav-main .sidenav-group-toggle[aria-expanded="true"] {
    background: #f4f5f7;
    color: #1f2530;
}

#sidenav-main .sidenav-group-toggle .sidenav-chevron {
    color: #9aa1ad;
    opacity: 1;
}

/* Active page: solid orange pill with white text + icon */
#sidenav-main .navbar-nav > .nav-item > .nav-link.active,
#sidenav-main .navbar-nav .sidenav-sub .nav-link.active {
    background: #F59921 !important;
    box-shadow: none !important;
    color: #fff !important;
    font-weight: 600;
}

#sidenav-main .navbar-nav > .nav-item > .nav-link.active .nav-link-text,
#sidenav-main .navbar-nav .sidenav-sub .nav-link.active .nav-link-text,
#sidenav-main .navbar-nav > .nav-item > .nav-link.active .icon i,
#sidenav-main .sidenav-sub .nav-link.active .sidenav-sub-icon {
    color: #fff !important;
}

/* Sub-items: indented under a thin guide line, smaller and lighter than the menu rows */
#sidenav-main .navbar-nav .sidenav-sub {
    margin: 0.2rem 0 0.4rem 1.4rem;
    padding: 0 0 0 0.5rem;
    border-left: 2px solid #eceef1;
}

#sidenav-main .navbar-nav .sidenav-sub .nav-link {
    padding: 0.42rem 0.6rem;
    margin: 0.1rem 0;
    border-radius: 0.55rem;
    font-size: 0.84rem;
    font-weight: 400;
    color: #6b7280;
}

#sidenav-main .navbar-nav .sidenav-sub .nav-link .nav-link-text {
    color: #6b7280;
}

#sidenav-main .navbar-nav .sidenav-sub .nav-link:hover:not(.active) {
    background: #f4f5f7;
}

#sidenav-main .navbar-nav .sidenav-sub .nav-link:hover:not(.active) .nav-link-text {
    color: #1f2530;
}

#sidenav-main .sidenav-sub-icon {
    color: #a0a7b4;
    font-size: 0.75rem;
    width: 1.25rem;
    margin-right: 0.4rem;
}

/* Count pills stay readable on the orange active row */
#sidenav-main .sidenav-sub .nav-link.active .sidenav-count {
    background: #fff !important;
    color: #F59921 !important;
}

/* Sidebar is flush with the screen edge, so the page starts right beside it
   (theme default leaves an extra 24px for the old floating card). */
@media (min-width: 1200px) {
    body.g-sidenav-show .main-content {
        margin-left: 15.625rem !important;
    }

    body.g-sidenav-show.sidebar-collapsed .main-content {
        margin-left: 78px !important;
    }
}

/* Collapsed (icon-only) sidebar keeps the same flat look */
body.sidebar-collapsed #sidenav-main .navbar-nav > .nav-item > .nav-link .icon {
    margin-right: 0 !important;
}

body.sidebar-collapsed #sidenav-main #sidenav-collapse-main {
    padding: 0 0.5rem;
}

body.sidebar-collapsed #sidenav-main .sidenav-sub-icon {
    color: #6b7280;
}

/* ============================================
   CREATE PAGES: "how it works" side panel
   ============================================ */
.create-steps .create-step {
    position: relative;
    display: flex;
    gap: 0.85rem;
    padding-bottom: 1.1rem;
}

.create-steps .create-step:last-child {
    padding-bottom: 0;
}

/* vertical connector between the numbered circles */
.create-steps .create-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 0.9rem;
    top: 1.9rem;
    bottom: 0.15rem;
    width: 2px;
    background: #e9ecef;
}

.create-step-number {
    flex: 0 0 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: #e9ecef;
    color: #67748e;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.create-step.is-current .create-step-number {
    background: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
    color: #fff;
}

.create-tip {
    background: #fffaf2;
    border: 1px solid #fde6bf;
}

/* ==========================================================================
   TABLES: one consistent, professional look for every list/data table
   (opt-outs: .table-sm, .quotation-table, .table-plain)
   ========================================================================== */
.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* Header row */
.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) thead th {
    background: #f6f8fb;
    color: #67748e !important;
    opacity: 1 !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    padding: 0.85rem 1rem !important;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef !important;
}

.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) thead th:first-child {
    border-top-left-radius: 0.6rem;
    border-left: 1px solid #e9ecef;
}

.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) thead th:last-child {
    border-top-right-radius: 0.6rem;
    border-right: 1px solid #e9ecef;
}

/* Body rows */
.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) tbody td {
    padding: 0.8rem 1rem !important;
    vertical-align: middle;
    color: #344767;
    border-bottom: 1px solid #eef0f4;
    background: #fff;
    transition: background-color 0.12s ease;
}

.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) tbody tr:hover > td {
    background: #fbfbfe;
}

.main-content .table:not(.table-sm):not(.quotation-table):not(.table-plain) tbody tr:last-child > td {
    border-bottom: 0;
}

/* Table container: soft frame so tables line up with the cards around them */
.main-content .table-responsive {
    border-radius: 0.6rem;
}

/* PerfectScrollbar (attached to .table-responsive in layouts/app) positions its rails absolutely, so the
   container must be the positioned ancestor. Otherwise the rail anchors to the card, grows with the table's
   scrollLeft and widens .main-content, which makes the whole page scroll sideways. */
.table-responsive.ps {
    position: relative;
}

/* Safety net: .main-content is a PerfectScrollbar container that must only scroll vertically. Clip anything
   that tries to extend past its width (rails, wide children) so the page can never be pushed sideways. */
.main-content > .container-fluid {
    overflow-x: clip;
}

/* Empty-state rows (single full-width cell) */
.main-content .table tbody td[colspan] {
    color: #8392ab;
    text-align: center;
}

/* ==========================================================================
   PAGINATION: same look for server pagination and the table paginator
   ========================================================================== */
.pg-nav {
    width: 100%;
}

.pg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.9rem 1rem 0.5rem;
}

.pg-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pg-summary {
    margin: 0;
    font-size: 0.8rem;
    color: #67748e;
}

.pg-size {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.7rem;
    color: #67748e;
    white-space: nowrap;
}

.pg-size .form-select {
    width: auto;
    height: 26px;
    padding: 0 1.6rem 0 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid #d2d6da;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.pg-nav .pagination {
    gap: 4px;
}

.pg-nav .page-item.active .page-link {
    color: #fff;
    background: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
    box-shadow: 0 3px 5px -1px rgba(245, 153, 33, 0.4);
}

.pg-nav .page-item.disabled .page-link {
    background: transparent;
    color: #8392ab;
}

.pg-nav .page-item:not(.active):not(.disabled) .page-link:hover {
    background: rgba(245, 153, 33, 0.1);
    color: #F59921 !important;
}

/* Rows outside the current page */
tr.pg-hide {
    display: none !important;
}

@media print {
    tr.pg-hide {
        display: table-row !important;
    }

    .pg-nav {
        display: none !important;
    }
}

/* ==========================================================================
   DASHBOARD: Top Performers
   ========================================================================== */
.tp-heading {
    margin: 0.25rem 0 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #67748e;
}

.tp-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.8rem;
    margin: 0 -0.8rem;
    border-radius: 0.75rem;
    transition: background-color 0.15s ease;
}

.tp-row:hover {
    background: #f8f9fc;
}

.tp-rank {
    flex: 0 0 2.1rem;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
}

.tp-rank-1 {
    background: linear-gradient(310deg, #f5b301 0%, #ffd96b 100%);
    box-shadow: 0 4px 10px -3px rgba(245, 179, 1, 0.65);
}

.tp-rank-2 {
    background: linear-gradient(310deg, #98a4b8 0%, #c9d1de 100%);
    box-shadow: 0 4px 10px -3px rgba(152, 164, 184, 0.65);
}

.tp-rank-3 {
    background: linear-gradient(310deg, #c8763a 0%, #e6a574 100%);
    box-shadow: 0 4px 10px -3px rgba(200, 118, 58, 0.55);
}

.tp-rank-n {
    background: #eef0f5;
    color: #67748e;
}

.tp-main {
    flex: 1 1 auto;
    min-width: 0;
}

.tp-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #344767;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-count {
    flex: 0 0 auto;
    font-size: 0.95rem;
    font-weight: 700;
    color: #344767;
}

.tp-count small {
    font-size: 0.72rem;
    font-weight: 500;
    color: #8392ab;
    margin-left: 0.2rem;
}

.tp-bar {
    height: 6px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: #eef0f5;
    overflow: hidden;
}

.tp-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(310deg, #F59921 0%, #fabf6b 100%);
}

.tp-row:nth-of-type(n+4) .tp-bar > span {
    background: linear-gradient(310deg, #9aa8c4 0%, #c3cde0 100%);
}

/* Stat tile */
.tp-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #f1fbef 0%, #f8fdf6 100%);
    border: 1px solid #d9f2d3;
}

.tp-stat-icon {
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    background: linear-gradient(310deg, #17ad37 0%, #98ec2d 100%);
    box-shadow: 0 6px 14px -4px rgba(23, 173, 55, 0.55);
}

.tp-stat-value {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    color: #344767;
}

.tp-stat-label {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: #67748e;
}

/* ==========================================================================
   FILTER BARS: uniform dropdowns (same height, same width) + searchable select
   ========================================================================== */

/* Every control in a filter bar is the same height */
form[method="GET" i] :is(.form-select-sm, .form-control-sm, .ss-trigger),
form[method="GET" i] .input-group-sm > :is(.form-control, .input-group-text),
form[method="GET" i] .select2-container--default .select2-selection--single {
    height: 40px !important;
    min-height: 40px;
}

form[method="GET" i] .select2-container {
    width: 100% !important;
}

#priceFilterDropdown {
    height: 40px !important;
}

/* Columns that hold a dropdown share the row equally */
form[method="GET" i].row > [class*="col-"]:has(select, .ss, .select2-container, .dropdown),
form[method="GET" i] > .row > [class*="col-"]:has(select, .ss, .select2-container, .dropdown) {
    flex: 1 1 0;
    width: auto;
    max-width: 100%;
    min-width: 180px;
}

/* Searchable select trigger (looks like the other form controls) */
.ss {
    position: relative;
    width: 100%;
}

.ss .ss-native {
    position: absolute !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: 0;
    bottom: 0;
}

.ss-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.88rem;
    font-weight: 400;
    color: #495057;
    background-color: #fff;
    border: 1px solid #d2d6da;
    border-radius: 0.5rem;
    cursor: pointer;
}

.ss-trigger .ss-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-trigger.is-placeholder .ss-label {
    color: #8392ab;
}

.ss.is-open .ss-trigger,
.ss-trigger:focus {
    border-color: #F59921;
    box-shadow: 0 0 0 2px rgba(245, 153, 33, 0.2);
    outline: 0;
}

.ss.is-disabled .ss-trigger {
    background-color: #f1f3f5;
    cursor: not-allowed;
}

/* Dropdown panel */
.ss-panel {
    position: fixed;
    z-index: 2100;
    max-width: calc(100vw - 16px);
    background: #fff;
    border: 1px solid #d2d6da;
    border-radius: 0.75rem;
    box-shadow: 0 8px 26px -4px rgba(20, 20, 20, 0.15);
    overflow: hidden;
}

.ss-search {
    position: relative;
    padding: 0.5rem;
    border-bottom: 1px solid #eef0f4;
}

.ss-search i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #8392ab;
}

.ss-search input {
    width: 100%;
    height: 34px;
    padding: 0 0.75rem 0 2rem;
    font-size: 0.85rem;
    border: 1px solid #d2d6da;
    border-radius: 0.5rem;
    outline: 0;
}

.ss-search input:focus {
    border-color: #F59921;
}

.ss-list {
    max-height: 260px;
    margin: 0;
    padding: 0.25rem;
    overflow-y: auto;
    list-style: none;
}

.ss-option,
.ss-empty,
.ss-group {
    padding: 0.45rem 0.7rem;
    font-size: 0.86rem;
    border-radius: 0.5rem;
}

.ss-option {
    color: #344767;
    cursor: pointer;
}

.ss-option.is-active {
    background: rgba(245, 153, 33, 0.12);
}

.ss-option.is-selected {
    font-weight: 700;
    color: #F59921;
}

.ss-option.is-disabled {
    color: #a0a9b8;
    cursor: not-allowed;
}

.ss-group {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8392ab;
}

.ss-empty {
    color: #8392ab;
    text-align: center;
}

/* ---- Searchable select inside regular forms / modals ---- */
/* Size comes from the copied .form-select / .form-select-sm classes; only fixed-height in filter bars (above). */
.ss-trigger {
    height: auto;
    line-height: 1.4;
    min-width: 0;
}

.ss-trigger.is-invalid {
    border-color: #fd5c70;
}

.ss.ss-auto {
    display: inline-block;
    width: auto;
    min-width: 140px;
}

/* Label above a select in a form keeps normal spacing when the select is wrapped */
.ss + .invalid-feedback,
.ss + .form-text {
    display: block;
}


/* ============================================
   APP BACKGROUND: minimal flat canvas behind every signed-in page
   Flat off-white, white cards, no gradients. Screen only.
   ============================================ */
@media screen {
    body.app-canvas,
    body.app-canvas.bg-gray-100 {
        background: #faf9f6 !important;
        min-height: 100vh;
    }

    /* Let the canvas show through the content wrappers */
    body.app-canvas .main-content,
    body.app-canvas .main-content.bg-gray-100 {
        background: transparent !important;
    }

    /* Top bar: plain white strip */
    body.app-canvas .navbar-main#navbarBlur {
        margin-top: 1rem;
        background: #ffffff !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border: 1px solid #e9edf2;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05) !important;
    }

    /* Cards: hairline border + light shadow */
    body.app-canvas .main-content .card {
        border: 1px solid #e9edf2;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    }

    /* Sidebar: subtle edge */
    #sidenav-main.sidenav {
        border-right: 1px solid #e9edf2 !important;
        box-shadow: none !important;
    }
}
