/* =========================
   CSS Variables & Root
   ========================= */
:root {
    --primary-green: #10b981;
    --primary-green-dark: #059669;
    --primary-green-light: #ecfdf5;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* =========================
   Base Styles
   ========================= */
body, .main-content {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif !important;
    background: #f6f8fa !important;
    color: var(--gray-700);
}
body {
    background-color: #f1f5f8;
    overflow-x: hidden;
}
a {
    text-decoration: none;
}

/* =========================
   Layout: Sidebar & Page Wrapper
   ========================= */
.page-wrapper {
    margin-left: 280px;
    transition: margin-left 0.3s ease-in-out, padding-left 0.3s ease-in-out;
}
.page-wrapper.sidebar-collapsed {
    margin-left: 80px;
    padding-left: 0;
}
.sidebar {
    flex-shrink: 0;
    width: 280px;
    background-color: #fff !important;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, left 0.3s ease;
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
}
.sidebar .fs-4 {
    color: var(--primary-green);
    font-weight: 600;
}
.sidebar .nav-item {
    margin-bottom: 0.5rem;
}
.sidebar .nav-link {
    display: flex;
    align-items: center;
    position: relative;
    color: #6c757d;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.sidebar .nav-link i {
    color: #28a745;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    margin-right: 0 !important;
    min-width: 1.5em;
    text-align: left;
}
.sidebar .sidebar-text, .sidebar .nav-link .bi-chevron-down, .sidebar .fs-4, .sidebar hr {
    transition: opacity 0.2s ease-in-out;
}
.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--primary-green);
    border-radius: 0.5rem;
}
.sidebar .nav-link.active i {
    opacity: 1;
    color: #fff;
}
.sidebar .nav-link:hover {
    background-color: #eaf8e9;
    color: var(--primary-green);
    transform: translateX(6px);
}
.sidebar.collapsed {
    width: 80px;
}
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .fs-4,
.sidebar.collapsed hr,
.sidebar.collapsed .bi-chevron-down {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.sidebar.collapsed .nav-link {
    text-align: center;
}
.sidebar.collapsed .nav-link i {
    margin-right: 0;
}
.sidebar.collapsed .collapse {
    display: none;
}
.sidebar-staff > div {
    transition: opacity 0.2s ease-in-out, width 0.3s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}
.sidebar.collapsed .sidebar-brand img {
    margin-right: 0 !important;
}
.sidebar.collapsed .sidebar-staff {
    justify-content: center;
    gap: 0 !important;
}
.sidebar.collapsed .sidebar-staff > div {
    opacity: 0;
    visibility: hidden;
    width: 0;
}
.sidebar .nav-link .sidebar-text {
    display: inline;
}
.sidebar-toggle-icon {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}
.sidebar.collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}
/* Sidebar toggle icon visibility */
#sidebar-toggle .icon-collapse {
    display: none;
}
#sidebar.collapsed ~ .flex-grow-1 .top-bar #sidebar-toggle .icon-expand {
    display: none;
}
#sidebar.collapsed ~ .flex-grow-1 .top-bar #sidebar-toggle .icon-collapse {
    display: inline-block;
}
/* On mobile, also hide .icon-collapse unless sidebar is open */
@media (max-width: 991.98px) {
    #sidebar-toggle .icon-collapse {
        display: none;
    }
    #sidebar.mobile-show ~ .flex-grow-1 .top-bar #sidebar-toggle .icon-expand {
        display: none;
    }
    #sidebar.mobile-show ~ .flex-grow-1 .top-bar #sidebar-toggle .icon-collapse {
        display: inline-block;
    }
}
.top-bar {
    background-color: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: none;
    flex-shrink: 0;
    padding: 0.75rem 1.5rem !important;
    align-items: center;
}
.top-bar .top-bar-search .input-group-text {
    height: 100%;
}
.top-bar-search {
    min-width: 350px;
}
.top-bar-search .form-control,
.top-bar-search .input-group-text {
    background: #fff !important;
    color: #222 !important;
    border: 1px solid #e5e7eb !important;
}
.top-bar-search .form-control:focus {
    box-shadow: none;
    background-color: #fff;
}
.top-bar-search .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    border-radius: 0.375rem; /* Matches Bootstrap's default */
}
.top-bar-search .form-control::placeholder {
    color: #6B7280 !important;
}
.top-bar-actions .nav-link {
    padding: 0 0.75rem;
    color: #6c757d;
}
.top-bar-actions .nav-link:hover {
    color: #28a745;
}
.top-bar-actions .badge {
    font-size: 0.6rem;
    padding: 0.2em 0.4em;
}
.top-bar .bi {
    color: #6B7280;
    cursor: pointer;
    transition: color 0.3s ease;
}
.top-bar .bi:hover {
    color: #28a745;
}
.top-bar .dropdown-menu {
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    right: 0;
    left: auto;
}
.main-content {
    background-color: #f1f5f8;
    padding-bottom: 5rem;
}
body.dark-theme .main-content {
    background: #181a1b !important;
    color: #f1f1f1 !important;
}
.input-group .form-control {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}
.input-group .input-group-text {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}
.category-item {
    display: block;
    color: #000;
    transition: transform 0.2s;
}
body.dark-theme .category-item {
    color: #f1f1f1 !important;
}
body.dark-theme .category-item:hover {
    color: #4CAF50 !important;
}
.category-icon, .category-icon-img {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.category-icon-img img{
    width: 60px;
    height: 60px;
    object-fit: contain;
}
body.dark-theme .category-icon, body.dark-theme .category-icon-img {
    background: #232526 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.category-item p {
    font-weight: 500;
    margin-top: 0.75rem;
}
.fruit-bg{ background-color: #fff0f0; }
.bread-bg{ background-color: #f3e5d8; }
.vegetable-bg{ background-color: #eaf8e9; }
.fish-bg{ background-color: #e0f7fa; }
.meat-bg{ background-color: #ffebee; }
.drinks-bg{ background-color: #e3f2fd; }
.seafood-bg{ background-color: #e0f2f1; }
.ice-cream-bg{ background-color: #fce4ec; }
.juice-bg{ background-color: #fff8e1; }
.jam-bg{ background-color: #f3e5f5; }
body.dark-theme .fruit-bg,
body.dark-theme .bread-bg,
body.dark-theme .vegetable-bg,
body.dark-theme .fish-bg,
body.dark-theme .meat-bg,
body.dark-theme .drinks-bg,
body.dark-theme .seafood-bg,
body.dark-theme .ice-cream-bg,
body.dark-theme .juice-bg,
body.dark-theme .jam-bg {
    background: #232526 !important;
}
.card {
    border-radius: 1rem;
    transition: all 0.2s ease-in-out;
    border: none;
    box-shadow: none;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}
.card-img-top {
    height: 120px;
    object-fit: contain;
    padding: 1rem;
}
.card-title {
    font-weight: 600;
}
.card-footer {
    background: transparent;
    border: none;
    padding: 0 1rem 1rem;
}
/* .card .btn-success {
    width: 40px;
    height: 40px;
} */
.discount-card .card-img {
    height: 200px;
    object-fit: cover;
    border-radius: 1rem;
}
.discount-card .card-img-overlay {
    background-color: rgba(0, 128, 0, 0.7);
    border-radius: 1rem;
}
.discount-card .card-title {
    font-size: 1.5rem;
    font-weight: 700;
}
.discount-card .btn {
    align-self: flex-start;
    padding: 0.3rem 1rem;
    font-weight: 600;
}
.list-group-item {
    background-color: #fff;
    border: 1px solid #f1f5f8;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
}
body.dark-theme .list-group-item {
    background: #232526 !important;
    color: #f1f1f1 !important;
    border: 1px solid #33393b !important;
}
.list-group-item h6 {
    font-weight: 600;
}
.input-group-append .btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 5px !important;
    margin: 0px 5px;
    border: 1px solid #28a745 !important;
    color: #28a745;
}
.input-group-append .btn:hover{
    background: #28a745;
    color: #fff;
}
.input-group-append .form-control {
    height: 30px;
    border-radius: 0;
    border: 1px solid #28a745 !important;
    text-align: center;
}
.input-group .form-control,
body.dark-theme .input-group .form-control {
    /* background: #232526 !important; */
    /* color: #f1f1f1 !important; */
    /* border: 1px solid #33393b !important; */
}
.card .bi-heart-fill {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #e0e0e0;
    cursor: pointer;
}
.card:hover .bi-heart-fill {
    color: #dc3545;
}
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
}
body.dark-theme .nav-tabs {
    border-bottom: 1px solid #33393b !important;
}
.nav-tabs .nav-link {
    color: #6B7280;
    font-weight: 500;
    border: none;
    padding-bottom: 0.75rem;
    margin-right: 1.5rem;
}
body.dark-theme .nav-tabs .nav-link {
    color: #bdbdbd !important;
    background: transparent !important;
}
.nav-tabs .nav-link.active {
    color: #4F46E5;
    font-weight: 600;
    border-bottom: 2px solid #4F46E5;
    background-color: transparent;
}
body.dark-theme .nav-tabs .nav-link.active {
    color: #4CAF50 !important;
    border-bottom: 2px solid #4CAF50 !important;
    background: #232526 !important;
}
.nav-tabs .nav-link .badge {
    font-size: 0.7rem;
    font-weight: 500;
}
.btn-primary {
    background-color: #4F46E5 !important;
    border-color: #4F46E5 !important;
    font-weight: 600;
    /* padding: 0.5rem 1rem; */
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: #4338CA;
    border-color: #4338CA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}
.table {
    border-collapse: collapse;
    width: 100%;
}
.table thead th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: #4B5563;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem;
}
.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #E5E7EB;
    font-size: 0.9rem;
    color: #374151;
}
.table > tbody > tr {
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}
#product-table > tbody > tr:hover {
    background-color: inherit !important;
    color: inherit !important;
    box-shadow: none !important;
    transform: none !important;
    border-top: none !important;
    border-bottom: none !important;
}
.table-row-selected {
    background-color: #F9FAFB;
    box-shadow: inset 3px 0 0 #4F46E5;
}
.table .form-check-input {
    border-radius: 0.25rem;
    border-color: #D1D5DB;
}
.table .form-check-input:checked {
    background-color: #4F46E5;
    border-color: #4F46E5;
}
.badge {
    padding: 0.3em 0.75em;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 9999px;
}
body.dark-theme .badge {
    background: #232526 !important;
    color: #4CAF50 !important;
    border: 1px solid #4CAF50 !important;
}
/* Removed bullet point from badges */

/* Action button hover styles */
.btn-outline-warning:hover,
.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover {
    color: white !important;
}

/* Preview button - make it blue filled */
.btn-outline-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
}

.btn-outline-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: white !important;
}
.status-fulfilled {
    background-color: #ECFDF5 !important;
    color: #065F46 !important;
}
.status-fulfilled:before { color: #10B981; }
.status-confirmed {
    background-color: #EFF6FF !important;
    color: #1E40AF !important;
}
.status-confirmed:before { color: #3B82F6; }
.status-partially-shipped {
    background-color: #FFFBEB !important;
    color: #92400E !important;
}
.status-partially-shipped:before { color: #F59E0B; }

/* Invoice status badge styles */
.status-paid {
    background-color: #ECFDF5 !important;
    color: #065F46 !important;
}
.status-paid:before { color: #10B981; }

.status-pending {
    background-color: #FFFBEB !important;
    color: #92400E !important;
}
.status-pending:before { color: #F59E0B; }

.status-cancelled {
    background-color: #FEF2F2 !important;
    color: #991B1B !important;
}
.status-cancelled:before { color: #EF4444; }

.status-completed {
    background-color: #EFF6FF !important;
    color: #1E40AF !important;
}
.status-completed:before { color: #3B82F6; }
.table .dropdown-toggle::after {
    display: none;
}
.table .dropdown-menu {
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-radius: 0.5rem;
    padding: 0.25rem 0;
}
.table .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}
.table .dropdown-item i {
    opacity: 0.7;
}
.table .dropdown-item:hover {
    background-color: transparent;
}
/* --- Dropdown on hover --- */
.top-bar .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}
.top-bar .dropdown > .dropdown-toggle::after {
    display: none;
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029; /* Below sidebar, above content */
    display: none;
}
.sidebar-overlay.active {
    display: block;
}
/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/
@media (max-width: 991.98px) {
    .sidebar {
        left: -280px;
        margin-left: 0;
        width: 280px;
        z-index: 5000;
    }
    .sidebar.mobile-show {
        left: 0;
        /*width: 320px !important;*/
    }
    .page-wrapper,
    .page-wrapper.sidebar-collapsed {
        margin-left: 0;
        padding-left: 0;
    }
    #sidebar-close-btn {
        display: block !important;
    }
    #sidebar-toggle .icon-collapse,
    #sidebar.collapsed ~ .flex-grow-1 #sidebar-toggle .icon-expand,
    #sidebar.collapsed ~ .flex-grow-1 #sidebar-toggle .icon-collapse {
        display: none;
    }
    #sidebar-toggle .icon-expand {
        display: inline-block;
    }
    
    .top-bar-search {
        min-width: 200px;
    }
    .top-bar .top-bar-actions .nav-link {
        padding: 0.5rem;
    }
    /* Responsive Table as Cards */
    .table-responsive thead {
        display: none;
    }
    .table-responsive tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .375rem;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    .table-responsive td:last-child {
        border-bottom: none;
    }
    .table-responsive td[data-label] {
        position: relative;
        padding-left: 50%;
    }
    .table-responsive td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 1rem;
        font-weight: 600;
        text-align: left;
        white-space: nowrap;
    }
    .table-responsive .d-none.d-lg-table-cell {
        display: flex !important;
    }
    .table-responsive td:has(.dropdown) {
        justify-content: flex-end;
    }
}
@media (max-width: 575.98px) {
    .top-bar-search {
        display: none; /* Hide search on very small screens */
    }
}
#sidebar-close-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}
#sidebar-toggle {
    z-index: 700;
    position: relative;
    margin-left: 0;
    padding-left: 0;
}
/* Ensure toggle button is always visible */
.top-bar .btn#sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide sidebar text and hr when collapsed */
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .fs-4,
.sidebar.collapsed hr {
    display: none;
}

#sidebar-toggle,
#sidebar-toggle:focus,
#sidebar-toggle:active,
#sidebar-toggle:focus-visible,
#sidebar-toggle.btn,
#sidebar-toggle.btn:focus,
#sidebar-toggle.btn:active,
#sidebar-toggle.btn:focus-visible,
#sidebar-toggle *:focus,
#sidebar-toggle *:active,
#sidebar-toggle *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Sidebar brand area matches topbar height and has bottom border */
.sidebar .sidebar-brand {
    height: 56px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    background: #fff;
}

body.dark-theme .top-bar-search .form-control,
body.dark-theme .top-bar-search .input-group-text {
    background: #232526 !important;
    color: #f1f1f1 !important;
    border: 1px solid #33393b !important;
}
body.dark-theme .top-bar-search .form-control::placeholder {
    color: #bdbdbd !important;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
.form-control,
.top-bar-search .form-control,
.top-bar-search .input-group-text {
    background: #fff !important;
    color: #222 !important;
    border: 1px solid #e5e7eb !important;
}
input[type="text"]::placeholder,
input[type="search"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
.form-control::placeholder {
    color: #6B7280 !important;
}

body.dark-theme .sidebar .sidebar-brand {
    background: #232526 !important;
    border-bottom: 1px solid #33393b !important;
}
body.dark-theme .sidebar .sidebar-brand img {
    background: #232526 !important;
    border-radius: 50%;
    padding: 4px;
}

body.dark-theme .sidebar-staff {
    background: #232526 !important;
    color: #f1f1f1 !important;
}
body.dark-theme .sidebar-staff .fw-bold {
    color: #f1f1f1 !important;
}
body.dark-theme .sidebar-staff .text-muted {
    color: #bdbdbd !important;
}
body.dark-theme .sidebar-staff a.nav-link.text-danger {
    color: #ff7675 !important;
}

/* Tally Prime style for purchase_stock.php */
body, .main-content {
    background: #f6f8fa !important;
}

.card, .form-section {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.form-section-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(33,40,50,0.07);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 1.2rem;
    letter-spacing: 0.01em;
    border-bottom: 1.5px solid #e3eafc;
    padding-bottom: 0.4rem;
}

#product-table {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(33,40,50,0.04);
    border: 1.5px solid #e0e0e0;
    margin-bottom: 1.5rem;
}
#product-table thead th {
    background: #e3eafc;
    color: #1976d2;
    border: none;
    font-weight: 600;
    font-size: 0.98rem;
    padding: 0.7rem 0.5rem;
}
#product-table td {
    border: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.5rem 0.5rem;
    background: #fff;
    font-size: 1rem;
}
#product-table tbody tr:last-child td {
    border-bottom: none;
}
#product-table input, #product-table select {
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    background: #fafbfc;
    box-shadow: none;
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#product-table input:focus, #product-table select:focus {
    outline: none;
    border-color: #1976d2;
    background: #f0f6ff;
    box-shadow: 0 0 0 2px #e3eafc;
}
#product-table .remove-row-btn {
    color: #b71c1c;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 4px;
    transition: background 0.2s;
}
#product-table .remove-row-btn:hover {
    background: #ffeaea;
}

