/* Beit Bid — Standard theme (teal #1E6367 · mustard #D4A045).
   Single product chrome. Loaded last so it wins over ui_themes.css. */

:root {
  --std-bg: #f2f4f7;
  --std-surface: #ffffff;
  --std-ink: #2d3748;
  --std-muted: #4a5568;
  --std-line: #e2e8f0;
  --std-primary: #1e6367;
  --std-primary-hover: #174f52;
  --std-primary-soft: #e6f2f2;
  --std-mustard: #d4a045;
  --std-mustard-ink: #1a1a1a;
  --std-mustard-soft: #f8efd9;
  --std-steel: #8d9aaa;
  --std-danger: #e74c3c;
  --std-danger-soft: #fde8e6;
  --std-shadow: 0 4px 18px rgba(45, 55, 72, 0.08);
  --std-shadow-sm: 0 1px 3px rgba(45, 55, 72, 0.06);
  --std-radius: 8px;
  --std-radius-lg: 16px;
}

html.dark,
html[data-dark="true"] {
  --std-bg: #121212;
  --std-surface: #1e1e1e;
  --std-ink: #eef2f6;
  --std-muted: #cbd5e0;
  --std-line: #2c2c2c;
  --std-primary-soft: #163032;
  --std-mustard-soft: #3a2e14;
  --std-danger-soft: #3a1c18;
  --std-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --std-shadow-sm: none;
}

/* Chevron mark when no uploaded logo */
.logo-chevrons {
  width: 22px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}
.logo-chevrons span {
  display: block;
  height: 6px;
  background: var(--std-primary);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.logo-chevrons span:last-child { background: var(--std-mustard); }
.logo-chevrons.lg { width: 36px; height: 32px; }
.logo-chevrons.lg span { height: 10px; }

/* Shell canvas */
body {
  color: var(--std-ink);
  background: var(--std-bg) !important;
}
main.tenant-page-surface,
.relative.flex.flex-1.flex-col {
  background: var(--std-bg) !important;
}
html.dark main.tenant-page-surface {
  background: var(--std-bg) !important;
}

/* Light sidebar */
aside.sidebar,
html.dark aside.sidebar {
  background: var(--std-surface) !important;
  border-right: 1px solid var(--std-line) !important;
  color: var(--std-ink);
}
aside.sidebar.tenant-nav-themed a.menu-item,
aside.sidebar.tenant-nav-themed .menu-item,
aside.sidebar.tenant-nav-themed button.menu-item {
  color: var(--std-ink) !important;
}
aside.sidebar.tenant-nav-themed a.menu-item:hover,
aside.sidebar.tenant-nav-themed .menu-item:hover {
  color: var(--std-ink) !important;
  background-color: var(--std-bg) !important;
}
aside.sidebar.tenant-nav-themed a.menu-item.sidebar-active-item,
aside.sidebar.tenant-nav-themed .menu-item.sidebar-active-item {
  color: var(--std-primary) !important;
  background-color: var(--std-primary-soft) !important;
  box-shadow: inset 3px 0 0 var(--std-primary);
  font-weight: 600;
}
.sidebar-active-item i { color: var(--std-primary) !important; }
.nav-section-label { color: var(--std-muted) !important; }
.sidebar nav .pl-9 a,
html.dark .sidebar nav .pl-9 a {
  color: var(--std-muted) !important;
}
.sidebar nav .pl-9 a:hover,
html.dark .sidebar nav .pl-9 a:hover {
  color: var(--std-ink) !important;
  background: var(--std-bg) !important;
}
.sidebar nav .pl-9 a[class*="text-emerald-400"],
html.dark .sidebar nav .pl-9 a[class*="text-emerald-400"] {
  color: var(--std-primary) !important;
  background: var(--std-primary-soft) !important;
}
.sidebar-logo-mark:not(.sidebar-logo-mark--image) {
  background: transparent !important;
  box-shadow: none !important;
}
.brand-name-std { color: var(--std-ink) !important; font-weight: 700; }
aside.sidebar .text-white { color: var(--std-ink) !important; }
.nav-item.is-danger,
aside a[href*="logout"] { color: var(--std-danger) !important; }

/* Topbar */
header#header.tenant-header-surface,
html.dark header#header.tenant-header-surface {
  background: var(--std-surface) !important;
  border-bottom: 1px solid var(--std-line) !important;
  backdrop-filter: none;
}
.topbar-green-line { display: none !important; }
.topbar-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--std-ink) !important;
}
.topbar-action-btn:hover { background: var(--std-bg) !important; }
.topbar-search-wrap input,
.topbar-search-wrap {
  border-radius: 999px !important;
  background: var(--std-bg) !important;
  border-color: var(--std-line) !important;
}
.std-top-nav { display: none; }
@media (min-width: 1100px) {
  .std-top-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
  }
  .std-top-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--std-muted);
    font-weight: 500;
    font-size: 14px;
  }
  .std-top-nav a:hover { color: var(--std-ink); background: var(--std-bg); }
  .std-top-nav a.is-active { color: var(--std-primary); font-weight: 700; }
}
.profile-avatar,
.profile-chip .profile-avatar {
  background: var(--std-primary) !important;
  color: #fff !important;
  border-radius: 50% !important;
}

