/* UI font: DM Sans via _VentaFontHead (--venta-font-sans). Fallback: */

/* EuclidFlex: optional - add EuclidFlex-Regular.otf to wwwroot/fonts/ and uncomment url() to use */
@font-face {
  font-family: 'EuclidFlex';
  src: local('EuclidFlex-Regular');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

:root {
  /* WCAG 2.1 AA normal text (4.5:1) on white / #f8f9fa / typical page bg */
  --primary-color: #1e7e34;
  --primary-dark: #155d27;
  --primary-light: #2ea44f;
  --success-color: #1e7e34;
  --venta-green-rgb: 30, 126, 52;
  --bs-success: #1e7e34;
  --bs-success-rgb: 30, 126, 52;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-bg: #f8f9fa;
  --border-color: #dee2e6;
  /* MOB-02 / WCAG 2.5.5 — minimum touch target (CSS px) */
  --touch-target-min: 44px;
}

html { font-size: 12px; }

@media (max-width: 991.98px) {
  /* MOB-01: prevent rare horizontal bleed from flex/grid min-width:auto on narrow viewports */
  html {
    overflow-x: hidden;
  }

  /* MOB-02: WCAG 2.5.5 — 44×44px minimum for buttons, inputs in tables/toolbars, nav */
  .btn-sm,
  .btn-group-sm > .btn {
    min-height: var(--touch-target-min);
  }
  .table .btn-sm,
  .table-responsive .btn-sm,
  td .btn-sm,
  .card .table .btn-sm {
    min-width: var(--touch-target-min);
  }
  .table .btn-sm[class*="py-0"],
  td .btn-sm[class*="py-0"] {
    padding: 0.375rem 0.5rem !important;
  }
  .form-control-sm,
  .form-select-sm {
    min-height: var(--touch-target-min);
  }
  .navbar-toggler {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
  }
  .navbar-nav .nav-link {
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }
  header .navbar .dropdown-menu {
    max-height: min(70vh, 28rem);
    overflow-y: auto;
  }
  .dropdown-item {
    min-height: var(--touch-target-min);
    box-sizing: border-box;
  }
  button.dropdown-item[type="submit"] {
    width: 100%;
    min-height: var(--touch-target-min);
  }
  .btn-link.btn-sm:not(.p-0) {
    min-height: var(--touch-target-min);
  }
  a.btn-link.btn-sm.p-0,
  button.btn-link.btn-sm.p-0 {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    padding: 0.5rem 0.75rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  tr.table-row-clickable {
    min-height: var(--touch-target-min);
  }
  tr.table-row-clickable td {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
  }
  .password-toggle {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
  }
  .btn-xs {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
  }
}
body {
  font-family: var(--venta-font-sans, 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 1rem;
  line-height: 1.6;
  color: #212529;
  background-color: #f0f2f5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23ffffff' fill-opacity='0.2' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
  min-height: 100vh;
}
/* Ensure cards always render on white over the subtle page background */
.card { background: #fff; }

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: white;
  height: 56px;
  border-bottom: 1px solid var(--border-color);
}

.navbar {
  height: 56px;
  min-height: 56px;
  padding-top: 0;
  padding-bottom: 0;
  background: white !important;
}

.navbar-brand {
  font-family: 'EuclidFlex', var(--venta-font-sans, 'DM Sans', system-ui, sans-serif);
  font-weight: 600;
  color: var(--primary-color) !important;
  font-size: 1.25rem;
}

.navbar-brand img { height: 29px; max-width: 115px; }

.nav-link {
  color: #212529 !important;
}

.nav-link:hover { color: var(--primary-color) !important; }

.navbar-nav .nav-link { padding: 0.5rem 1rem; }

main { padding-top: 76px; }

/* MOB-01: keep wide tables/charts inside the viewport shell (horizontal scroll on main, not on html) */
main#venta-main {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

main#venta-lite-main.venta-lite-main {
  overflow-x: auto;
  max-width: 100%;
}
.container-fluid { padding-left: 1rem; padding-right: 1rem; }

/* Clickable table rows — navigate to record on row click */
.table-row-clickable { cursor: pointer; }
.table-row-clickable:hover { background-color: rgba(var(--venta-green-rgb), 0.08) !important; }

.card {
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.card-header {
  background: var(--light-bg);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background-color: var(--success-color); border-color: var(--success-color); }
.btn-success:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }

/* Visual hierarchy — primary cards */
.card.card-primary { border-width: 2px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.card-header.bg-primary-subtle { background: rgba(var(--venta-green-rgb), 0.08); }

/* Supplier Product catalogue — list vs grid view */
.supplier-product-catalogue-list { display: flex; flex-direction: column; gap: 0.25rem; }
.supplier-product-catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.supplier-product-catalogue-grid .product-item {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bs-border-color, var(--border-color));
  border-radius: 0.25rem;
  background: var(--bs-body-bg, #fff);
}
html[data-theme='dark'] .supplier-product-catalogue-grid .product-item {
  border-color: #404040;
  background: #2d2d2d;
}

.supplier-catalogue-thumb { width: 48px; height: 48px; object-fit: cover; display: block; }
.supplier-catalogue-thumb-placeholder { width: 48px; height: 48px; min-width: 48px; background: var(--bs-secondary-bg, #f8f9fa); }
.supplier-catalogue-thumb-link { text-decoration: none; }

/* Status badges */
.badge-status-draft { background-color: #6c757d; }
.badge-status-pending { background-color: #ffc107; color: #212529; }
.badge-status-approved { background-color: var(--primary-color); color: #fff; }
.badge-status-rejected { background-color: #dc3545; }

.breadcrumb { font-size: 0.875rem; }
.breadcrumb-item a { color: var(--primary-color); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #6c757d; }

.footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
  background: #fff;
}

.venta-legal-footer--compact {
  font-size: 0.8125rem;
}

.venta-legal-footer .venta-legal-footer__nav a {
  color: var(--primary-color);
}

.venta-legal-footer .venta-legal-footer__nav a:hover {
  color: var(--primary-dark);
}

/* Empty states (lists / tables) */
.venta-empty-state__icon-wrap {
  width: 5.5rem;
  height: 5.5rem;
  background: rgba(var(--venta-green-rgb), 0.1);
}
.venta-empty-state__icon {
  font-size: 2.75rem;
  color: var(--primary-color);
  opacity: 0.85;
  line-height: 1;
}
.venta-empty-state__img {
  object-fit: contain;
}
.venta-empty-state__title {
  font-weight: 600;
}

.field-validation-error,
span.text-danger.field-validation-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
}
.input-validation-error,
.form-control.input-validation-error {
  border-color: var(--danger-color, #dc3545);
}
.validation-summary-errors {
  font-size: 0.875rem;
}

/* Dark mode — brand green tuned for WCAG AA on #141414 / #2d2d2d (UXD-11) */
html[data-theme='dark'] {
  --primary-color: #8fd050;
  --primary-dark: #74b040;
}
html[data-theme='dark'] body {
  background: #141414;
  color: #e0e0e0;
}
html[data-theme='dark'] .card {
  background: #2d2d2d;
  border-color: #404040;
}
html[data-theme='dark'] .card-header {
  background: #333333;
  border-color: #404040;
  color: #e0e0e0;
}
html[data-theme='dark'] header,
html[data-theme='dark'] .navbar {
  background: #2d2d2d !important;
  border-color: #404040;
}
html[data-theme='dark'] .nav-link { color: #e0e0e0 !important; }
html[data-theme='dark'] .nav-link:hover { color: var(--primary-color) !important; }

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD GLOBAL CONSTRAINTS
   ════════════════════════════════════════════════════════════════════ */

/* Prevent stretching on ultra-wide monitors */
#dashboardSection { max-width: 1280px; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* Tighter card chrome for dashboard panels */
#dashboardSection .card-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
}
#dashboardSection .card-body { padding: 0.75rem; }

/* Hard cap on chart canvas — prevents Chart.js responsive mode from overflowing */
#dashboardSection canvas { max-height: 130px; }

/* ════════════════════════════════════════════════════════════════════
   CHART CONTAINERS — Fit on screen, constrain width on large resolutions
   ════════════════════════════════════════════════════════════════════ */

.chart-container {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}
@media (min-width: 1200px) {
  .chart-container { max-width: 1400px; }
}

/* Report section — cap width for charts on report pages */
.report-section { max-width: 1560px; margin-left: auto; margin-right: auto; }

/* Plotly hover/tooltip — apply site font to rollover text */
.js-plotly-plot .hoverlayer .hovertext,
.plotly .hoverlayer .hovertext,
.gjs-plotly-plot .hoverlayer .hovertext {
  font-family: var(--venta-font-sans, 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
  font-size: 12px !important;
}

/* Chart card header with export dropdown */
.chart-card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* ════════════════════════════════════════════════════════════════════
   HOME DASHBOARD — First-time welcome
   ════════════════════════════════════════════════════════════════════ */

/* Centered, constrained layout for first-time view */
.home-first-time-outer {
  min-height: calc(100vh - 56px - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.home-first-time-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.home-demo-config-wrapper {
  max-width: 720px;
}
.home-select-layout-single {
  justify-content: center;
  gap: 0;
}

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

.home-welcome-hero {
  background-image: radial-gradient(circle at 20% 80%, rgba(var(--venta-green-rgb),0.04) 0%, transparent 50%),
    linear-gradient(160deg, #f8fff9 0%, #edfbf0 50%, #e8f5eb 100%);
  border-radius: 12px;
  padding: 3rem 2rem;
  border: 1px solid rgba(var(--venta-green-rgb),0.12);
}
html[data-theme='dark'] .home-welcome-hero {
  background-image: radial-gradient(circle at 20% 80%, rgba(112,177,23,0.06) 0%, transparent 50%),
    linear-gradient(160deg, #1e2d1f 0%, #1a1a1a 100%);
  border-color: rgba(112,177,23,0.2);
}

.home-cap-card {
  padding: 1.25rem 1rem;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-align: center;
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.18s;
  animation: fadeInUp 0.5s ease forwards;
}
.home-welcome-hero .row > div:nth-child(1) .home-cap-card { animation-delay: 0.05s; }
.home-welcome-hero .row > div:nth-child(2) .home-cap-card { animation-delay: 0.1s; }
.home-welcome-hero .row > div:nth-child(3) .home-cap-card { animation-delay: 0.15s; }
.home-welcome-hero .row > div:nth-child(4) .home-cap-card { animation-delay: 0.2s; }
.home-cap-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-3px);
  border-color: rgba(var(--venta-green-rgb),0.3);
}
html[data-theme='dark'] .home-cap-card { background: #2d2d2d; border-color: #404040; }
html[data-theme='dark'] .home-cap-card:hover { border-color: rgba(112,177,23,0.4); }

.home-cap-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.5rem;
  transition: transform 0.22s ease;
}
.home-cap-card:hover .home-cap-icon { transform: scale(1.08); }
.home-cap-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; color: #212529; }
html[data-theme='dark'] .home-cap-title { color: #e0e0e0; }
.home-cap-desc  { font-size: 0.72rem; color: #6c757d; }

.home-select-grid { display: grid; gap: 0.5rem; }
.home-select-grid-dataset { grid-template-columns: repeat(3, 150px); }
.home-select-grid-persona { grid-template-columns: repeat(2, 150px); }

.home-dataset-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 150px; height: 150px; min-width: 150px; min-height: 150px;
  padding: 0.6rem 0.5rem;
  flex-shrink: 0;
  aspect-ratio: 1;
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s, transform 0.22s;
  text-align: center;
  animation: fadeInUp 0.5s ease forwards;
}
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(1) { animation-delay: 0.1s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(2) { animation-delay: 0.15s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(3) { animation-delay: 0.2s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(4) { animation-delay: 0.25s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(5) { animation-delay: 0.3s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(6) { animation-delay: 0.35s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(7) { animation-delay: 0.4s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(8) { animation-delay: 0.45s; }
#datasetSection .home-select-grid-dataset .home-dataset-card:nth-child(9) { animation-delay: 0.5s; }
#datasetSection .home-select-grid-persona .home-dataset-card:nth-child(1) { animation-delay: 0.1s; }
#datasetSection .home-select-grid-persona .home-dataset-card:nth-child(2) { animation-delay: 0.15s; }
#datasetSection .home-select-grid-persona .home-dataset-card:nth-child(3) { animation-delay: 0.2s; }
#datasetSection .home-select-grid-persona .home-dataset-card:nth-child(4) { animation-delay: 0.25s; }
#datasetSection .home-select-grid-persona .home-dataset-card:nth-child(5) { animation-delay: 0.3s; }
#datasetSection .home-select-grid-persona .home-dataset-card:nth-child(6) { animation-delay: 0.35s; }
.home-dataset-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(var(--venta-green-rgb),0.18);
  background: #f8fff9;
  transform: translateY(-3px);
}
.home-dataset-card:hover .home-dataset-icon { transform: scale(1.12); }
html[data-theme='dark'] .home-dataset-card { background: #2d2d2d; border-color: #404040; }
html[data-theme='dark'] .home-dataset-card:hover { background: #1e2d1f; border-color: #70B117; }
.home-dataset-icon {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 0.4rem;
  transition: transform 0.22s ease;
}
/* Fallback leaf icon for Sustainability button when Bootstrap Icons fail to load */
.sustainability-button .home-dataset-icon:empty {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231e7e34'%3E%3Cpath d='M17.92 7.02C17.45 4.18 14.97 2 12 2c-2.97 0-5.45 2.18-5.92 5.02C3.97 7.55 2 9.74 2 12.5 2 15.91 4.76 18.75 8.29 18.75c.54 0 1.07-.05 1.59-.15.59.91 1.62 1.5 2.82 1.5s2.23-.59 2.82-1.5c.52.1 1.05.15 1.59.15 3.53 0 6.29-2.84 6.29-6.25 0-2.76-1.97-4.95-4.68-5.48z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
html[data-theme='dark'] .home-dataset-icon { color: #70B117; }
html[data-theme='dark'] .sustainability-button .home-dataset-icon:empty { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2370B117'%3E%3Cpath d='M17.92 7.02C17.45 4.18 14.97 2 12 2c-2.97 0-5.45 2.18-5.92 5.02C3.97 7.55 2 9.74 2 12.5 2 15.91 4.76 18.75 8.29 18.75c.54 0 1.07-.05 1.59-.15.59.91 1.62 1.5 2.82 1.5s2.23-.59 2.82-1.5c.52.1 1.05.15 1.59.15 3.53 0 6.29-2.84 6.29-6.25 0-2.76-1.97-4.95-4.68-5.48z'/%3E%3C/svg%3E"); }
.home-dataset-name { font-weight: 600; font-size: 14px; margin-bottom: 0.25rem; color: #212529; }
html[data-theme='dark'] .home-dataset-name { color: #e0e0e0; }
.home-dataset-desc { font-size: 0.72rem; color: #6c757d; }

.home-select-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 75px;
  align-items: flex-start;
}
.home-select-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.home-select-card-selected {
  border-color: var(--primary-color) !important;
  box-shadow: 0 6px 20px rgba(var(--venta-green-rgb),0.25) !important;
  background: #f8fff9 !important;
}
html[data-theme='dark'] .home-select-card-selected {
  border-color: #70B117 !important;
  background: #1e2d1f !important;
}

#loadDemoBtn {
  padding: 20px 28px !important;
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 50px !important;
}

.demo-launch-buttons {
  margin-top: 70px;
}
.demo-launch-btn {
  padding: 1rem 1.75rem !important;
  font-size: 1.15rem !important;
}
.demo-launch-btn .demo-launch-sub {
  font-size: 0.85rem;
}

/* ════════════════════════════════════════════════════════════════════
   HOME DASHBOARD — Hero
   ════════════════════════════════════════════════════════════════════ */

.home-hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(var(--venta-green-rgb),0.3);
  position: relative;
}
.home-hero::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}
html[data-theme='dark'] .home-hero {
  background: linear-gradient(135deg, #3a7a1e 0%, #1e4d0a 100%);
}

.home-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 2rem 1.75rem;
  position: relative; z-index: 1;
}
@media (max-width: 767px) {
  .home-hero-inner { flex-direction: column; align-items: flex-start; padding: 1.5rem; }
  .home-hero-health { align-self: flex-end; }
}

.home-hero-greeting {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.home-hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}
.home-hero-dataset {
  opacity: 0.7;
  font-weight: 400;
}
.home-hero-subtitle {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-bottom: 0;
}
.home-hero-subtitle i { opacity: 0.8; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.home-hero-actions .btn { font-size: 0.78rem; }

.home-hero-health { text-align: center; flex-shrink: 0; }
.home-health-ring { position: relative; width: 80px; height: 80px; margin: 0 auto 0.35rem; }
.home-health-svg  { width: 80px; height: 80px; }
.home-health-value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 700; color: white;
}
.home-health-value span { font-size: 0.7rem; font-weight: 400; }
.home-health-label { font-size: 0.7rem; font-weight: 600; opacity: 0.85; }
.home-health-sub   { font-size: 0.65rem; opacity: 0.65; }

/* ════════════════════════════════════════════════════════════════════
   KPI STRIP
   ════════════════════════════════════════════════════════════════════ */

/* Strip wrapper — flex, wrap, with a cap per tile */
#kpiStrip { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#kpiStrip > div { flex: 1 1 130px; max-width: 200px; min-width: 110px; }

.home-kpi-card {
  display: flex; flex-direction: column;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  color: inherit;
  height: 100%;
}
.home-kpi-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  border-color: var(--primary-color);
  color: inherit;
}
html[data-theme='dark'] .home-kpi-card { background: #2d2d2d; border-color: #404040; }
html[data-theme='dark'] .home-kpi-card:hover { border-color: #70B117; }

.home-kpi-icon   { font-size: 1.1rem; margin-bottom: 0.3rem; }
.home-kpi-value  { font-size: 1.55rem; font-weight: 700; line-height: 1; margin-bottom: 0.15rem; color: #212529; }
html[data-theme='dark'] .home-kpi-value { color: #e0e0e0; }
.home-kpi-label  { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6c757d; font-weight: 500; }
.home-kpi-sub    { font-size: 0.65rem; color: #6c757d; margin-top: 0.2rem; }
.home-kpi-badge  { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 20px; font-size: 0.62rem; font-weight: 600; }

/* ════════════════════════════════════════════════════════════════════
   INSIGHTS STRIP
   ════════════════════════════════════════════════════════════════════ */

.home-insights-strip {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
html[data-theme='dark'] .home-insights-strip { background: #2d2d2d; border-color: #404040; }

.home-insights-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--light-bg);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}
html[data-theme='dark'] .home-insights-header { background: #333; border-color: #404040; }

.home-insights-list { display: flex; flex-wrap: wrap; }

.home-insight-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  flex: 1; min-width: 260px;
  transition: background 0.15s;
}
.home-insight-item:last-child { border-right: none; }
.home-insight-item:hover { background: rgba(0,0,0,0.03); color: inherit; }
html[data-theme='dark'] .home-insight-item:hover { background: rgba(255,255,255,0.04); }

.home-insight-danger  { border-left: 3px solid #dc3545; }
.home-insight-warning { border-left: 3px solid #ffc107; }
.home-insight-info    { border-left: 3px solid #17a2b8; }
.home-insight-secondary { border-left: 3px solid #6c757d; }

/* ════════════════════════════════════════════════════════════════════
   CONTINUE CARD
   ════════════════════════════════════════════════════════════════════ */

.home-continue-card { border-left: 3px solid var(--primary-color); }
html[data-theme='dark'] .home-continue-card { border-left-color: #70B117; }

.home-continue-icon {
  width: 40px; height: 40px; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--light-bg);
  border-radius: 8px; flex-shrink: 0;
}
html[data-theme='dark'] .home-continue-icon { background: #333; }

/* ════════════════════════════════════════════════════════════════════
   MODULE HUB GRID
   ════════════════════════════════════════════════════════════════════ */

.home-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}
@media (max-width: 575px) {
  .home-module-grid { grid-template-columns: repeat(4, 1fr); }
}

.home-module-tile {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.6rem 0.35rem 0.55rem;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none; color: inherit;
  position: relative;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  text-align: center;
  min-height: 80px;
  justify-content: center;
}
.home-module-tile:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  border-color: var(--primary-color);
  color: inherit;
}
html[data-theme='dark'] .home-module-tile { background: #2d2d2d; border-color: #404040; }
html[data-theme='dark'] .home-module-tile:hover { border-color: #70B117; }

.home-module-featured {
  border-color: rgba(var(--venta-green-rgb),0.4);
  box-shadow: 0 2px 8px rgba(var(--venta-green-rgb),0.12);
}
html[data-theme='dark'] .home-module-featured { border-color: rgba(112,177,23,0.4); }

.home-module-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  transition: transform 0.18s;
}
.home-module-tile:hover .home-module-icon { transform: scale(1.1); }
.home-module-name { font-weight: 600; font-size: 0.7rem; margin-bottom: 0.1rem; line-height: 1.2; }
.home-module-stat { font-size: 0.6rem; color: #6c757d; }

.home-module-status {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
}
.home-status-active { background: var(--primary-color); }
.home-status-empty  { background: #dee2e6; }
html[data-theme='dark'] .home-status-active { background: #70B117; }

/* ════════════════════════════════════════════════════════════════════
   COMPLIANCE / DEADLINE SECTION
   ════════════════════════════════════════════════════════════════════ */

.home-compliance-chart-wrap {
  position: relative; display: flex;
  align-items: center; justify-content: center;
}
.home-compliance-total {
  position: absolute;
  text-align: center; pointer-events: none;
}

.home-deadline-pills { display: flex; flex-direction: column; gap: 0.4rem; }
.home-deadline-pill  { display: flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; }
.home-deadline-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.home-deadline-red   .home-deadline-dot { background: #dc3545; }
.home-deadline-amber .home-deadline-dot { background: #ffc107; }
.home-deadline-green .home-deadline-dot { background: var(--primary-color); }
html[data-theme='dark'] .home-deadline-green .home-deadline-dot { background: #70B117; }

/* ════════════════════════════════════════════════════════════════════
   SUSTAINABILITY
   ════════════════════════════════════════════════════════════════════ */

.home-sustainability-ring {
  display: flex; justify-content: space-around; align-items: center;
}
.home-sust-ring-item { text-align: center; }
.home-sust-label { font-size: 0.65rem; color: #6c757d; margin-top: 0.25rem; font-weight: 500; }
.home-sust-targets { border-top: 1px solid var(--border-color); padding-top: 0.75rem; }
html[data-theme='dark'] .home-sust-targets { border-color: #404040; }
.home-sust-target + .home-sust-target { margin-top: 0.5rem; }

/* ════════════════════════════════════════════════════════════════════
   SUPPLY CHAIN STATS
   ════════════════════════════════════════════════════════════════════ */

.home-sc-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;
}
.home-sc-stat {
  background: var(--light-bg);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
html[data-theme='dark'] .home-sc-stat { background: #333; }
.home-sc-stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.home-sc-stat-label { font-size: 0.65rem; color: #6c757d; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.2rem; }

/* ════════════════════════════════════════════════════════════════════
   CHART LEGEND
   ════════════════════════════════════════════════════════════════════ */

.home-chart-legend { display: flex; flex-direction: column; gap: 0.35rem; }
.home-legend-item  { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
.home-legend-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════
   WORKFLOW QUEUE
   ════════════════════════════════════════════════════════════════════ */

.home-workflow-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--light-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
html[data-theme='dark'] .home-workflow-icon { background: #333; }
.btn-xs { padding: 0.1rem 0.45rem; font-size: 0.68rem; }

/* ════════════════════════════════════════════════════════════════════
   ACTIVITY TIMELINE
   ════════════════════════════════════════════════════════════════════ */

.home-timeline { display: flex; flex-direction: column; gap: 0; }

.home-timeline-item {
  display: flex; gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.home-timeline-item:last-child { border-bottom: none; }
html[data-theme='dark'] .home-timeline-item { border-color: #404040; }

.home-tl-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--light-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid var(--tl-color, #dee2e6);
}
html[data-theme='dark'] .home-tl-icon { background: #333; }

.home-tl-body { display: flex; align-items: flex-start; gap: 0.5rem; flex: 1; min-width: 0; }
.home-tl-user { flex-shrink: 0; }
.home-tl-content { flex: 1; min-width: 0; }

.home-tl-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-color); color: white;
  font-size: 0.6rem; font-weight: 700;
  flex-shrink: 0; margin-top: 2px;
}
html[data-theme='dark'] .home-tl-avatar { background: #70B117; }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile stacking
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 575px) {
  .home-hero-title { font-size: 1.1rem; }
  .home-kpi-value  { font-size: 1.4rem; }
  .home-sc-stats   { grid-template-columns: repeat(2, 1fr); }
  .home-cap-card   { padding: 1rem 0.5rem; }
  main { padding-top: 70px; }
}

/* ════════════════════════════════════════════════════════════════════
   DARK MODE — overrides for dashboard sections
   ════════════════════════════════════════════════════════════════════ */

html[data-theme='dark'] .home-kpi-value { color: #e0e0e0; }
html[data-theme='dark'] .progress { background-color: #404040; }
html[data-theme='dark'] .home-insights-list .home-insight-item { border-color: #404040; }
html[data-theme='dark'] .home-module-stat { color: #999; }
html[data-theme='dark'] .home-sust-label  { color: #999; }
html[data-theme='dark'] .home-sc-stat-label { color: #999; }
html[data-theme='dark'] .home-legend-item { color: #e0e0e0; }
html[data-theme='dark'] .home-deadline-pill { color: #e0e0e0; }
html[data-theme='dark'] .home-health-value { color: white; }

/* SVG text inherits body colour in dark mode */
html[data-theme='dark'] .home-sust-ring-item svg text { fill: #e0e0e0; }

/* ════════════════════════════════════════════════════════════════════
   PACKAGING SPECIFICATIONS — level badges and product chips
   ════════════════════════════════════════════════════════════════════ */

.pkg-level-primary { background-color: #198754; color: #fff; }
.pkg-level-secondary { background-color: #0d6efd; color: #fff; }
.pkg-level-tertiary { background-color: #fd7e14; color: #fff; }
.product-chip { font-size: 0.75rem; font-weight: 500; padding: 0.2em 0.5em; }

/* ════════════════════════════════════════════════════════════════════
   Shared loading placeholders + toasts (UXD-07 / UXD-09)
   ════════════════════════════════════════════════════════════════════ */

.venta-toast-stack { pointer-events: none; }
.venta-toast-stack .toast { pointer-events: auto; }

@keyframes app-skeleton-shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.app-skeleton {
  min-height: 2.5rem;
  background: linear-gradient(90deg, #e9ecef 0%, #f3f4f6 45%, #e9ecef 90%);
  background-size: 220% 100%;
  animation: app-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 0.25rem;
}

.app-skeleton-line {
  height: 0.65rem;
  margin-bottom: 0.35rem;
  background: linear-gradient(90deg, #e9ecef 0%, #f3f4f6 45%, #e9ecef 90%);
  background-size: 220% 100%;
  animation: app-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 0.25rem;
}

.report-views-bar-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .app-skeleton,
  .app-skeleton-line,
  .vl-skeleton {
    animation: none !important;
    opacity: 0.88;
  }
}

/* ACC-14 / WCAG 1.4.10: allow flex main regions to shrink at high zoom so content reflows vertically */
#mainContent { min-width: 0; }
.venta-lite-main { min-width: 0; }

/* ════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ════════════════════════════════════════════════════════════════════ */

@media print {
  header, .navbar, .home-hero-actions, #quickActionsCard, #insightsStrip,
  .btn, button { display: none !important; }
  .home-hero   { box-shadow: none !important; color: black !important; background: #e8f5e9 !important; }
  .card        { break-inside: avoid; box-shadow: none !important; border: 1px solid #dee2e6 !important; }
  main         { padding-top: 0 !important; }
  .col-lg-4, .col-lg-8, .col-xl-2 { flex: 0 0 auto; }
}
