/* Fonts load from page <head> when needed — no CSS @import (blocks sidebar paint). */
:root {
  --wf-primary: #ffffff;
  --wf-secondary: #011936;
  --wf-accent: #d0491d;
  --wf-sidebar-width: 240px;
  --wf-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html,
body,
body.winflow-has-sidebar,
body.winflow-login-body,
.winflow-sidebar,
.winflow-main,
.winflow-login-page,
.winflow-login-card,
.dashboard-body,
.admin-layout,
.dashboard-layout,
.main-content {
  font-family: var(--wf-font) !important;
}

body.winflow-has-sidebar {
  padding-left: var(--wf-sidebar-width);
  margin: 0;
  min-height: 100vh;
  background: var(--wf-primary);
  color: var(--wf-secondary);
}

.winflow-main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
}

.winflow-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 68px;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e6ebf0;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-sizing: border-box;
  overflow: visible;
}

.winflow-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 15rem;
  flex: 1 1 auto;
}

.winflow-topbar-title {
  min-width: 0;
  max-width: 100%;
}

.winflow-topbar h1 {
  margin: 0;
  display: block;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  color: #011936 !important;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winflow-topbar-wave {
  display: inline;
  font-size: 1em;
  line-height: 1;
  margin-left: 0.2rem;
}

.winflow-topbar-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5a6b7d !important;
  line-height: 1.3;
  white-space: nowrap;
}

.winflow-topbar-right {
  display: flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
  overflow: visible;
  position: relative;
  z-index: 50;
}

.winflow-topbar-filters {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-right: 0.15rem;
  position: relative;
  z-index: 60;
  overflow: visible;
}

.winflow-topbar-filter-wrap {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.winflow-topbar-filter-wrap:has(.winflow-topbar-filter-btn[aria-expanded="true"]) {
  z-index: 70;
}

.winflow-topbar-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 8.75rem;
  height: 36px;
  padding: 0 0.55rem 0 0.6rem;
  border: 1px solid #e6ebf0;
  border-radius: 10px;
  background: #f5f7fa;
  color: #5a6b7d;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.winflow-topbar-filter-btn > svg:first-child,
.winflow-topbar-filter-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.winflow-topbar-filter-btn > svg:first-child {
  width: 13px;
  height: 13px;
}

.winflow-topbar-filter-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.winflow-topbar-filter-icon--users {
  border-radius: 6px;
  background: rgba(208, 73, 29, 0.12);
  color: #d0491d;
}

.winflow-topbar-filter-btn--users {
  border-color: rgba(208, 73, 29, 0.28);
  background: #fff7f3;
}

.winflow-topbar-filter-btn--users:hover,
.winflow-topbar-filter-btn--users[aria-expanded="true"] {
  border-color: rgba(208, 73, 29, 0.55);
  background: #ffefe7;
  color: #011936;
  box-shadow: 0 0 0 2px rgba(208, 73, 29, 0.12);
}

.winflow-topbar-filter-btn span:not(.winflow-topbar-filter-icon) {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-align: left;
}

.winflow-topbar-filter-btn:hover,
.winflow-topbar-filter-btn[aria-expanded="true"] {
  background: #eef1f4;
  border-color: #d1d5db;
  color: #011936;
}

.winflow-topbar-filter-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.65;
}

.winflow-topbar-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 80;
  min-width: 100%;
  width: max(100%, 210px);
  max-height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid #e6ebf0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(1, 25, 54, 0.14);
}

.winflow-topbar-filter-menu--users {
  left: auto;
  right: 0;
}

.winflow-topbar-filter-item {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: #011936;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winflow-topbar-filter-item:hover {
  background: #f5f7fa;
}

.winflow-topbar-filter-item.is-active {
  background: rgba(208, 73, 29, 0.1);
  color: #d0491d;
}

.winflow-topbar-filter-empty {
  padding: 0.65rem 0.7rem;
  color: #5a6b7d;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.winflow-topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6ebf0;
  border-radius: 10px;
  background: #f5f7fa;
  color: #5a6b7d;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.winflow-topbar-icon-btn:hover {
  background: #eef1f4;
  border-color: #d1d5db;
  color: #011936;
  text-decoration: none;
}

.winflow-topbar-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.winflow-topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid #e6ebf0;
  border-radius: 10px;
  background: #f5f7fa;
  color: #011936;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.winflow-topbar-date .winflow-topbar-date-short {
  display: none;
}

.winflow-topbar-date svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #d0491d;
}

.winflow-topbar-profile {
  position: relative;
  flex-shrink: 0;
}

.winflow-topbar-profile-btn {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.winflow-topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #011936;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.winflow-topbar-profile-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 50;
  width: 220px;
  padding: 0.45rem;
  border: 1px solid #e6ebf0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(1, 25, 54, 0.12);
}

.winflow-topbar-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem 0.7rem;
  border-bottom: 1px solid #e6ebf0;
  margin-bottom: 0.35rem;
}

.winflow-topbar-profile-meta strong {
  font-size: 0.85rem;
  color: #011936;
}

.winflow-topbar-profile-meta span,
.winflow-topbar-profile-meta small {
  font-size: 0.72rem;
  color: #5a6b7d;
  word-break: break-all;
}

.winflow-topbar-profile-menu a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  color: #011936;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.winflow-topbar-profile-menu a:hover {
  background: #f3f4f6;
}

.winflow-topbar-profile-menu a.is-danger {
  color: #d0491d;
}

.winflow-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.winflow-topbar-logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.winflow-topbar-brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--wf-secondary);
}

.winflow-topbar-user {
  font-size: 0.875rem;
  color: #5a6b7d;
}

.winflow-blank-panel,
.wf-users-wrap,
.wf-dash {
  flex: 1 1 auto;
  min-height: 0;
  background: #ffffff;
}

/* All-workflows hub home — do not alter topbar/footer or department embeds */
.wf-dash {
  padding: 1.5rem 1.6rem 2.25rem;
  background:
    radial-gradient(980px 380px at 8% -8%, rgba(208, 73, 29, 0.1), transparent 58%),
    radial-gradient(820px 340px at 100% 0%, rgba(1, 25, 54, 0.07), transparent 52%),
    linear-gradient(180deg, #f4f7fb 0%, #f7f9fc 45%, #ffffff 100%);
}

.wf-dash--home {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0.75rem;
}

body.winflow-dash-home-mode .winflow-main {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

body.winflow-dash-home-mode .wf-dash--home {
  flex: 1 1 auto;
  min-height: 0;
}

body.winflow-dash-home-mode .winflow-site-footer {
  flex-shrink: 0;
}

.wf-dash-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding-right: 0.2rem;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #c5d0dc transparent;
}

.wf-dash-scroll::-webkit-scrollbar {
  width: 8px;
}

.wf-dash-scroll::-webkit-scrollbar-thumb {
  background: #c5d0dc;
  border-radius: 999px;
}

.wf-dash-hero--compact {
  flex-shrink: 0;
  position: static;
  padding: 1rem 1.2rem;
  gap: 1rem;
}

.wf-dash-hero--compact .wf-dash-brand {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.wf-dash-hero--compact .wf-dash-title {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}

.wf-dash-hero--compact .wf-dash-stat {
  min-height: 72px;
  padding: 0.7rem 0.8rem;
}

.wf-dash-overview {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.wf-dash-overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.wf-dash-overview-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0.95rem;
  align-items: stretch;
}

.wf-dash-bars--overview {
  min-height: 200px;
}

.wf-dash-chart-card--h {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wf-dash-hbars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.15rem;
  scrollbar-width: thin;
}

.wf-dash-hbar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.wf-dash-hbar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.wf-dash-hbar-label span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5a6b7d;
}

.wf-dash-hbar-label strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: #011936;
}

.wf-dash-hbar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef3f8;
  border: 1px solid #e6ebf0;
  overflow: hidden;
}

