/* Custom CSS for POS System */
/* Add your custom colors and styles here */

/* Example: Overriding a tailwind color if build is missing */
.custom-text-green {
    color: #00935f !important;
}

.custom-bg-green {
    background-color: #00935f !important;
}

/* Add any other custom overrides below */

/* Custom Top Bar Style */
.custom-top-bar {
    background: #1f2937 !important; /* Premium Dark Gray */
    background-image: none !important; /* Remove any existing gradient */
}

/* Override button colors inside the top bar to match the dark theme */
.custom-top-bar button,
.custom-top-bar a {
    background-color: #374151 !important; /* Lighter gray for buttons */
    border-color: #4b5563 !important; /* Subtle border */
    color: #ffffff !important;
}

.custom-top-bar button:hover,
.custom-top-bar a:hover {
    background-color: #4b5563 !important; /* Lighter on hover */
}

.custom-top-bar summary {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
}

/* --------------------------------------------------------- */
/* DEEP NUCLEAR SIDEBAR FIX */
/* --------------------------------------------------------- */

/* 1. Base Sidebar Styling */
.custom-sidebar {
    background-color: #1f2937 !important;
    border-right: 1px solid #374151 !important;
}

/* Sidebar Header Divider */
.custom-sidebar .custom-sidebar-header {
    background-color: #1f2937 !important; /* Changed to match sidebar body */
    border-bottom: 1px solid #374151 !important;
    border-right: none !important;
}

/* Dashboard Header Customization */
.custom-dashboard-header,
.custom-dashboard-bg {
    background: #111827 !important; /* Premium Dark Background */
    background-image: none !important; /* Remove Tailwind Gradients */
}

/* Dashboard Text Colors */
.custom-dashboard-header h1 {
    color: #ffffff !important;
}

/* Fix Filter Button in Dashboard */
#dashboard_date_filter {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border: 1px solid #374151 !important;
}

#dashboard_date_filter:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------- */
/* DASHBOARD CARDS COLORING */
/* --------------------------------------------------------- */

/* Common Card Styles (Glassmorphism Base) */
.card-total-sales,
.card-net,
.card-invoice-due,
.card-sell-return,
.card-total-purchase,
.card-purchase-due,
.card-purchase-return,
.card-expense {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    min-height: 110px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    border-radius: 0.75rem !important; /* Rounded corners for glass look */
}

/* Ensure ALL text inside these cards is white */
.card-total-sales p,
.card-net p,
.card-invoice-due p,
.card-sell-return p,
.card-total-purchase p,
.card-purchase-due p,
.card-purchase-return p,
.card-expense p,
.card-total-sales span,
.card-net span,
.card-invoice-due span,
.card-sell-return span,
.card-total-purchase span,
.card-purchase-due span,
.card-purchase-return span,
.card-expense span {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Legibility on glass */
}

/* Card 1: Total Sales - Vibrant Blue Glass */
.card-total-sales {
    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.45) 0%,
        rgba(59, 130, 246, 0.35) 100%
    ) !important;
    border-color: rgba(96, 165, 250, 0.6) !important;
}

/* Card 2: Net - Vibrant Green Glass */
.card-net {
    background: linear-gradient(
        135deg,
        rgba(5, 150, 105, 0.45) 0%,
        rgba(16, 185, 129, 0.35) 100%
    ) !important;
    border-color: rgba(52, 211, 153, 0.6) !important;
}

/* Card 3: Invoice Due - Vibrant Orange Glass */
.card-invoice-due {
    background: linear-gradient(
        135deg,
        rgba(217, 119, 6, 0.45) 0%,
        rgba(245, 158, 11, 0.35) 100%
    ) !important;
    border-color: rgba(251, 191, 36, 0.6) !important;
}

/* Card 4: Total Sell Return - Vibrant Red Glass */
.card-sell-return {
    background: linear-gradient(
        135deg,
        rgba(220, 38, 38, 0.45) 0%,
        rgba(239, 68, 68, 0.35) 100%
    ) !important;
    border-color: rgba(248, 113, 113, 0.6) !important;
}

/* Card 5: Total Purchase - Vibrant Indigo Glass */
.card-total-purchase {
    background: linear-gradient(
        135deg,
        rgba(79, 70, 229, 0.45) 0%,
        rgba(99, 102, 241, 0.35) 100%
    ) !important;
    border-color: rgba(129, 140, 248, 0.6) !important;
}

/* Card 6: Purchase Due - Vibrant Purple Glass */
.card-purchase-due {
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.45) 0%,
        rgba(139, 92, 246, 0.35) 100%
    ) !important;
    border-color: rgba(167, 139, 250, 0.6) !important;
}

/* Card 7: Total Purchase Return - Vibrant Pink Glass */
.card-purchase-return {
    background: linear-gradient(
        135deg,
        rgba(219, 39, 119, 0.45) 0%,
        rgba(236, 72, 153, 0.35) 100%
    ) !important;
    border-color: rgba(244, 114, 182, 0.6) !important;
}

/* Card 8: Expense - Vibrant Cyan Glass */
.card-expense {
    background: linear-gradient(
        135deg,
        rgba(8, 145, 178, 0.45) 0%,
        rgba(6, 182, 212, 0.35) 100%
    ) !important;
    border-color: rgba(34, 211, 238, 0.6) !important;
}

/* --------------------------------------------------------- */
/* NEW DASHBOARD LAYOUT STYLES */
/* --------------------------------------------------------- */

/* Sales Overview Card - Trading App Dark Blue Style */
.sales-overview-card {
    background: linear-gradient(
        135deg,
        #0f172a 0%,
        #020617 100%
    ) !important; /* Slate-900 to Slate-950 */
    border: 1px solid rgba(56, 189, 248, 0.1) !important; /* Subtle Cyan Border */
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.5),
        0 4px 6px -2px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Side Accent Cards (Stacked on right) */