/* Command palette — charcoal scrim + dark ink on white (WCAG-friendly) */
#beit-bid-palette .beit-bid-palette-scrim {
  background: rgba(26, 32, 44, 0.78) !important;
  backdrop-filter: blur(2px);
}
#beit-bid-palette .beit-bid-palette-card,
html.dark #beit-bid-palette .beit-bid-palette-card {
  background: #ffffff !important;
  color: #2d3748 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 24px 64px rgba(26, 32, 44, 0.45) !important;
}
#beit-bid-palette .beit-bid-palette-head {
  border-bottom: 1px solid #e2e8f0;
}
#beit-bid-palette #beit-bid-palette-input,
html.dark #beit-bid-palette #beit-bid-palette-input {
  background: #ffffff !important;
  color: #2d3748 !important;
  border: 0 !important;
  box-shadow: none !important;
  min-height: 0;
  padding: 0 !important;
}
#beit-bid-palette #beit-bid-palette-input::placeholder {
  color: #4a5568 !important;
  opacity: 1;
}
#beit-bid-palette .beit-bid-palette-muted,
#beit-bid-palette .beit-bid-palette-empty,
#beit-bid-palette .palette-item-icon {
  color: #4a5568 !important;
}
#beit-bid-palette .beit-bid-palette-kbd {
  font-size: 10px;
  font-weight: 600;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  background: #f2f4f7;
}
#beit-bid-palette .palette-item {
  color: #2d3748;
  text-decoration: none;
}
#beit-bid-palette .palette-item-label {
  color: #2d3748 !important;
}
#beit-bid-palette .palette-item-hit {
  color: #1e6367 !important;
  font-weight: 700;
}
#beit-bid-palette .palette-item.is-active,
#beit-bid-palette .palette-item:hover {
  background: #e6f2f2 !important;
  color: #2d3748 !important;
}

/* Buttons — solid teal, 8px, no gradients */
.beit-bid-submit-btn,
button.beit-bid-submit-btn,
a.beit-bid-submit-btn,
.tenant-btn-primary,
.page-content-surface .beit-bid-submit-btn {
  background: var(--std-primary) !important;
  background-image: none !important;
  color: #fff !important;
  border: 1px solid var(--std-primary) !important;
  border-radius: var(--std-radius) !important;
  font-weight: 600;
  box-shadow: none !important;
  filter: none !important;
}
.beit-bid-submit-btn:hover,
.tenant-btn-primary:hover {
  background: var(--std-primary-hover) !important;
  border-color: var(--std-primary-hover) !important;
  filter: none !important;
}
.view-btn,
.beit-bid-cancel-btn {
  background: var(--std-surface) !important;
  color: var(--std-ink) !important;
  border: 1px solid var(--std-line) !important;
  border-radius: var(--std-radius) !important;
}
.view-btn:hover,
.beit-bid-cancel-btn:hover {
  background: var(--std-bg) !important;
  color: var(--std-ink) !important;
}

/* KPI / stat cards — light, not forest gradient */
.stat-card-dark,
a.stat-card-dark,
.tenant-ui-stat-card,
a.tenant-ui-stat-card,
.kpi-card,
.metric-card {
  background: var(--std-surface) !important;
  background-image: none !important;
  border: 1px solid var(--std-line) !important;
  border-radius: var(--std-radius) !important;
  box-shadow: var(--std-shadow-sm) !important;
  color: var(--std-ink) !important;
  transform: none !important;
}
.stat-card-dark:hover,
.metric-card:hover,
.tenant-ui-stat-card:hover {
  box-shadow: var(--std-shadow) !important;
  transform: none !important;
}
.stat-card-dark.is-active {
  border-color: var(--std-primary) !important;
  background: var(--std-primary-soft) !important;
}
.stat-card-dark .stat-card-title,
.tenant-ui-stat-title {
  color: var(--std-muted) !important;
}
.stat-card-dark .stat-card-value,
.tenant-ui-stat-value {
  color: var(--std-primary) !important;
}
.stat-card-dark::before,
.stat-accent-line { display: none !important; }

/* Tabs */
.queue-tab {
  border-radius: 8px !important;
  font-weight: 500;
}
.queue-tab.active {
  background: var(--std-surface) !important;
  color: var(--std-primary) !important;
  font-weight: 700;
  box-shadow: var(--std-shadow-sm);
}
.queue-tab:not(.active) { color: var(--std-muted) !important; }

/* Cards / tables / modals */
.page-content-surface .bg-white,
.tenant-surface-card,
.grad-card {
  background: var(--std-surface) !important;
  background-image: none !important;
  border-color: var(--std-line) !important;
  border-radius: var(--std-radius-lg) !important;
  box-shadow: var(--std-shadow-sm);
  color: var(--std-ink) !important;
}
.page-content-surface table,
.page-content-surface table th,
.page-content-surface table td {
  background: transparent !important;
  color: var(--std-ink) !important;
}
.page-content-surface table thead th {
  background: #eef1f4 !important;
  color: var(--std-muted) !important;
}
html.dark .page-content-surface table thead th {
  background: #262626 !important;
}
.beit-bid-modal,
html.dark .page-content-surface .beit-bid-modal {
  background: var(--std-surface) !important;
  color: var(--std-ink) !important;
  border-radius: var(--std-radius-lg) !important;
  box-shadow: 0 18px 50px rgba(45, 55, 72, 0.18);
}

