/* TIM-OE 2026-05-07 - targeted materials dark mode fix */

html.timoe-preload-dark,
html.timoe-preload-dark body {
  background: #06111f !important;
}

html.timoe-materials-preload-dark body,
html.timoe-materials-preload-dark #root,
html.timoe-materials-preload-dark main,
html.timoe-materials-preload-dark [data-timoe-main="vibiz"] {
  background: #06111f !important;
}

/* Prevent white flash on materials while module renders */
html.timoe-materials-preload-dark #timoe-material-stock-page,
html.timoe-materials-preload-dark #timoe-material-stock-react-host,
html.timoe-materials-preload-dark #timoe-material-stock-page .tms-wrap,
html.timoe-materials-preload-dark #timoe-material-stock-page .tms-page {
  background: linear-gradient(180deg, #071223 0%, #0b1426 46%, #111827 100%) !important;
  color: #e5edf8 !important;
}

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-wrap,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-page,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-wrap,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-page,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-wrap,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-page,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-wrap,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-page,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-wrap,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-page {
  background: linear-gradient(180deg, #071223 0%, #0b1426 46%, #111827 100%) !important;
  border-color: rgba(51,65,85,.72) !important;
  color: #e5edf8 !important;
  box-shadow: 0 12px 28px rgba(2,6,23,.24) !important;
}

/* Native-looking dark cards for materials only */
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-card,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-stat,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-wh-card,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-alert,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-alert-item,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-empty,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-banner,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-history-item,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-used-card,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-consumption-card,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-consumption-quickitem,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-consumption-note,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-card,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-stat,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-wh-card,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-alert,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-alert-item,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-empty,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-banner,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-history-item,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-used-card,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-consumption-card,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-consumption-quickitem,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-consumption-note,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-card,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-stat,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-wh-card,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-alert,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-alert-item,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-empty,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-banner,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-history-item,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-used-card,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-consumption-card,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-consumption-quickitem,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-consumption-note,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-card,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-stat,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-wh-card,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-alert,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-alert-item,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-empty,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-banner,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-history-item,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-used-card,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-consumption-card,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-consumption-quickitem,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-consumption-note,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-card,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-stat,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-wh-card,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-alert,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-alert-item,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-empty,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-banner,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-history-item,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-used-card,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-consumption-card,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-consumption-quickitem,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-consumption-note {
  background: linear-gradient(180deg, rgba(10,18,34,.98), rgba(15,23,42,.94)) !important;
  border-color: rgba(51,65,85,.74) !important;
  color: #e5edf8 !important;
  box-shadow: 0 14px 28px rgba(2,6,23,.18) !important;
}

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-card .tms-toolbar,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-card .tms-toolbar,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-card .tms-toolbar,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-card .tms-toolbar,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-card .tms-toolbar {
  border-bottom-color: rgba(51,65,85,.55) !important;
}

/* Text */
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-section-title,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-wh-card h4,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-history-title,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-namecell strong,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-used-card strong,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-worker-title,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-section-title,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-wh-card h4,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-history-title,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-namecell strong,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-used-card strong,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-worker-title,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-section-title,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-wh-card h4,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-history-title,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-namecell strong,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-used-card strong,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-worker-title,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-section-title,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-wh-card h4,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-history-title,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-namecell strong,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-used-card strong,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-worker-title,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-section-title,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-wh-card h4,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-history-title,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-namecell strong,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-used-card strong,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-worker-title {
  color: #f8fafc !important;
  text-shadow: none !important;
}

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-small,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-section-sub,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-namecell small,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-history-meta,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-history-note,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-help,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-stat-label,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-used-card small,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-small,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-section-sub,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-namecell small,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-history-meta,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-history-note,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-help,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-stat-label,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-used-card small,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-small,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-section-sub,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-namecell small,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-history-meta,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-history-note,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-help,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-stat-label,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-used-card small,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-small,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-section-sub,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-namecell small,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-history-meta,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-history-note,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-help,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-stat-label,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-used-card small,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-small,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-section-sub,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-namecell small,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-history-meta,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-history-note,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-help,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-stat-label,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-used-card small {
  color: #94a3b8 !important;
}

/* Inputs and buttons */
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-input,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-select,
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-textarea,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-input,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-select,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-textarea,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-input,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-select,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-textarea,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-input,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-select,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-textarea,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-input,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-select,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-textarea {
  background: rgba(15,23,42,.88) !important;
  border-color: rgba(71,85,105,.76) !important;
  color: #f8fafc !important;
}

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-btn.gray,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-btn.gray,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-btn.gray,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-btn.gray,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-btn.gray {
  background: linear-gradient(180deg, #1e293b, #0f172a) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(71,85,105,.82) !important;
  box-shadow: 0 10px 20px rgba(2,6,23,.20) !important;
}

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-zoom-tools,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-zoom-tools,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-zoom-tools,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-zoom-tools,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-zoom-tools {
  background: rgba(15,23,42,.92) !important;
  border-color: rgba(71,85,105,.72) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03) !important;
}

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-zoom-label,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-zoom-label,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-zoom-label,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-zoom-label,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-zoom-label { color:#cbd5e1 !important; }

html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-zoom-btn,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-zoom-btn,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-zoom-btn,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-zoom-btn,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-zoom-btn {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(71,85,105,.72) !important;
  box-shadow: 0 4px 12px rgba(2,6,23,.18) !important;
}

/* Pills and small status buttons */
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-pill,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-pill,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-pill,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-pill,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-pill {
  background: #172554 !important;
  color: #bfdbfe !important;
  border: 1px solid rgba(59,130,246,.28) !important;
}
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-pill.tms-low,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-pill.tms-low,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-pill.tms-low,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-pill.tms-low,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-pill.tms-low {
  background: #3f1015 !important;
  color: #fecaca !important;
  border-color: rgba(248,113,113,.30) !important;
}
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-pill.tms-good,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-pill.tms-good,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-pill.tms-good,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-pill.tms-good,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-pill.tms-good {
  background: #0f2f22 !important;
  color: #bbf7d0 !important;
  border-color: rgba(34,197,94,.26) !important;
}

/* Tables and stat cards */
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-table td,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-table td,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-table td,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-table td,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-table td {
  background: rgba(15,23,42,.92) !important;
  color: #e5edf8 !important;
}
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-table th,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-table th,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-table th,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-table th,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-table th {
  color: #94a3b8 !important;
}

/* Keep stat decorative circles subtle in dark */
html.dark body.timoe-vibiz-admin #timoe-material-stock-page .tms-stat:before,
body.timoe-vibiz-admin.theme-dark #timoe-material-stock-page .tms-stat:before,
body.timoe-vibiz-admin.dark #timoe-material-stock-page .tms-stat:before,
body.timoe-vibiz-admin:has(.theme-dark) #timoe-material-stock-page .tms-stat:before,
body.timoe-vibiz-admin:has(.dark) #timoe-material-stock-page .tms-stat:before {
  background: rgba(148,163,184,.08) !important;
}
