/* =====================================================
   Hub Tech — global overrides (all hosts / pages)
   ===================================================== */

html, body {
  background-color: #070B14 !important;
  color: #F1F5F9 !important;
}

/* Common light utilities → dark */
.bg-white { background-color: rgba(30, 41, 59, 0.92) !important; color: #F1F5F9 !important; }
.bg-\[\#F7F6F8\],
.bg-\[\#F9F8FA\],
.bg-\[\#EFEEF2\],
.bg-gray-50,
.bg-gray-100 {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
}
.bg-\[\#1A1A1F\] { background-color: #020617 !important; color: #F8FAFC !important; }
.bg-\[\#EED5D5\], .bg-\[\#D4A5A5\] {
  background-color: rgba(14, 165, 233, 0.18) !important;
  color: #E0F2FE !important;
}

.text-\[\#1A1A1F\], .text-gray-900, .text-gray-800 { color: #F1F5F9 !important; }
.text-\[\#6E6A75\], .text-gray-500, .text-gray-600, .text-gray-400 { color: #94A3B8 !important; }
.text-\[\#D4A5A5\], .text-\[\#9E6B6B\] { color: #38BDF8 !important; }
.text-\[\#e8d9cc\] { color: rgba(56, 189, 248, 0.45) !important; }

.border-\[\#E4E2E8\], .border-gray-200, .border-gray-100 {
  border-color: rgba(148, 163, 184, 0.22) !important;
}
.border-\[\#1A1A1F\] { border-color: rgba(56, 189, 248, 0.45) !important; }
.border-\[\#D4A5A5\] { border-color: #38BDF8 !important; }

.text-red-600, .text-red-500 { color: #FCA5A5 !important; }
.text-green-600, .text-green-500 { color: #6EE7B7 !important; }

.hover\:bg-gray-50:hover,
.hover\:bg-gray-100:hover,
.hover\:bg-\[\#F7F6F8\]:hover {
  background-color: rgba(51, 65, 85, 0.65) !important;
}

input.bg-white, textarea.bg-white, select.bg-white,
.bg-white input, .bg-white textarea, .bg-white select,
input.form-input, textarea.form-input, select.form-input {
  background-color: rgba(2, 6, 23, 0.65) !important;
  color: #F8FAFC !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

.fixed.inset-0.bg-black\/50,
.fixed.inset-0.bg-black\/40 {
  backdrop-filter: blur(6px);
}

button.bg-\[\#1A1A1F\],
.bg-\[\#1A1A1F\].text-white {
  background: linear-gradient(135deg, #0EA5E9 0%, #6366F1 100%) !important;
  border-color: transparent !important;
}

/* Tabs (admin / modals) */
.loc-tab, .user-tab, .prod-tab, .hub-tab {
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.15s ease !important;
}
.loc-tab:hover, .user-tab:hover, .prod-tab:hover, .hub-tab:hover {
  color: #E0F2FE !important;
  background: rgba(51, 65, 85, 0.35) !important;
}
.loc-tab.active, .user-tab.active, .prod-tab.active, .hub-tab.active {
  color: #7DD3FC !important;
  border-bottom-color: #38BDF8 !important;
  background: rgba(14, 165, 233, 0.08) !important;
}
.loc-tab i, .user-tab i, .prod-tab i, .hub-tab i {
  margin-right: 0.4rem;
  opacity: 0.9;
}

/* Section titles using blush accent */
.text-\[\#D4A5A5\].uppercase,
h4.text-\[\#D4A5A5\] {
  color: #38BDF8 !important;
}

/* Accent checkboxes */
.accent-\[\#D4A5A5\] { accent-color: #0EA5E9 !important; }

/* Modal chrome */
[class*="modal-shell-header"] { background: #020617 !important; color: #F8FAFC !important; }
[class*="modal-shell-toolbar"], [class*="modal-shell-footer"] {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

/* Sticky headers that stayed white */
header.dash-header,
header.sticky,
.sticky.top-0 {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #F1F5F9 !important;
}

/* Fun motion helpers */
@keyframes hub-pop {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); }
  70% { transform: scale(1.02) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes hub-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hub-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
}
@keyframes hub-tab-ink {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.hub-pop { animation: hub-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hub-slide-up { animation: hub-slide-up 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hub-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.hub-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.hub-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.hub-stagger > *:nth-child(4) { animation-delay: 0.16s; }
.hub-stagger > *:nth-child(5) { animation-delay: 0.2s; }
.hub-stagger > *:nth-child(6) { animation-delay: 0.24s; }
.hub-stagger > *:nth-child(7) { animation-delay: 0.28s; }
.hub-stagger > *:nth-child(8) { animation-delay: 0.32s; }
.hub-stagger > *:nth-child(9) { animation-delay: 0.36s; }
.hub-stagger > * { animation: hub-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1); opacity: 1 !important; }

.module-card.active .mod-icon,
.filter-chip.active {
  animation: hub-glow-pulse 1.8s ease-in-out infinite;
}

button, .btn, .module-card, .filter-chip, .loc-tab, .user-tab, .prod-tab {
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.15s ease, filter 0.15s ease !important;
}


/* ===== Modals / dialogs — no bright panels ===== */
.modal-shell,
.modal-shell-lg,
.modal-shell-sm,
[id$="-modal"] > div,
[id$="-modal"] > .bg-white,
.fixed.inset-0 > .bg-white,
.fixed.inset-0 > div.bg-white {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

[id$="-modal"] .p-5,
[id$="-modal"] .p-4,
[id$="-modal"] .p-6,
[id$="-modal"] .overflow-y-auto,
[id$="-modal"] .flex-1 {
  background-color: transparent !important;
  color: #F1F5F9 !important;
}

[id$="-modal"] .border-b,
[id$="-modal"] .border-t {
  border-color: rgba(148, 163, 184, 0.22) !important;
}

[id$="-modal"] h3,
[id$="-modal"] h4,
[id$="-modal"] label,
[id$="-modal"] .form-label {
  color: #94A3B8 !important;
}
[id$="-modal"] h3 {
  color: #F8FAFC !important;
}
[id$="-modal"] h4.text-\[\#D4A5A5\],
[id$="-modal"] .text-\[\#D4A5A5\] {
  color: #38BDF8 !important;
}

/* Admin chrome */
header.bg-white,
header.h-16 {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #F1F5F9 !important;
}
body.bg-\[\#F7F6F8\],
.bg-\[\#F7F6F8\] {
  background-color: #070B14 !important;
}
.loc-row:hover {
  background: rgba(51, 65, 85, 0.45) !important;
}

/* =====================================================
   Tables — no white headers; bright purple theme
   ===================================================== */
table,
table.sortable-table,
.card table,
.overflow-x-auto table,
[class*="table"] {
  border-color: rgba(192, 132, 252, 0.28) !important;
  background: transparent !important;
  color: #F5E1FF !important;
}

/* Header: deep violet, bright purple labels */
thead,
table thead,
table.sortable-table thead,
thead tr,
thead th,
table thead th,
.sortable-table thead th {
  background: linear-gradient(180deg, #4C1D95 0%, #5B21B6 55%, #6D28D9 100%) !important;
  color: #F3E8FF !important;
  border-color: rgba(216, 180, 254, 0.35) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

thead th:hover,
table.sortable-table thead th:not(.no-sort):hover {
  color: #FFFFFF !important;
  background: linear-gradient(180deg, #6D28D9 0%, #7C3AED 100%) !important;
}

table.sortable-table thead th.sort-asc,
table.sortable-table thead th.sort-desc {
  color: #E9D5FF !important;
}

/* Body rows: purple-tinted dark + bright hover */
tbody,
table tbody {
  background: transparent !important;
}

tbody tr,
table tbody tr,
.loc-row,
.user-row,
.list-row {
  background: rgba(76, 29, 149, 0.22) !important;
  color: #F5E1FF !important;
  border-color: rgba(167, 139, 250, 0.22) !important;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
  background: rgba(91, 33, 182, 0.32) !important;
}

tbody tr:hover,
table tbody tr:hover,
.loc-row:hover,
.user-row:hover,
.list-row:hover {
  background: rgba(139, 92, 246, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(216, 180, 254, 0.35);
}

tbody td,
table tbody td {
  color: #F5E1FF !important;
  border-color: rgba(167, 139, 250, 0.18) !important;
}

tbody td .text-gray-500,
tbody td .text-gray-400,
tbody td .text-xs {
  color: #D8B4FE !important;
}

/* Rounded table shells that stayed white */
.overflow-hidden.rounded-xl,
.overflow-hidden.rounded-2xl,
.overflow-hidden.rounded-lg {
  background: rgba(46, 16, 101, 0.55) !important;
  border: 1px solid rgba(167, 139, 250, 0.28) !important;
}

/* Keep refund / alert rows readable but on purple base */
tr.inv-below-min td {
  background-color: rgba(127, 29, 29, 0.55) !important;
  color: #FECACA !important;
}
tr.row-refund td,
tr.refund-row td {
  background-color: rgba(127, 29, 29, 0.4) !important;
}

/* Mobile card-style tables */
@media (max-width: 767px) {
  .responsive-data-table tbody tr {
    background: rgba(76, 29, 149, 0.35) !important;
    border-color: rgba(167, 139, 250, 0.3) !important;
  }
  .responsive-data-table tbody td::before {
    color: #C4B5FD !important;
  }
}


/* Force purple headers — beat sticky #F7F6F8 !important from pos.css */
html body table thead,
html body table thead tr,
html body thead.bg-\[\#F7F6F8\],
html body thead[class*="bg-"],
html body .overflow-x-auto > table thead,
html body .overflow-y-auto > table thead,
html body .table-sticky-head {
  background: linear-gradient(180deg, #4C1D95 0%, #6D28D9 100%) !important;
  color: #F3E8FF !important;
  border-color: rgba(196, 181, 253, 0.35) !important;
}

html body table thead th,
html body table thead td,
html body .overflow-x-auto > table thead th,
html body .overflow-y-auto > table thead th,
html body .modal-shell-body > table thead th,
html body .modal-shell thead th,
html body #admin-content thead th,
html body .admin-main thead th,
html body .responsive-data-table thead th,
html body thead.bg-\[\#F7F6F8\] th,
html body thead[class*="bg-"] th {
  background: linear-gradient(180deg, #4C1D95 0%, #6D28D9 100%) !important;
  color: #F3E8FF !important;
  border-color: rgba(196, 181, 253, 0.35) !important;
  box-shadow: 0 1px 0 rgba(196, 181, 253, 0.35) !important;
}

html body table thead th *,
html body thead th span,
html body thead th button {
  color: #F3E8FF !important;
}

/* =====================================================
   Icons — purple color scheme (global)
   Semantic status colors kept for success / danger / warn
   ===================================================== */

/* Default: all Font Awesome + inline SVG icons */
i.fas,
i.far,
i.fal,
i.fab,
i.fa,
i[class*="fa-"],
.btn i,
button i,
a i,
.module-card i,
.mod-icon i,
.sub-item i,
.loc-tab i,
.user-tab i,
.prod-tab i,
.filter-chip i,
.tools-btn i,
.icon-btn i,
.nav-icon i,
header i,
.card i,
label i,
.form-label i,
.product-tile i,
.empty-state i,
.sil-empty i,
.toast i,
[class*="icon"] i {
  color: #C084FC !important; /* bright purple */
}

/* Stronger on primary interactive surfaces */
.btn-primary i,
.btn.btn-primary i,
button.btn-primary i {
  color: #F3E8FF !important;
}

/* Module icon wells */
.mod-icon,
.module-card .mod-icon {
  color: #E9D5FF !important;
  background: rgba(109, 40, 217, 0.28) !important;
  border-color: rgba(192, 132, 252, 0.35) !important;
}
.mod-icon i,
.module-card .mod-icon i {
  color: #E9D5FF !important;
}

/* Active / selected tabs */
.loc-tab.active i,
.user-tab.active i,
.prod-tab.active i,
.sub-item.active i,
.filter-chip.active i {
  color: #F5D0FE !important;
}

/* Hover lift */
.btn:hover i,
button:hover i,
.module-card:hover .mod-icon i,
.sub-item:hover i {
  color: #F3E8FF !important;
}

/* ----- Semantic exceptions (do not force purple) ----- */
.text-green-500,
.text-green-600,
.text-emerald-400,
.text-emerald-500,
.btn-success i,
.btn.btn-success i,
.text-green-500 i,
.text-green-600 i,
.text-emerald-400 i,
.text-emerald-500 i,
.fa-check.text-green-500,
.fa-check.text-green-600,
td .text-green-500,
td .fa-check {
  color: #34D399 !important;
}

.text-red-500,
.text-red-600,
.text-rose-400,
.text-rose-500,
.btn-danger i,
.btn.btn-danger i,
button.text-red-500 i,
button.text-red-600 i,
.text-red-500 i,
.text-red-600 i,
.fa-trash,
.fa-trash-can,
.fa-xmark.text-red-500,
.fa-times.text-red-500 {
  color: #F87171 !important;
}

/* Delete outline buttons often use rose border — keep icon readable red */
button.border-rose-300 i,
button.border-red-300 i,
.btn-outline.text-red-500 i,
.btn-outline.text-rose-500 i {
  color: #FB7185 !important;
}

.text-amber-400,
.text-amber-500,
.text-yellow-400,
.text-yellow-500,
.text-amber-400 i,
.text-amber-500 i,
.text-yellow-400 i,
.text-yellow-500 i,
.fa-triangle-exclamation,
.fa-exclamation {
  color: #FBBF24 !important;
}

/* Sync / live sky accents optional → shift to soft violet-blue so still on-scheme */
.sync-live,
.text-sky-400,
.text-sky-300,
.text-info {
  color: #D8B4FE !important;
}
.sync-live i,
.text-sky-400 i,
.text-sky-300 i {
  color: #E9D5FF !important;
}

/* Toast icons: keep type color (motion.js sets inline — reinforce) */
.sil-toast.ok i { color: #34D399 !important; }
.sil-toast.err i { color: #F87171 !important; }
.sil-toast.warn i { color: #FBBF24 !important; }