/* Pills */
.pill-ok { background: var(--std-primary-soft) !important; color: var(--std-primary) !important; }
.pill-amber { background: var(--std-mustard-soft) !important; color: #8a6418 !important; }
.pill-red { background: var(--std-danger-soft) !important; color: var(--std-danger) !important; }
.pill-closed { background: #eef1f4 !important; color: #8a97a8 !important; }

/* Preloader */
[x-show="pageLoading"] {
  background: var(--std-bg) !important;
}

/* FAB */
.fab-main {
  background: var(--std-surface) !important;
  background-image: none !important;
  color: var(--std-ink) !important;
  border: 1px solid var(--std-line) !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  box-shadow: var(--std-shadow) !important;
}
.fab-halo { display: none !important; }

/* Footer */
.tenant-erp-footer {
  background: transparent !important;
  color: var(--std-muted) !important;
  border-color: var(--std-line) !important;
}

/* Section accent bar */
.w-1\.5.h-6.rounded-full,
.w-1.h-5.rounded-full {
  background: var(--std-primary) !important;
}

/* Login */
body.std-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--std-bg) !important;
  text-align: center;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--std-ink);
}
.std-login .login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.std-login .login-brand .word { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.std-login h1 { font-size: 22px; font-weight: 700; margin: 16px 0 20px; }
.std-login .login-card {
  width: min(400px, 100%);
  background: var(--std-surface);
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: var(--std-shadow);
  text-align: left;
}
.std-login label {
  display: block;
  font-size: 12px;
  color: var(--std-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.std-login input[type="email"],
.std-login input[type="password"],
.std-login input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--std-line);
  border-radius: 8px;
  background: var(--std-surface);
  color: var(--std-ink);
}
.std-login input:focus {
  outline: none;
  border-color: var(--std-primary);
  box-shadow: 0 0 0 3px var(--std-primary-soft);
}
.std-login .btn-primary {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  background: var(--std-primary);
  color: #fff;
  border: 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.std-login .btn-primary:hover { background: var(--std-primary-hover); }
.std-login .login-links { margin: 8px 0 12px; font-size: 13px; }
.std-login .login-links a,
.std-login .login-links button {
  color: var(--std-muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.std-login .login-links a:hover,
.std-login .login-links button:hover { color: var(--std-primary); }
.std-login .lede { margin-top: 18px; color: var(--std-muted); }
.std-login .lede a { color: var(--std-primary); font-weight: 600; }
.public-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 28px;
  font-size: 12px;
  font-weight: 600;
}
.public-auth-links a {
  color: var(--std-muted);
  text-decoration: none;
}
.public-auth-links a:hover { color: var(--std-primary); }
.fab-dark {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 25;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2d3748;
  color: #fff;
  border: 0;
  font-size: 18px;
  box-shadow: var(--std-shadow);
}
html.dark .fab-dark,
html[data-dark="true"] .fab-dark {
  background: var(--std-mustard);
  color: #1a1a1a;
}

/* Workspace stepper: done = teal, current = mustard, blocked = danger */
[role="navigation"][aria-label="Workspace steps"] button.bg-emerald-800,
[role="navigation"][aria-label="Workspace steps"] .bg-emerald-800 {
  background: var(--std-mustard) !important;
  border-color: var(--std-mustard) !important;
  color: var(--std-mustard-ink) !important;
}
[role="navigation"][aria-label="Workspace steps"] button.bg-emerald-600,
[role="navigation"][aria-label="Workspace steps"] .bg-emerald-600 {
  background: var(--std-primary) !important;
  border-color: var(--std-primary) !important;
  color: #fff !important;
}

/* List tabs / filter chips (tenders, reports) */
.tab-btn {
  border-radius: 8px !important;
  font-weight: 500 !important;
}
.tab-btn.active {
  background: var(--std-surface) !important;
  color: var(--std-primary) !important;
  box-shadow: var(--std-shadow-sm) !important;
}
.tab-btn:not(.active) {
  background: transparent !important;
  color: var(--std-muted) !important;
}
.tab-btn:not(.active):hover {
  background: var(--std-primary-soft) !important;
  color: var(--std-primary) !important;
}
.filter-pill {
  border-color: var(--std-line) !important;
  color: var(--std-muted) !important;
}
.filter-pill:hover {
  border-color: var(--std-primary) !important;
  color: var(--std-primary) !important;
}
.filter-pill.active {
  background: var(--std-primary) !important;
  color: #fff !important;
  border-color: var(--std-primary) !important;
}

/* Dashboard queue KPI cards: coloured header stripe (sample dash-card-h) */
#bid-stat-grid a.stat-card-dark,
.grid a.stat-card-dark,
.grid .stat-card-dark {
  box-shadow: inset 0 8px 0 var(--std-primary), var(--std-shadow-sm) !important;
  padding-top: 1.5rem !important;
}
#bid-stat-grid a.stat-card-dark:nth-child(5n+2),
.grid a.stat-card-dark:nth-child(5n+2),
.grid .stat-card-dark:nth-child(5n+2) {
  box-shadow: inset 0 8px 0 var(--std-mustard), var(--std-shadow-sm) !important;
}
#bid-stat-grid a.stat-card-dark:nth-child(5n+3),
.grid a.stat-card-dark:nth-child(5n+3),
.grid .stat-card-dark:nth-child(5n+3) {
  box-shadow: inset 0 8px 0 var(--std-steel), var(--std-shadow-sm) !important;
}
#bid-stat-grid a.stat-card-dark:nth-child(5n+4),
.grid a.stat-card-dark:nth-child(5n+4),
.grid .stat-card-dark:nth-child(5n+4) {
  box-shadow: inset 0 8px 0 var(--std-primary), var(--std-shadow-sm) !important;
}
#bid-stat-grid a.stat-card-dark:nth-child(5n+5),
.grid a.stat-card-dark:nth-child(5n+5),
.grid .stat-card-dark:nth-child(5n+5) {
  box-shadow: inset 0 8px 0 var(--std-mustard), var(--std-shadow-sm) !important;
}
#bid-stat-grid a.stat-card-dark.is-active {
  background: var(--std-primary-soft) !important;
}

/* Queue / tab strip */
#bid-queue-panel,
.rounded-2xl:has(> .flex .queue-tab) {
  border-color: var(--std-line) !important;
  background: var(--std-surface) !important;
}

/* Finish-setup / onboarding banners */
.bg-emerald-50 {
  background: var(--std-mustard-soft) !important;
  color: var(--std-ink) !important;
  border-color: var(--std-mustard) !important;
}

/* Neutralise leftover emerald Tailwind + hardcoded Bid greens */
.bg-\[\#064e3b\],
.bg-\[\#059669\],
.bg-emerald-600,
.bg-emerald-700,
.bg-emerald-800,
.bg-emerald-900 {
  background-color: var(--std-primary) !important;
}
.text-\[\#064e3b\],
.text-\[\#059669\],
.text-emerald-400,
.text-emerald-500,
.text-emerald-600,
.text-emerald-700,
.text-emerald-800,
.text-emerald-900 {
  color: var(--std-primary) !important;
}
html.dark .dark\:text-emerald-200,
html.dark .dark\:text-emerald-300,
html.dark .dark\:text-emerald-400 {
  color: var(--std-primary) !important;
}
.border-emerald-100,
.border-emerald-200,
.border-emerald-400\/40,
.border-emerald-500\/10,
.border-emerald-500\/15,
.border-emerald-500\/30,
.border-emerald-600\/30 {
  border-color: var(--std-line) !important;
}
.hover\:bg-emerald-50:hover,
.bg-emerald-50\/30,
.bg-emerald-50\/40 {
  background-color: var(--std-primary-soft) !important;
}
html.dark .dark\:bg-emerald-950\/30,
html.dark .dark\:bg-emerald-950\/40,
html.dark .dark\:hover\:bg-emerald-950\/40:hover {
  background-color: var(--std-primary-soft) !important;
}
.bg-\[\#F8FAFC\] { background-color: var(--std-bg) !important; }

.view-btn {
  color: var(--std-ink) !important;
  background: var(--std-surface) !important;
  border-color: var(--std-line) !important;
}
.metric-card {
  border-color: var(--std-line) !important;
  box-shadow: var(--std-shadow-sm) !important;
  transform: none !important;
}
.metric-card:hover {
  box-shadow: var(--std-shadow) !important;
  border-color: var(--std-line) !important;
  transform: none !important;
}
.section-label { color: var(--std-muted) !important; }

/* PDF.js field overlay — sample pdf-field */
.pdf-widget-overlay:not(.is-selected) {
  border-color: var(--std-primary) !important;
  background: rgba(30, 99, 103, 0.08) !important;
}
.pdf-widget-overlay.is-selected {
  outline: 2px solid var(--std-mustard);
}
.pdf-editor-toolbar {
  background: var(--std-bg) !important;
}

/* Inputs in Bid modals */
.beit-bid-modal input,
.beit-bid-modal select,
.beit-bid-modal textarea,
.form-input {
  border-color: var(--std-line) !important;
  background: var(--std-surface) !important;
  border-radius: var(--std-radius) !important;
}
.beit-bid-modal input:focus,
.beit-bid-modal select:focus,
.beit-bid-modal textarea:focus,
.form-input:focus {
  border-color: var(--std-primary) !important;
  box-shadow: 0 0 0 3px var(--std-primary-soft) !important;
}
.beit-bid-modal label,
.form-label {
  color: var(--std-muted) !important;
}

/* Profile / toast leftovers */
.profile-chip .profile-avatar,
.avatar {
  background: var(--std-primary) !important;
}
.toast:not(.toast--err) {
  background: var(--std-primary) !important;
}

/* ── Contrast sweep: buttons, fields, list cards ── */
.beit-bid-submit-btn,
button.beit-bid-submit-btn,
a.beit-bid-submit-btn,
.tenant-btn-primary {
  padding: 0.55rem 1.15rem !important;
  min-height: 38px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #ffffff !important;
  background: var(--std-primary) !important;
  border: 1px solid var(--std-primary) !important;
  margin: 0;
}
.beit-bid-submit-btn.text-xs,
.beit-bid-cancel-btn.text-xs,
.view-btn.text-xs {
  padding: 0.4rem 0.85rem !important;
  min-height: 32px;
  font-size: 12px !important;
}
.view-btn,
.beit-bid-cancel-btn {
  padding: 0.5rem 0.95rem !important;
  min-height: 36px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--std-ink) !important;
  background: var(--std-surface) !important;
  border: 1px solid var(--std-line) !important;
  margin: 0;
}
.view-btn:hover,
.beit-bid-cancel-btn:hover {
  color: var(--std-ink) !important;
  background: var(--std-bg) !important;
  border-color: var(--std-primary) !important;
}

.page-content-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]),
.page-content-surface select,
.page-content-surface textarea,
.beit-bid-modal input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]),
.beit-bid-modal select,
.beit-bid-modal textarea,
main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]),
main select,
main textarea {
  background: var(--std-surface) !important;
  color: var(--std-ink) !important;
  border: 1px solid var(--std-line) !important;
  border-radius: var(--std-radius) !important;
  padding: 0.5rem 0.75rem !important;
  min-height: 38px;
}
.page-content-surface textarea,
.beit-bid-modal textarea,
main textarea {
  min-height: 4.5rem;
}
.page-content-surface select,
.beit-bid-modal select,
main select {
  padding-right: 2rem !important;
}
.page-content-surface input::placeholder,
.page-content-surface textarea::placeholder,
.beit-bid-modal input::placeholder,
main input::placeholder {
  color: var(--std-muted) !important;
  opacity: 1;
}

