/* Final cleanup loaded after every module stylesheet.
   Keeps the ERP light, white, blue-accented, and removes the pink wash. */
:root,
html,
body {
  --primary: #2563eb !important;
  --primary-2: #1d4ed8 !important;
  --maisha-pink: #2563eb !important;
  --maisha-hot: #2563eb !important;
  --maisha-blue: #2563eb !important;
  --bg: #f8fafc !important;
  --surface: #ffffff !important;
  --surface-2: #f8fafc !important;
  --surface-solid: #ffffff !important;
  --ink: #0f172a !important;
  --muted: #64748b !important;
  --line: #dbe4f0 !important;
  color-scheme: light !important;
}

html,
html.theme-light,
body,
body.app-body,
body.grid-sheen,
body.light-mode {
  background: #f8fafc !important;
  background-image: none !important;
  color: #0f172a !important;
}

[data-theme-toggle] {
  display: none !important;
}

body::before,
body::after,
.app-body::before,
.app-body::after,
.grid-sheen::before,
.grid-sheen::after,
.absolute.inset-0,
.bg-grid,
.landing-glow,
.orb,
.gradient-orb {
  display: none !important;
  content: none !important;
  background: transparent !important;
  background-image: none !important;
}

.brand-word {
  background: linear-gradient(90deg, #e11d8f, #155dfc) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

.brand-logo img,
.profile-avatar,
.company-avatar {
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18) !important;
}

.app-main,
.app-content,
main,
.page-shell,
.content-shell,
.public-main {
  background: #f8fafc !important;
  background-image: none !important;
}

.sidebar,
[data-sidebar],
.sidebar-brand,
.sidebar-footer,
.topbar,
header {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #dbe4f0 !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.card,
.glass,
.dashboard-hero,
.dash-kpi,
.dash-mini,
.dash-module-pill,
.module-tile,
.stat-card,
.metric-card,
.kpi-card,
.table-wrap,
.panel,
.box,
.alert,
.tabs,
.tab-list,
.quick-action-grid a,
.quick-action-grid button,
.company-switcher-btn,
.top-search input,
.search-box input,
article,
aside,
section[class*="card"],
div[class*="card"],
form[class*="card"],
fieldset,
details,
.auth-card,
.pricing-card,
.module-card,
.feature-card,
.maisha-analytics-card {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #dbe4f0 !important;
  color: #0f172a !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045) !important;
}

.dashboard-hero,
.hero,
.crm-hero,
.service-hero,
.manufacturing-hero,
.pos-hero,
.inventory-hero {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #dbe4f0 !important;
  color: #0f172a !important;
}

.dashboard-hero *,
.hero *,
.crm-hero *,
.service-hero *,
.manufacturing-hero *,
.pos-hero *,
.inventory-hero *,
.card *,
.glass *,
.table-wrap * {
  color: inherit;
}

.dashboard-hero .btn-primary,
.hero .btn-primary,
.crm-hero .btn-primary,
.service-hero .btn-primary,
.manufacturing-hero .btn-primary,
.pos-hero .btn-primary,
.inventory-hero .btn-primary {
  color: #ffffff !important;
}

.sidebar-link,
.nav-link,
.tab-button,
.tab,
.page-tab,
.btn,
button,
input,
select,
textarea {
  border-color: #dbe4f0 !important;
}

.sidebar-link.active,
.sidebar-link:hover,
.nav-link.active,
.tab-button.active,
.tab.active,
.page-tab.active,
.page-button.active {
  background: #eff6ff !important;
  background-image: none !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  box-shadow: none !important;
}

.btn,
button,
a.btn,
input[type="submit"],
input[type="button"] {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #dbe4f0 !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.btn-primary,
button[type="submit"],
a.btn-primary,
input[type="submit"],
.button-primary,
.primary-action {
  background: #2563eb !important;
  background-image: none !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18) !important;
}

.btn-primary:hover,
button[type="submit"]:hover,
a.btn-primary:hover,
input[type="submit"]:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.btn-secondary,
.btn-ghost,
.icon-btn {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #dbe4f0 !important;
  color: #0f172a !important;
}

.badge,
.badge-primary,
.pill,
.chip,
[class*="badge"],
[class*="pill"] {
  background: #eff6ff !important;
  background-image: none !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}

table,
thead,
tbody,
tr,
td,
th,
.table,
.table th,
.table td {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #dbe4f0 !important;
  color: #0f172a !important;
}

thead th,
.table th {
  background: #f8fafc !important;
  color: #0f172a !important;
}

input,
select,
textarea,
.form-control,
.form-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
}

[class*="pink"],
[class*="rose"],
[class*="fuchsia"],
[class*="violet"],
[class*="purple"],
[class*="border-pink"],
[class*="ring-pink"],
[class*="divide-pink"],
[style*="225,29,143"],
[style*="255,79,179"],
[style*="236,72,153"],
[style*="244,114,182"],
[style*="f9a8d4"],
[style*="ff4fb3"],
[style*="e11d8f"] {
  border-color: #dbe4f0 !important;
  box-shadow: none !important;
}

[class*="bg-pink"],
[class*="from-pink"],
[class*="via-pink"],
[class*="to-pink"],
[class*="bg-rose"],
[class*="from-rose"],
[class*="to-rose"],
[class*="bg-fuchsia"],
[class*="from-fuchsia"],
[class*="to-fuchsia"],
[class*="bg-violet"],
[class*="from-violet"],
[class*="via-violet"],
[class*="to-violet"],
[class*="bg-purple"],
[class*="from-purple"],
[class*="via-purple"],
[class*="to-purple"] {
  background: #ffffff !important;
  background-image: none !important;
}

[class*="text-pink"],
[class*="text-rose"],
[class*="text-fuchsia"],
[class*="text-violet"],
[class*="text-purple"],
.hover\:text-pink-400:hover {
  color: #2563eb !important;
}

body.grid-sheen .landing-hero-accent,
body.grid-sheen .text-transparent.bg-clip-text {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: #0f172a !important;
  color: #0f172a !important;
}

.auth-title {
  font-size: clamp(2.1rem, 7vw, 3.3rem) !important;
  line-height: .96 !important;
}

.auth-title .brand-word {
  display: inline-block;
  font-size: .86em !important;
}

body.grid-sheen .maisha-analytics-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body.grid-sheen .maisha-analytics-card {
  min-height: 92px !important;
  padding: 14px !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

body.grid-sheen .maisha-analytics-card::before {
  display: none !important;
}

body.grid-sheen .maisha-analytics-card strong {
  position: relative !important;
  z-index: 2 !important;
  color: #0f172a !important;
  font-size: .84rem !important;
  line-height: 1.1 !important;
}

body.grid-sheen .maisha-analytics-card small {
  display: none !important;
}

body.grid-sheen .maisha-analytics-bars {
  position: absolute !important;
  left: 14px !important;
  right: 14px !important;
  bottom: 12px !important;
  height: 34px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 5px !important;
  z-index: 1 !important;
}

body.grid-sheen .maisha-analytics-bars i {
  display: block !important;
  flex: 1 1 0 !important;
  height: 100% !important;
  min-height: 8px !important;
  border-radius: 8px 8px 2px 2px !important;
  background: linear-gradient(180deg, #38bdf8, #2563eb) !important;
  transform-origin: bottom center !important;
  -webkit-transform-origin: bottom center !important;
  animation: maishaFinalBars 1.05s ease-in-out infinite !important;
  -webkit-animation: maishaFinalBars 1.05s ease-in-out infinite !important;
}

body.grid-sheen .maisha-analytics-bars i:nth-child(2) { animation-delay: .12s !important; -webkit-animation-delay: .12s !important; }
body.grid-sheen .maisha-analytics-bars i:nth-child(3) { animation-delay: .24s !important; -webkit-animation-delay: .24s !important; }
body.grid-sheen .maisha-analytics-bars i:nth-child(4) { animation-delay: .36s !important; -webkit-animation-delay: .36s !important; }
body.grid-sheen .maisha-analytics-bars i:nth-child(5) { animation-delay: .48s !important; -webkit-animation-delay: .48s !important; }
body.grid-sheen .maisha-analytics-bars i:nth-child(6) { animation-delay: .6s !important; -webkit-animation-delay: .6s !important; }

body.grid-sheen .maisha-flow {
  position: absolute !important;
  left: 14px !important;
  right: 14px !important;
  bottom: 14px !important;
  display: grid !important;
  gap: 6px !important;
  z-index: 1 !important;
}

body.grid-sheen .maisha-flow span {
  display: block !important;
  height: 7px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #2563eb) !important;
  background-size: 240% 100% !important;
  animation: maishaFinalFlow 1.15s linear infinite !important;
  -webkit-animation: maishaFinalFlow 1.15s linear infinite !important;
}

body.grid-sheen .maisha-flow span:nth-child(2) { animation-delay: .18s !important; -webkit-animation-delay: .18s !important; }
body.grid-sheen .maisha-flow span:nth-child(3) { animation-delay: .36s !important; -webkit-animation-delay: .36s !important; }

@keyframes maishaFinalBars {
  0%, 100% { transform: scaleY(.28); -webkit-transform: scaleY(.28); }
  50% { transform: scaleY(1); -webkit-transform: scaleY(1); }
}

@-webkit-keyframes maishaFinalBars {
  0%, 100% { -webkit-transform: scaleY(.28); }
  50% { -webkit-transform: scaleY(1); }
}

@keyframes maishaFinalFlow {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@-webkit-keyframes maishaFinalFlow {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.grid-sheen .maisha-analytics-bars i {
    animation: maishaFinalBars 1.05s ease-in-out infinite !important;
    -webkit-animation: maishaFinalBars 1.05s ease-in-out infinite !important;
  }

  body.grid-sheen .maisha-flow span {
    animation: maishaFinalFlow 1.15s linear infinite !important;
    -webkit-animation: maishaFinalFlow 1.15s linear infinite !important;
  }
}

@media (max-width: 640px) {
  body.grid-sheen .maisha-analytics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.grid-sheen .maisha-analytics-card {
    min-height: 86px !important;
    padding: 12px !important;
  }

  body.grid-sheen .maisha-analytics-card strong {
    font-size: .72rem !important;
  }

  body.grid-sheen .maisha-analytics-bars {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    height: 30px !important;
    gap: 4px !important;
  }

  body.grid-sheen .maisha-flow {
    left: 10px !important;
    right: 10px !important;
    bottom: 12px !important;
    gap: 5px !important;
  }
}