.card-side-accent {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

.card-side-accent:hover {
    background-color: #263344 !important;
}

/* Override individual side card backgrounds for slight variation */
.card-side-accent.card-total-purchase {
    background: linear-gradient(90deg, #1f2937 0%, rgba(59, 130, 246, 0.1) 100%) !important;
}

.card-side-accent.card-purchase-due {
    background: linear-gradient(90deg, #1f2937 0%, rgba(245, 158, 11, 0.1) 100%) !important;
}

.card-side-accent.card-purchase-return {
    background: linear-gradient(90deg, #1f2937 0%, rgba(16, 185, 129, 0.1) 100%) !important;
}

.card-side-accent.card-expense {
    background: linear-gradient(90deg, #1f2937 0%, rgba(139, 92, 246, 0.1) 100%) !important;
}

/* Unified Dashboard Grid Layout */
.dashboard-unified-grid .tw-grid {
    display: grid !important;
    gap: 1rem !important;
}

@media (min-width: 1280px) {
    .dashboard-unified-grid .tw-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Chart spans 3 columns and 4 rows */
    .dashboard-unified-grid .xl\:tw-col-span-3 {
        grid-column: span 3 / span 3 !important;
        grid-row: span 4 / span 4 !important;
    }

    /* Right cards start at column 4 */
    .dashboard-unified-grid .xl\:tw-col-start-4 {
        grid-column-start: 4 !important;
    }

    /* First right card starts at row 2 (same row as chart) */
    .dashboard-unified-grid .xl\:tw-row-start-2 {
        grid-row-start: 2 !important;
    }
}

@media (min-width: 640px) and (max-width: 1279px) {
    .dashboard-unified-grid .tw-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dashboard-unified-grid .sm\:tw-col-span-2 {
        grid-column: span 2 / span 2 !important;
    }
}

/* Hide the light background icons inside cards to prevent clashes, 
   or make them white/transparent */
.card-total-sales .tw-bg-sky-100,
.card-net .tw-bg-green-100,
.card-invoice-due .tw-bg-yellow-100,
.card-sell-return .tw-bg-red-100,
.card-total-purchase .tw-bg-blue-100,
.card-purchase-due .tw-bg-yellow-100,
.card-purchase-return .tw-bg-red-100,
.card-expense .tw-bg-red-100 {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Dashboard Content Charts & Tables */
.custom-dashboard-content,
.tw-bg-white {
    /* Aggressive override for any missed white bg in dashboard */
    background-color: #1f2937 !important;
    border: none !important; /* Remove border for cleaner look */
    color: #d1d5db !important;
    box-shadow: none !important; /* Remove any shadows/rings */
}

.custom-dashboard-content h3,
.custom-dashboard-content h4,
.custom-dashboard-content p,
.custom-dashboard-content span {
    color: #ffffff !important;
}

/* Fix Chart Backgrounds (if transparent, this will show dark) */
.custom-dashboard-content canvas {
    background-color: transparent !important;
}

/* Fix Tables inside Dashboard */
.custom-dashboard-content table {
    color: #d1d5db !important;
}

.custom-dashboard-content table th {
    background-color: #111827 !important;
    color: #ffffff !important;
    border-color: #374151 !important;
}

.custom-dashboard-content table td {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border-color: #374151 !important;
}

/* --------------------------------------------------------- */
/* GLOBAL DARK MODE (FULL PROJECT) */
/* --------------------------------------------------------- */

/* 1. Base Structure & Backgrounds */
html,
body,
.content-wrapper,
.right-side,
.main-footer,
.wrapper,
.tw-bg-gray-100 {
    background-color: #111827 !important;
    color: #d1d5db !important;
}

/* 2. Top Navigation & Header */
.main-header,
.navbar,
.navbar-static-top,
.main-header .navbar {
    background-color: #1f2937 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; /* Subtle Glass Border */
}

/* Welcome Message Heading & Dashboard Card Titles */
.custom-dashboard-header h1,
.custom-dashboard-bottom-section h3 {
    color: #cbd5e1 !important; /* Slate-300 - Matching table text */
}

.main-header .logo {
    background-color: #111827 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Override Tailwind border on custom header */
.custom-top-bar {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important; /* Forces the glass border */
}

/* Dropdown Menus (Actions, etc.) */
.dropdown-menu {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.dropdown-menu > li > a {
    color: #cbd5e1 !important;
    padding: 8px 16px !important;
    transition: background-color 0.2s !important;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background-color: #374151 !important;
    color: #ffffff !important;
}

.dropdown-menu .divider {
    background-color: #374151 !important;
    border-color: #374151 !important;
}

/* Tabs Styling (Nav-tabs & Nav-pills) */
.nav-tabs,
.nav-pills {
    background-color: #1f2937 !important;
    border-bottom: 1px solid #374151 !important;
}

.nav-tabs > li > a,
.nav-pills > li > a {
    color: #cbd5e1 !important;
    background-color: transparent !important;
    border: none !important;
}

.nav-tabs > li > a:hover,
.nav-pills > li > a:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
    border: none !important;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus,
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
    background-color: #374151 !important;
    color: #ffffff !important;
    border: none !important;
    border-bottom: 2px solid #3b82f6 !important; /* Blue accent */
}

/* DataTables Buttons (Export, Print, etc.) */
.dt-buttons .dt-button,
.buttons-csv,
.buttons-excel,
.buttons-print,
.buttons-pdf,
.buttons-colvis,
button.dt-button,
div.dt-button,
a.dt-button {
    background-color: #374151 !important;
    background-image: none !important;
    color: #cbd5e1 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 6px !important;
    padding: 5px 12px !important;
    font-weight: 500 !important; /* Reduced weight */
    font-size: 13px !important;
}

.dt-buttons .dt-button:hover,
button.dt-button:hover,
div.dt-button:hover,
a.dt-button:hover {
    background-color: #4b5563 !important;
    color: #ffffff !important;
    border-color: #6b7280 !important;
}

/* Tab Content Panel */
.tab-content,
.tab-pane,
.nav-tabs-custom,
.nav-tabs-custom > .tab-content {
    background-color: #1f2937 !important;
    border: none !important;
}

.nav-tabs-custom > .nav-tabs {
    background-color: #111827 !important;
    border-bottom: 1px solid #374151 !important;
}

.nav-tabs-custom > .nav-tabs > li > a {
    color: #cbd5e1 !important;
    background: transparent !important;
    border: none !important;
}

.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active > a:hover {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    border-bottom: 2px solid #3b82f6 !important;
}

.navbar-nav > li > a {
    color: #d1d5db !important;
}

.navbar-nav > li > a:hover,
.navbar-nav > .active > a {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* 3. Content Containers (Cards, Boxes, Wells) */
.box,
.card,
.small-box,
.info-box,
.well {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #d1d5db !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
}

.well {
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.box-header,
.card-header {
    color: #ffffff !important;
    border-bottom-color: #374151 !important;
}

.box-body,
.card-body,
.box-footer,
.card-footer {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border-top-color: #374151 !important;
}

.box-title,
.card-title {
    color: #ffffff !important;
}

/* 4. Global Typography */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: #ffffff !important;
}

a {
    color: #60a5fa !important; /* Light blue links */
}

a:hover {
    color: #93c5fd !important;
}

/* TinyMCE (Text Editor) Dark Mode Fix */
.tox-tinymce {
    border: 1px solid #4b5563 !important;
    border-radius: 10px !important;
    background-color: #111827 !important;
    overflow: hidden !important;
}

.tox .tox-menubar, 
.tox .tox-toolbar, 
.tox .tox-toolbar__primary, 
.tox .tox-toolbar__overflow,
.tox .tox-statusbar {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #ffffff !important;
}

.tox .tox-mbtn, 
.tox .tox-tbtn, 
.tox .tox-tbtn--disabled, 
.tox .tox-tbtn--enabled {
    color: #ffffff !important;
}

.tox .tox-mbtn:hover, 
.tox .tox-tbtn:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

.tox .tox-icon svg {
    fill: #ffffff !important;
}

.tox .tox-edit-area__iframe,
.tox-edit-area {
    background-color: #1f2937 !important;
}

/* Fix for editor content when not in iframe */
.tox .tox-edit-area > .tox-editor-header {
    background-color: #111827 !important;
}

.tox .tox-statusbar a, 
.tox .tox-statusbar__path-item, 
.tox .tox-statusbar__wordcount {
    color: #9ca3af !important;
}

/* 5. Global Forms */
.form-control,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='search'],
input[type='file'],
textarea,
select {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
}

.upload-element {
    padding: 8px 12px !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-size: 14px !important;
}

.upload-element::file-selector-button {
    background-color: #4b5563 !important;
    color: #ffffff !important;
    border: 1px solid #6b7280 !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    margin-right: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

.upload-element::file-selector-button:hover {
    background-color: #60a5fa !important;
    border-color: #60a5fa !important;
}

.upload-element:hover {
    border-color: #60a5fa !important;
}

.form-control:focus {
    border-color: #60a5fa !important;
    box-shadow: none !important;
}

.input-group-addon {
    background-color: #4b5563 !important;
    border-color: #4b5563 !important;
    color: #ffffff !important;
}

label,
.checkbox label,
.radio label,
.help-block {
    color: #ffffff !important;
    font-weight: 500 !important;
}

.help-block i {
    color: #9ca3af !important; /* Muted gray for italic help text */
}

/* 6. Global Tables (DataTables & Standard) */
/* 6. Global Tables (DataTables & Standard) */
.table,
table.dataTable,
.table-bordered {
    background-color: #1f2937 !important;
    color: #cbd5e1 !important; /* "Slate-300" - Cool steel gray, premium look */
    border: 0.5px solid rgba(55, 65, 81, 0.5) !important;
}

/* DataTables controls text (Show entries, Search label, Info) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #cbd5e1 !important; /* Matching Slate-300 */
}
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    color: #cbd5e1 !important;
}

.table th,
table.dataTable th,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
    background-color: #111827 !important; /* Header Darker */
    color: #ffffff !important;
    border: 0.5px solid rgba(55, 65, 81, 0.5) !important; /* Thin cell borders */
}

.table td,
table.dataTable td {
    background-color: #1f2937 !important;
    border: 0.5px solid rgba(55, 65, 81, 0.5) !important;
    color: #cbd5e1 !important; /* Slate-300 - Matching headers and titles */
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #293548 !important; /* Slightly lighter for stripe */
}

.table-hover > tbody > tr:hover,
table.dataTable tbody tr:hover {
    background-color: #374151 !important;
}

/* DataTables specifics (Global) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #d1d5db !important;
}

/* Pagination Buttons - Aggressive Styling (DataTables & Bootstrap) */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next,
.pagination > li > a,
.pagination > li > span {
    background-color: #374151 !important;
    color: #d1d5db !important;
    border: 1px solid #4b5563 !important;
    margin-left: 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.pagination > li > a:hover,
.pagination > li > span:hover {
    background-color: #111827 !important;
    color: #ffffff !important;
    border-color: #6b7280 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
    background-color: #111827 !important;
    color: #ffffff !important;
    border-color: #6b7280 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active,
.pagination > .disabled > span,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
    background-color: #1f2937 !important;
    color: #6b7280 !important;
    border-color: #374151 !important;
    box-shadow: none !important;
}

/* 7. Global Select2 Overrides */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #ffffff !important;
    line-height: 28px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #d1d5db transparent transparent transparent !important;
}

.select2-dropdown {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #d1d5db !important;
    border-radius: 8px !important;
}

.select2-search__field {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #4b5563 !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected='true'] {
    background-color: #111827 !important;
}

/* 8. Global Modals */
.modal-content {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border: 1px solid #374151 !important;
}

.modal-header {
    border-bottom-color: #374151 !important;
}

.modal-footer {
    border-top-color: #374151 !important;
}

.close {
    color: #ffffff !important;
    text-shadow: none !important;
    opacity: 0.8 !important;
}

/* 9. Buttons (Global overrides) */
.btn-default {
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: #4b5563 !important;
}

.btn-default:hover {
    background-color: #4b5563 !important;
}

.btn-modal {
    color: #ffffff !important; /* Ensure icons in modal buttons wait white */
}

/* --------------------------------------------------------- */
/* GLOBAL SCROLLBARS (Webkit) */
/* --------------------------------------------------------- */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 6px;
    border: 3px solid #111827; /* Create padding around thumb */
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* --------------------------------------------------------- */
/* DATATABLES EXTRAS & FOOTER */
/* --------------------------------------------------------- */

/* Table Footer (Total Rows) */
.table tfoot th,
.table tfoot td,
table.dataTable tfoot th,
table.dataTable tfoot td {
    background-color: #1f2937 !important;
    color: #ffffff !important; /* Bold white for totals */
    border-color: #374151 !important;
}

/* DataTables Export Buttons */
div.dt-buttons .dt-button,
a.dt-button {
    background-color: #374151 !important;
    color: #ffffff !important;
    border: 1px solid #4b5563 !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 4px !important;
}

div.dt-buttons .dt-button:hover,
a.dt-button:hover {
    background-color: #4b5563 !important;
    border-color: #6b7280 !important;
}

/* --------------------------------------------------------- */
/* HIGHCHARTS DARK THEME FIX */
/* --------------------------------------------------------- */
.highcharts-background {
    fill: #1f2937 !important;
}

.highcharts-container {
    background-color: #1f2937 !important;
}

.highcharts-root text {
    color: #d1d5db !important;
    fill: #d1d5db !important;
}

.highcharts-title {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.highcharts-legend-item text {
    color: #d1d5db !important;
    fill: #d1d5db !important;
}

.highcharts-axis-labels text {
    color: #9ca3af !important;
    fill: #9ca3af !important;
}

.highcharts-axis-line,
.highcharts-grid-line {
    stroke: #374151 !important;
}

/* Tooltips */
.highcharts-tooltip-box {
    fill: #1f2937 !important;
    fill-opacity: 0.95 !important;
    stroke: #4b5563 !important;
    stroke-width: 1px !important;
}

.highcharts-tooltip text {
    fill: #ffffff !important;
    color: #ffffff !important;
}

/* Highcharts Context Menu (Hamburger Menu) */
.highcharts-menu {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    padding: 5px 0 !important;
}

.highcharts-menu-item {
    color: #d1d5db !important;
    background-color: transparent !important;
    transition: background-color 0.2s;
    cursor: pointer !important;
}

.highcharts-menu-item:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* Fix the Context Button (The Hamburger Icon Itself) */
.highcharts-button-box {
    fill: #1f2937 !important; /* Dark background for the button rect */
    stroke: #374151 !important;
    stroke-width: 1px !important;
}

.highcharts-button-symbol {
    stroke: #d1d5db !important; /* Light color for the hamburger lines */
    stroke-width: 3px !important;
}

.highcharts-button:hover .highcharts-button-box {
    fill: #374151 !important; /* Lighter dark on hover */
}

/* --------------------------------------------------------- */
/* PREMIUM SIDEBAR REDESIGN (Match Image 2 & 3) */
/* --------------------------------------------------------- */

/* 1. Container & Base styles */
#side-bar {
    background-color: #1f2937 !important;
    border-right: 1px solid #374151 !important;
    padding: 15px 10px !important;
}

#side-bar a {
    color: #ced4da !important; /* Lighter gray for better visibility */
    background-color: transparent !important;
    border-radius: 8px !important;
    margin: 4px 0 !important;
    padding: 10px 15px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    transition: all 0.2s ease-in-out !important;
    border: none !important;
    text-decoration: none !important;
}

/* 2. Hover State */
#side-bar a:hover:not(.tw-bg-gray-200) {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

/* 3. Active Main Item (Solid Blue BG only on the LINK, not the container) */
#side-bar a.tw-bg-gray-200,
#side-bar div.tw-bg-gray-200 > a.drop_down {
    background-color: #3b82f6 !important; /* Solid Vibrant Blue */
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Ensure the wrapper DIV doesn't have a background */
#side-bar div.tw-bg-gray-200 {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* 4. Active Text & Icons (Force White) */
#side-bar .tw-bg-gray-200 span,
#side-bar a.tw-bg-gray-200 span,
#side-bar div.tw-bg-gray-200 > a.drop_down span,
#side-bar .tw-bg-gray-200 i,
#side-bar .tw-bg-gray-200 svg,
#side-bar a.tw-bg-gray-200 i,
#side-bar a.tw-bg-gray-200 svg {
    color: #ffffff !important;
}

/* Arrow indicator inside main items */
#side-bar a svg.tw-size-4 {
    margin-left: auto !important;
}

/* 5. Submenu (Children) Styling (Match Image 2) */
#side-bar div.chiled {
    margin-top: 5px !important;
    margin-bottom: 8px !important;
    padding-left: 0 !important;
}

/* Submenu links indentation */
#side-bar div.chiled a {
    padding-left: 45px !important; /* Indent sub-items */
    font-size: 0.9rem !important;
    margin: 2px 0 !important;
}