.purchase-totals-summary {
    background: #f8fafc;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(33,40,50,0.06);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    border: 1.5px solid #e0e0e0;
}

.btn {
    font-weight: 600;
    border-radius: 6px;
    transition: box-shadow 0.2s, background 0.2s;
}
.btn-success {
    background: #1976d2;
    border-color: #1976d2;
}
.btn-success:hover {
    background: #1256a3;
    border-color: #1256a3;
}
.btn-outline-primary {
    border-color: #1976d2;
    color: #1976d2;
}
.btn-outline-primary:hover {
    background: #e3eafc;
    color: #1256a3;
    border-color: #1256a3;
}

@media (max-width: 767.98px) {
    .form-section-card {
        padding: 1rem 0.5rem 0.5rem 0.5rem;
    }
    .purchase-totals-summary {
        padding: 1rem 0.7rem;
    }
    #product-table {
        font-size: 0.95rem;
    }
}

/* Remove heavy icons, box-shadows, and backgrounds */
.sidebar, .top-bar, .sidebar-staff, .sidebar .sidebar-brand {
    box-shadow: none !important;
}

/* Subtle section headers */
.form-section-title {
    border-bottom: 1.5px solid #e3eafc !important;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
}

/* Hide card hover effect */
.card:hover {
    transform: none !important;
    box-shadow: none !important;
}

