/* =====================================================
   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;
}

.sil-dial-btn,
button.sil-dial-btn.form-input {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #64748b !important;
  opacity: 1 !important;
  height: 2.85rem;
  min-height: 2.85rem;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.sil-dial-menu {
  background-color: #0f172a !important;
  border: 1px solid #64748b !important;
  color: #f8fafc !important;
  z-index: 80;
}
.sil-dial-opt {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}
.sil-dial-opt:hover {
  background-color: #1e3a5f !important;
  color: #ffffff !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%, #0284C7 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; blue theme
   ===================================================== */
table,
table.sortable-table,
.card table,
.overflow-x-auto table,
[class*="table"] {
  border-color: rgba(56, 189, 248, 0.28) !important;
  background: transparent !important;
  color: #F8FAFC !important;
}

/* Header: deep sky, bright blue labels */
thead,
table thead,
table.sortable-table thead,
thead tr,
thead th,
table thead th,
.sortable-table thead th {
  background: linear-gradient(180deg, #0C4A6E 0%, #075985 55%, #0369A1 100%) !important;
  color: #F0F9FF !important;
  border-color: rgba(186, 230, 253, 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, #0369A1 0%, #0284C7 100%) !important;
}

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

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

tbody tr,
table tbody tr,
.loc-row,
.user-row,
.list-row {
  background: rgba(12, 74, 110, 0.22) !important;
  color: #F8FAFC !important;
  border-color: rgba(56, 189, 248, 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(7, 89, 133, 0.32) !important;
}

tbody tr:hover,
table tbody tr:hover,
.loc-row:hover,
.user-row:hover,
.list-row:hover {
  background: rgba(14, 165, 233, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.35);
}

tbody td,
table tbody td {
  color: #F8FAFC !important;
  border-color: rgba(56, 189, 248, 0.18) !important;
}

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

/* Rounded table shells that stayed white */
.overflow-hidden.rounded-xl,
.overflow-hidden.rounded-2xl,
.overflow-hidden.rounded-lg {
  background: rgba(8, 47, 73, 0.55) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
}

/* Keep refund / alert rows readable but on blue 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(12, 74, 110, 0.35) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
  }
  .responsive-data-table tbody td::before {
    color: #BAE6FD !important;
  }
}


/* Force blue 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, #0C4A6E 0%, #0369A1 100%) !important;
  color: #F0F9FF !important;
  border-color: rgba(186, 230, 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, #0C4A6E 0%, #0369A1 100%) !important;
  color: #F0F9FF !important;
  border-color: rgba(186, 230, 253, 0.35) !important;
  box-shadow: 0 1px 0 rgba(186, 230, 253, 0.35) !important;
}

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

/* =====================================================
   Icons — blue 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: #7DD3FC !important; /* sky blue */
}

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

/* Module icon wells */
.mod-icon,
.module-card .mod-icon {
  color: #E0F2FE !important;
  background: rgba(3, 105, 161, 0.28) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}
.mod-icon i,
.module-card .mod-icon i {
  color: #E0F2FE !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: #E0F2FE !important;
}

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

/* ----- Semantic exceptions (do not force blue) ----- */
.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 sky blue */
.sync-live,
.text-sky-400,
.text-sky-300,
.text-info {
  color: #7DD3FC !important;
}
.sync-live i,
.text-sky-400 i,
.text-sky-300 i {
  color: #E0F2FE !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; }


/* Date input calendar icon — visible on dark hub UI */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  filter: invert(58%) sepia(70%) saturate(2400%) hue-rotate(170deg) brightness(1.15) contrast(1.05);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(70%) sepia(50%) saturate(2000%) hue-rotate(165deg) brightness(1.15);
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
  color-scheme: dark;
}


/* CRM search results — names always light on dark blue rows */
#crm-results .crm-search-table tbody td,
#crm-results .crm-search-table tbody td * {
  color: #F8FAFC !important;
}
#crm-results .crm-search-table tbody tr:hover td,
#crm-results .crm-search-table tbody tr:hover td * {
  color: #FFFFFF !important;
}


/* Glass KPI bridge (works with motion.css) */
.kpi-panel.sil-glass-kpi { color: #F1F5F9; }


/* Booking / admin native select — single chevron */
select.form-input, select.bk-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237DD3FC' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 8px;
  padding-right: 2rem;
}
select.form-input::-ms-expand, select.bk-select::-ms-expand { display: none; }


/* App switcher (S logo) */
.sil-switcher { position: relative; display: inline-flex; align-items: center; }
.sil-switcher-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; padding: 0; border: 0; background: transparent;
  border-radius: 0.75rem; cursor: pointer;
}
.sil-switcher-btn img { width: 2.25rem; height: 2.25rem; border-radius: 0.7rem; display: block; }
.sil-switcher-btn:hover { background: rgba(14,165,233,.12); }
.sil-switcher { position: relative; display: inline-flex; align-items: center; z-index: 50; }
#sil-app-switcher { position: relative; flex: 0 0 auto; width: auto; }
.sil-switcher-menu.hidden { display: none !important; }
.sil-switcher-menu.sil-open { display: block !important; }
.sil-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  z-index: 80;
  min-width: 13rem;
  padding: .4rem;
  background: #0f172a; border: 1px solid rgba(148,163,184,.28);
  border-radius: 0.9rem; box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.sil-switcher-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .7rem; border-radius: .6rem;
  color: #E2E8F0; text-decoration: none; font-size: .9rem;
}
.sil-switcher-item i { width: 1.1rem; text-align: center; color: #7DD3FC; }
.sil-switcher-item:hover { background: rgba(14,165,233,.16); color: #fff; }

.sil-switcher-item.sil-switcher-logout {
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(148,163,184,.22);
  margin-top: .25rem;
  border-radius: .6rem;
  cursor: pointer;
  color: #FCA5A5;
}
.sil-switcher-item.sil-switcher-logout i { color: #FCA5A5; }
.sil-switcher-item.sil-switcher-logout:hover { background: rgba(244,63,94,.16); color: #fff; }