/* Active Submenu Item (Blue text like Image 2) */
#side-bar div.chiled a.tw-text-primary-700 {
    background-color: transparent !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
}

#side-bar div.chiled a:hover {
    background-color: transparent !important;
    color: #ffffff !important;
}

/* Hide the vertical line indicator if it looks messy */
#side-bar div.chiled .tw-bg-gray-200:not(a) {
    display: none !important;
}

/* --------------------------------------------------------- */
/* DATERANGEPICKER DARK THEME */
/* --------------------------------------------------------- */
.daterangepicker {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #d1d5db !important;
    font-family: inherit !important;
}

.daterangepicker::before,
.daterangepicker::after {
    border-bottom-color: #374151 !important; /* Fix arrow color */
}

.daterangepicker .ranges li {
    background-color: transparent !important;
    color: #cbd5e1 !important;
}

.daterangepicker .ranges li:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

.daterangepicker .ranges li.active {
    background-color: #2563eb !important; /* Primary blue for active item */
    color: #ffffff !important;
}

/* Calendar Grid (if shown) */
.daterangepicker .calendar-table {
    background-color: #1f2937 !important;
    border: none !important;
}

.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
    background-color: #111827 !important;
    color: #4b5563 !important;
}

.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
    background-color: #374151 !important;
}