.wf-dash-hbar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.wf-dash-section-head {
  margin: 0 0 0.75rem;
}

.wf-dash-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #011936;
  letter-spacing: -0.02em;
}

.wf-dash-section-copy {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #5a6b7d;
}

.wf-dash-latest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.wf-dash-latest-card {
  --wf-latest-accent: #011936;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  max-height: 300px;
  padding: 0.95rem 1rem;
  border: 1px solid #e6ebf0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(1, 25, 54, 0.04);
  border-top: 3px solid var(--wf-latest-accent);
}

.wf-dash-latest-card--navy { --wf-latest-accent: #011936; }
.wf-dash-latest-card--orange { --wf-latest-accent: #d0491d; }
.wf-dash-latest-card--blue { --wf-latest-accent: #1d4ed8; }
.wf-dash-latest-card--teal { --wf-latest-accent: #0f766e; }

.wf-dash-latest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.wf-dash-latest-app {
  display: inline-block;
  margin-bottom: 0.2rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wf-latest-accent);
}

.wf-dash-latest-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #011936;
}

.wf-dash-latest-more {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #d0491d;
  text-decoration: none;
}

.wf-dash-latest-more:hover {
  text-decoration: underline;
}

.wf-dash-latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  scrollbar-width: thin;
}

.wf-dash-latest-list a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
}

.wf-dash-latest-list a:hover {
  border-color: #e6ebf0;
  background: #ffffff;
}

.wf-dash-latest-list strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: #011936;
  line-height: 1.3;
}

.wf-dash-latest-list span {
  font-size: 0.7rem;
  color: #5a6b7d;
}

.wf-dash-latest-empty {
  margin: auto 0;
  text-align: center;
  font-size: 0.82rem;
  color: #5a6b7d;
}

.wf-dash-app-body {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.wf-dash-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wf-dash-grid--compact .wf-dash-card {
  min-height: 168px;
}

/* Department app dashboard embedded inside hub shell (unchanged behavior) */
.wf-dash--embed {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  background: #f7f9fc;
}

.wf-dash-embed-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-bottom: 1px solid #e6ebf0;
  background: #ffffff;
}

.wf-dash-embed-badge-app {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d0491d;
}

.wf-dash-embed-badge-dept {
  font-size: 0.82rem;
  font-weight: 700;
  color: #011936;
}

.wf-dash-embed-badge-sep {
  color: #c5ced8;
}

.wf-dash-embed-frame {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: calc(100vh - 12.5rem);
  border: 0;
  background: #f7f9fc;
}

body.winflow-dash-embed-mode .winflow-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.winflow-dash-embed-mode .wf-dash--embed {
  flex: 1 1 auto;
}

.wf-dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.9fr);
  gap: 1.25rem 1.75rem;
  align-items: stretch;
  padding: 1.35rem 1.45rem;
  border: 1px solid #e6ebf0;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    #ffffff;
  box-shadow: 0 18px 40px rgba(1, 25, 54, 0.06);
}

.wf-dash-hero-copy {
  min-width: 0;
}

.wf-dash-brand {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #d0491d;
}

.wf-dash-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #011936;
  line-height: 1.2;
}

.wf-dash-copy {
  margin: 0.45rem 0 0;
  max-width: 40rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #5a6b7d;
}

.wf-dash-app-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.wf-dash-app-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.9rem;
  border: 1px solid #e6ebf0;
  border-radius: 999px;
  background: #ffffff;
  color: #011936;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.wf-dash-app-chip:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: #d0491d;
  border-color: rgba(208, 73, 29, 0.35);
  background: #fff7f3;
}

.wf-dash-app-chip--navy:hover { color: #011936; border-color: rgba(1, 25, 54, 0.25); background: #eef3f8; }
.wf-dash-app-chip--orange:hover { color: #d0491d; }
.wf-dash-app-chip--blue:hover { color: #1d4ed8; border-color: rgba(29, 78, 216, 0.28); background: #eff4ff; }
.wf-dash-app-chip--teal:hover { color: #0f766e; border-color: rgba(15, 118, 110, 0.28); background: #edfaf7; }

.wf-dash-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  align-content: center;
}

.wf-dash-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-height: 88px;
  padding: 0.85rem 0.9rem;
  border: 1px solid #e6ebf0;
  border-radius: 16px;
  background: #f7f9fc;
}

.wf-dash-stat strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #011936;
  line-height: 1;
}

.wf-dash-stat span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5a6b7d;
}

.wf-dash-stat--period strong {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.wf-dash-app-panel {
  --wf-panel-accent: #011936;
  margin: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid #e6ebf0;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(1, 25, 54, 0.045);
  scroll-margin-top: 5.5rem;
}

.wf-dash-app-panel--navy { --wf-panel-accent: #011936; }
.wf-dash-app-panel--orange { --wf-panel-accent: #d0491d; }
.wf-dash-app-panel--blue { --wf-panel-accent: #1d4ed8; }
.wf-dash-app-panel--teal { --wf-panel-accent: #0f766e; }

.wf-dash-app-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 0 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eef2f6;
}

.wf-dash-app-heading-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.wf-dash-app-heading-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--wf-panel-accent) 12%, #ffffff);
  color: var(--wf-panel-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.wf-dash-app-heading-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #011936;
  letter-spacing: -0.02em;
}

.wf-dash-app-heading-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5a6b7d;
}

.wf-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.wf-dash-card {
  --wf-card-accent: #011936;
  --wf-card-soft: rgba(1, 25, 54, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 198px;
  padding: 1.15rem 1.15rem 1.05rem;
  border: 1px solid #e6ebf0;
  border-radius: 18px;
  background: #ffffff;
  text-decoration: none;
  color: #011936;
  opacity: 1;
  visibility: visible;
  box-shadow: 0 8px 22px rgba(1, 25, 54, 0.04);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.wf-dash-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--wf-card-accent);
}

.wf-dash-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--wf-card-soft);
  pointer-events: none;
}

.wf-dash-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--wf-card-accent) 28%, #e6ebf0);
  box-shadow: 0 18px 36px rgba(1, 25, 54, 0.1);
  text-decoration: none;
  color: inherit;
}

.wf-dash-card--navy { --wf-card-accent: #011936; --wf-card-soft: rgba(1, 25, 54, 0.08); }
.wf-dash-card--orange { --wf-card-accent: #d0491d; --wf-card-soft: rgba(208, 73, 29, 0.12); }
.wf-dash-card--teal { --wf-card-accent: #0f766e; --wf-card-soft: rgba(15, 118, 110, 0.12); }
.wf-dash-card--blue { --wf-card-accent: #1d4ed8; --wf-card-soft: rgba(29, 78, 216, 0.1); }
.wf-dash-card--indigo { --wf-card-accent: #163a5f; --wf-card-soft: rgba(22, 58, 95, 0.1); }
.wf-dash-card--rose { --wf-card-accent: #be123c; --wf-card-soft: rgba(190, 18, 60, 0.1); }

.wf-dash-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.wf-dash-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--wf-card-soft);
  color: var(--wf-card-accent);
}

.wf-dash-card-icon .winflow-nav-icon {
  width: 20px;
  height: 20px;
}

.wf-dash-card-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a6b7d;
}

.wf-dash-card-title {
  margin: 0;
  position: relative;
  z-index: 1;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #011936;
  line-height: 1.25;
}

.wf-dash-card-desc {
  margin: 0;
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #5a6b7d;
}

.wf-dash-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--wf-card-accent);
}

.wf-dash-card:hover .wf-dash-card-cta svg {
  transform: translateX(3px);
}

.wf-dash-card-cta svg {
  transition: transform 0.18s ease;
}

.wf-dash-empty {
  padding: 2.25rem 1.25rem;
  border: 1px dashed #d7dee7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.wf-dash-empty h3 {
  margin: 0 0 0.4rem;
  color: #011936;
  font-size: 1.05rem;
}

.wf-dash-empty p {
  margin: 0;
  color: #5a6b7d;
  font-size: 0.88rem;
}

@keyframes wfDashCardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wf-dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wf-dash-kpi {
  --wf-kpi-accent: #011936;
  --wf-kpi-soft: rgba(1, 25, 54, 0.08);
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 0;
  height: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e6ebf0;
  border-radius: 14px;
  background: #ffffff;
  text-decoration: none;
  color: #011936;
  opacity: 1;
  visibility: visible;
  box-shadow: 0 6px 16px rgba(1, 25, 54, 0.04);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.wf-dash-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--wf-kpi-accent);
}