/* Dark mode: never keep charcoal text on dark surfaces */
html.dark .page-content-surface,
html.dark .page-content-surface .bg-white,
html.dark .page-content-surface .dark\:bg-gray-900,
html.dark .page-content-surface table,
html.dark .page-content-surface table th,
html.dark .page-content-surface table td {
  color: var(--std-ink) !important;
}
html.dark .page-content-surface select,
html.dark .page-content-surface select option,
html.dark .page-content-surface input:not([type="checkbox"]):not([type="radio"]),
html.dark .page-content-surface textarea {
  color: var(--std-ink) !important;
  background-color: var(--std-surface) !important;
}

/* Always use list cards — hide wide tables */
.projects-table,
.employees-table,
.users-table,
.tenants-table,
.org-table {
  display: none !important;
}
.projects-card-grid,
.employees-card-grid,
.users-card-grid,
.tenants-card-grid,
.org-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important;
  gap: 12px !important;
  padding: 12px !important;
}

/* Tenders + org workflows + users: list/grid toggle */
.tenders-layout-toolbar,
.org-workflows-layout-toolbar,
.users-layout-toolbar {
  border-bottom: 1px solid var(--std-line);
  background: var(--std-surface);
}
.layout-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--std-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--std-bg);
}
.layout-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--std-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}
.layout-toggle-btn + .layout-toggle-btn {
  border-left: 1px solid var(--std-line);
}
.layout-toggle-btn.is-active {
  background: var(--std-primary);
  color: #fff;
}
.workspace-badge {
  background: var(--std-mustard-soft) !important;
  color: #8a6418 !important;
  border-color: var(--std-mustard) !important;
}
html.dark .workspace-badge {
  color: var(--std-mustard) !important;
}
.org-workflows-results.layout-grid .projects-table {
  display: none !important;
}
.tenders-results.layout-grid .projects-card-grid,
.org-workflows-results.layout-grid .projects-card-grid {
  display: grid !important;
}
.tenders-results.layout-grid .tenders-list-cards {
  display: none !important;
}
.tenders-results:not(.layout-grid) .projects-card-grid,
.tenders-results.layout-list .projects-card-grid,
.org-workflows-results:not(.layout-grid) .projects-card-grid,
.org-workflows-results.layout-list .projects-card-grid {
  display: none !important;
}
.tenders-results:not(.layout-grid) .tenders-list-cards,
.tenders-results.layout-list .tenders-list-cards {
  display: grid !important;
  grid-template-columns: 1fr !important;
  padding: 12px 16px 16px !important;
}
.tenders-section-page .tenders-results .beit-list-item,
.tenders-results .beit-list-item {
  background: #ffffff !important;
  color: #2d3748 !important;
  border: 1px solid #e2e8f0 !important;
}
.tenders-section-page .tenders-results .beit-list-item-title,
.tenders-results .beit-list-item-title {
  color: #2d3748 !important;
}
.tenders-section-page .tenders-results .beit-list-item-meta,
.tenders-results .beit-list-item-meta {
  color: #4a5568 !important;
}
.org-workflows-results:not(.layout-grid) .projects-table-wrap,
.org-workflows-results.layout-list .projects-table-wrap {
  overflow-x: auto;
}
.org-workflows-results:not(.layout-grid) .projects-table,
.org-workflows-results.layout-list .projects-table {
  display: table !important;
  width: 100%;
  background: var(--std-surface);
  color: var(--std-ink);
}
.org-workflows-results:not(.layout-grid) .projects-table thead th,
.org-workflows-results.layout-list .projects-table thead th {
  color: var(--std-muted) !important;
  background: var(--std-bg);
  border-bottom: 1px solid var(--std-line);
}
.org-workflows-results:not(.layout-grid) .projects-table tbody td,
.org-workflows-results.layout-list .projects-table tbody td {
  color: var(--std-ink);
  border-bottom: 1px solid var(--std-line);
}
.org-workflows-results:not(.layout-grid) .projects-table tbody tr:hover,
.org-workflows-results.layout-list .projects-table tbody tr:hover {
  background: var(--std-primary-soft) !important;
}