#product-table .gst-type {
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    padding: 0.2rem 0.3rem !important;
    min-width: 90px;
    box-shadow: none !important;
}
#product-table .gst-type:focus {
    border: 2px solid #1976d2 !important;
    outline: none !important;
    background: #f0f6ff !important;
}

/* --- Begin: Styles moved from purchase_stock.php --- */
:root {
    --primary-green: #10b981;
    --primary-green-dark: #059669;
    --primary-green-light: #ecfdf5;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}
body {
    background: #e5e9f2 !important;
    color: var(--gray-700);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}
.main-content {
    background: #e5e9f2 !important;
}
input, select, textarea {
    background: #fff !important;
    color: var(--gray-900) !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px var(--primary-green-light), 0 1px 2px rgba(0,0,0,0.05);
    background: #fff !important;
}
.card, .form-section {
    background: #fff !important;
    border-radius: 0.75rem !important;
    border: 1px solid var(--gray-200) !important;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    padding: 1.5rem !important;
}
.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
}
.btn-success, .btn-outline-primary, .btn-primary {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    color: #fff !important;
    font-weight: 600;
}
.btn-success:hover, .btn-outline-primary:hover, .btn-primary:hover {
    background-color: var(--primary-green-dark) !important;
    border-color: var(--primary-green-dark) !important;
}
.btn-outline-secondary {
    border-color: var(--gray-200);
    color: var(--gray-700);
    font-weight: 600;
}
.btn-outline-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}
.table-responsive thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    text-transform: capitalize;
    font-size: 0.92rem;
    letter-spacing: 0.05em;
}
.table td, .table th {
    vertical-align: middle;
}
#product-table tbody tr:hover {
    background: var(--primary-green-light);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: background 0.2s, box-shadow 0.2s;
}
.purchase-totals-summary {
    background: #fff !important;
    border-radius: 0.75rem !important;
    border: 1px solid var(--gray-200) !important;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    padding: 1.5rem !important;
}
.form-check-input:checked {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
.form-check-input:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
.form-check-input {
    width: 1.2em !important;
    height: 1.2em !important;
    margin-top: 0 !important;
    cursor: pointer !important;
}
.form-check-label {
    cursor: pointer !important;
    user-select: none !important;
}
.form-check-label-weak {
    font-weight: 400 !important;
    font-size: 0.95rem;
}
.nav-tabs {
    border-bottom: 1px solid var(--gray-200);
    padding: 0 1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    margin-right: 0.25rem;
    color: var(--gray-500);
    font-weight: 600;
    background: transparent;
    transition: color 0.2s, border-color 0.2s;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
}
.nav-tabs .nav-link.active {
    border-bottom-color: var(--primary-green);
    color: var(--primary-green) !important;
    background: transparent;
}
.nav-tabs .nav-link:hover:not(.active) {
    border-bottom-color: var(--gray-400);
    color: var(--gray-700);
    background: none !important;
}
@media (max-width: 767.98px) {
    .nav-tabs {
        overflow: hidden;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    .nav-tabs .nav-item {
        flex: 0 0 auto;
    }
}
.tab-pane {
    transition: opacity 0.3s;
}
.tab-pane:not(.active) {
    opacity: 0;
}
.tab-pane.active {
    opacity: 1;
}
.tabs-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    padding: 0;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.tabs-card .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-200);
    background: transparent;
    position: relative;
    margin-bottom: 0;
    padding: 0 1.5rem;
}
.tabs-card .nav-item {
    flex: 0 0 auto;
}
.tabs-card .nav-link {
    min-width: 120px;
    min-height: 48px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 1rem 0.5rem;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--gray-500);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tabs-card .nav-link.active {
    background: transparent;
    color: var(--primary-green) !important;
    font-weight: 600;
    border-bottom: 3px solid var(--primary-green);
    z-index: 2;
}
.tabs-card .nav-link:hover:not(.active) {
    background: none !important;
    color: var(--gray-700);
    border-bottom: 3px solid var(--gray-400);
}
.tabs-card .tab-content {
    padding: 2rem 2rem 1.5rem 2rem;
    background: #fff;
    border-radius: 0 0 0.75rem 0.75rem;
}
.top-bar-search input {
     background: var(--gray-50) !important;
}
.top-bar-search .input-group-text {
    background: var(--gray-50) !important;
}
.form-check-input:checked {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
.form-check-input:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
.form-check-input {
    width: 1.2em !important;
    height: 1.2em !important;
    margin-top: 0 !important;
    cursor: pointer !important;
}
.form-check-label {
    cursor: pointer !important;
    user-select: none !important;
}
.form-check-label-weak {
    font-weight: 400 !important;
    font-size: 0.95rem;
}

.autocomplete-dropdown {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 1rem;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}
.autocomplete-item {
    background: #fff;
    color: #222;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.autocomplete-item:hover, .autocomplete-item:focus {
    background: #f3f4f6;
    color: #059669;
}

/* Disabled field professional style for invoice forms */
.userDisabled[disabled], .form-control:disabled.userDisabled {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}
.userDisabled2[disabled], .form-control:disabled.userDisabled2 {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* Improve select box dropdown border and z-index */
.form-select {
    border: 1.5px solid #b2b2b2 !important;
    background-clip: padding-box;
    z-index: 2;
    position: relative;
}

/* For dropdown menu (Bootstrap 5) */
.form-select:focus {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 0.15rem rgba(76, 175, 80, 0.15);
    z-index: 10;
}

/* Ensure select's dropdown is above overlays */
select, .form-select, .form-select:focus {
    z-index: 1051 !important;
}

/* Custom border for select dropdown (Webkit browsers) */
select:focus::-ms-value { /* IE/Edge */
    border: 1.5px solid #4CAF50 !important;
}
select:focus option, .form-select:focus option {
    border-bottom: 1.5px solid #b2b2b2 !important;
}

/* For Chrome, Safari, Edge */
select, .form-select {
    border-radius: 8px !important;
    outline: none !important;
}

/* Remove default outline for select on focus */
select:focus, .form-select:focus {
    outline: none !important;
}

/* Make preview icon white on hover */
.btn-outline-info:hover, .btn-outline-info:focus {
    color: #fff !important;
}
.btn-outline-info:hover i, .btn-outline-info:focus i {
    color: #fff !important;
}

.action-btn-square {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    font-size: 1.1rem;
}

.btn-square {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 8px;
}

/* =========================
   Dashboard Page Styles
   ========================= */
/* (All rules in this section are already defined above. Removed duplicates for clarity.) */
/* (All rules in this section are already defined above. Removed duplicates for clarity.) */

/* =========================
   Stock Info Page Styles
   ========================= */
.purchase-heading {
    font-size: 1.5rem;
    font-weight: 600;
}

.btn-back-dashboard {
    border-color: var(--primary-green-dark) !important;
    color: var(--primary-green-dark) !important;
    background: #fff;
    transition: background 0.2s, color 0.2s;
}

.btn-back-dashboard:hover, .btn-back-dashboard:focus {
    background: var(--primary-green-dark) !important;
    color: #fff !important;
}

/* Stock Info Page Responsive Styles */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        border: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        padding: 1rem;
    }
    
    .table thead {
        display: none;
    }
    
    .table td {
        display: block;
        border: none;
        padding: 0.5rem 0;
        text-align: left;
        position: relative;
    }
    
    .table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #374151;
        display: inline-block;
        min-width: 80px;
        margin-right: 0.5rem;
    }
    
    .table td:first-child {
        font-weight: 600;
        color: #1f2937;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .text-center {
        text-align: left !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .searchbar-group {
        max-width: 60% !important;
        flex: 1;
    }
    
    .btn-success {
        width: auto;
        justify-content: center;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .table tbody tr {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }
    
    .table td {
        padding: 0.4rem 0;
        font-size: 0.9rem;
    }
    
    .table td:before {
        min-width: 70px;
        font-size: 0.85rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .purchase-heading {
        font-size: 1.25rem;
    }
    
    .btn-back-dashboard {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-success {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-3 {
        gap: 0.25rem;
    }
    
    .searchbar-group {
        max-width: 55% !important;
    }
    
    .btn-success {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Stock Info Page Specific Styles */
.p-3.mb-2[style*='background:#f8fafc'] {
    background: #f8fafc !important;
}

.dark-theme .p-3.mb-2[style*='background:#f8fafc'] {
    background: #232526 !important;
}

.dark-theme .form-label, .dark-theme label[for='gst-type-all'] {
    color: #e5e7eb !important;
}

.main-content,
.d-flex.flex-grow-1.overflow-hidden,
.flex-grow-1.d-flex.flex-column {
    overflow: visible !important;
    height: auto !important;
}

html, body {
    height: 100%;
    overflow: auto !important;
}

.dark-theme .input-group .form-control {
    background: #232526 !important;
    color: #e5e7eb !important;
    border-color: #444 !important;
}

.dark-theme .input-group-text {
    background: #232526 !important;
    color: #e5e7eb !important;
    border-color: #444 !important;
}

.input-group .form-control,
.input-group .input-group-text {
    border-radius: 2rem !important;
}

.input-group .input-group-text {
    border-right: none !important;
}

/* .input-group .form-control {
    border-left: none !important;
} */

/* Stock Info Table Styles */
.stock-info-table td {
    text-transform: uppercase;
}

.stock-info-table th {
    text-transform: uppercase;
}

/* Dark theme support for stock info page */
body.dark-theme .table tbody tr {
    background: #232526 !important;
    border-color: #444 !important;
}

body.dark-theme .table td {
    color: #e5e7eb !important;
}

body.dark-theme .table td:before {
    color: #d1d5db !important;
}

body.dark-theme .table td:first-child {
    color: #f9fafb !important;
    border-bottom-color: #444 !important;
}

/* =========================
   Dark Theme Overrides
   ========================= */
body.dark-theme {
    background: #181a1b !important;
    color: #f1f1f1 !important;
}

body.dark-theme .main-content {
    background: #181a1b !important;
    color: #f1f1f1 !important;
}

body.dark-theme .card, body.dark-theme .form-section, body.dark-theme .purchase-totals-summary {
    background: #232526 !important;
    color: #f1f1f1 !important;
    border-color: #33393b !important;
}

body.dark-theme .form-section-title {
    color: #f9fafb !important;
    border-color: #374151 !important;
}

body.dark-theme input, body.dark-theme select, body.dark-theme textarea, body.dark-theme #product-table input, body.dark-theme #product-table select {
    background: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #374151 !important;
}

body.dark-theme input:focus, body.dark-theme select:focus, body.dark-theme textarea:focus, body.dark-theme #product-table input:focus, body.dark-theme #product-table select:focus {
    background: #262b32 !important;
    color: #fff !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

body.dark-theme .table-responsive thead th, body.dark-theme #product-table thead th {
    background: #232526 !important;
    color: #bdbdbd !important;
    border-bottom: 1px solid #33393b !important;
}

body.dark-theme .table td, body.dark-theme .table th, body.dark-theme #product-table td, body.dark-theme #product-table th {
    background: #232526 !important;
    color: #d1d5db !important;
    border-color: #33393b !important;
}

body.dark-theme #product-table tbody tr:hover {
    background: #262b32 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px 0 rgba(16,185,129,0.18);
}

body.dark-theme .purchase-totals-summary {
    background: #232526 !important;
    color: #f1f1f1 !important;
    border-color: #33393b !important;
}

body.dark-theme .btn-success, body.dark-theme .btn-outline-primary, body.dark-theme .btn-primary {
    background-color: var(--primary-green-dark) !important;
    border-color: var(--primary-green-dark) !important;
    color: #fff !important;
}

body.dark-theme .btn-success:hover, body.dark-theme .btn-outline-primary:hover, body.dark-theme .btn-primary:hover {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
}

body.dark-theme .form-check-input:checked {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}

body.dark-theme .form-check-input:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}

body.dark-theme .form-check-label {
    color: #d1d5db !important;
}

body.dark-theme .alert {
    background: #193c2f !important;
    color: #6ee7b7 !important;
    border-color: #134e4a !important;
}

body.dark-theme .alert-info {
    background: #193c2f !important;
    color: #6ee7b7 !important;
    border-color: #134e4a !important;
}

body.dark-theme .form-label, body.dark-theme .form-section-title, body.dark-theme label {
    color: #f1f1f1 !important;
}

body.dark-theme .sidebar {
    background: #181c1f !important;
    color: #f1f1f1 !important;
}

body.dark-theme .sidebar .nav-link {
    color: #bdbdbd !important;
}

body.dark-theme .sidebar .nav-link.active {
    background: #059669 !important;
    color: #fff !important;
}

body.dark-theme .sidebar .nav-link:hover {
    background: #23272b !important;
    color: #fff !important;
}

body.dark-theme .sidebar .fs-4 {
    color: #6ee7b7 !important;
}

body.dark-theme .sidebar .nav-link i {
    color: #6ee7b7 !important;
    opacity: 1 !important;
}

body.dark-theme .table, body.dark-theme .table th, body.dark-theme .table td, body.dark-theme #product-table, body.dark-theme #product-table th, body.dark-theme #product-table td {
    border-color: #33393b !important;
}