.wf-dash-kpi:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--wf-kpi-accent) 30%, #e6ebf0);
  box-shadow: 0 10px 22px rgba(1, 25, 54, 0.08);
  text-decoration: none;
  color: #011936;
}

.wf-dash-kpi--navy { --wf-kpi-accent: #011936; --wf-kpi-soft: rgba(1, 25, 54, 0.08); }
.wf-dash-kpi--orange { --wf-kpi-accent: #d0491d; --wf-kpi-soft: rgba(208, 73, 29, 0.12); }
.wf-dash-kpi--teal { --wf-kpi-accent: #0f766e; --wf-kpi-soft: rgba(15, 118, 110, 0.12); }
.wf-dash-kpi--blue { --wf-kpi-accent: #1d4ed8; --wf-kpi-soft: rgba(29, 78, 216, 0.1); }
.wf-dash-kpi--indigo { --wf-kpi-accent: #163a5f; --wf-kpi-soft: rgba(22, 58, 95, 0.1); }
.wf-dash-kpi--rose { --wf-kpi-accent: #be123c; --wf-kpi-soft: rgba(190, 18, 60, 0.1); }

.wf-dash-kpi-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.wf-dash-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--wf-kpi-soft);
  color: var(--wf-kpi-accent);
}

.wf-dash-kpi-icon .winflow-nav-icon {
  width: 18px;
  height: 18px;
}

.wf-dash-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a6b7d !important;
  line-height: 1.2;
}

.wf-dash-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #011936 !important;
  line-height: 1.1;
}

.wf-dash-kpi-sub {
  font-size: 0.7rem;
  color: #5a6b7d !important;
  line-height: 1.2;
}

.wf-dash-charts {
  margin-bottom: 1rem;
}

.wf-dash-chart-card {
  padding: 1.1rem 1.15rem 1.15rem;
  border: 1px solid #eef2f6;
  border-radius: 18px;
  background: #f8fafc;
}

.wf-dash-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.wf-dash-chart-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d0491d;
}

.wf-dash-chart-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #011936;
  letter-spacing: -0.02em;
}

.wf-dash-chart-period {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid #e6ebf0;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  color: #011936;
}

.wf-dash-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 0.85rem;
  align-items: end;
  min-height: 180px;
}

.wf-dash-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.wf-dash-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-height: 2.35rem;
  text-align: center;
}

.wf-dash-bar-meta span {
  font-size: 0.68rem;
  font-weight: 600;
  color: #5a6b7d;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-dash-bar-meta strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: #011936;
}

.wf-dash-bar-track {
  display: flex;
  align-items: flex-end;
  height: 132px;
  padding: 0.35rem 0.2rem 0;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e6ebf0;
}

.wf-dash-bar-fill {
  display: block;
  width: 100%;
  height: var(--wf-bar-h, 8%);
  min-height: 8px;
  border-radius: 10px 10px 6px 6px;
  background: #011936;
  transform-origin: bottom;
  opacity: 1;
}

