/* ============================================
   SYSTEM-WIDE REBRAND OVERRIDES
   Navy: #0F172A
   Emerald: #10B981
   Light Gray: #F8FAFC
   Dark Slate: #1E293B
   Soft Gray: #E2E8F0
   ============================================ */

/* ----- Global Typography Refinement ----- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

h1, h2, h3, h4, h5, h6, .box-title, .kpi-header__title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-weight: 700 !important;
}

/* ----- Header & Sidebar Backgrounds (Navy) ----- */
.tw-bg-primary-800,
.tw-from-primary-800,
.tw-bg-blue-800,
.tw-from-blue-800,
.tw-bg-purple-800,
.tw-from-purple-800,
.tw-bg-gradient-to-r.tw-from-primary-800,
aside.side-bar.tw-bg-primary-800,
aside.side-bar .tw-bg-primary-800,
header .tw-bg-primary-800,
header .tw-from-primary-800,
header.main-header,
.skin-blue-light .main-header .navbar,
.skin-blue-light .main-header .logo,
.bg-blue {
    background: #0F172A !important;
    background-color: #0F172A !important;
    background-image: none !important;
}

.tw-to-primary-900,
.tw-to-blue-900,
.tw-to-purple-900 {
    background-color: #0F172A !important;
    background-image: none !important;
}

.hover\:tw-bg-primary-700:hover,
.hover\:tw-bg-blue-700:hover,
.hover\:tw-bg-purple-700:hover {
    background-color: #1E293B !important;
}

/* ----- Primary Text Colors (Navy) ----- */
.tw-text-primary-800,
.tw-text-primary-700,
.text-primary,
.text-blue-600 {
    color: #0F172A !important;
}

/* ----- Borders ----- */
.tw-border-primary-500\/30 {
    border-color: rgba(226, 232, 240, 0.1) !important;
}