.users-results.layout-grid .users-table {
  display: none !important;
}
.users-results.layout-grid .beit-list {
  display: grid !important;
}
.users-results:not(.layout-grid) .beit-list,
.users-results.layout-list .beit-list {
  display: none !important;
}
.users-results:not(.layout-grid) .users-table-wrap,
.users-results.layout-list .users-table-wrap {
  overflow-x: auto;
}
.users-results:not(.layout-grid) .users-table,
.users-results.layout-list .users-table {
  display: table !important;
  width: 100%;
  background: var(--std-surface);
  color: var(--std-ink);
}
.users-results:not(.layout-grid) .users-table thead th,
.users-results.layout-list .users-table thead th {
  color: var(--std-muted) !important;
  background: var(--std-bg);
  border-bottom: 1px solid var(--std-line);
}
.users-results:not(.layout-grid) .users-table tbody td,
.users-results.layout-list .users-table tbody td {
  color: var(--std-ink);
  border-bottom: 1px solid var(--std-line);
}
.users-results:not(.layout-grid) .users-table tbody tr:hover,
.users-results.layout-list .users-table tbody tr:hover {
  background: var(--std-primary-soft) !important;
}

.project-card,
html.dark .project-card {
  background: var(--std-surface) !important;
  border: 1px solid var(--std-line) !important;
  color: var(--std-ink) !important;
  box-shadow: none !important;
  transform: none !important;
}
.project-card-name,
html.dark .project-card-name { color: var(--std-ink) !important; }
.project-card-scope,
.project-card-account { color: var(--std-muted) !important; }
.project-card-meta-label,
html.dark .project-card-meta-label { color: var(--std-muted) !important; }
.project-card-meta-value,
html.dark .project-card-meta-value { color: var(--std-ink) !important; }
.project-card-footer {
  border-top-color: var(--std-line) !important;
  flex-wrap: wrap;
}
.project-card-footer .view-btn,
.project-card-footer .beit-bid-submit-btn,
.project-card-footer .beit-bid-cancel-btn {
  flex: 1 1 auto;
}