body.dark-theme #product-table input, body.dark-theme #product-table select {
    border-color: #374151 !important;
}

body.dark-theme .top-bar {
    background: #181c1f !important;
    color: #f1f1f1 !important;
    border-bottom: 1px solid #23272b !important;
}

body.dark-theme .top-bar .bi {
    color: #bdbdbd !important;
}

body.dark-theme .sidebar.collapsed .sidebar-staff,
body.dark-theme .sidebar.collapsed .sidebar-brand {
    background: #181c1f !important;
}

body.dark-theme .sidebar .sidebar-staff img,
body.dark-theme .sidebar.collapsed .sidebar-staff img {
    background: transparent !important;
    box-shadow: none !important;
}

body.dark-theme .dropdown-menu {
    background: #23272b !important;
    color: #f1f1f1 !important;
    border: 1px solid #33393b !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
}

body.dark-theme .dropdown-item {
    color: #f1f1f1 !important;
    background: transparent !important;
}

body.dark-theme .dropdown-item:hover, body.dark-theme .dropdown-item:focus {
    background: #2d3237 !important;
    color: #6ee7b7 !important;
}

body.dark-theme .dropdown-divider {
    border-color: #33393b !important;
}

/* THEME GREEN BUTTON */
.btn-theme-green {
    background: #10b981 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.5rem !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16,185,129,0.08);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-theme-green:hover, .btn-theme-green:focus {
    background: #059669 !important;
    color: #fff !important;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 16px rgba(16,185,129,0.16);
}
.new-invoice-btn {
    padding: 0.4rem 1.2rem !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.01em;
}
/* ICON BUTTONS */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    border: none !important;
    padding: 0 !important;
}
.btn-edit {
    background: #10b981 !important;
    color: #fff !important;
}
.btn-edit:hover, .btn-edit:focus {
    background: #059669 !important;
    color: #fff !important;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(16,185,129,0.16);
}
.btn-delete {
    background: #ef4444 !important;
    color: #fff !important;
}
.btn-delete:hover, .btn-delete:focus {
    background: #b91c1c !important;
    color: #fff !important;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(239,68,68,0.16);
}