.daterangepicker select.hourselect,
.daterangepicker select.minuteselect,
.daterangepicker select.secondselect,
.daterangepicker select.ampmselect {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------- */
/* SCROLLBAR DARK THEME */
/* --------------------------------------------------------- */
/* Webkit Browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background-color: #111827; /* Dark track background */
}

::-webkit-scrollbar-track {
    background-color: #111827; /* Dark track */
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background-color: #374151; /* Thumb color */
    border-radius: 5px;
    border: 2px solid #111827; /* Creates gap effect */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #4b5563; /* Lighter on hover */
}

::-webkit-scrollbar-corner {
    background-color: #111827; /* Corner between scrollbars */
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #374151 #111827;
}

/* --------------------------------------------------------- */
/* CHECKBOX & RADIO DARK THEME */
/* --------------------------------------------------------- */
input[type='checkbox'],
input[type='radio'] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    background-color: #374151 !important;
    border: 2px solid #6b7280 !important;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}

input[type='radio'] {
    border-radius: 50%;
}

input[type='checkbox']:checked,
input[type='radio']:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

input[type='checkbox']:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type='radio']:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
}

input[type='checkbox']:hover,
input[type='radio']:hover {
    border-color: #9ca3af !important;
}

/* --------------------------------------------------------- */
/* ACTION BUTTONS DARK THEME (Add, Download, etc.) */
/* --------------------------------------------------------- */
/* 9. Buttons (Global overrides) */
.btn-primary,
.tw-bg-primary-500,
.tw-bg-primary-600,
.tw-dw-btn-primary,
a.btn-primary,
button.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover,
.tw-bg-primary-500:hover,
.tw-bg-primary-600:hover,
.tw-dw-btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4), 0 4px 6px -2px rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.btn-primary:active,
button.btn-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 5px 10px -3px rgba(59, 130, 246, 0.3) !important;
}

/* 10. PREMIUM OUTLINE BUTTONS (Modified: 8px Radius & Outline Style) */
.btn-pill-premium {
    background: transparent !important;
    color: #3b82f6 !important;
    border: 1.5px solid #3b82f6 !important;
    border-radius: 8px !important; /* Reduced radius */
    padding: 10px 24px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1) !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.btn-pill-premium:hover {
    transform: translateY(-2px) !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3) !important;
}

.btn-pill-premium:active {
    transform: translateY(0) !important;
}

.btn-pill-premium i, 
.btn-pill-premium svg {
    font-size: 1.1rem !important;
    transition: color 0.3s ease !important;
}

.btn-pill-premium:hover i, 
.btn-pill-premium:hover svg {
    color: #ffffff !important;
}

/* 11. TABLE ACTION BUTTONS (Edit, View, Delete) */
.btn-action-edit {
    background: #4f7cf2 !important; /* Solid blue from image */
    color: #ffffff !important;
    border: none !important;
    border-radius: 20px !important; /* Pill shape */
    padding: 6px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2) !important;
    text-decoration: none !important;
}

.btn-action-view {
    background: transparent !important;
    color: #60a5fa !important;
    border: 1.5px solid #60a5fa !important;
    border-radius: 20px !important; /* Pill shape */
    padding: 5px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.btn-action-delete {
    background: #e8554e !important; /* Solid red from image */
    color: #ffffff !important;
    border: none !important;
    border-radius: 20px !important; /* Pill shape */
    padding: 6px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(232, 85, 78, 0.2) !important;
    text-decoration: none !important;
}

.btn-action-edit:hover,
.btn-action-delete:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.1) !important;
    color: #ffffff !important;
}

.btn-action-view:hover {
    background: rgba(96, 165, 250, 0.1) !important;
    transform: translateY(-2px) !important;
    color: #60a5fa !important;
}

.btn-action-edit i, 
.btn-action-view i, 
.btn-action-delete i {
    font-size: 14px !important;
}