.beit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.beit-list.beit-list-stack {
  grid-template-columns: 1fr;
}
.beit-list-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--std-line);
  border-radius: var(--std-radius-lg);
  background: var(--std-surface);
  color: var(--std-ink);
}
a.beit-list-item {
  text-decoration: none;
  color: var(--std-ink);
}
.beit-list-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.beit-list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--std-ink);
  line-height: 1.35;
}
.beit-list-item-meta {
  font-size: 12px;
  color: var(--std-muted);
}
.beit-list-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.beit-list-item-actions > a,
.beit-list-item-actions > button,
.beit-list-item .beit-bid-submit-btn.w-full,
.beit-list-item .beit-bid-cancel-btn.w-full {
  flex: 1 1 auto;
  justify-content: center;
  text-align: center;
}

.quick-action-btn {
  color: var(--std-ink) !important;
  background: transparent !important;
}
.quick-action-btn:hover {
  background: var(--std-primary-soft) !important;
  color: var(--std-primary) !important;
  transform: none !important;
}
.quick-action-btn .qa-icon {
  background: var(--std-primary-soft) !important;
  color: var(--std-primary) !important;
}

.pill-closed { background: #eef1f4 !important; color: #4a5568 !important; }
html.dark .pill-closed { background: #2c2c2c !important; color: #cbd5e0 !important; }

/* Workspace step tabs */
.workspace-step-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.workspace-step-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--std-line);
  background: var(--std-surface);
  color: var(--std-muted);
}
.workspace-step-tab.is-done { color: var(--std-primary); }
.workspace-step-tab.is-blocked { color: var(--std-muted); opacity: 0.85; }
.workspace-step-tab.is-current,
.workspace-step-tab[aria-selected="true"] {
  background: var(--std-primary);
  border-color: var(--std-primary);
  color: #fff;
  opacity: 1;
}
.workspace-step-index {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: var(--std-primary-soft);
  color: var(--std-primary);
}
.workspace-step-tab.is-current .workspace-step-index,
.workspace-step-tab[aria-selected="true"] .workspace-step-index {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Bids dashboard lists / cards — contrast + readable ink */
.theme6-dashboard .metric-card,
.theme6-dashboard .bg-white {
  background: var(--std-surface) !important;
  color: var(--std-ink) !important;
  border-color: var(--std-line) !important;
}
.theme6-dashboard .section-label {
  color: var(--std-muted) !important;
}
.theme6-dashboard .beit-list-item {
  background: var(--std-bg);
  color: var(--std-ink);
  border-color: var(--std-line);
}
html.dark .theme6-dashboard .beit-list-item {
  background: var(--std-surface);
}
a.beit-list-item {
  text-decoration: none;
  color: inherit;
}
a.beit-list-item:hover {
  border-color: var(--std-primary);
  background: var(--std-primary-soft);
}
a.beit-list-item .beit-list-item-title {
  color: var(--std-ink);
}
.theme6-dashboard .stat-card-dark .stat-card-title {
  color: var(--std-muted) !important;
}
.theme6-dashboard .stat-card-dark .stat-card-value {
  color: var(--std-primary) !important;
}
.beit-list-item-title .beit-list-swatch,
.beit-list-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--std-primary);
}
.beit-list-stack .beit-list-item:nth-child(7n+1) .beit-list-swatch { background: #1e6367; }
.beit-list-stack .beit-list-item:nth-child(7n+2) .beit-list-swatch { background: #d4a045; }
.beit-list-stack .beit-list-item:nth-child(7n+3) .beit-list-swatch { background: #174f52; }
.beit-list-stack .beit-list-item:nth-child(7n+4) .beit-list-swatch { background: #8d9aaa; }
.beit-list-stack .beit-list-item:nth-child(7n+5) .beit-list-swatch { background: #2d3748; }
.beit-list-stack .beit-list-item:nth-child(7n+6) .beit-list-swatch { background: #c4892e; }
.beit-list-stack .beit-list-item:nth-child(7n+7) .beit-list-swatch { background: #4a5568; }

.section-label {
  color: var(--std-muted) !important;
}
.progress-bar {
  background: var(--std-primary-soft) !important;
}
.progress-fill {
  background: var(--std-primary) !important;
  background-image: none !important;
}
.employee-card,
.user-card,
html.dark .employee-card,
html.dark .user-card {
  background: var(--std-surface) !important;
  border: 1px solid var(--std-line) !important;
  color: var(--std-ink) !important;
  box-shadow: none !important;
  transform: none !important;
}
.employee-card-name,
.user-card-email,
html.dark .employee-card-name,
html.dark .user-card-email {
  color: var(--std-ink) !important;
}
.employee-card-role,
.employee-card-email,
.user-card-id,
.employee-card-meta-label,
.user-card-meta-label {
  color: var(--std-muted) !important;
}
.employee-card-meta-value,
.user-card-meta-value {
  color: var(--std-ink) !important;
}
.employee-card-footer,
.user-card-footer {
  border-top-color: var(--std-line) !important;
}
.hub-feature-icon {
  color: var(--std-primary) !important;
}

.crawler-settings-page {
  color: var(--std-ink);
}
.crawler-settings-page h1 {
  color: var(--std-ink) !important;
}
.crawler-settings-page .section-label {
  color: var(--std-muted) !important;
}
.crawler-settings-page p,
.crawler-settings-page label,
.crawler-settings-page .text-gray-500,
.crawler-settings-page .text-gray-400,
.crawler-settings-page .text-gray-700,
.crawler-settings-page .dark\:text-gray-400,
.crawler-settings-page .dark\:text-gray-300 {
  color: var(--std-muted) !important;
}
.crawler-settings-page h1,
.crawler-settings-page label,
.crawler-settings-page .text-sm.font-medium,
.crawler-settings-page .text-xl.font-semibold,
.crawler-settings-page #js-crawler-new-count,
.crawler-settings-page #js-crawler-updated-count,
.crawler-settings-page #js-crawler-failed-count,
.crawler-settings-page #js-crawler-status {
  color: var(--std-ink) !important;
}
.crawler-settings-page input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.crawler-settings-page select,
.crawler-settings-page textarea {
  color: var(--std-ink) !important;
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
.crawler-settings-page .js-organ-search {
  color: #2d3748 !important;
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
.crawler-settings-page .js-organ-dropdown,
html.dark .crawler-settings-page .js-organ-dropdown {
  background: #ffffff !important;
  color: #2d3748 !important;
  border-color: #e2e8f0 !important;
}
.crawler-settings-page .js-organ-dropdown p,
.crawler-settings-page .js-organ-option,
html.dark .crawler-settings-page .js-organ-option,
html.dark .crawler-settings-page .js-organ-dropdown p {
  color: #2d3748 !important;
  background: #ffffff !important;
}
.crawler-settings-page .js-organ-option:hover,
html.dark .crawler-settings-page .js-organ-option:hover {
  background: #edf2f7 !important;
  color: #2d3748 !important;
}
.crawler-settings-page .text-red-600,
.crawler-settings-page .text-red-700 {
  color: #c53030 !important;
}
.crawler-settings-page .crawler-log-panel,
.crawler-settings-page .crawler-log-panel * {
  color: #e2e8f0 !important;
}
.crawler-settings-page .crawler-log-panel > p {
  color: #a0aec0 !important;
}

.module-hub-page h1 {
  color: var(--std-ink) !important;
}
.module-hub-page header p {
  color: var(--std-muted) !important;
}

/* Compliance Centre — same surface / ink as the rest of the platform */
.compliance-section-page {
  background: var(--std-bg) !important;
  color: var(--std-ink);
}
.compliance-section-page h1,
.compliance-section-page h2,
.compliance-section-page .beit-list-item-title {
  color: var(--std-ink) !important;
}
.compliance-section-page p,
.compliance-section-page label,
.compliance-section-page span,
.compliance-section-page li,
.compliance-section-page .text-xs,
.compliance-section-page .text-sm {
  color: var(--std-muted);
}
.compliance-section-page .beit-list-item-title,
.compliance-section-page .stat-card-value,
.compliance-section-page h1,
.compliance-section-page h2,
.compliance-section-page .font-medium,
.compliance-section-page .font-semibold {
  color: var(--std-ink) !important;
}
.compliance-section-page .stat-card-title,
.compliance-section-page .beit-list-item-meta {
  color: var(--std-muted) !important;
}
.compliance-section-page .stat-card-value {
  color: var(--std-primary) !important;
}
.compliance-section-page .stat-card-dark,
.compliance-section-page .compliance-card,
.compliance-section-page .beit-list-item {
  background: var(--std-surface) !important;
  color: var(--std-ink) !important;
  border: 1px solid var(--std-line) !important;
  box-shadow: var(--std-shadow-sm) !important;
}
.compliance-section-page .beit-list-item.is-expired {
  border-color: var(--std-danger) !important;
}
.compliance-section-page .compliance-status-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--std-bg) !important;
  color: var(--std-ink) !important;
  border: 1px solid var(--std-line);
}
.compliance-section-page .compliance-overdue {
  color: var(--std-danger) !important;
}
.compliance-section-page a {
  color: var(--std-primary);
}
.compliance-section-page .view-btn,
.compliance-section-page .beit-bid-cancel-btn {
  color: var(--std-ink) !important;
}
.compliance-section-page input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]):not([type="file"]),
.compliance-section-page select,
.compliance-section-page textarea {
  color: var(--std-ink) !important;
  background: var(--std-surface) !important;
  border: 1px solid var(--std-line) !important;
}
.compliance-section-page .compliance-upload-box {
  background: var(--std-bg) !important;
  border: 1px dashed var(--std-line) !important;
  color: var(--std-ink);
}
.compliance-section-page .compliance-flash-error {
  background: var(--std-danger-soft) !important;
  border-color: var(--std-danger) !important;
  color: var(--std-danger) !important;
}
.compliance-section-page .compliance-flash-ok {
  background: var(--std-primary-soft) !important;
  border-color: var(--std-primary) !important;
  color: var(--std-ink) !important;
}
.compliance-section-page .border-b {
  border-color: var(--std-line) !important;
}

.users-section-page {
  background: var(--std-bg) !important;
  color: var(--std-ink);
}
.users-section-page h1,
.users-section-page h2,
.users-section-page h3,
.users-section-page .beit-list-item-title {
  color: var(--std-ink) !important;
}
.users-section-page p,
.users-section-page label,
.users-section-page span,
.users-section-page .text-gray-400,
.users-section-page .text-gray-500,
.users-section-page .text-gray-700,
.users-section-page .dark\:text-white,
.users-section-page .dark\:text-gray-300 {
  color: var(--std-muted);
}
.users-section-page h1,
.users-section-page h2,
.users-section-page h3,
.users-section-page .beit-list-item-title,
.users-section-page .font-medium,
.users-section-page .stat-card-value {
  color: var(--std-ink) !important;
}
.users-section-page h1 .font-semibold {
  color: var(--std-primary) !important;
}
.users-section-page .stat-card-title,
.users-section-page .beit-list-item-meta,
.users-section-page .section-label {
  color: var(--std-muted) !important;
}
.users-section-page .stat-card-value {
  color: var(--std-primary) !important;
}
.users-section-page .stat-card-dark,
.users-section-page .metric-card,
.users-section-page .beit-list-item,
.users-section-page .bg-white,
.users-section-page .dark\:bg-gray-900,
.users-section-page .beit-bid-modal {
  background: var(--std-surface) !important;
  color: var(--std-ink) !important;
  border-color: var(--std-line) !important;
  box-shadow: var(--std-shadow-sm);
}
.users-section-page input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.users-section-page select,
.users-section-page textarea {
  color: var(--std-ink) !important;
  background: var(--std-surface) !important;
  border-color: var(--std-line) !important;
}
.users-section-page .users-flash-ok {
  background: var(--std-primary-soft) !important;
  border: 1px solid var(--std-primary) !important;
  color: var(--std-ink) !important;
}
.users-section-page a {
  color: var(--std-primary);
}
.users-section-page .view-btn,
.users-section-page .beit-bid-cancel-btn {
  color: var(--std-ink) !important;
}

/* Settings lists — white cards + dark ink (same as tenders / platform surface) */
.settings-section-page {
  background: var(--std-bg) !important;
  color: #2d3748;
}
.settings-section-page h1,
.settings-section-page h2,
.settings-section-page h3,
.settings-section-page .beit-list-item-title {
  color: #2d3748 !important;
}
.settings-section-page p,
.settings-section-page label,
.settings-section-page span,
.settings-section-page .text-gray-400,
.settings-section-page .text-gray-500,
.settings-section-page .text-gray-700,
.settings-section-page .dark\:text-white,
.settings-section-page .dark\:text-gray-300 {
  color: #4a5568;
}
.settings-section-page h1,
.settings-section-page h2,
.settings-section-page h3,
.settings-section-page .beit-list-item-title,
.settings-section-page .font-medium,
.settings-section-page .stat-card-value {
  color: #2d3748 !important;
}
.settings-section-page h1 .font-semibold {
  color: #1e6367 !important;
}
.settings-section-page .stat-card-title,
.settings-section-page .beit-list-item-meta,
.settings-section-page .section-label {
  color: #4a5568 !important;
}
.settings-section-page .stat-card-value {
  color: #1e6367 !important;
}
.settings-section-page .stat-card-dark,
.settings-section-page .metric-card,
.settings-section-page .beit-list-item,
.settings-section-page .employee-card,
.settings-section-page .bg-white,
.settings-section-page .dark\:bg-gray-900,
.settings-section-page .dark\:bg-gray-800,
.settings-section-page .beit-bid-modal {
  background: #ffffff !important;
  color: #2d3748 !important;
  border-color: #e2e8f0 !important;
  box-shadow: var(--std-shadow-sm);
}
html.dark .settings-section-page .stat-card-dark,
html.dark .settings-section-page .metric-card,
html.dark .settings-section-page .beit-list-item,
html.dark .settings-section-page .employee-card,
html.dark .settings-section-page .bg-white,
html.dark .settings-section-page .dark\:bg-gray-900,
html.dark .settings-section-page .dark\:bg-gray-800,
html.dark .settings-section-page .beit-bid-modal {
  background: #ffffff !important;
  color: #2d3748 !important;
}
.settings-section-page input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.settings-section-page select,
.settings-section-page textarea {
  color: #2d3748 !important;
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
.settings-section-page a {
  color: #1e6367;
}
.settings-section-page .view-btn,
.settings-section-page .beit-bid-cancel-btn {
  color: #2d3748 !important;
  background: #ffffff !important;
}

/* Autocomplete filters — white surface, dark ink, above page cards */
.js-catalog-search,
.js-organ-search,
html.dark .js-catalog-search,
html.dark .js-organ-search {
  background: #ffffff !important;
  color: #2d3748 !important;
  border-color: #e2e8f0 !important;
}
.js-catalog-dropdown,
.js-organ-dropdown,
html.dark .js-catalog-dropdown,
html.dark .js-organ-dropdown {
  position: fixed;
  z-index: 200;
  max-height: 14rem;
  overflow-y: auto;
  background: #ffffff !important;
  color: #2d3748 !important;
  border-color: #e2e8f0 !important;
  box-shadow: var(--std-shadow);
}
.js-catalog-option,
.js-organ-option,
.js-catalog-dropdown p,
.js-organ-dropdown p,
html.dark .js-catalog-option,
html.dark .js-organ-option,
html.dark .js-catalog-dropdown p,
html.dark .js-organ-dropdown p {
  color: #2d3748 !important;
  background: #ffffff !important;
}
.js-catalog-option:hover,
.js-organ-option:hover,
html.dark .js-catalog-option:hover,
html.dark .js-organ-option:hover {
  background: #edf2f7 !important;
  color: #2d3748 !important;
}
.metric-card:has(.js-catalog-combobox),
.metric-card:has(.js-organ-picker),
.beit-bid-modal:has(.js-catalog-combobox) {
  overflow: visible !important;
}