.badge,
.status-paid,
.status-pending,
.status-cancelled {
    color: #fff !important;
}

/* Dark Theme Styles for Invoice Customer Page */
.dark-theme .form-section {
    background: #1f2937 !important;
    border-color: #374151 !important;
}
.dark-theme .form-section-title {
    border-color: #374151 !important;
    color: #f9fafb !important;
}
.dark-theme .tabs-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}
.dark-theme .tabs-card .nav-tabs {
    background: transparent !important;
    border-bottom: 1px solid #374151 !important;
}
.dark-theme .tabs-card .nav-link {
    color: #9ca3af !important;
    background: transparent !important;
}
.dark-theme .tabs-card .nav-link.active {
    background: transparent !important;
    color: var(--primary-green) !important;
    border-bottom: 3px solid var(--primary-green) !important;
}
.dark-theme .tabs-card .nav-link:hover:not(.active) {
    background: transparent !important;
    color: #d1d5db !important;
    border-bottom: 3px solid #4b5563 !important;
}
.dark-theme .tabs-card .tab-content,
.dark-theme .form-section {
    background: #111827 !important;
    color: #d1d5db !important;
    border-radius: 0 0 1rem 1rem;
}
.dark-theme input,
.dark-theme select,
.dark-theme textarea {
    background: #1f2937 !important;
    color: #d1d5db !important;
    border-color: #374151 !important;
}
.dark-theme input:focus,
.dark-theme select:focus,
.dark-theme textarea:focus {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Common Invoice Page Styles (moved from internal <style> blocks) */
body {
    background: #e5e9f2 !important;
    color: var(--gray-700);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}
.main-content {
    background: #e5e9f2 !important;
}
input, select, textarea {
    background: #fff !important;
    color: var(--gray-900) !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px var(--primary-green-light), 0 1px 2px rgba(0,0,0,0.05);
    background: #fff !important;
}
.card, .form-section, .tabs-card {
    background: #fff !important;
    border-radius: 0.75rem !important;
    border: 1px solid var(--gray-200) !important;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    padding: 1.5rem !important;
}
.btn-success, .btn-outline-primary, .btn-primary {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    color: #fff !important;
    font-weight: 600;
}
.btn-success:hover, .btn-outline-primary:hover, .btn-primary:hover {
    background-color: var(--primary-green-dark) !important;
    border-color: var(--primary-green-dark) !important;
}
.btn-outline-secondary {
    border-color: var(--gray-200);
    color: var(--gray-700);
    font-weight: 600;
}
.btn-outline-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}
.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
}
.form-section {
    padding: 1.5rem !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 0.75rem !important;
    background: #fff !important;
}
.form-check-label-weak {
    font-weight: 400 !important;
    font-size: 0.95rem;
}
.nav-tabs {
    border-bottom: 1px solid var(--gray-200);
    padding: 0 1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    margin-right: 0.25rem;
    color: var(--gray-500);
    font-weight: 600;
    background: transparent;
    transition: color 0.2s, border-color 0.2s;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
}
.nav-tabs .nav-link.active {
    border-bottom-color: var(--primary-green);
    color: var(--primary-green) !important;
    background: transparent;
}
.nav-tabs .nav-link:hover:not(.active) {
    border-bottom-color: var(--gray-400);
    color: var(--gray-700);
    background: none !important;
}
@media (max-width: 767.98px) {
    .nav-tabs {
        overflow: hidden;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    .nav-tabs .nav-item {
        flex: 0 0 auto;
    }
}
.tab-pane {
    transition: opacity 0.3s;
}
.tab-pane:not(.active) {
    opacity: 0;
}
.tab-pane.active {
    opacity: 1;
}
.tabs-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    padding: 0;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.tabs-card .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-200);
    background: transparent;
    position: relative;
    margin-bottom: 0;
    padding: 0 1.5rem;
}
.tabs-card .nav-item {
    flex: 0 0 auto;
}
.tabs-card .nav-link {
    min-width: 120px;
    min-height: 48px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 1rem 0.5rem;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--gray-500);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tabs-card .nav-link.active {
    background: transparent;
    color: var(--primary-green) !important;
    font-weight: 600;
    border-bottom: 3px solid var(--primary-green);
    z-index: 2;
}
.tabs-card .nav-link:hover:not(.active) {
    background: none !important;
    color: var(--gray-700);
    border-bottom: 3px solid var(--gray-400);
}
.tabs-card .tab-content {
    padding: 2rem 2rem 1.5rem 2rem;
    background: #fff;
    border-radius: 0 0 0.75rem 0.75rem;
}
.top-bar-search input {
     background: var(--gray-50) !important;
}
.top-bar-search .input-group-text {
    background: var(--gray-50) !important;
}
.form-check-input:checked {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
.form-check-input:focus {
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}
.form-check-input {
    width: 1.2em !important;
    height: 1.2em !important;
    margin-top: 0 !important;
    cursor: pointer !important;
}
.form-check-label {
    cursor: pointer !important;
    user-select: none !important;
}
.form-check-label-weak {
    font-weight: 400 !important;
    font-size: 0.95rem;
}

.autocomplete-dropdown {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 1rem;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}
.autocomplete-item {
    background: #fff;
    color: #222;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.autocomplete-item:hover, .autocomplete-item:focus {
    background: #f3f4f6;
    color: #059669;
}

/* Disabled field professional style for invoice forms */
.userDisabled[disabled], .form-control:disabled.userDisabled {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}
.userDisabled2[disabled], .form-control:disabled.userDisabled2 {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* Improve select box dropdown border and z-index */
.form-select {
    border: 1.5px solid #b2b2b2 !important;
    background-clip: padding-box;
    z-index: 2;
    position: relative;
}

/* For dropdown menu (Bootstrap 5) */
.form-select:focus {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 0.15rem rgba(76, 175, 80, 0.15);
    z-index: 10;
}

/* Ensure select's dropdown is above overlays */
select, .form-select, .form-select:focus {
    z-index: 1051 !important;
}

/* Custom border for select dropdown (Webkit browsers) */
select:focus::-ms-value { /* IE/Edge */
    border: 1.5px solid #4CAF50 !important;
}
select:focus option, .form-select:focus option {
    border-bottom: 1.5px solid #b2b2b2 !important;
}

/* For Chrome, Safari, Edge */
select, .form-select {
    border-radius: 8px !important;
    outline: none !important;
}

/* Remove default outline for select on focus */
select:focus, .form-select:focus {
    outline: none !important;
}

/* Make preview icon white on hover */
.btn-outline-info:hover, .btn-outline-info:focus {
    color: #fff !important;
}
.btn-outline-info:hover i, .btn-outline-info:focus i {
    color: #fff !important;
}

.action-btn-square {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    font-size: 1.1rem;
}

.btn-square {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 8px;
}

/* Make searchbar-group 100% width on small screens, 70% on md and above */
.searchbar-group {
    max-width: 100% !important;
    flex: 1;
}
@media (min-width: 768px) { /* md and above */
    .searchbar-group {
        max-width: 80% !important;
    }
}

.searchbar-group input.form-control:focus {
    box-shadow: none !important;
    outline: none !important;
    border-color: #dee2e6 !important;
}

.searchbar-group .input-group-text i {
    color: #bdbdbd;
}

.pagination .page-link {
    color: var(--primary-green) !important;
}
.pagination .active .page-link {
    background-color: var(--primary-green) !important;
    color: #fff !important;
    border-color: var(--primary-green) !important;
}

.filter-dropdown-menu .dropdown-item:hover, .filter-dropdown-menu .dropdown-item:focus {
    background: var(--primary-green) !important;
    color: #fff !important;
}

.dropdown-menu .dropdown-item.active {
    background: var(--primary-green) !important;
    color: #fff !important;
}

#rowsDropdown + .dropdown-menu .dropdown-item:hover, #rowsDropdown + .dropdown-menu .dropdown-item:focus {
    background: var(--primary-green) !important;
    color: #fff !important;
}

.btn[style*="--primary-green"]:hover {
    background-color: #059669 !important;
    color: #fff !important;
}

#exportDropdown + .dropdown-menu .dropdown-item:hover, #exportDropdown + .dropdown-menu .dropdown-item:focus {
    background: #fff !important;
    color: var(--primary-green) !important;
}

body, html, .main-content, .page-wrapper {
  max-width: 100vw;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

body, html, .main-content, .page-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
}