/* Danger/Red Buttons */
.btn-danger,
a.btn-danger,
button.btn-danger {
    background: linear-gradient(135deg, #991b1b 0%, #ef4444 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Warning/Yellow Buttons */
.btn-warning,
a.btn-warning,
button.btn-warning {
    background: linear-gradient(135deg, #92400e 0%, #f59e0b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Default/Gray Buttons */
.btn-default,
a.btn-default,
button.btn-default {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #d1d5db !important;
}

.btn-default:hover,
a.btn-default:hover,
button.btn-default:hover {
    background-color: #4b5563 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------- */
/* TOOLTIPS & POPOVERS DARK THEME */
/* --------------------------------------------------------- */
.tooltip-inner,
.popover {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.popover-title {
    background-color: #111827 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #374151 !important;
}

.popover-content {
    color: #cbd5e1 !important;
}

.tooltip.top .tooltip-arrow,
.popover.top > .arrow::after {
    border-top-color: #1f2937 !important;
}

.tooltip.bottom .tooltip-arrow,
.popover.bottom > .arrow::after {
    border-bottom-color: #1f2937 !important;
}

.tooltip.left .tooltip-arrow,
.popover.left > .arrow::after {
    border-left-color: #1f2937 !important;
}

.tooltip.right .tooltip-arrow,
.popover.right > .arrow::after {
    border-right-color: #1f2937 !important;
}

/* --------------------------------------------------------- */
/* TINYMCE EDITOR DARK THEME */
/* --------------------------------------------------------- */
.tox-tinymce,
.tox .tox-edit-area,
.tox .tox-edit-area__iframe {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-toolbar__overflow,
.tox .tox-menubar,
.tox .tox-statusbar {
    background-color: #111827 !important;
    border-color: #374151 !important;
}

.tox .tox-tbtn,
.tox .tox-mbtn {
    color: #d1d5db !important;
}

.tox .tox-tbtn:hover,
.tox .tox-mbtn:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

.tox .tox-tbtn--enabled,
.tox .tox-tbtn--enabled:hover {
    background-color: #3b82f6 !important;
}

.tox .tox-statusbar__text-container,
.tox .tox-statusbar__wordcount {
    color: #9ca3af !important;
}

/* TinyMCE iframe body */
.mce-content-body {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
}

/* --------------------------------------------------------- */
/* FILE INPUT DARK THEME */
/* --------------------------------------------------------- */
input[type='file'] {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #d1d5db !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

input[type='file']::file-selector-button {
    background-color: #4b5563 !important;
    border: 1px solid #6b7280 !important;
    color: #ffffff !important;
    padding: 6px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin-right: 10px !important;
    transition: background-color 0.2s !important;
}

input[type='file']::file-selector-button:hover {
    background-color: #6b7280 !important;
}

/* Webkit specific (Chrome, Safari) */
input[type='file']::-webkit-file-upload-button {
    background-color: #4b5563 !important;
    border: 1px solid #6b7280 !important;
    color: #ffffff !important;
    padding: 6px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin-right: 10px !important;
}

input[type='file']::-webkit-file-upload-button:hover {
    background-color: #6b7280 !important;
}

/* --------------------------------------------------------- */
/* ADDITIONAL BUTTON VARIANTS DARK THEME */
/* --------------------------------------------------------- */
/* Info/Cyan Buttons */
.btn-info,
a.btn-info,
button.btn-info {
    background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.btn-info:hover,
a.btn-info:hover,
button.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%) !important;
}

/* Pink/Magenta Buttons (like "Save And Add Another") */
.btn-pink,
.tw-bg-pink-600,
.tw-bg-pink-500,
a.btn-pink,
button[class*='pink'],
.btn-flat.bg-purple,
.bg-purple,
.btn-purple {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Purple/Indigo Buttons (like "Save & Add Opening Stock") */
.btn-flat.bg-maroon,
.bg-maroon,
.btn-maroon,
.tw-bg-indigo-600,
.tw-bg-purple-600 {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Flat buttons override */
.btn-flat {
    background-color: #374151 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #d1d5db !important;
}

.btn-flat:hover {
    background-color: #4b5563 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------- */
/* VALIDATION ERROR MESSAGES */
/* --------------------------------------------------------- */
.error,
.help-block,
.text-danger,
.has-error .help-block,
.has-error .control-label,
.has-error .form-control-feedback,
label.error,
span.error,
.invalid-feedback,
.form-error,
p.error {
    color: #ef4444 !important; /* Red color for errors */
    font-size: 12px !important;
}

.has-error .form-control {
    border-color: #ef4444 !important;
}

/* jQuery Validate plugin errors */
label.error {
    color: #ef4444 !important;
    font-weight: normal !important;
    margin-top: 4px !important;
    display: block !important;
}

/* --------------------------------------------------------- */
/* AUTH / REGISTER PAGE DARK THEME */
/* --------------------------------------------------------- */

/* Override the white background of the container */
html,
body,
.right-col,
.tw-bg-white {
    background-color: #111827 !important;
    background: #111827 !important;
    color: #d1d5db !important;
}

/* Override the wizard content forced white from auth2 layout */
.wizard > .content {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border: 1px solid #374151 !important;
}

/* Override specific hardcoded dark text colors in register blade to be white */
.tw-text-\[\#1e1e1e\] {
    color: #ffffff !important;
}

/* Adjust gray text to be lighter in dark mode */
.tw-text-gray-500 {
    color: #9ca3af !important;
}

/* Ring color overrides for containers */
.tw-ring-gray-200 {
    --tw-ring-opacity: 1 !important;
    --tw-ring-color: #374151 !important;
    border-color: #374151 !important;
}

/* Wizard Steps Styling */
.wizard > .steps .current a,
.wizard > .steps .current a:hover,
.wizard > .steps .current a:active {
    background: #3b82f6 !important;
    color: #fff !important;
}

.wizard > .steps .disabled a,
.wizard > .steps .disabled a:hover,
.wizard > .steps .disabled a:active {
    background: #111827 !important;
    color: #9ca3af !important;
}

.wizard > .steps .done a,
.wizard > .steps .done a:hover,
.wizard > .steps .done a:active {
    background: #10b981 !important;
    color: #fff !important;
}

/* Wizard Actions (Next/Previous Buttons) */
.wizard > .actions a,
.wizard > .actions a:hover,
.wizard > .actions a:active {
    background: #3b82f6 !important;
    color: #fff !important;
    border-radius: 4px !important;
}

/* Form Inputs inside Wizard */
.wizard > .content > .body input,
.wizard > .content > .body select,
.wizard > .content > .body textarea {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

/* Titles and Headings in Auth Pages */
.tw-font-bold,
.tw-font-semibold,
.tw-font-medium {
    color: #ffffff !important;
}

/* Fix for Select2 in Auth Pages */
.select2-container--default .select2-selection--single {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
}

/* --------------------------------------------------------- */
/* BROWSER AUTOFILL FIX (Chrome/Edge) */
/* --------------------------------------------------------- */
/* Prevents the white/pale-blue background on autofilled inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #374151 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Ensure all form controls in the wizard are strictly dark */
.wizard > .content > .body input.form-control,
.wizard > .content > .body select.form-control,
.wizard > .content > .body textarea.form-control {
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: #4b5563 !important;
}

/* Conflict Removal: ensure earlier rule doesn't override transparent bg */
/* Deleted conflicting block */

/* --------------------------------------------------------- */
/* MODERN INPUT GROUP - ICON INSIDE FIELD */
/* --------------------------------------------------------- */

/* 1. Break the default Bootstrap table layout to allow absolute positioning */
/* 1. Container: Reset bootstrap table layout completely */
.input-group {
    display: block !important; /* Kill display: table */
    position: relative !important;
    width: 100% !important;
    border-collapse: separate !important;
    margin-bottom: 15px !important;
    /* vertical-align: middle !important; */
}

/* 2. Input Field: Defines the height of the container */
.input-group .form-control {
    display: block !important; /* Kill display: table-cell */
    width: 100% !important;
    height: 48px !important; /* Taller, explicit height */
    padding-left: 45px !important; /* Clear space for icon */
    padding-right: 12px !important;
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    float: none !important; /* Prevent bootstrap floats */
    margin: 0 !important;
}

/* 3. Icon (Addon): Overlay absolutely on top of the input */
.input-group .input-group-addon {
    display: flex !important; /* Use flex to center icon */
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 45px !important; /* Match padding-left of input */
    height: 100% !important; /* Verify full height */
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #9ca3af !important;
    z-index: 20 !important; /* Sit on top of input */
    pointer-events: none !important; /* Clicks pass through */
    border-radius: 8px 0 0 8px !important;
}

/* 4. Icon alignment: Remove any unexpected margins */
.input-group .input-group-addon i,
.input-group .input-group-addon svg {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* 5. Select2 Specific Fixes */
.input-group .select2-container {
    width: 100% !important;
    display: block !important;
}

.input-group .select2-selection--single {
    height: 48px !important; /* Match input height */
    padding-left: 45px !important;
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.input-group .select2-selection__rendered {
    padding-left: 0 !important;
    color: #ffffff !important;
    line-height: normal !important;
}

.input-group .select2-selection__arrow {
    height: 48px !important;
    top: 0 !important;
    right: 5px !important;
}

/* 6. Fix for multiselect if present */
/* 6. Fix for multiselect if present */
.input-group .select2-selection--multiple {
    min-height: 48px !important;
    padding-left: 45px !important;
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 8px !important;
}

/* Premium Blue Pill Style for Multi-Select Choices */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #4a89dc !important; /* Premium Blue */
    border: none !important;
    border-radius: 4px !important; /* Slight rounded corners, not fully pill per image, or pill? Image looks rounded rect */
    color: #ffffff !important;
    padding: 2px 8px !important;
    margin-top: 6px !important;
    font-size: 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255,255,255,0.7) !important;
    margin-right: 5px !important;
    font-weight: bold !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffffff !important;
}

/* Remove border/background from the search input container in multi-select */
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin-top: 6px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
    list-style: none !important;
}

/* --------------------------------------------------------- */
/* MODERN DATATABLES INPUTS */
/* --------------------------------------------------------- */
.dataTables_wrapper .dataTables_filter input {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    height: 38px !important;
    margin-left: 8px !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_length select {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 6px 24px 6px 12px !important; /* varying padding for select arrow */
    height: 38px !important;
    margin: 0 4px !important;
    outline: none !important;
}

/* Ensure filter label text is visible */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    color: #d1d5db !important;
    display: flex !important;
    align-items: center !important;
}

/* --------------------------------------------------------- */
/* SIDEBAR COLOR & SEPARATOR - ULTRA THIN */
/* --------------------------------------------------------- */
.main-sidebar,
.left-side,
.custom-sidebar,
.main-header .logo {
    background-color: #1f2937 !important;
    position: relative !important;
    box-shadow: none !important; /* Remove shadow completely for flatness */
}

/* PSEUDO-ELEMENT DIVIDER */
.custom-sidebar::after,
.main-sidebar::after,
.left-side::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.03) !important; /* Extremely faint "Ghost" line */
    z-index: 9999;
    display: block;
}

/* Ensure Sidebar Menu Items match the background */
.sidebar-menu,
.main-sidebar .user-panel,
.sidebar-form,
.custom-sidebar .sidebar-menu {
    background-color: #1f2937 !important;
}

/* --------------------------------------------------------- */
/* SIDEBAR MENU DIVIDERS */
/* --------------------------------------------------------- */
.custom-sidebar .sidebar-menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Remove conflicting border from content wrapper */
.content-wrapper {
    border-left: none !important;
}

/* --------------------------------------------------------- */
/* SIDEBAR MENU DIVIDERS */
/* --------------------------------------------------------- */
.custom-sidebar .sidebar-menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Separator between items */
}

.custom-sidebar .sidebar-menu > li:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* --------------------------------------------------------- */
/* ADMINLTE BOX / CARD DARK THEME */
/* --------------------------------------------------------- */
.box,
.card,
.tw-bg-white.tw-shadow-sm.tw-rounded-xl,
.custom-dashboard-content {
    background-color: #1f2937 !important;
    border-top: 3px solid #3b82f6 !important; /* Blue top border */
    border-left: 1px solid #374151 !important;
    border-right: 1px solid #374151 !important;
    border-bottom: 1px solid #374151 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    color: #d1d5db !important;
    margin-bottom: 20px !important;
    border-radius: 8px !important;
    display: block !important; /* Ensure visibility */
}

.box-header,
.card-header {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #374151 !important;
    border-radius: 8px 8px 0 0 !important;
}

.box-body,
.card-body {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border-radius: 0 0 8px 8px !important;
}

.box-footer,
.card-footer {
    background-color: #111827 !important; /* Slightly darker for footer */
    border-top: 1px solid #374151 !important;
    color: #d1d5db !important;
    border-radius: 0 0 8px 8px !important;
}

/* Ensure chart containers inside boxes don't have double backgrounds causing issues */
.box .highcharts-container,
.card .highcharts-container {
    border-radius: 0 0 8px 8px !important;
}

/* --------------------------------------------------------- */
/* PERFECTED "ADD NEW" BUTTON IN INPUT GROUPS */
/* --------------------------------------------------------- */

/* 1. Container Setup */
.input-group {
    position: relative !important;
    display: block !important;
}

/* 2. The Add Button Container - Positioned absolutely right */
.input-group .input-group-btn {
    position: absolute !important;
    top: 1px !important; /* Inside vertical border */
    right: 1px !important; /* Inside horizontal border */
    bottom: 1px !important; /* Inside vertical border */
    width: 42px !important; /* Square-ish touch target */
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Vertical Separator line to left of button */
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 3. The Button Itself - Transparent & Centered */
.input-group .input-group-btn .btn {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #3b82f6 !important; /* Primary Blue */
    border-radius: 0 6px 6px 0 !important; /* Match input radius minus border */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

.input-group .input-group-btn .btn:hover {
    background-color: rgba(59, 130, 246, 0.1) !important; /* Subtle blue glow */
    color: #60a5fa !important;
}

.input-group .input-group-btn .btn i {
    font-size: 16px !important;
}

/* 4. Adjust Select2/Input to make room */
.input-group:has(.input-group-btn) .select2-selection--single,
.input-group:has(.input-group-btn) .form-control {
    /* Padding Right = Button Width (42px) + Arrow/Breathing Room (30px) */
    padding-right: 72px !important;
    border-radius: 8px !important; /* Maintain full rounded corners */
}

/* 5. Reposition Select2 Arrow to be LEFT of the add button */
.input-group:has(.input-group-btn) .select2-selection__arrow {
    right: 43px !important; /* Push arrow left of the 42px button */
    border-left: none !important;
}

/* --------------------------------------------------------- */
/* ROBUST FILE INPUT DESIGN (Dark Mode & Plugin Compatible) */
/* --------------------------------------------------------- */

/* 1. Main Container - Allow vertical stacking */
.file-input {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    margin-bottom: 10px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* 2. The Preview Box (Images show here) */
.file-preview {
    border: 1px dashed #4b5563 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    background-color: #1f2937 !important; /* Dark card bg */
    color: #d1d5db !important;
}

/* Close/Remove button inside preview */
.file-preview .close {
    color: #ffffff !important;
    opacity: 0.7 !important;
    font-size: 20px !important;
    text-shadow: none !important;
}

/* 3. The Input Control Bar (Caption + Buttons) */
.file-input .input-group {
    display: flex !important;
    width: 100% !important;
    height: 48px !important;
    background-color: #374151 !important; /* Input Dark Bg */
    border: 1px solid #4b5563 !important;
    border-radius: 8px !important;
    position: relative !important;
    align-items: center !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

/* 3a. File Name Text */
.file-caption {
    flex-grow: 1 !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 15px !important;
    color: #d1d5db !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.file-caption-name {
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
}

/* 4. Action Buttons Container */
.input-group-btn {
    display: flex !important;
    height: 100% !important;
    position: static !important; /* Reset layout */
    margin: 0 !important;
    border: none !important;
}

/* 4a. Individual Buttons (Browse, Remove, Upload) - FIXED LAYOUT */
.btn-file,
.fileinput-remove-button,
.fileinput-upload-button,
.fileinput-cancel-button {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 48px !important; /* Square touch target */
    color: #3b82f6 !important;
    font-size: 0 !important;
    position: relative !important;
}

/* HIDE CANCEL BUTTON to declutter (UX Improvement) */
.fileinput-cancel-button {
    display: none !important;
}

/* Force specific modern icons using pseudo-elements */
/* Common Icon Styles */
.btn-file i,
.fileinput-remove-button i,
.fileinput-upload-button i {
    visibility: hidden !important; /* Hide original icon */
    width: 0 !important;
    position: absolute !important;
}

.btn-file::after,
.fileinput-remove-button::after,
.fileinput-upload-button::after {
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

/* BROWSE Button - Folder Open Icon */
.btn-file::after {
    content: '\f07c' !important; /* fa-folder-open */
    color: #3b82f6 !important;
}

/* REMOVE Button - Trash Alt Icon */
.fileinput-remove-button::after {
    content: '\f2ed' !important; /* fa-trash-alt */
    color: #ef4444 !important;
}

/* UPLOAD Button (if present) - Upload Icon */
.fileinput-upload-button::after {
    content: '\f093' !important; /* fa-upload */
    color: #10b981 !important;
}

/* Button Hover State */
.btn-file:hover,
.fileinput-remove-button:hover,
.fileinput-upload-button:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Button Hover State */
.btn-file:hover,
.fileinput-remove-button:hover,
.fileinput-upload-button:hover,
.fileinput-cancel-button:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #60a5fa !important;
}

/* 5. Hide Button Labels (Show Icons Only) */
.file-input .btn span,
.fileinput-remove span,
.fileinput-cancel span,
.fileinput-upload span,
.btn-file span {
    display: none !important;
}

/* 6. Fix Icons Size */
.file-input i {
    font-size: 16px !important;
}

/* 7. Reset inner form control artifacts */
.file-input .form-control {
    display: none !important; /* Often duplicate control */
}

/* --------------------------------------------------------- */
/* BUSINESS SETTINGS DARK THEME - REFINED */
/* --------------------------------------------------------- */

/* Wrapper - Force Dark */
.pos-tab-container,
.pos-tab-container .tw-bg-white {
    background-color: #1e293b !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

/* Sidebar Menu Column */
.pos-tab-menu {
    background-color: #0f172a !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    min-height: 100% !important; /* Ensure full height */
    padding: 15px !important;
}

/* Sidebar Links (Inactive) */
.pos-tab-menu .list-group-item {
    background-color: transparent !important;
    color: #94a3b8 !important; /* Slate 400 */
    border: none !important;
    margin-bottom: 4px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    padding: 10px 15px !important;
}

/* Sidebar Links (Hover) */
.pos-tab-menu .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

/* Sidebar Links (Active) - PURE WHITE TEXT ON BLUE */
.pos-tab-menu .list-group-item.active,
.pos-tab-menu .list-group-item.active:hover,
.pos-tab-menu .list-group-item.active:focus {
    background: #3b82f6 !important; /* Solid vibrant blue */
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important; /* Forces White Text */
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4) !important;
    border: none !important;
    border-left: none !important; /* Remove side border if any */
}

/* Content Area (Right Side) */
.pos-tab {
    background-color: #1e293b !important;
    padding: 20px !important;
}

/* Ensure background covers the whole area */
.pos-tab-content,
.pos-tab-content.active {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: none !important;
}

/* Widget internal overrides for specific Tailwind classes */
.pos-tab-container .tw-p-2,
.pos-tab-container .sm\:tw-p-3,
.pos-tab-container .tw-flow-root,
.pos-tab-container div[class*='tw-bg-white'] {
    background-color: #1e293b !important;
    background: #1e293b !important;
}

/* Text Colors */
.pos-tab-content h1,
.pos-tab-content h2,
.pos-tab-content h3,
.pos-tab-content h4,
.pos-tab-content .text-black,
.pos-tab-content .tw-text-black {
    color: #fff !important;
}

/* Labels */
.pos-tab-content label {
    color: #cbd5e1 !important; /* Slate 300 */
    font-weight: 500;
    margin-bottom: 8px;
}

/* Help Text */
.pos-tab-content .help-block {
    color: #94a3b8 !important;
}

/* Input Fields inside settings */
.pos-tab-content .form-control {
    background-color: #334155 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 6px !important;
    height: 40px !important;
}

.pos-tab-content .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}

/* Input Group Addons */
.pos-tab-content .input-group-addon {
    background-color: #334155 !important; /* Match input bg */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: none !important;
    color: #94a3b8 !important;
}

/* Select2 in Settings */
.pos-tab-content .select2-container--default .select2-selection--single {
    background-color: #334155 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    height: 40px !important;
}

.pos-tab-content
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    color: #fff !important;
    line-height: 38px !important;
    padding-left: 12px;
}

.pos-tab-content .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}

.pos-tab-content
    .select2-container--default
    .select2-selection--single
    .select2-selection__arrow
    b {
    border-color: #94a3b8 transparent transparent transparent !important;
}

/* Update Button */
.pos-tab-container button[type='submit'],
.tw-dw-btn-error {
    background-color: #ef4444 !important;
    border: none;
    color: white !important;
}

/* Fix Layout for Custom Field Labels (Select inside Addon) */
.custom_label_product_div .input-group {
    display: flex !important;
    width: 100% !important;
}

.custom_label_product_div .input-group .form-control {
    flex: 1 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.custom_label_product_div .input-group .input-group-addon {
    padding: 0 !important;
    background-color: #334155 !important;
    border-color: #4b5563 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 130px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}

.custom_label_product_div .input-group .input-group-addon select.custom_labels_products {
    background-color: transparent !important;
    border: none !important;
    color: #ffffff !important;
    height: 38px !important; 
    padding: 0 10px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    width: 100% !important;
    display: block !important;
    position: relative !important;
    z-index: 11 !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    pointer-events: auto !important;
}

.custom_label_product_div .input-group .input-group-addon select.custom_labels_products option {
    background-color: #1f2937 !important;
    color: #ffffff !important;
}

.custom_label_product_div .input-group .input-group-addon select.custom_labels_products:focus {
    outline: none !important;
    border: none !important;
}

/* Dark Theme Fix for Input Groups */
.input-group {
    background-color: #313d4f !important;
    border-radius: 8px !important;
    display: flex !important;
    width: 100% !important;
    align-items: stretch !important;
    position: relative !important;
    border: 1px solid #4b5563 !important;
    overflow: visible !important;
}

.input-group .form-control,
.input-group select.form-control {
    flex: 1 1 auto !important;
    background-color: transparent !important;
    border: none !important;
    color: #ffffff !important;
    height: 38px !important;
    padding: 6px 12px !important;
    position: relative !important;
    z-index: 1 !important;
    width: 1% !important; /* Bootstrap flex fix: Prevent squashing addons */
    min-width: 0 !important;
}

/* Ensure select arrow is visible in dark theme */
.input-group select.form-control {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    padding-right: 30px !important;
}

.input-group-addon {
    background-color: #3f4e64 !important;
    border: none !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 15px !important;
    min-width: fit-content !important;
    width: auto !important;
    position: relative !important;
    z-index: 10 !important;
    white-space: nowrap !important;
    gap: 15px !important; /* Proper gap between multiple checkboxes */
}

/* Specific fix for iCheck helper to be clickable and centered */
.input-group-addon .icheckbox_square-blue,
.input-group-addon .iradio_square-blue,
.input-group-addon .iCheck-helper,
.input-group-addon input[type="checkbox"] {
    margin: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 15 !important;
    flex-shrink: 0 !important;
}

.input-group-addon label {
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-weight: normal !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    position: relative !important;
    z-index: 12 !important;
}

/* Ensure the addon doesn't break on small screens */
@media (max-width: 768px) {
    .input-group-addon {
        padding: 0 10px !important;
        gap: 5px !important;
    }
}

/* Specific fix for custom labels with select */
.custom_label_product_div .input-group .input-group-addon {
    min-width: 130px !important;
    padding: 0 !important;
    justify-content: center !important;
}

.custom_label_product_div .input-group .input-group-addon select.custom_labels_products {
    background-color: transparent !important;
    border: none !important;
    color: #ffffff !important;
    height: 38px !important;
    width: 100% !important;
    cursor: pointer !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    position: relative !important;
    z-index: 22 !important;
}

/* --------------------------------------------------------- */
/* HEADER BUTTONS REFINEMENT */
/* --------------------------------------------------------- */
.custom-top-bar button,
.custom-top-bar a.sm\:tw-inline-flex,
.custom-top-bar summary,
.custom-top-bar .small-view-button,
.custom-top-bar .side-bar-collapse,
.custom-top-bar .notifications-menu .dropdown-toggle {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important; /* Reset existing ring if any */
}

/* Ensure hover state keeps the border or enhances it */
.custom-top-bar button:hover,
.custom-top-bar a.sm\:tw-inline-flex:hover,
.custom-top-bar summary:hover,
.custom-top-bar .small-view-button:hover,
.custom-top-bar .side-bar-collapse:hover,
.custom-top-bar .notifications-menu .dropdown-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Adjust Repair Button specifically if needed, but the general rule should catch it */
/* Also ensure the 'tw-ring' class doesn't override our border */
.custom-top-bar .tw-ring-1 {
    box-shadow: none !important;
}

/* --------------------------------------------------------- */
/* SALES OVERVIEW CHART CARD REFINEMENT */
/* --------------------------------------------------------- */
.sales-overview-card {
    background-color: #1e293b !important; /* Dark Slate Blue Base */
    background: linear-gradient(
        145deg,
        #1e293b 0%,
        #0f172a 100%
    ) !important; /* Subtle gradient for depth */
    border: 1px solid rgba(59, 130, 246, 0.2) !important; /* Blue hint border */
}

/* --------------------------------------------------------- */
/* POS TABLE COLUMN ALIGNMENT */
/* --------------------------------------------------------- */
/* Subtotal column - Force right alignment */
#pos_table td.text-right,
#pos_table th.text-right {
    text-align: right !important;
}

#pos_table .pos_line_total_text,
#pos_table .display_currency.pos_line_total_text,
#pos_table td .pos_line_total_text,
#pos_table td .display_currency {
    text-align: right !important;
    display: block !important;
    padding-right: 10px !important;
    width: 100% !important;
}

/* Force the td cell content to be right aligned */
#pos_table tbody tr td:nth-last-child(2) {
    text-align: right !important;
}

#pos_table tbody tr td:nth-last-child(2) span {
    text-align: right !important;
    display: block !important;
    width: 100% !important;
    padding-right: 10px !important;
}

/* Price inc. tax column alignment */
#pos_table .pos_unit_price_inc_tax {
    text-align: right !important;
}

/* Price inc. tax td - second last from right considering delete button */
#pos_table tbody tr td:nth-last-child(3) {
    text-align: right !important;
}

/* --------------------------------------------------------- */
/* THIN TABLE BORDERS - GLOBAL OVERRIDE */
/* --------------------------------------------------------- */

/* All table borders - Make them thinner and more subtle */
.table,
.table-bordered,
table.dataTable,
.dataTable,
table {
    border: 0.5px solid rgba(55, 65, 81, 0.4) !important;
    border-collapse: collapse !important;
}

/* All table cells borders - th and td */
.table th,
.table td,
.table-bordered th,
.table-bordered td,
table.dataTable th,
table.dataTable td,
.dataTable th,
.dataTable td,
table th,
table td,
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > tfoot > tr > td {
    border: 0.5px solid rgba(55, 65, 81, 0.4) !important;
}

/* Make DataTable wrapper borders thin */
.dataTables_wrapper table.dataTable {
    border: 0.5px solid rgba(55, 65, 81, 0.4) !important;
}

/* POS Table specific thin borders */
#pos_table,
#pos_table th,
#pos_table td,
#pos_table tbody tr td {
    border: 0.5px solid rgba(55, 65, 81, 0.4) !important;
}

/* Remove double borders effect */
.table-bordered {
    border-collapse: collapse !important;
}

/* Thin border for table footer rows */
.table tfoot tr,
.table tfoot th,
.table tfoot td,
table.dataTable tfoot tr,
table.dataTable tfoot th,
table.dataTable tfoot td {
    border: 0.5px solid rgba(55, 65, 81, 0.4) !important;
}

/* --------------------------------------------------------- */
/* LOGIN PAGE CONTAINER STYLING */
/* --------------------------------------------------------- */

/* Login container outline border - Premium subtle glow effect */
.tw-p-5.tw-rounded-2xl,
.tw-p-5.md\:tw-p-6.tw-mb-4.tw-rounded-2xl {
    border: 1px solid rgba(99, 102, 241, 0.4) !important; /* Indigo subtle border */
    box-shadow: 
        0 0 20px rgba(99, 102, 241, 0.15),
        0 4px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Alternative: Target by structure - Login form container */
.content-wrapper .row > .col-md-4 > .tw-p-5 {
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    box-shadow: 
        0 0 25px rgba(99, 102, 241, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hover effect on login container */
.tw-p-5.tw-rounded-2xl:hover,
.content-wrapper .row > .col-md-4 > .tw-p-5:hover {
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: 
        0 0 30px rgba(99, 102, 241, 0.25),
        0 8px 40px rgba(0, 0, 0, 0.5) !important;
}

/* --------------------------------------------------------- */
/* SWEETALERT PREMIUM STYLING */
/* --------------------------------------------------------- */

/* Modal Container (Background & Border) */
.swal-modal,
.sweet-alert {
    background-color: #1f2937 !important; /* Dark Slate Gray */
    border: 1px solid #374151 !important; /* Subtle Border */
    border-radius: 1rem !important; /* Modern Rounded Corners */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* Dark-themed containers - .well */
.well {
    background-color: #1f2937 !important; /* Dark Slate Gray */
    border: 1px solid #374151 !important; /* Subtle Border */
    border-radius: 0.5rem !important; /* Slightly rounded corners */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    color: #d1d5db !important; /* Ensure text is readable */
}

/* Title & Text */
.swal-title,
.sweet-alert h2,
.checkbox label,
.radio label {
    color: #ffffff !important;
    font-weight: 500 !important;
}

.swal-text,
.sweet-alert p {
    color: #d1d5db !important; /* Slate-300 */
}

/* Icons (Warning defaults) */
.swal-icon--warning,
.sweet-alert .sa-icon.sa-warning {
    border-color: #f59e0b !important;
}

.swal-icon--warning__body,
.swal-icon--warning__dot,
.sweet-alert .sa-icon.sa-warning .sa-body,
.sweet-alert .sa-icon.sa-warning .sa-dot {
    background-color: #f59e0b !important;
}

/* Buttons Container */
.swal-footer,
.sweet-alert .sa-button-container {
    background-color: transparent !important;
    margin-top: 1rem !important;
}

/* Base Button Styling */
.swal-button,
.sweet-alert button {
    border-radius: 9999px !important; /* Full Pill Shape */
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border: none !important;
    outline: none !important;
    transition: all 0.2s ease-in-out !important;
}

.swal-button:focus,
.sweet-alert button:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5) !important;
}

/* Cancel Button - Dark/Gray/White */
.swal-button--cancel,
.sweet-alert button.cancel {
    background-color: #374151 !important; /* Dark Gray bg */
    color: #ffffff !important; /* White text */
}

.swal-button--cancel:hover,
.sweet-alert button.cancel:hover {
    background-color: #4b5563 !important; /* Lighter Gray hover */
    transform: translateY(-1px);
}

/* Confirm Button (Danger) - Solid Red */
.swal-button--danger,
.sweet-alert button.confirm {
    background-color: #ef4444 !important; /* Red-500 */
    color: #ffffff !important;
}

.swal-button--danger:hover,
.sweet-alert button.confirm:hover {
    background-color: #dc2626 !important; /* Red-600 */
    transform: translateY(-1px);
}

/* Standard Confirm (if not danger) - Solid Blue */
.swal-button--confirm:not(.swal-button--danger) {
    background-color: #2563eb !important; /* Blue-600 */
    color: #ffffff !important;
}

.swal-button--confirm:not(.swal-button--danger):hover {
    background-color: #1d4ed8 !important; /* Blue-700 */
}

/* Info Icon Custom Color (Cyan) */
.fa-info,
.fa-info-circle,
.text-info {
    color: #38bdf8 !important; /* Sky-400 */
}

/* --------------------------------------------------------- */
/* Select2 Dark Mode Fixes */
/* --------------------------------------------------------- */

/* Container & Selection */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    min-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #ffffff !important;
    line-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #1f2937 !important;
    border: 1px solid #3b82f6 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
}

/* Dropdown Menu (The big white box fix) */
.select2-dropdown {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
    z-index: 9999 !important;
}

/* Search Box inside Dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #111827 !important;
    border: 1px solid #374151 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
}

/* Results & Options */
.select2-results__option {
    padding: 8px 12px !important;
    color: #d1d5db !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #374151 !important;
    color: #ffffff !important;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
}

/* --------------------------------------------------------- */
/* End of Select2 Dark Mode Fixes */
/* --------------------------------------------------------- */

/* Fix for Select2: Ensure the original hidden select stays hidden */
select.select2-hidden-accessible {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
}

/* Cleanup for search settings area */
#search_settings + .select2-container {
    margin-top: 5px !important;
}

/* Force hide jQuery Steps elements in case of caching issues */
.wizard > .steps,
.wizard > .actions {
    display: none !important;
}

.wizard > .content {
    display: block !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
}

/* Ensure the form is visible */
#business_register_form {
    display: block !important;
}

/* --------------------------------------------------------- */
/* POS RECEIPT (SLIM/80MM) PRINT PROTECTION */
/* --------------------------------------------------------- */
/* 
   This section prevents the custom dashboard/dark-mode styles 
   from affecting thermal printer receipts. 
*/

/* Reset background and text for all receipt containers */
.ticket, 
.ticket *, 
.invoice, 
.invoice *, 
#receipt_section, 
#receipt_section *,
.print_section,
.print_section * {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Specific resets for tables inside receipts */
.ticket table, 
.ticket table th, 
.ticket table td,
.invoice table,
.invoice table th,
.invoice table td {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: none !important;
}

/* Reset font-family to standard for better thermal printing */
.ticket, .invoice {
    font-family: 'Arial', 'Helvetica', 'Times New Roman', sans-serif !important;
}

/* Hide custom scrollbars or other dashboard-specific decorations in print */
@media print {
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .ticket {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