/* ----- Buttons and Badges (Emerald Accent) ----- */
.tw-bg-success,
.btn-success,
.bg-green-400,
.bg-green-500,
.bg-green-600,
.tw-bg-\[\#10B981\],
.bg-green {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: #ffffff !important;
}

.btn-success:hover,
.btn-success:active,
.btn-success:focus {
    background-color: #0e9f6e !important;
    border-color: #0e9f6e !important;
}

/* ----- Primary & Info Buttons (Navy) ----- */
.btn-primary,
.btn-info,
.bg-aqua {
    background-color: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.btn-info:hover,
.btn-info:active,
.btn-info:focus {
    background-color: #1E293B !important;
    border-color: #1E293B !important;
}

/* ----- POS Module Specific Overrides ----- */
.tw-bg-\[\#646EE4\] {
    background-color: #10B981 !important; /* Make POS primary action Emerald */
}
.hover\:tw-bg-\[\#414aac\]:hover {
    background-color: #0e9f6e !important;
}

.bg-info {
    background-color: #0F172A !important;
}
.bg-info>a:hover {
    background-color: #1E293B !important;
}

/* ----- DataTables & Pagination (Navy/Emerald) ----- */
.pagination > .active > a, 
.pagination > .active > a:focus, 
.pagination > .active > a:hover, 
.pagination > .active > span, 
.pagination > .active > span:focus, 
.pagination > .active > span:hover {
    background-color: #0F172A !important;
    border-color: #0F172A !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-item.active .page-link {
    background-color: #0F172A !important;
    border-color: #0F172A !important;
}

.dt-button-collection .dropdown-menu,
.dt-button-collection {
    background-color: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
}
ul.dt-button-collection > li > a {
    color: #1E293B !important;
}
ul.dt-button-collection > li > a:hover {
    background-color: #E2E8F0 !important;
    color: #0F172A !important;
}

/* ----- Tabs (Navy/Emerald) ----- */
.nav-tabs-custom > .nav-tabs > li.active {
    border-top-color: #10B981 !important;
}
div.pos-tab-menu div.list-group > a.active,
div.pos-tab-menu div.list-group > a.active .glyphicon,
div.pos-tab-menu div.list-group > a.active .fa {
    background: #0F172A !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
div.pos-tab-menu div.list-group>a.active:after {
    border-left: 10px solid #0F172A !important;
}

/* ----- Dropdowns (Navy) ----- */
.dropdown-menu > li > a:hover, 
.dropdown-menu > li > a:focus {
    background-color: #E2E8F0 !important;
    color: #0F172A !important;
}

/* ----- Info Icons & Checkboxes (Emerald) ----- */
.text-info,
.fa-info-circle {
    color: #10B981 !important;
}
.icheckbox_square-blue, 
.iradio_square-blue {
    filter: hue-rotate(240deg) saturate(2) brightness(1.2);
}
.icheckbox_square-blue.checked, 
.iradio_square-blue.checked {
    filter: hue-rotate(240deg) saturate(2) brightness(1.2);
}

/* ----- General Layout Tweaks ----- */
body, .content-wrapper, .wrapper, .bg-light-gray {
    background-color: #F8FAFC !important;
}
.box {
    border-top-color: #0F172A !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #E2E8F0 !important;
    background: #ffffff !important;
}

.box-header {
    padding: 12px 16px !important;
}

.box-header.with-border {
    border-bottom: 1px solid #F1F5F9 !important;
}

.box-body {
    padding: 16px !important;
}

/* Compact Sidebar Refinement */
.main-sidebar {
    background-color: #0F172A !important;
}

/* ----- Exhaustive AdminLTE Color Overrides ----- */
/* Success -> Emerald */
.text-success, .text-green { color: #10B981 !important; }
.box-success { border-top-color: #10B981 !important; }

/* Warning -> Warning (#F59E0B) */
.bg-warning, .bg-yellow, .btn-warning {
    background-color: #F59E0B !important;
    border-color: #F59E0B !important;
    color: #ffffff !important;
}
.btn-warning:hover, .btn-warning:active, .btn-warning:focus {
    background-color: #D97706 !important;
    border-color: #D97706 !important;
    color: #ffffff !important;
}
.text-warning, .text-yellow { color: #F59E0B !important; }
.box-warning { border-top-color: #F59E0B !important; }

/* Danger -> Error (#EF4444) */
.bg-danger, .bg-red, .btn-danger {
    background-color: #EF4444 !important;
    border-color: #EF4444 !important;
    color: #ffffff !important;
}
.btn-danger:hover, .btn-danger:active, .btn-danger:focus {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #ffffff !important;
}
.text-danger, .text-red { color: #EF4444 !important; }
.box-danger { border-top-color: #EF4444 !important; }

/* Info & Primary Box Borders */
.box-info { border-top-color: #0F172A !important; } /* Navy */
.box-primary { border-top-color: #0F172A !important; } /* Navy */

/* Text Info specific -> #3B82F6 */
.text-info, .text-aqua { color: #3B82F6 !important; }

/* ----- Final Legacy Hex & Plugin Overrides ----- */
/* Old Plugins Blue (#1572e8) -> Navy (#0F172A) */
.bg-\[\#1572e8\], [style*="background: #1572e8"], [style*="background-color: #1572e8"] {
    background-color: #0F172A !important;
}

/* POS Header Specific text icons */
.tw-text-\[\#646EE4\], .tw-text-\[\#414aac\] {
    color: #0F172A !important;
}

/* ----- Missed Tailwind Gradients (Indigo -> Blue) ----- */
.tw-bg-gradient-to-r.tw-from-indigo-600.tw-to-blue-500,
.tw-from-indigo-600.tw-to-blue-500,
.hover\:tw-from-indigo-600:hover, 
.hover\:tw-to-blue-600:hover,
.active\:tw-from-indigo-700:active, 
.active\:tw-to-blue-700:active {
    background: #10B981 !important; /* Force Solid Emerald */
    background-color: #10B981 !important;
    background-image: none !important;
    border-color: #10B981 !important;
}

.focus\:tw-ring-blue-500:focus {
    --tw-ring-color: rgba(16, 185, 129, 0.5) !important; /* Emerald focus ring */
}

/* POS Sidebar active gradient text */
h3.tw-from-indigo-600.tw-to-blue-500.tw-text-transparent.tw-bg-clip-text {
    background: none !important;
    background-color: transparent !important;
    color: #10B981 !important; /* Force Solid Emerald text */
    -webkit-text-fill-color: #10B981 !important;
}

/* ----- POS Module Stray Hardcoded Colors ----- */
/* Dark Blue -> Navy */
.tw-bg-\[\#001F3E\] { background-color: #0F172A !important; }
/* POS Express Checkout Cash Green -> Emerald */
.tw-bg-\[rgb\(40\,183\,123\)\] { background-color: #10B981 !important; }

/* Text Icons -> Semantic/Brand Colors */
.tw-text-\[\#009ce4\], .tw-text-\[\#009EE4\] { color: #3B82F6 !important; } /* Light Blues -> Info */
.tw-text-\[\#E7A500\] { color: #F59E0B !important; } /* Yellow -> Warning */
.tw-text-\[\#EF4B51\], .tw-text-\[\#EF4B53\], .tw-text-\[\#D61B60\] { color: #EF4444 !important; } /* Reds -> Error */
.tw-text-\[\#5E5CA8\] { color: #0F172A !important; } /* Purple -> Navy */
.tw-text-\[\#00935F\] { color: #10B981 !important; } /* Off-Green -> Emerald */
.tw-text-\[\#A5ADBB\] { color: #64748B !important; } /* Light Gray -> Slate */

.tw-text-indigo-700 { color: #0F172A !important; } /* Grand Total Text -> Navy */

/* ----- DaisyUI Primary Button Overrides (Indigo -> Emerald) ----- */
/* Base */
.tw-dw-btn.tw-dw-btn-primary, 
.tw-dw-btn-primary {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: #ffffff !important;
}

/* Hover */
.tw-dw-btn.tw-dw-btn-primary:hover,
.tw-dw-btn.tw-dw-btn-primary.tw-dw-btn-active,
.tw-dw-btn-primary:hover,
.tw-dw-btn-primary.tw-dw-btn-active {
    background-color: #059669 !important; /* Darker Emerald for hover */
    border-color: #059669 !important;
}

/* Focus */
.tw-dw-btn.tw-dw-btn-primary:focus-visible,
.tw-dw-btn-primary:focus-visible {
    outline-color: #10B981 !important;
}

/* Outline Variant */
.tw-dw-btn.tw-dw-btn-primary.tw-dw-btn-outline,
.tw-dw-btn-primary.tw-dw-btn-outline {
    background-color: transparent !important;
    border-color: #10B981 !important;
    color: #10B981 !important;
}
.tw-dw-btn.tw-dw-btn-primary.tw-dw-btn-outline:hover,
.tw-dw-btn-primary.tw-dw-btn-outline:hover {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
    color: #ffffff !important;
}

/* Target specific DaisyUI classes like Close Register */
button[type="submit"].tw-dw-btn-primary.tw-text-white {
    background-color: #10B981 !important;
    border-color: #10B981 !important;
}