.wf-dash-bar-fill--navy { background: linear-gradient(180deg, #163a5f, #011936); }
.wf-dash-bar-fill--orange { background: linear-gradient(180deg, #e36a3a, #d0491d); }
.wf-dash-bar-fill--teal { background: linear-gradient(180deg, #14b8a6, #0f766e); }
.wf-dash-bar-fill--blue { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.wf-dash-bar-fill--indigo { background: linear-gradient(180deg, #3a5f86, #163a5f); }
.wf-dash-bar-fill--rose { background: linear-gradient(180deg, #f43f5e, #be123c); }

@keyframes wfDashBarIn {
  from {
    transform: scaleY(0.15);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 1200px) {
  .wf-dash-overview-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wf-dash-latest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .wf-dash-grid,
  .wf-dash-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-dash-overview-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body.winflow-dash-home-mode .winflow-main {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .wf-dash--home {
    overflow: visible;
  }

  .wf-dash-scroll {
    overflow: visible;
    max-height: none;
  }

  .wf-dash {
    padding: 1rem 1rem 1.5rem;
  }

  .wf-dash-hero {
    grid-template-columns: 1fr;
    padding: 1.1rem 1.1rem;
  }

  .wf-dash-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wf-dash-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-dash-grid,
  .wf-dash-grid--compact {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .wf-dash-card {
    min-height: 0;
  }

  .wf-dash-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-dash-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .wf-dash-bar-track {
    height: 108px;
  }

  .wf-dash-app-heading {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .wf-dash-hero-stats,
  .wf-dash-overview-kpis,
  .wf-dash-latest-grid,
  .wf-dash-kpi-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wf-dash-card,
  .wf-dash-kpi,
  .wf-dash-bar-fill {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .wf-dash-card:hover,
  .wf-dash-kpi:hover,
  .wf-dash-app-chip:hover {
    transform: none;
  }
}

.winflow-site-footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  border-top: 1px solid #e6ebf0;
  background: #ffffff;
  text-align: center;
}

.winflow-site-footer-text {
  margin: 0;
  padding: 0.95rem 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #5a6b7d;
}

.winflow-site-footer-text strong {
  color: #011936;
  font-weight: 700;
}

.winflow-site-footer-text a {
  color: inherit;
  text-decoration: none;
}

.winflow-site-footer-text a strong {
  color: #7c3aed;
}

.winflow-site-footer-text a:hover strong {
  color: #d0491d;
  text-decoration: underline;
}

.winflow-footer-sep {
  margin: 0 0.25em;
  color: #5a6b7d;
}

@media (max-width: 991px) {
  body.winflow-has-sidebar {
    padding-left: 0;
  }
}

.winflow-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20000;
  width: var(--wf-sidebar-width);
  height: 100vh;
  background: var(--wf-secondary);
  color: #e8eef5;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(1, 25, 54, 0.15);
  overflow: hidden;
  pointer-events: auto;
}

.winflow-sidebar a.winflow-nav-link,
.winflow-sidebar a.winflow-sidebar-brand,
.winflow-sidebar a.winflow-logout,
.winflow-sidebar .winflow-user-btn {
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.winflow-sidebar-header {
  padding: 0.4rem 0.55rem 0.35rem calc(0.75rem + 3px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #ffffff;
}

.winflow-sidebar-brand {
  display: flex;
  justify-content: flex-start;
  text-decoration: none;
  color: var(--wf-primary);
}

.winflow-sidebar-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  margin: 0;
  flex-shrink: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0;
  filter: none;
}

.winflow-sidebar-brand-text {
  display: none;
}

.winflow-sidebar-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.winflow-nav-section {
  display: contents;
  margin-top: 0;
}

.winflow-nav-section:first-child {
  margin-top: 0;
}

.winflow-nav-section-title {
  padding: 0.35rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wf-accent);
}

.winflow-nav-link {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  gap: 0.5rem;
  min-height: 34px;
  padding: 0 0.85rem 0 0.75rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.8125rem;
  line-height: 1.2;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.winflow-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

.winflow-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.winflow-nav-link.is-active {
  background: rgba(208, 73, 29, 0.18);
  border-left-color: var(--wf-accent);
  color: #fff;
  font-weight: 600;
}

.winflow-nav-link.is-active .winflow-nav-icon {
  opacity: 1;
  color: var(--wf-accent);
}

.winflow-sidebar-footer {
  position: relative;
  padding: 0.35rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.winflow-user-menu {
  position: relative;
}

.winflow-user-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.3rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.winflow-user-btn:hover,
.winflow-user-menu.is-open .winflow-user-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.winflow-sidebar-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winflow-user-caret {
  flex-shrink: 0;
  font-size: 0.7rem;
  opacity: 0.7;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.winflow-user-menu.is-open .winflow-user-caret {
  transform: rotate(180deg);
}

.winflow-user-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  padding: 0.35rem;
  border-radius: 8px;
  background: #0a2744;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.winflow-user-dropdown[hidden] {
  display: none !important;
}

.winflow-logout {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--wf-accent);
  text-decoration: none;
  font-weight: 600;
}

.winflow-logout:hover {
  background: rgba(208, 73, 29, 0.12);
  text-decoration: none;
}

.winflow-sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20001;
  background: var(--wf-secondary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

@media (max-width: 1400px) {
  .winflow-topbar-date-full {
    display: none;
  }

  .winflow-topbar-date-short {
    display: inline;
  }

  .winflow-topbar-filter-btn {
    width: 7.75rem;
  }
}

@media (max-width: 1200px) {
  .winflow-topbar {
    gap: 0.85rem;
  }

  .winflow-topbar h1 {
    font-size: 1.1rem;
  }

  .winflow-topbar-filters {
    gap: 0.3rem;
  }

  .winflow-topbar-filter-btn {
    width: 7.1rem;
    padding: 0 0.45rem 0 0.5rem;
  }
}

@media (max-width: 991px) {
  body.winflow-has-sidebar {
    padding-left: 0;
  }

  .winflow-sidebar-toggle {
    display: block;
  }

  .winflow-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .winflow-sidebar.is-open {
    transform: translateX(0);
  }

  .winflow-topbar {
    padding: 0.65rem 0.85rem 0.65rem 3.25rem;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-height: 0;
  }

  .winflow-topbar-left {
    min-width: 0;
    flex: 1 1 calc(100% - 8rem);
  }

  .winflow-topbar h1 {
    font-size: 1.05rem;
  }

  .winflow-topbar-date {
    display: none;
  }

  .winflow-topbar-right {
    gap: 0.35rem;
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .winflow-topbar-filters {
    order: 5;
    width: 100%;
    margin-right: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .winflow-topbar-filter-btn {
    width: 100%;
    justify-content: center;
    height: 34px;
    font-size: 0.68rem;
  }

  .winflow-topbar-icon-btn {
    width: 34px;
    height: 34px;
  }

  body.winflow-has-sidebar .dashboard-layout,
  body.winflow-has-sidebar .admin-layout {
    margin-left: 0;
  }
}

/* Hide native app sidebars when WinFlow shell is active */
body.winflow-has-sidebar .sidebar:not(.winflow-sidebar) {
  display: none !important;
}

body.winflow-has-sidebar .sidebar-backdrop:not(.winflow-backdrop) {
  display: none !important;
}

/* No Okna brand marks in page chrome — WinFlow sidebar is the only brand */
body.winflow-has-sidebar img.brand-logo,
body.winflow-has-sidebar .brand-logo,
body.winflow-has-sidebar .login-logo-img,
body.winflow-has-sidebar .pt-logo,
body.winflow-has-sidebar .pwa-banner-logo,
body.winflow-has-sidebar img[src*="oknalogo"],
body.winflow-has-sidebar img[src*="oknainvento"],
body.winflow-has-sidebar img[src*="mainlogo"],
body.winflow-has-sidebar .sidebar-logo:not(.winflow-sidebar-logo) {
  display: none !important;
}

body.winflow-has-sidebar .main-content,
body.winflow-has-sidebar .content,
body.winflow-has-sidebar .admin-layout,
body.winflow-has-sidebar .dashboard-layout {
  margin-left: 0 !important;
}

/* Prevent app shells from clipping/trapping the fixed WinFlow sidebar */
html.winflow-shell body.winflow-has-sidebar .app-layout,
html.winflow-shell body.winflow-has-sidebar .admin-layout,
html.winflow-shell body.winflow-has-sidebar .dashboard-layout {
  overflow: visible !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
  isolation: auto !important;
}

/* Modals/dialogs must sit above the WinFlow sidebar (z-index 20000).
   Nested .modal > .modal-overlay is excluded below — that backdrop was
   painting over the form and swallowing every click. */
html.winflow-shell body.winflow-has-sidebar .app-modal,
html.winflow-shell body.winflow-has-sidebar .vv-photo-lightbox,
html.winflow-shell body.winflow-has-sidebar .pwa-install-banner {
  z-index: 21000 !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-overlay {
  z-index: 21000 !important;
}

html.winflow-shell body.winflow-has-sidebar .pwa-install-banner {
  display: none !important;
}

/* Modals — light card + scrollable body + sticky footer */
html.winflow-shell body.winflow-has-sidebar .modal-overlay {
  background: rgba(1, 25, 54, 0.45) !important;
  padding: 0 !important;
}

html.winflow-shell body.winflow-has-sidebar .modal.open {
  z-index: 21000 !important;
  padding: 1rem !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Outer .modal is the viewport overlay — keep it transparent */
html.winflow-shell body.winflow-has-sidebar .modal {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #011936 !important;
}

/* Backdrop inside .modal shares the 21000 layer with the card and was
   painting on top of it, so the form looked dimmed and ignored clicks.
   Standalone .modal-overlay roots (Assist) stay at 21000 above. */
html.winflow-shell body.winflow-has-sidebar .modal > .modal-overlay {
  z-index: 0 !important;
}

/* Card is .modal-dialog (Flow) / .modal-order / .modal-complaint (Assist) */
html.winflow-shell body.winflow-has-sidebar .modal-dialog,
html.winflow-shell body.winflow-has-sidebar .modal-order,
html.winflow-shell body.winflow-has-sidebar .modal-complaint {
  position: relative;
  z-index: 1 !important;
  background: #ffffff !important;
  color: #011936 !important;
  border: 1px solid #e6ebf0 !important;
  box-shadow: 0 24px 60px rgba(1, 25, 54, 0.18) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: min(92dvh, calc(100vh - 2rem)) !important;
  overflow: hidden !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-complaint {
  max-width: min(1080px, calc(100vw - 48px)) !important;
  width: 100% !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-dialog .admin-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1.25rem 1.25rem 1.5rem !important;
  background: #ffffff !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-header,
html.winflow-shell body.winflow-has-sidebar .modal-footer {
  flex-shrink: 0 !important;
  background: #ffffff !important;
  border-color: #e6ebf0 !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  padding: 0.875rem 1.25rem !important;
  border-top: 1px solid #e6ebf0 !important;
  box-shadow: 0 -6px 16px rgba(1, 25, 54, 0.04) !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-footer .btn-secondary,
html.winflow-shell body.winflow-has-sidebar .modal-footer button.btn-secondary {
  background: #f5f7fa !important;
  border: 1px solid #d5dde6 !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-header h2 {
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .modal-close {
  background: #f5f7fa !important;
  border: 1px solid #e6ebf0 !important;
  color: #5a6b7d !important;
}

/* Order punch / admin form labels + placeholders — readable on light UI */
html.winflow-shell body.winflow-has-sidebar .admin-form label,
html.winflow-shell body.winflow-has-sidebar .modal-body label,
html.winflow-shell body.winflow-has-sidebar .form-step-heading {
  color: #011936 !important;
  font-weight: 600 !important;
}

html.winflow-shell body.winflow-has-sidebar .admin-form .form-hint,
html.winflow-shell body.winflow-has-sidebar .modal-body .form-hint,
html.winflow-shell body.winflow-has-sidebar .optional-label {
  color: #5a6b7d !important;
}

html.winflow-shell body.winflow-has-sidebar .admin-form input,
html.winflow-shell body.winflow-has-sidebar .admin-form select,
html.winflow-shell body.winflow-has-sidebar .admin-form textarea,
html.winflow-shell body.winflow-has-sidebar .modal-body input,
html.winflow-shell body.winflow-has-sidebar .modal-body select,
html.winflow-shell body.winflow-has-sidebar .modal-body textarea {
  background: #ffffff !important;
  color: #011936 !important;
  border: 1px solid #d5dde6 !important;
  color-scheme: light !important;
}

html.winflow-shell body.winflow-has-sidebar .admin-form input::placeholder,
html.winflow-shell body.winflow-has-sidebar .admin-form textarea::placeholder,
html.winflow-shell body.winflow-has-sidebar .modal-body input::placeholder,
html.winflow-shell body.winflow-has-sidebar .modal-body textarea::placeholder,
html.winflow-shell body.winflow-has-sidebar input::placeholder,
html.winflow-shell body.winflow-has-sidebar textarea::placeholder {
  color: #5a6b7d !important;
  opacity: 1 !important;
}

html.winflow-shell body.winflow-has-sidebar .admin-form select,
html.winflow-shell body.winflow-has-sidebar .modal-body select {
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .admin-form select:invalid,
html.winflow-shell body.winflow-has-sidebar .modal-body select:invalid {
  color: #5a6b7d !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .form-grid,
html.winflow-shell body.winflow-has-sidebar .complaint-form .form-grid-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px 16px !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .form-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 0 !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .form-field-span-4 {
  grid-column: 1 / -1 !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .form-field-span-2 {
  grid-column: span 2 !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .form-section-label {
  color: #011936 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin: 14px 0 8px !important;
  padding-top: 4px !important;
  border-top: none !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-card {
  background: #f5f7fa !important;
  border: 1px solid #e6ebf0 !important;
  border-radius: 12px !important;
  padding: 14px !important;
  margin-bottom: 14px !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-card-label,
html.winflow-shell body.winflow-has-sidebar .complaint-form .search-card-hint {
  color: #5a6b7d !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-row {
  display: flex !important;
  align-items: stretch !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-toggle {
  display: inline-flex !important;
  flex-shrink: 0 !important;
  background: #ffffff !important;
  border: 1px solid #e6ebf0 !important;
  border-radius: 10px !important;
  padding: 4px !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-toggle-btn {
  color: #5a6b7d !important;
  background: transparent !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-toggle-btn.is-active {
  background: #d0491d !important;
  color: #ffffff !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-input-wrap {
  position: relative !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-input-wrap input {
  width: 100% !important;
  box-sizing: border-box !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-suggestions {
  background: #ffffff !important;
  border: 1px solid #e6ebf0 !important;
  box-shadow: 0 12px 28px rgba(1, 25, 54, 0.12) !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .search-suggestion:hover {
  background: #f5f7fa !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form .input-readonly {
  background: #f5f7fa !important;
  color: #011936 !important;
  border-color: #e6ebf0 !important;
}

html.winflow-shell body.winflow-has-sidebar .complaint-form label {
  color: #011936 !important;
}

@media (max-width: 900px) {
  html.winflow-shell body.winflow-has-sidebar .complaint-form .form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  html.winflow-shell body.winflow-has-sidebar .complaint-form .search-row {
    flex-direction: column !important;
  }

  html.winflow-shell body.winflow-has-sidebar .complaint-form .form-grid-4 {
    grid-template-columns: 1fr !important;
  }

  html.winflow-shell body.winflow-has-sidebar .complaint-form .form-field-span-2 {
    grid-column: 1 / -1 !important;
  }
}

/* --------------------------------------------------------------------------
   Light theme for all copied app pages (WinFlow shell)
   bg #FFFFFF · text #011936 · accent #D0491D
   -------------------------------------------------------------------------- */
html.winflow-shell,
html.winflow-shell body.winflow-has-sidebar {
  color-scheme: light !important;
}

html.winflow-shell body.winflow-has-sidebar,
html.winflow-shell body.winflow-has-sidebar.admin-body,
html.winflow-shell body.winflow-has-sidebar.dashboard-body,
html.winflow-shell body.winflow-has-sidebar.dashboard-page {
  background: #ffffff !important;
  color: #011936 !important;
}

/* Flow + Invento tokens */
html.winflow-shell body.winflow-has-sidebar.admin-body,
html.winflow-shell body.winflow-has-sidebar {
  --bg-body: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-topbar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f7fa;
  --bg-input: #ffffff;
  --border: #e6ebf0;
  --border-light: #e6ebf0;
  --text-primary: #011936;
  --text-secondary: #5a6b7d;
  --text-muted: #5a6b7d;
  --accent-blue: #d0491d;
  --accent-blue-dim: rgba(208, 73, 29, 0.12);
  --accent-blue-soft: rgba(208, 73, 29, 0.12);
}

/* Assist tokens */
html.winflow-shell body.winflow-has-sidebar.dashboard-body {
  --d-bg: #ffffff;
  --d-surface: #ffffff;
  --d-surface-2: #f5f7fa;
  --d-border: #e6ebf0;
  --d-border-strong: #d5dde6;
  --d-text: #011936;
  --d-muted: #5a6b7d;
  --d-muted-2: #8a97a6;
  --c-blue: #d0491d;
}

/* Connect tokens — undo black .dashboard-page shell */
html.winflow-shell body.winflow-has-sidebar.dashboard-page {
  --bg: #ffffff;
  --card: #ffffff;
  --dark: #011936;
  --muted: #5a6b7d;
  --line: #e6ebf0;
  --primary: #d0491d;
  --dash-white: #ffffff;
  --dash-gray: #f5f7fa;
  --dash-border: #e6ebf0;
  --dash-topbar-bg: #ffffff;
  --dash-topbar-border: #e6ebf0;
  --dash-topbar-text: #011936;
  --dash-topbar-muted: #5a6b7d;
  --dash-topbar-search-bg: #f5f7fa;
  --dash-sidebar-bg: #ffffff;
  --dash-sidebar-border: #e6ebf0;
  --dash-sidebar-text: #5a6b7d;
  --dash-sidebar-heading: #011936;
  --dash-sidebar-active: #d0491d;
  --dash-sidebar-hover: rgba(1, 25, 54, 0.06);
  --dash-sidebar-muted: #5a6b7d;
  --shadow: 0 1px 2px rgba(1, 25, 54, 0.06);
}

html.winflow-shell body.winflow-has-sidebar .main-content,
html.winflow-shell body.winflow-has-sidebar .content,
html.winflow-shell body.winflow-has-sidebar .admin-layout,
html.winflow-shell body.winflow-has-sidebar .dashboard-layout,
html.winflow-shell body.winflow-has-sidebar .app-layout,
html.winflow-shell body.winflow-has-sidebar .page-content,
html.winflow-shell body.winflow-has-sidebar .dashboard-main {
  background: #ffffff !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .topbar,
html.winflow-shell body.winflow-has-sidebar .admin-topbar,
html.winflow-shell body.winflow-has-sidebar .dashboard-topbar,
html.winflow-shell body.winflow-has-sidebar .page-header,
html.winflow-shell body.winflow-has-sidebar .dashboard-page-header {
  background: #ffffff !important;
  color: #011936 !important;
  border-bottom-color: #e6ebf0 !important;
}

html.winflow-shell body.winflow-has-sidebar .topbar h1,
html.winflow-shell body.winflow-has-sidebar .topbar h2,
html.winflow-shell body.winflow-has-sidebar .page-title,
html.winflow-shell body.winflow-has-sidebar .content-card,
html.winflow-shell body.winflow-has-sidebar .card,
html.winflow-shell body.winflow-has-sidebar .stat-card,
html.winflow-shell body.winflow-has-sidebar .panel,
html.winflow-shell body.winflow-has-sidebar .table-card,
html.winflow-shell body.winflow-has-sidebar .data-card {
  background: #ffffff !important;
  color: #011936 !important;
  border-color: #e6ebf0 !important;
}

html.winflow-shell body.winflow-has-sidebar input,
html.winflow-shell body.winflow-has-sidebar select,
html.winflow-shell body.winflow-has-sidebar textarea,
html.winflow-shell body.winflow-has-sidebar .form-control,
html.winflow-shell body.winflow-has-sidebar .search-input {
  background: #ffffff !important;
  color: #011936 !important;
  border-color: #d5dde6 !important;
  color-scheme: light !important;
}

html.winflow-shell body.winflow-has-sidebar input::placeholder,
html.winflow-shell body.winflow-has-sidebar textarea::placeholder {
  color: #5a6b7d !important;
  opacity: 1 !important;
}

html.winflow-shell body.winflow-has-sidebar table,
html.winflow-shell body.winflow-has-sidebar th,
html.winflow-shell body.winflow-has-sidebar td {
  color: #011936;
  border-color: #e6ebf0;
}

html.winflow-shell body.winflow-has-sidebar thead th,
html.winflow-shell body.winflow-has-sidebar .table thead th {
  background: #f5f7fa !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .btn-primary,
html.winflow-shell body.winflow-has-sidebar .btn.primary,
html.winflow-shell body.winflow-has-sidebar button.primary {
  background: #d0491d !important;
  border-color: #d0491d !important;
  color: #ffffff !important;
}

html.winflow-shell body.winflow-has-sidebar .text-muted,
html.winflow-shell body.winflow-has-sidebar .muted,
html.winflow-shell body.winflow-has-sidebar .eyebrow,
html.winflow-shell body.winflow-has-sidebar .subtitle {
  color: #5a6b7d !important;
}

/* Login — full-bleed bg + right card (WinFlow theme) */
.winflow-login-body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  color: var(--wf-secondary);
  background: var(--wf-secondary);
}

.winflow-login-page {
  position: relative;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
}

.winflow-login-visual {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--wf-secondary);
  background-image: url("../images/login-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.winflow-login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 35%, rgba(1, 25, 54, 0.55) 75%, rgba(1, 25, 54, 0.72) 100%);
  pointer-events: none;
}

.winflow-login-main {
  position: relative;
  z-index: 2;
  width: min(46%, 560px);
  min-width: min(100%, 400px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vh, 1.25rem);
  overflow: hidden;
}

.winflow-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--wf-primary);
  border-radius: 16px;
  padding: clamp(1rem, 2.2vh, 1.5rem) clamp(1.15rem, 2.5vw, 1.65rem);
  box-shadow: 0 22px 50px rgba(1, 25, 54, 0.28);
}

.winflow-login-all-apps {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0 0.55rem;
  color: var(--wf-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.winflow-login-all-apps svg {
  flex-shrink: 0;
}

.winflow-login-all-apps:hover {
  opacity: 0.85;
  color: var(--wf-secondary);
}

.winflow-login-all-apps:focus-visible {
  outline: 2px solid var(--wf-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.winflow-login-header {
  text-align: center;
  margin-bottom: 0.85rem;
}

.winflow-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 auto 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--wf-accent);
}

.winflow-login-logo {
  display: block;
  width: min(200px, 72%);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  filter: none;
}

.winflow-login-brand-text {
  display: none;
}

.winflow-login-header h1 {
  margin: 0 0 0.2rem;
  color: var(--wf-secondary);
  font-size: clamp(1.15rem, 2.4vh, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.winflow-login-header p {
  margin: 0;
  color: #5a6b7d;
  font-size: 0.8125rem;
}

.winflow-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.winflow-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wf-secondary);
  margin-bottom: 0.3rem;
}

.winflow-form-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d5dde6;
  border-radius: 999px;
  background: #f4f6f8;
  font-size: 0.9375rem;
  color: var(--wf-secondary);
}

.winflow-form-group input:focus {
  outline: 2px solid rgba(208, 73, 29, 0.35);
  border-color: var(--wf-accent);
  background: #fff;
}

.winflow-password-field {
  position: relative;
}

.winflow-password-field input {
  padding-right: 2.75rem;
}

.winflow-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: #6b7c8f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.winflow-password-toggle:hover {
  color: var(--wf-secondary);
}

.winflow-login-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.65rem 1rem;
  background: var(--wf-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

.winflow-login-submit:hover {
  filter: brightness(1.05);
}

.winflow-login-footer {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #5a6b7d;
}

.winflow-login-footer strong {
  color: #011936;
  font-weight: 700;
}

.winflow-login-footer a {
  color: inherit;
  text-decoration: none;
}

.winflow-login-footer a strong {
  color: #7c3aed;
}

.winflow-login-footer a:hover strong {
  color: #d0491d;
  text-decoration: underline;
}

.winflow-alert-error {
  background: #fdecea;
  color: #b42318;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  margin-bottom: 0.7rem;
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .winflow-login-page {
    justify-content: center;
  }

  .winflow-login-main {
    width: 100%;
    min-width: 0;
    padding: 0.85rem;
  }

  .winflow-login-card {
    padding: 1rem 1.15rem;
  }

  .winflow-login-visual::after {
    background: rgba(1, 25, 54, 0.55);
  }
}

/* --------------------------------------------------------------------------
   Flow Orders toolbar — search inline with filters
   -------------------------------------------------------------------------- */
html.winflow-shell body.winflow-has-sidebar .orders-toolbar--inline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-search {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 260px;
  width: auto;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-status-filter,
html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-date-filter {
  flex: 0 0 auto;
  min-width: 118px;
  max-width: 140px;
  height: 34px;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-export-wrap,
html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-custom-date-filter,
html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .tasks-date-apply,
html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .tasks-date-reset,
html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-add-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-add-btn {
  margin-left: auto;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar--inline > .orders-count {
  font-size: 0.8125rem;
  color: #5a6b7d;
}

html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row--empty {
  justify-content: space-between;
}

@media (max-width: 900px) {
  html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-search {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  html.winflow-shell body.winflow-has-sidebar .orders-toolbar-inline-row .orders-add-btn {
    margin-left: 0;
  }
}

/* --------------------------------------------------------------------------
   Flow Orders toolbar + footer — light theme contrast (was dark-mode colors)
   -------------------------------------------------------------------------- */
html.winflow-shell body.winflow-has-sidebar .orders-export-btn {
  border: 1px solid #0f9f6e !important;
  background: #e8faf3 !important;
  color: #065f46 !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-export-btn:hover,
html.winflow-shell body.winflow-has-sidebar .orders-export-btn:focus {
  border-color: #059669 !important;
  background: #d1fae5 !important;
  color: #064e3b !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-export-menu {
  background: #ffffff !important;
  border: 1px solid #d5dde6 !important;
  box-shadow: 0 12px 28px rgba(1, 25, 54, 0.12) !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-export-menu-item {
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-export-menu-item:hover,
html.winflow-shell body.winflow-has-sidebar .orders-export-menu-item:focus-visible {
  background: #f0fdf4 !important;
  color: #065f46 !important;
}

html.winflow-shell body.winflow-has-sidebar .tasks-date-apply,
html.winflow-shell body.winflow-has-sidebar .orders-filter-actions .tasks-date-apply {
  border: 1px solid #2563eb !important;
  background: #eff6ff !important;
  color: #1e3a8a !important;
}

html.winflow-shell body.winflow-has-sidebar .tasks-date-apply:hover,
html.winflow-shell body.winflow-has-sidebar .orders-filter-actions .tasks-date-apply:hover {
  background: #dbeafe !important;
  color: #1e40af !important;
}

html.winflow-shell body.winflow-has-sidebar .tasks-date-reset,
html.winflow-shell body.winflow-has-sidebar .orders-filter-actions .tasks-date-reset {
  border: 1px solid #c5ced8 !important;
  background: #f5f7fa !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-footer,
html.winflow-shell body.winflow-has-sidebar .live-tracking-page .orders-footer,
html.winflow-shell body.winflow-has-sidebar .tasks-footer {
  left: var(--wf-sidebar-width) !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 50 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  min-height: 56px !important;
  padding: 0.75rem 1.5rem !important;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
  background: #ffffff !important;
  border-top: 1px solid #e6ebf0 !important;
  box-shadow: 0 -6px 20px rgba(1, 25, 54, 0.06) !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-page--has-footer {
  --orders-footer-height: 64px;
  padding-bottom: calc(var(--orders-footer-height) + 1.25rem) !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-rows-select,
html.winflow-shell body.winflow-has-sidebar .orders-rows-label,
html.winflow-shell body.winflow-has-sidebar .orders-page-info {
  color: #5a6b7d !important;
  align-items: center !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-per-page-select,
html.winflow-shell body.winflow-has-sidebar .page-jump-input {
  height: 36px !important;
  min-width: 3.25rem !important;
  padding: 0 0.5rem !important;
  border: 1px solid #d5dde6 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #011936 !important;
  color-scheme: light !important;
  font-size: 0.8125rem !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-per-page-select {
  min-width: 4.25rem !important;
  padding-right: 1.75rem !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-page-btn {
  height: 36px !important;
  background: #ffffff !important;
  border: 1px solid #d5dde6 !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-page-btn:hover:not(:disabled) {
  background: #f5f7fa !important;
  border-color: #c5ced8 !important;
  color: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .orders-page-btn:disabled {
  opacity: 0.45 !important;
}

@media (max-width: 900px) {
  html.winflow-shell body.winflow-has-sidebar .orders-footer,
  html.winflow-shell body.winflow-has-sidebar .live-tracking-page .orders-footer,
  html.winflow-shell body.winflow-has-sidebar .tasks-footer {
    left: 0 !important;
  }
}

/* Same refresh, bell, and date on every page — dark text on the light theme */
html.winflow-shell body.winflow-has-sidebar .topbar-icon-btn,
html.winflow-shell body.winflow-has-sidebar .topbar-refresh,
html.winflow-shell body.winflow-has-sidebar .topbar-notif,
html.winflow-shell body.winflow-has-sidebar .topbar-notification,
html.winflow-shell body.winflow-has-sidebar .topbar-refresh-btn,
html.winflow-shell body.winflow-has-sidebar .topbar-icons .icon-btn,
html.winflow-shell body.winflow-has-sidebar .notification-bell > .icon-btn {
  width: 40px !important;
  height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  border: 1px solid #e6ebf0 !important;
  border-radius: 8px !important;
  color: #011936 !important;
  box-shadow: none !important;
}

html.winflow-shell body.winflow-has-sidebar .topbar-icon-btn svg,
html.winflow-shell body.winflow-has-sidebar .topbar-refresh svg,
html.winflow-shell body.winflow-has-sidebar .topbar-notif svg,
html.winflow-shell body.winflow-has-sidebar .topbar-notification svg,
html.winflow-shell body.winflow-has-sidebar .topbar-refresh-btn svg,
html.winflow-shell body.winflow-has-sidebar .topbar-icons .icon-btn svg,
html.winflow-shell body.winflow-has-sidebar .topbar-notification-icon,
html.winflow-shell body.winflow-has-sidebar .topbar-refresh-icon {
  color: #011936 !important;
  stroke: #011936 !important;
}

html.winflow-shell body.winflow-has-sidebar .topbar-date {
  display: inline-flex !important;
  align-items: center !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 0.875rem !important;
  background: #ffffff !important;
  border: 1px solid #e6ebf0 !important;
  border-radius: 8px !important;
  color: #011936 !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

/* Hub unified notifications dropdown */
.winflow-topbar-notif-wrap {
  position: relative;
}

.winflow-topbar-notify {
  position: relative;
}

.winflow-topbar-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d0491d;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.winflow-topbar-notif-badge.is-hidden {
  display: none;
}

.winflow-topbar-notif-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(360px, calc(100vw - 1.5rem));
  border: 1px solid #e6ebf0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(1, 25, 54, 0.12);
  overflow: hidden;
}

.winflow-topbar-notif-menu.is-open {
  display: block;
}

.winflow-topbar-notif-menu-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid #eef2f6;
}

.winflow-topbar-notif-menu-head strong {
  font-size: 0.92rem;
  color: #011936;
}

.winflow-topbar-notif-menu-apps {
  font-size: 0.68rem;
  font-weight: 600;
  color: #7a8a9a;
  letter-spacing: 0.02em;
}

.winflow-topbar-notif-menu-list {
  max-height: 360px;
  overflow: auto;
}

.winflow-topbar-notif-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: #5a6b7d;
  font-size: 0.85rem;
}

.winflow-topbar-notif-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f1f4f8;
  text-decoration: none;
  color: inherit;
}

.winflow-topbar-notif-item:hover {
  background: #f7f9fc;
  text-decoration: none;
  color: inherit;
}

.winflow-topbar-notif-app {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #eef3f8;
  color: #011936;
}

.winflow-topbar-notif-app--flow { background: rgba(208, 73, 29, 0.12); color: #d0491d; }
.winflow-topbar-notif-app--assist { background: rgba(190, 18, 60, 0.1); color: #be123c; }
.winflow-topbar-notif-app--connect { background: rgba(29, 78, 216, 0.1); color: #1d4ed8; }
.winflow-topbar-notif-app--invento { background: rgba(15, 118, 110, 0.12); color: #0f766e; }

.winflow-topbar-notif-item strong {
  font-size: 0.86rem;
  color: #011936;
  line-height: 1.3;
}

.winflow-topbar-notif-item p {
  margin: 0;
  font-size: 0.78rem;
  color: #5a6b7d;
  line-height: 1.4;
}

.winflow-topbar-notif-item time {
  font-size: 0.7rem;
  color: #7a8a9a;
}

.winflow-topbar-notif-menu-foot {
  padding: 0.65rem 1rem;
  border-top: 1px solid #eef2f6;
  text-align: center;
}

.winflow-topbar-notif-menu-foot a {
  font-size: 0.8rem;
  font-weight: 700;
  color: #d0491d;
  text-decoration: none;
}

.winflow-topbar-notif-menu-foot a:hover {
  text-decoration: underline;
}

/* Hub alerts page */
.wf-alerts {
  flex: 1 1 auto;
  padding: 1.35rem 1.5rem 2rem;
  background: #f7f9fc;
}

.wf-alerts-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.wf-alerts-app-block {
  margin-bottom: 1.25rem;
}

.wf-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.wf-alerts-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid #e6ebf0;
  border-radius: 14px;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 20px rgba(1, 25, 54, 0.04);
}

.wf-alerts-item:hover {
  border-color: #d7dee7;
  text-decoration: none;
  color: inherit;
}

.wf-alerts-item-type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d0491d;
}

.wf-alerts-item strong {
  color: #011936;
  font-size: 0.95rem;
}

.wf-alerts-item p {
  margin: 0;
  color: #5a6b7d;
  font-size: 0.84rem;
  line-height: 1.45;
}

.wf-alerts-item time {
  font-size: 0.72rem;
  color: #7a8a9a;
}


/* ===== Hub All-workflows — force readable UI ===== */
body.winflow-dash-home-mode .winflow-topbar,
body.winflow-dash-home-mode .winflow-topbar-title,
body.winflow-dash-home-mode .winflow-topbar h1,
body.winflow-dash-home-mode .winflow-topbar-subtitle {
  color: #011936 !important;
}

body.winflow-dash-home-mode .winflow-topbar-subtitle {
  color: #5a6b7d !important;
}

body.winflow-dash-home-mode .wf-dash--home,
body.winflow-dash-home-mode .wf-dash-scroll {
  color: #011936 !important;
}

body.winflow-dash-home-mode .wf-dash-brand {
  color: #d0491d !important;
}

body.winflow-dash-home-mode .wf-dash-title,
body.winflow-dash-home-mode .wf-dash-section-title,
body.winflow-dash-home-mode .wf-dash-chart-title,
body.winflow-dash-home-mode .wf-dash-app-heading-name,
body.winflow-dash-home-mode .wf-dash-latest-title,
body.winflow-dash-home-mode .wf-dash-card-title,
body.winflow-dash-home-mode .wf-dash-stat strong,
body.winflow-dash-home-mode .wf-dash-kpi-value,
body.winflow-dash-home-mode .wf-dash-bar-meta strong,
body.winflow-dash-home-mode .wf-dash-hbar-label strong,
body.winflow-dash-home-mode .wf-dash-latest-list strong {
  color: #011936 !important;
}

body.winflow-dash-home-mode .wf-dash-copy,
body.winflow-dash-home-mode .wf-dash-section-copy,
body.winflow-dash-home-mode .wf-dash-kpi-label,
body.winflow-dash-home-mode .wf-dash-kpi-sub,
body.winflow-dash-home-mode .wf-dash-stat span,
body.winflow-dash-home-mode .wf-dash-bar-meta span,
body.winflow-dash-home-mode .wf-dash-hbar-label span,
body.winflow-dash-home-mode .wf-dash-card-desc,
body.winflow-dash-home-mode .wf-dash-latest-list span,
body.winflow-dash-home-mode .wf-dash-app-heading-meta {
  color: #5a6b7d !important;
}

body.winflow-dash-home-mode .wf-dash-overview-kpis {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.85rem !important;
}

body.winflow-dash-home-mode .wf-dash-kpi {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #ffffff !important;
  border: 1px solid #e6ebf0 !important;
  color: #011936 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0.75rem 0.85rem !important;
}

body.winflow-dash-home-mode .wf-dash-overview-charts {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) !important;
  gap: 0.95rem !important;
}

body.winflow-dash-home-mode .wf-dash-chart-card,
body.winflow-dash-home-mode .wf-dash-latest-card,
body.winflow-dash-home-mode .wf-dash-app-panel,
body.winflow-dash-home-mode .wf-dash-hero {
  background: #ffffff !important;
  border: 1px solid #e6ebf0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.winflow-dash-home-mode .wf-dash-bars {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)) !important;
  gap: 0.85rem !important;
  min-height: 180px !important;
  align-items: end !important;
}

body.winflow-dash-home-mode .wf-dash-bar-track {
  display: flex !important;
  align-items: flex-end !important;
  height: 132px !important;
  background: #f7f9fc !important;
  border: 1px solid #e6ebf0 !important;
}

body.winflow-dash-home-mode .wf-dash-bar-fill,
body.winflow-dash-home-mode .wf-dash-hbar-fill {
  opacity: 1 !important;
  visibility: visible !important;
}

body.winflow-dash-home-mode .wf-dash-latest-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.85rem !important;
}

body.winflow-dash-home-mode .wf-dash-latest-more {
  color: #d0491d !important;
}

@media (max-width: 1100px) {
  body.winflow-dash-home-mode .wf-dash-overview-charts {
    grid-template-columns: 1fr !important;
  }
  body.winflow-dash-home-mode .wf-dash-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.winflow-dash-home-mode .wf-dash-latest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  body.winflow-dash-home-mode .wf-dash-overview-kpis,
  body.winflow-dash-home-mode .wf-dash-latest-grid {
    grid-template-columns: 1fr !important;
  }
}

/* —— WinFlow PWA top banner —— */
.winflow-pwa-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  flex-shrink: 0;
}

.winflow-pwa-banner-img {
  display: block;
  width: auto;
  max-width: min(220px, 58vw);
  max-height: 72px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.winflow-login-pwa-banner {
  margin: 0 0 1.15rem;
  border-radius: 12px;
  overflow: hidden;
}

.winflow-login-pwa-banner .winflow-pwa-banner-img {
  max-width: min(260px, 70vw);
  max-height: 96px;
}

@media (max-width: 768px) {
  .winflow-pwa-banner {
    padding: 0.45rem 0.65rem;
  }

  .winflow-pwa-banner-img {
    max-width: min(200px, 70vw);
    max-height: 64px;
  }
}

/* Clickable hub chart bars + details popup */
button.wf-dash-bar-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
  text-align: inherit;
  width: 100%;
  border-radius: 14px;
  transition: background 0.15s ease;
}

button.wf-dash-bar-item.wf-dash-bar-btn {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.2rem;
}

button.wf-dash-hbar.wf-dash-bar-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  text-align: left;
  padding: 0.28rem 0.35rem;
}

button.wf-dash-bar-btn:hover {
  background: #f4f7fb;
}

button.wf-dash-bar-btn:hover .wf-dash-bar-track,
button.wf-dash-bar-btn:hover .wf-dash-hbar-track {
  border-color: #c5d0dc;
}

button.wf-dash-bar-btn:focus-visible {
  outline: 2px solid #d0491d;
  outline-offset: 2px;
}

.wf-dash-pop {
  position: fixed;
  inset: 0;
  z-index: 60000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.wf-dash-pop.is-open {
  display: flex !important;
}

.wf-dash-pop[hidden] {
  display: none !important;
}

.wf-dash-pop-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(1, 25, 54, 0.46);
  cursor: pointer;
}

.wf-dash-pop-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(82vh, 680px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #011936;
  border-radius: 18px;
  border: 1px solid #e6ebf0;
  box-shadow: 0 24px 60px rgba(1, 25, 54, 0.22);
  overflow: hidden;
}

.wf-dash-pop-accent {
  height: 6px;
  flex-shrink: 0;
  background: #011936;
}

.wf-dash-pop-accent--navy { background: linear-gradient(90deg, #163a5f, #011936); }
.wf-dash-pop-accent--orange { background: linear-gradient(90deg, #e36a3a, #d0491d); }
.wf-dash-pop-accent--teal { background: linear-gradient(90deg, #14b8a6, #0f766e); }
.wf-dash-pop-accent--blue { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.wf-dash-pop-accent--indigo { background: linear-gradient(90deg, #3a5f86, #163a5f); }
.wf-dash-pop-accent--rose { background: linear-gradient(90deg, #f43f5e, #be123c); }

.wf-dash-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.35rem 1.15rem;
}

.wf-dash-pop-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d0491d;
}

.wf-dash-pop-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #011936;
}

.wf-dash-pop-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #5a6b7d;
}

.wf-dash-pop-x {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #e6ebf0;
  background: #ffffff;
  color: #011936;
  cursor: pointer;
}

.wf-dash-pop-x:hover {
  background: #f4f7fb;
}

.wf-dash-pop-count {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.35rem 1.15rem 0.75rem;
}

.wf-dash-pop-count strong {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #011936;
}

.wf-dash-pop-count span {
  font-size: 0.82rem;
  color: #5a6b7d;
}

.wf-dash-pop-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.7rem 0.4rem;
  border-top: 1px solid #eef2f6;
}

.wf-dash-pop-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid #eef2f6;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
}

a.wf-dash-pop-item:hover {
  background: #f7f9fc;
}

.wf-dash-pop-item strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: #011936;
}

.wf-dash-pop-item span {
  font-size: 0.75rem;
  color: #5a6b7d;
}

.wf-dash-pop-empty {
  margin: 0;
  padding: 1.25rem 0.5rem 1.4rem;
  font-size: 0.88rem;
  color: #5a6b7d;
}

.wf-dash-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem 1rem;
  border-top: 1px solid #eef2f6;
}

.wf-dash-pop-note {
  margin: 0;
  font-size: 0.75rem;
  color: #5a6b7d;
}

.wf-dash-pop-more {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: #011936;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.wf-dash-pop-more:hover {
  background: #163a5f;
}

.wf-dash-pop-more[hidden] {
  display: none !important;
}

body.wf-dash-pop-open .wf-dash-scroll {
  overflow: hidden;
}

